From 2969833b2d79a4c99c4ad6f79d1319dd94791035 Mon Sep 17 00:00:00 2001 From: Hat Kid <6624576+Hat-Kid@users.noreply.github.com> Date: Sun, 3 Mar 2024 21:15:27 +0100 Subject: [PATCH] decomp3: more engine stuff, detect non-virtual state inheritance (#3377) - `speech` - `ambient` - `water-h` - `vol-h` - `generic-obs` - `carry-h` - `pilot-h` - `board-h` - `gun-h` - `flut-h` - `indax-h` - `lightjak-h` - `darkjak-h` - `target-util` - `history` - `collide-reaction-target` - `logic-target` - `sidekick` - `projectile` - `voicebox` - `ragdoll-edit` - most of `ragdoll` (not added to gsrc yet) - `curves` - `find-nearest` - `lightjak-wings` - `target-handler` - `target-anim` - `target` - `target2` - `target-swim` - `target-lightjak` - `target-invisible` - `target-death` - `target-gun` - `gun-util` - `board-util` - `target-board` - `board-states` - `mech-h` - `vol` - `vent` - `viewer` - `gem-pool` - `collectables` - `crates` - `secrets-menu` Additionally: - Detection of non-virtual state inheritance - Added a config file that allows overriding the process stack size set by `stack-size-set!` calls - Fix for integer multiplication with `r0` - Fixed detection for the following macros: - `static-attack-info` - `defpart` and `defpartgroup` (probably still needs adjustments, uses Jak 2 implementation at the moment) - `sound-play` (Jak 3 seems to always call `sound-play-by-name` with a `sound-group` of 0, so the macro has been temporarily defaulted to use that) One somewhat significant change made here that should be noted is that the return type of `process::init-from-entity!` was changed to `object`. I've been thinking about this for a while, since it looks a bit nicer without the `(none)` at the end and I have recently encountered init methods that early return `0`. --- common/type_system/TypeSystem.cpp | 3 +- decompiler/Function/Function.h | 2 + decompiler/IR2/Form.cpp | 28 +- decompiler/IR2/Form.h | 3 + decompiler/IR2/FormExpressionAnalysis.cpp | 38 +- decompiler/ObjectFile/ObjectFileDB_IR2.cpp | 5 + decompiler/analysis/find_defstates.cpp | 87 +- decompiler/analysis/insert_lets.cpp | 34 +- decompiler/analysis/stack_spill.cpp | 2 +- decompiler/config.cpp | 4 + decompiler/config.h | 1 + decompiler/config/jak1/jak1_config.jsonc | 1 + .../process_stack_size_overrides.jsonc | 2 + decompiler/config/jak2/jak2_config.jsonc | 1 + .../process_stack_size_overrides.jsonc | 2 + decompiler/config/jak3/all-types.gc | 4393 ++++++++------- decompiler/config/jak3/jak3_config.jsonc | 10 +- .../ntsc_v1/anonymous_function_types.jsonc | 86 + .../jak3/ntsc_v1/art-group-info.min.json | 2 +- decompiler/config/jak3/ntsc_v1/art_info.jsonc | 31 +- decompiler/config/jak3/ntsc_v1/hacks.jsonc | 15 +- .../config/jak3/ntsc_v1/label_types.jsonc | 186 +- .../process_stack_size_overrides.jsonc | 4 + .../jak3/ntsc_v1/stack_structures.jsonc | 153 +- .../config/jak3/ntsc_v1/type_casts.jsonc | 1042 +++- .../config/jak3/ntsc_v1/var_names.jsonc | 39 +- decompiler/data/StrFileReader.cpp | 1 + decompiler/data/StrFileReader.h | 3 + decompiler/util/data_decompile.cpp | 4 + decompiler/util/sparticle_decompile.cpp | 3 +- goal_src/jak3/engine/ai/traffic-h.gc | 17 + goal_src/jak3/engine/ambient/ambient-h.gc | 3 + goal_src/jak3/engine/ambient/ambient.gc | 576 ++ goal_src/jak3/engine/anim/aligner-h.gc | 12 +- .../jak3/engine/camera/cam-interface-h.gc | 3 + goal_src/jak3/engine/camera/camera-h.gc | 42 +- goal_src/jak3/engine/camera/pov-camera-h.gc | 10 +- .../jak3/engine/collide/collide-cache-h.gc | 8 +- .../engine/collide/collide-edge-grab-h.gc | 2 +- goal_src/jak3/engine/collide/collide-h.gc | 4 +- .../jak3/engine/collide/collide-shape-h.gc | 73 +- .../jak3/engine/collide/collide-target-h.gc | 222 +- .../jak3/engine/collide/collide-touch-h.gc | 4 +- goal_src/jak3/engine/collide/find-nearest.gc | 276 + .../jak3/engine/common-obs/cloth-art-h.gc | 7 +- .../jak3/engine/common-obs/collectables.gc | 3032 +++++++++++ goal_src/jak3/engine/common-obs/crates.gc | 1591 ++++++ goal_src/jak3/engine/common-obs/curves.gc | 510 ++ goal_src/jak3/engine/common-obs/gem-pool.gc | 82 + .../jak3/engine/common-obs/generic-obs-h.gc | 106 +- .../jak3/engine/common-obs/generic-obs.gc | 4056 ++++++++++++++ .../jak3/engine/common-obs/projectile-h.gc | 106 +- goal_src/jak3/engine/common-obs/projectile.gc | 671 +++ .../jak3/engine/common-obs/secrets-menu.gc | 387 ++ goal_src/jak3/engine/common-obs/vent.gc | 723 +++ goal_src/jak3/engine/common-obs/voicebox.gc | 593 ++ goal_src/jak3/engine/common-obs/water-h.gc | 92 + goal_src/jak3/engine/data/art-elts.gc | 2674 +++++---- goal_src/jak3/engine/data/art-h.gc | 20 +- goal_src/jak3/engine/debug/debug-h.gc | 2 + goal_src/jak3/engine/debug/history.gc | 511 ++ goal_src/jak3/engine/debug/viewer.gc | 252 + goal_src/jak3/engine/draw/drawable-h.gc | 5 +- goal_src/jak3/engine/engine/engines.gc | 2 + goal_src/jak3/engine/entity/entity-h.gc | 6 +- goal_src/jak3/engine/game/effect-control-h.gc | 22 +- goal_src/jak3/engine/game/fact-h.gc | 2 +- goal_src/jak3/engine/game/game-h.gc | 31 +- goal_src/jak3/engine/game/game-info-h.gc | 2 +- goal_src/jak3/engine/game/game-info.gc | 38 +- goal_src/jak3/engine/game/game-save.gc | 116 +- goal_src/jak3/engine/game/main-h.gc | 1 + goal_src/jak3/engine/game/pilot-h.gc | 62 + goal_src/jak3/engine/game/settings-h.gc | 112 +- goal_src/jak3/engine/game/settings.gc | 7 +- goal_src/jak3/engine/game/task/task-arrow.gc | 431 ++ goal_src/jak3/engine/geometry/path-h.gc | 8 +- goal_src/jak3/engine/geometry/vol-h.gc | 108 + goal_src/jak3/engine/geometry/vol.gc | 250 + .../jak3/engine/gfx/background/subdivide-h.gc | 14 +- .../engine/gfx/foreground/foreground-h.gc | 1 + .../engine/gfx/foreground/shadow-cpu-h.gc | 1 + .../jak3/engine/gfx/generic/generic-vu1-h.gc | 2 +- .../gfx/sprite/particles/sparticle-h.gc | 26 + .../sprite/particles/sparticle-launcher-h.gc | 332 +- .../sprite/particles/sparticle-launcher.gc | 28 + goal_src/jak3/engine/level/level-h.gc | 4 +- goal_src/jak3/engine/level/level-info.gc | 20 +- goal_src/jak3/engine/nav/nav-mesh-h.gc | 2 + goal_src/jak3/engine/physics/ragdoll-edit.gc | 1218 +++++ goal_src/jak3/engine/physics/ragdoll-h.gc | 149 +- goal_src/jak3/engine/physics/trajectory-h.gc | 8 +- .../process-drawable/process-drawable.gc | 10 +- .../process-drawable/process-focusable.gc | 53 +- goal_src/jak3/engine/sound/gsound-h.gc | 41 + goal_src/jak3/engine/sound/gsound.gc | 2 +- goal_src/jak3/engine/sound/speech-h.gc | 146 +- goal_src/jak3/engine/sound/speech.gc | 592 ++ goal_src/jak3/engine/target/board/board-h.gc | 358 ++ .../jak3/engine/target/board/board-states.gc | 3653 +++++++++++++ .../jak3/engine/target/board/board-util.gc | 222 + .../jak3/engine/target/board/target-board.gc | 3300 ++++++++++++ .../engine/target/collide-reaction-target.gc | 602 +++ goal_src/jak3/engine/target/darkjak-h.gc | 23 + goal_src/jak3/engine/target/flut/flut-h.gc | 60 + goal_src/jak3/engine/target/gun/gun-h.gc | 286 + goal_src/jak3/engine/target/gun/gun-util.gc | 1159 ++++ goal_src/jak3/engine/target/indax/indax-h.gc | 8 + goal_src/jak3/engine/target/lightjak-h.gc | 64 + goal_src/jak3/engine/target/lightjak-wings.gc | 877 +++ goal_src/jak3/engine/target/logic-target.gc | 3254 +++++++++++ goal_src/jak3/engine/target/mech/carry-h.gc | 532 ++ goal_src/jak3/engine/target/mech/mech-h.gc | 75 + goal_src/jak3/engine/target/sidekick.gc | 625 +++ goal_src/jak3/engine/target/surface-h.gc | 4 +- goal_src/jak3/engine/target/target-anim.gc | 1839 +++++++ goal_src/jak3/engine/target/target-death.gc | 3085 +++++++++++ goal_src/jak3/engine/target/target-gun.gc | 3528 ++++++++++++ goal_src/jak3/engine/target/target-h.gc | 366 +- goal_src/jak3/engine/target/target-handler.gc | 2126 ++++++++ .../jak3/engine/target/target-invisible.gc | 574 ++ .../jak3/engine/target/target-lightjak.gc | 3518 ++++++++++++ goal_src/jak3/engine/target/target-part.gc | 2 + goal_src/jak3/engine/target/target-swim.gc | 1024 ++++ goal_src/jak3/engine/target/target-util.gc | 2395 +++++++++ goal_src/jak3/engine/target/target.gc | 4225 +++++++++++++++ goal_src/jak3/engine/target/target2.gc | 2004 +++++++ goal_src/jak3/engine/ui/bigmap-h.gc | 2 +- goal_src/jak3/engine/ui/hud-h.gc | 5 + goal_src/jak3/engine/ui/minimap-h.gc | 8 +- .../engine/ui/progress/progress-static.gc | 2 +- goal_src/jak3/engine/ui/text-h.gc | 90 +- goal_src/jak3/engine/util/script-h.gc | 10 +- goal_src/jak3/engine/util/sync-info-h.gc | 6 +- goal_src/jak3/kernel/gkernel-h.gc | 2 +- goal_src/jak3/kernel/gstate.gc | 19 +- .../reference/jak3/decompiler-macros.gc | 391 +- .../jak3/engine/ambient/ambient_REF.gc | 608 +++ .../jak3/engine/anim/aligner-h_REF.gc | 4 +- .../jak3/engine/camera/camera-h_REF.gc | 34 +- .../jak3/engine/camera/pov-camera-h_REF.gc | 6 +- .../engine/collide/collide-cache-h_REF.gc | 12 +- .../engine/collide/collide-edge-grab-h_REF.gc | 6 +- .../jak3/engine/collide/collide-h_REF.gc | 18 +- .../engine/collide/collide-shape-h_REF.gc | 35 +- .../engine/collide/collide-target-h_REF.gc | 226 +- .../engine/collide/collide-touch-h_REF.gc | 8 +- .../jak3/engine/collide/find-nearest_REF.gc | 487 ++ .../engine/common-obs/collectables_REF.gc | 3551 ++++++++++++ .../jak3/engine/common-obs/crates_REF.gc | 1743 ++++++ .../jak3/engine/common-obs/curves_REF.gc | 663 +++ .../jak3/engine/common-obs/gem-pool_REF.gc | 89 + .../engine/common-obs/generic-obs-h_REF.gc | 96 +- .../jak3/engine/common-obs/generic-obs_REF.gc | 4772 +++++++++++++++++ .../engine/common-obs/projectile-h_REF.gc | 72 +- .../jak3/engine/common-obs/projectile_REF.gc | 744 +++ .../engine/common-obs/secrets-menu_REF.gc | 395 ++ .../jak3/engine/common-obs/vent_REF.gc | 810 +++ .../jak3/engine/common-obs/voicebox_REF.gc | 693 +++ .../jak3/engine/common-obs/water-h_REF.gc | 395 ++ .../jak3/engine/debug/history_REF.gc | 729 +++ .../reference/jak3/engine/debug/viewer_REF.gc | 284 + .../jak3/engine/draw/drawable-h_REF.gc | 2 +- .../jak3/engine/entity/entity-h_REF.gc | 2 +- .../jak3/engine/game/effect-control-h_REF.gc | 10 +- .../reference/jak3/engine/game/fact-h_REF.gc | 2 +- .../reference/jak3/engine/game/game-h_REF.gc | 7 +- .../jak3/engine/game/game-info_REF.gc | 38 +- .../jak3/engine/game/game-save_REF.gc | 116 +- .../reference/jak3/engine/game/pilot-h_REF.gc | 116 + .../jak3/engine/game/settings_REF.gc | 11 +- .../jak3/engine/game/task/task-arrow_REF.gc | 473 ++ .../jak3/engine/geometry/path-h_REF.gc | 12 +- .../jak3/engine/geometry/vol-h_REF.gc | 141 + .../reference/jak3/engine/geometry/vol_REF.gc | 266 + .../engine/gfx/background/subdivide-h_REF.gc | 18 +- .../engine/gfx/generic/generic-vu1-h_REF.gc | 6 +- .../particles/sparticle-launcher-h_REF.gc | 18 +- .../jak3/engine/level/level-h_REF.gc | 2 +- .../jak3/engine/level/level-info_REF.gc | 20 +- .../jak3/engine/physics/ragdoll-edit_REF.gc | 1246 +++++ .../jak3/engine/physics/ragdoll-h_REF.gc | 100 +- .../jak3/engine/physics/trajectory-h_REF.gc | 12 +- .../process-drawable/process-drawable_REF.gc | 14 +- .../process-drawable/process-focusable_REF.gc | 23 +- .../reference/jak3/engine/sound/gsound_REF.gc | 2 +- .../jak3/engine/sound/speech-h_REF.gc | 28 +- .../reference/jak3/engine/sound/speech_REF.gc | 632 +++ .../jak3/engine/target/board/board-h_REF.gc | 531 ++ .../engine/target/board/board-states_REF.gc | 3695 +++++++++++++ .../engine/target/board/board-util_REF.gc | 238 + .../engine/target/board/target-board_REF.gc | 3379 ++++++++++++ .../target/collide-reaction-target_REF.gc | 620 +++ .../jak3/engine/target/darkjak-h_REF.gc | 62 + .../jak3/engine/target/flut/flut-h_REF.gc | 114 + .../jak3/engine/target/gun/gun-h_REF.gc | 430 ++ .../jak3/engine/target/gun/gun-util_REF.gc | 1281 +++++ .../jak3/engine/target/indax/indax-h_REF.gc | 34 + .../jak3/engine/target/lightjak-h_REF.gc | 131 + .../jak3/engine/target/lightjak-wings_REF.gc | 934 ++++ .../jak3/engine/target/logic-target_REF.gc | 3362 ++++++++++++ .../jak3/engine/target/mech/carry-h_REF.gc | 583 ++ .../jak3/engine/target/mech/mech-h_REF.gc | 145 + .../jak3/engine/target/sidekick_REF.gc | 634 +++ .../jak3/engine/target/surface-h_REF.gc | 6 +- .../jak3/engine/target/target-anim_REF.gc | 1867 +++++++ .../jak3/engine/target/target-death_REF.gc | 3146 +++++++++++ .../jak3/engine/target/target-gun_REF.gc | 3574 ++++++++++++ .../jak3/engine/target/target-h_REF.gc | 207 +- .../jak3/engine/target/target-handler_REF.gc | 2162 ++++++++ .../engine/target/target-invisible_REF.gc | 628 +++ .../jak3/engine/target/target-lightjak_REF.gc | 3656 +++++++++++++ .../jak3/engine/target/target-swim_REF.gc | 1037 ++++ .../jak3/engine/target/target-util_REF.gc | 2602 +++++++++ .../jak3/engine/target/target2_REF.gc | 2035 +++++++ .../jak3/engine/target/target_REF.gc | 4271 +++++++++++++++ .../reference/jak3/engine/ui/bigmap-h_REF.gc | 6 +- .../reference/jak3/engine/ui/minimap-h_REF.gc | 10 +- .../engine/ui/progress/progress-static_REF.gc | 2 +- .../jak3/engine/util/script-h_REF.gc | 6 +- .../jak3/engine/util/sync-info-h_REF.gc | 10 +- test/offline/config/jak3/config.jsonc | 6 +- 222 files changed, 124041 insertions(+), 4187 deletions(-) create mode 100644 decompiler/config/jak1/ntsc_v1/process_stack_size_overrides.jsonc create mode 100644 decompiler/config/jak2/ntsc_v1/process_stack_size_overrides.jsonc create mode 100644 decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc create mode 100644 test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/collide/find-nearest_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/curves_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/gem-pool_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/secrets-menu_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/water-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/debug/history_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/debug/viewer_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/game/pilot-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/geometry/vol-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/geometry/vol_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/sound/speech_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/board/board-util_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/darkjak-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/gun/gun-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/gun/gun-util_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/indax/indax-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/lightjak-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/lightjak-wings_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/logic-target_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/mech/carry-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/sidekick_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target-anim_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target-death_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target-gun_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target-handler_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target-swim_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target-util_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target2_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target_REF.gc diff --git a/common/type_system/TypeSystem.cpp b/common/type_system/TypeSystem.cpp index 82154bd493f..88f054eaa30 100644 --- a/common/type_system/TypeSystem.cpp +++ b/common/type_system/TypeSystem.cpp @@ -1482,8 +1482,7 @@ std::vector TypeSystem::search_types_by_size( } } else { for (const auto& [type_name, type_info] : m_types) { - // Only NullType's have no parent - if (!type_info->has_parent()) { + if (dynamic_cast(type_info.get())) { continue; } const auto size_of_type = m_types[type_name]->get_size_in_memory(); diff --git a/decompiler/Function/Function.h b/decompiler/Function/Function.h index cece597db9b..bc033a50d82 100644 --- a/decompiler/Function/Function.h +++ b/decompiler/Function/Function.h @@ -195,6 +195,8 @@ class Function { std::vector types_defined; + int process_stack_size = 0; + private: void check_epilogue(const LinkedObjectFile& file); void resize_first_block(int new_start, const LinkedObjectFile& file); diff --git a/decompiler/IR2/Form.cpp b/decompiler/IR2/Form.cpp index 2bccd03a862..af649b7f29d 100644 --- a/decompiler/IR2/Form.cpp +++ b/decompiler/IR2/Form.cpp @@ -2900,11 +2900,13 @@ void GetSymbolStringPointer::get_modified_regs(RegSet& regs) const { DefstateElement::DefstateElement(const std::string& process_type, const std::string& state_name, + const std::string& parent_name, const std::vector& entries, bool is_virtual, bool is_override) : m_process_type(process_type), m_state_name(state_name), + m_parent_name(parent_name), m_entries(entries), m_is_virtual(is_virtual), m_is_override(is_override) { @@ -2954,6 +2956,10 @@ goos::Object DefstateElement::to_form_internal(const Env& env) const { } } + if (!m_parent_name.empty()) { + forms.push_back(pretty_print::to_symbol(fmt::format(":parent {}", m_parent_name))); + } + for (const auto& e : m_entries) { forms.push_back(pretty_print::to_symbol(fmt::format(":{}", handler_kind_to_name(e.kind)))); auto to_print = e.val; @@ -3071,19 +3077,15 @@ goos::Object DefskelgroupElement::ClothParams::to_list(const std::string& ag_nam const Env& env) const { std::vector result; if (mesh != 0) { - // TODO use art element name for mesh - (void)ag_name; - // const auto& art = env.dts->art_group_info; - // if (art.find(ag_name) != art.end() && art.at(ag_name).find(mesh) != art.at(ag_name).end()) { - // auto name = art.at(ag_name).at(mesh); - // result.push_back(pretty_print::build_list( - // {pretty_print::to_symbol("mesh"), pretty_print::to_symbol(name)})); - // } else { - // result.push_back(pretty_print::build_list( - // {pretty_print::to_symbol("mesh"), pretty_print::to_symbol(std::to_string(mesh))})); - // } - result.push_back(pretty_print::build_list( - {pretty_print::to_symbol("mesh"), pretty_print::to_symbol(std::to_string(mesh))})); + const auto& art = env.dts->art_group_info; + if (art.find(ag_name) != art.end() && art.at(ag_name).find(mesh) != art.at(ag_name).end()) { + auto name = art.at(ag_name).at(mesh); + result.push_back(pretty_print::build_list( + {pretty_print::to_symbol("mesh"), pretty_print::to_symbol(name)})); + } else { + result.push_back(pretty_print::build_list( + {pretty_print::to_symbol("mesh"), pretty_print::to_symbol(std::to_string(mesh))})); + } } if (gravity != 0.0f) { result.push_back(pretty_print::build_list( diff --git a/decompiler/IR2/Form.h b/decompiler/IR2/Form.h index a311c2be6e0..ffff0181d38 100644 --- a/decompiler/IR2/Form.h +++ b/decompiler/IR2/Form.h @@ -1661,6 +1661,7 @@ class DefstateElement : public FormElement { }; DefstateElement(const std::string& process_type, const std::string& state_name, + const std::string& parent_name, const std::vector& entries, bool is_virtual, bool is_override); @@ -1680,6 +1681,7 @@ class DefstateElement : public FormElement { private: std::string m_process_type; std::string m_state_name; + std::string m_parent_name; std::vector m_entries; bool m_is_virtual = false; bool m_is_override = false; @@ -1817,6 +1819,7 @@ class DefpartElement : public FormElement { case GameVersion::Jak1: return field_id == 67; case GameVersion::Jak2: + case GameVersion::Jak3: return field_id == 72; default: ASSERT_MSG(false, fmt::format("unknown version for is_sp_end")); diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 79dde526755..be4549fba1f 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -1497,7 +1497,13 @@ void SimpleExpressionElement::update_from_stack_force_ui_2(const Env& env, FormStack& stack, std::vector* result, bool allow_side_effects) { - auto arg0_u = is_uint_type(env, m_my_idx, m_expr.get_arg(0).var()); + bool arg0_constant = !m_expr.get_arg(0).is_var(); + bool arg0_u; + if (!arg0_constant) { + arg0_u = is_uint_type(env, m_my_idx, m_expr.get_arg(0).var()); + } else { + arg0_u = m_expr.get_arg(0).is_int(); + } bool arg1_u = true; bool arg1_reg = m_expr.get_arg(1).is_var(); if (arg1_reg) { @@ -1507,12 +1513,17 @@ void SimpleExpressionElement::update_from_stack_force_ui_2(const Env& env, } std::vector args; - if (arg1_reg) { - args = pop_to_forms({m_expr.get_arg(0).var(), m_expr.get_arg(1).var()}, env, pool, stack, - allow_side_effects); + if (arg0_constant) { + args = pop_to_forms({m_expr.get_arg(1).var()}, env, pool, stack, allow_side_effects); + args.push_back(pool.form(m_expr.get_arg(0))); } else { - args = pop_to_forms({m_expr.get_arg(0).var()}, env, pool, stack, allow_side_effects); - args.push_back(pool.form(m_expr.get_arg(1))); + if (arg1_reg) { + args = pop_to_forms({m_expr.get_arg(0).var(), m_expr.get_arg(1).var()}, env, pool, stack, + allow_side_effects); + } else { + args = pop_to_forms({m_expr.get_arg(0).var()}, env, pool, stack, allow_side_effects); + args.push_back(pool.form(m_expr.get_arg(1))); + } } if (!arg0_u) { @@ -3442,6 +3453,15 @@ void FunctionCallElement::update_from_stack(const Env& env, } } } + } else if (env.func->process_stack_size > 0 && head_obj.is_symbol("stack-size-set!")) { + // override process stack size + auto old_size = arg_forms.at(1)->to_form(env); + if (old_size.is_int()) { + arg_forms.at(1) = pool.alloc_single_element_form( + arg_forms.at(1)->parent_element, std::to_string(env.func->process_stack_size)); + env.func->warnings.info("Process stack size was changed from {} to {}", + old_size.as_int(), env.func->process_stack_size); + } } } @@ -3532,10 +3552,10 @@ void FunctionCallElement::update_from_stack(const Env& env, } auto elt_group = arg_forms.at(5)->try_as_element(); if (elt_group && elt_group->op().is_func() && - elt_group->op().func()->to_form(env).is_symbol("sound-group") && - elt_group->elts().size() == 1) { + elt_group->op().func()->to_form(env).is_symbol("sound-group")) { Form* so_group_f = nullptr; - if (!elt_group->elts().at(0)->to_form(env).is_symbol("sfx")) { + if (elt_group->elts().size() == 1 && + !elt_group->elts().at(0)->to_form(env).is_symbol("sfx")) { so_group_f = pool.form( elt_group->elts().at(0)->to_form(env).as_symbol().name_ptr); } diff --git a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp index 7ee8cdb4039..8aed2f23a7e 100644 --- a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp +++ b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp @@ -622,6 +622,11 @@ void ObjectFileDB::ir2_type_analysis_pass(int seg, const Config& config, ObjectF func.ir2.env.set_stack_structure_hints( try_lookup(config.stack_structure_hints_by_function, func_name)); + if (config.process_stack_size_overrides.find(func_name) != + config.process_stack_size_overrides.end()) { + func.process_stack_size = config.process_stack_size_overrides.at(func_name); + } + if (func.guessed_name.kind == FunctionName::FunctionKind::V_STATE) { if (config.art_group_type_remap.find(func.guessed_name.type_name) != config.art_group_type_remap.end()) { diff --git a/decompiler/analysis/find_defstates.cpp b/decompiler/analysis/find_defstates.cpp index f68e689f164..cd4f917db1b 100644 --- a/decompiler/analysis/find_defstates.cpp +++ b/decompiler/analysis/find_defstates.cpp @@ -227,7 +227,7 @@ FormElement* rewrite_nonvirtual_defstate( get_defstate_entries(elt->body(), body_index, env, info.first, elt->entries().at(0).dest, info.second, pool, {}, skip_states); - return pool.alloc_element(info.second.last_arg().base_type(), info.first, + return pool.alloc_element(info.second.last_arg().base_type(), info.first, "", entries, false, false); } @@ -389,10 +389,10 @@ FormElement* rewrite_virtual_defstate( if (method_info.type.base_type() != "state" || method_info.type.last_arg().base_type() != "_type_") { env.func->warnings.error_and_throw( - "Virtual defstate is defining a virtual state in method {} of {}, but the type " + "Virtual defstate is defining a virtual state \"{}\" in method {} of {}, but the type " "of this method is {}, which is not a valid virtual state type (must be " "\"(state ... _type_)\")", - method_info.name, type_name, method_info.type.print()); + expected_state_name, method_info.name, type_name, method_info.type.print()); } bool state_override = false; @@ -449,14 +449,87 @@ FormElement* rewrite_virtual_defstate( elt->body(), body_idx + 1, env, expected_state_name, elt->entries().at(0).dest, method_info.type.substitute_for_method_call(type_name), pool, type_name, skip_states); - return pool.alloc_element(type_name, expected_state_name, entries, true, + return pool.alloc_element(type_name, expected_state_name, "", entries, true, state_override); } +FormElement* rewrite_nonvirtual_defstate_with_inherit( + LetElement* elt, + const Env& env, + const std::string& expected_state_name, + FormPool& pool, + const std::unordered_map>& skip_states = {}) { + // (let ((gp-1 (new 'static 'state + // :name 'target-swim-walk + // :next #f + // :exit #f + // :parent #f + // :code #f + // :trans #f + // :post #f + // :enter #f + // :event #f + // ) + // ) + // ) + // (inherit-state gp-1 target-swim) + // (set! (-> gp-1 parent) target-swim) + // (set! target-swim-walk (the-as (state target) gp-1)) + // (set! (-> gp-1 enter) L120) + // (set! (-> gp-1 exit) (-> target-swim-stance exit)) + // (set! (-> gp-1 trans) (the-as (function object) L107)) + // (set! (-> gp-1 code) L95) + // ) + env.func->warnings.warning("Encountered non-virtual defstate {} with inherit.", + expected_state_name); + ASSERT(elt->body()->size() > 0); + int body_index = 0; + + // the setup + auto first_in_body = elt->body()->at(body_index); + auto inherit = dynamic_cast(first_in_body); + std::string parent_state; + if (inherit) { + parent_state = inherit->elts().at(1)->to_string(env); + } + // advance to state set + body_index += 2; + auto info = get_state_info(elt->body()->at(body_index), env); + if (info.first != expected_state_name) { + env.func->warnings.error_and_throw( + "Inconsistent defstate name. code has {}, static state has {}", info.first, + expected_state_name); + } + if (debug_defstates) { + lg::debug("State: {} Type: {}", info.first, info.second.print()); + } + body_index++; + + auto entries = + get_defstate_entries(elt->body(), body_index, env, info.first, elt->entries().at(0).dest, + info.second, pool, {}, skip_states); + + return pool.alloc_element(info.second.last_arg().base_type(), info.first, + parent_state, entries, false, false); +} + bool is_nonvirtual_state(LetElement* elt) { return dynamic_cast(elt->body()->at(0)); } +bool is_nonvirtual_state_with_inherit(LetElement* elt) { + auto inherit = dynamic_cast(elt->body()->at(0)); + if (inherit) { + auto inherit_matcher = Matcher::op(GenericOpMatcher::func(Matcher::symbol("inherit-state")), + {Matcher::any_reg(0), Matcher::any_symbol(1)}); + auto mr = match(inherit_matcher, inherit); + if (mr.matched) { + return true; + } + } + return false; +} + } // namespace void run_defstate( @@ -495,6 +568,12 @@ void run_defstate( if (rewritten) { fe = rewritten; } + } else if (is_nonvirtual_state_with_inherit(as_let)) { + auto rewritten = rewrite_nonvirtual_defstate_with_inherit( + as_let, env, expected_state_name, pool, skip_states); + if (rewritten) { + fe = rewritten; + } } else { auto rewritten = rewrite_virtual_defstate(as_let, env, expected_state_name, pool, skip_states); diff --git a/decompiler/analysis/insert_lets.cpp b/decompiler/analysis/insert_lets.cpp index 1582bec096b..a224e10fff5 100644 --- a/decompiler/analysis/insert_lets.cpp +++ b/decompiler/analysis/insert_lets.cpp @@ -367,6 +367,7 @@ FormElement* rewrite_as_send_event(LetElement* in, Matcher::any(1)); break; case GameVersion::Jak2: + case GameVersion::Jak3: set_from_form_matcher = Matcher::set( Matcher::deref(Matcher::any_reg(0), false, {DerefTokenMatcher::string("from")}), Matcher::op_fixed(FixedOperatorKind::PROCESS_TO_PPOINTER, {Matcher::any(1)})); @@ -1718,7 +1719,7 @@ FormElement* rewrite_attack_info(LetElement* in, const Env& env, FormPool& pool) const auto& words = env.file->words_by_seg.at(label.target_segment); // offset of `mask` field in `attack-info` int mask_field_offset = 64; - if (env.version == GameVersion::Jak2) { + if (env.version >= GameVersion::Jak2) { mask_field_offset = 88; } u32 mask = words.at((label.offset + mask_field_offset) / 4).data; @@ -1754,9 +1755,36 @@ FormElement* rewrite_attack_info(LetElement* in, const Env& env, FormPool& pool) {"knock", {21, DEFAULT}}, {"test", {22, DEFAULT}}, }; + const static std::map> possible_args_jak3 = { + {"vector", {1, VECTOR}}, + {"intersection", {2, VECTOR}}, + {"attacker", {3, DEFAULT}}, + {"invinc-time", {5, DEFAULT}}, + {"mode", {6, DEFAULT}}, + {"shove-back", {7, DEFAULT}}, + {"shove-up", {8, DEFAULT}}, + {"speed", {9, DEFAULT}}, + {"control", {11, DEFAULT}}, + {"angle", {12, DEFAULT}}, + {"id", {15, DEFAULT}}, + {"count", {16, DEFAULT}}, + {"penetrate-using", {17, DEFAULT}}, + {"attacker-velocity", {18, VECTOR}}, + {"damage", {19, DEFAULT}}, + {"shield-damage", {20, DEFAULT}}, + {"vehicle-damage-factor", {21, DEFAULT}}, + {"vehicle-impulse-factor", {21, DEFAULT}}, + {"knock", {23, DEFAULT}}, + {"test", {24, DEFAULT}}, + }; - const auto& possible_args = - env.version == GameVersion::Jak1 ? possible_args_jak1 : possible_args_jak2; + auto possible_args = possible_args_jak1; + if (env.version == GameVersion::Jak2) { + possible_args = possible_args_jak2; + } + if (env.version == GameVersion::Jak3) { + possible_args = possible_args_jak3; + } std::vector> args_in_info; for (int i = 0; i < in->body()->size() - 1; ++i) { diff --git a/decompiler/analysis/stack_spill.cpp b/decompiler/analysis/stack_spill.cpp index d27b2e17589..db582119651 100644 --- a/decompiler/analysis/stack_spill.cpp +++ b/decompiler/analysis/stack_spill.cpp @@ -47,7 +47,7 @@ void StackSpillMap::finalize() { max_offset = std::max(max_offset, slot.second.offset + slot.second.size); } - ASSERT(max_offset < 4096); // just a sanity check here + ASSERT(max_offset < 8192); // just a sanity check here std::vector var_count(max_offset, 0); for (auto& slot : m_slot_map) { diff --git a/decompiler/config.cpp b/decompiler/config.cpp index 93560c2995c..7470771244b 100644 --- a/decompiler/config.cpp +++ b/decompiler/config.cpp @@ -329,6 +329,10 @@ Config make_config_via_json(nlohmann::json& json) { config.object_patches.insert({obj, new_pch}); } + auto process_stack_size_json = read_json_file_from_config(json, "process_stack_size_file"); + config.process_stack_size_overrides = + process_stack_size_json.get>(); + return config; } } // namespace diff --git a/decompiler/config.h b/decompiler/config.h index dc22108c2f2..fe173803504 100644 --- a/decompiler/config.h +++ b/decompiler/config.h @@ -177,6 +177,7 @@ struct Config { std::unordered_map> art_group_info_dump; std::unordered_map> jg_info_dump; std::unordered_map joint_node_hacks; + std::unordered_map process_stack_size_overrides; std::unordered_map> import_deps_by_file; diff --git a/decompiler/config/jak1/jak1_config.jsonc b/decompiler/config/jak1/jak1_config.jsonc index 52069959138..94c53c73c79 100644 --- a/decompiler/config/jak1/jak1_config.jsonc +++ b/decompiler/config/jak1/jak1_config.jsonc @@ -91,6 +91,7 @@ "all_types_file": "decompiler/config/jak1/all-types.gc", "art_group_dump_file": "decompiler/config/jak1/ntsc_v1/art-group-info.min.json", "joint_node_dump_file": "decompiler/config/jak1/ntsc_v1/joint-node-info.min.json", + "process_stack_size_file": "decompiler/config/jak1/ntsc_v1/process_stack_size_overrides.jsonc", // optional: a predetermined object file name map from a file. // this will make decompilation naming consistent even if you only run on some objects. diff --git a/decompiler/config/jak1/ntsc_v1/process_stack_size_overrides.jsonc b/decompiler/config/jak1/ntsc_v1/process_stack_size_overrides.jsonc new file mode 100644 index 00000000000..4745ef76c54 --- /dev/null +++ b/decompiler/config/jak1/ntsc_v1/process_stack_size_overrides.jsonc @@ -0,0 +1,2 @@ +// This overrides the stack size for calls to stack-size-set! in given functions. +{} diff --git a/decompiler/config/jak2/jak2_config.jsonc b/decompiler/config/jak2/jak2_config.jsonc index ad141a5aa8f..6446674487a 100644 --- a/decompiler/config/jak2/jak2_config.jsonc +++ b/decompiler/config/jak2/jak2_config.jsonc @@ -101,6 +101,7 @@ "all_types_file": "decompiler/config/jak2/all-types.gc", "art_group_dump_file": "decompiler/config/jak2/ntsc_v1/art-group-info.min.json", "joint_node_dump_file": "decompiler/config/jak2/ntsc_v1/joint-node-info.min.json", + "process_stack_size_file": "decompiler/config/jak2/ntsc_v1/process_stack_size_overrides.jsonc", // optional: a predetermined object file name map from a file. // this will make decompilation naming consistent even if you only run on some objects. diff --git a/decompiler/config/jak2/ntsc_v1/process_stack_size_overrides.jsonc b/decompiler/config/jak2/ntsc_v1/process_stack_size_overrides.jsonc new file mode 100644 index 00000000000..4745ef76c54 --- /dev/null +++ b/decompiler/config/jak2/ntsc_v1/process_stack_size_overrides.jsonc @@ -0,0 +1,2 @@ +// This overrides the stack size for calls to stack-size-set! in given functions. +{} diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 0da8c6242ad..2adfa9cb685 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -554,7 +554,7 @@ (new "Allocate a process-tree with the kernel clock." (symbol type string) _type_) ;; 0 (activate "Move a process from dead to active, moving it to the given tree." (_type_ process-tree string pointer) process-tree) ;; 9 (deactivate "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (_type_) none) ;; 10 - (init-from-entity! (_type_ entity-actor) none) ;; 11 + (init-from-entity! (_type_ entity-actor) object) ;; 11 (run-logic? "Should this process be run? Checked by execute-process-tree." (_type_) symbol) ;; 12 (process-tree-method-13 () none) ;; 13 ) @@ -7418,7 +7418,7 @@ (lf18 18) (lf19 19) (lf20 20) - (lf21 21) + (desert 21) (lf22 22) (lf23 23) (lf24 24) @@ -7708,7 +7708,7 @@ (level-group-method-19 () none) ;; 19 ;; (level-update (_type_) none) (level-get-target-inside (_type_) level) ;; 20 (level-group-method-21 () none) ;; 21 ;; (alloc-levels-if-needed (_type_ symbol) none) - (art-group-get-by-name (_type_ string (pointer uint32)) art-group) ;; 22 ;; (load-commands-set! (_type_ pair) none) + (art-group-get-by-name (_type_ string (pointer level)) art-group) ;; 22 ;; (load-commands-set! (_type_ pair) none) (level-group-method-23 () none) ;; 23 ;; (art-group-get-by-name (_type_ string (pointer uint32)) art-group) (level-group-method-24 () none) ;; 24 ;; (alt-load-command-get-index (_type_ symbol int) pair) (level-group-method-25 () none) ;; 25 ;; (update-vis-volumes (_type_) none) @@ -8599,11 +8599,11 @@ (text-0053 #x0053) (progress-secrets #x0054) (text-0055 #x0055) - (text-0056 #x0056) - (text-0057 #x0057) - (text-0058 #x0058) - (text-0059 #x0059) - (text-005a #x005a) + (progress-secrets-toggle-beard #x0056) + (progress-secrets-hflip-screen #x0057) + (progress-secrets-endless-ammo #x0058) + (progress-secrets-invulnerable #x0059) + (progress-secrets-hero-mode #x005a) (progress-scene-player-act-1 #x005b) (progress-scene-player-act-2 #x005c) (progress-scene-player-act-3 #x005d) @@ -8611,11 +8611,11 @@ (progress-title-mega-scrap-book #x005f) (text-0060 #x0060) (text-0061 #x0061) - (text-0062 #x0062) + (progress-secrets-endless-dark #x0062) (text-0063 #x0063) (text-0065 #x0065) - (text-0066 #x0066) - (text-0067 #x0067) + (progress-secrets-big-head #x0066) + (progress-secrets-little-head #x0067) (text-0068 #x0068) (text-0069 #x0069) (progress-missions #x006a) @@ -9231,7 +9231,7 @@ (text-077b #x077b) (text-077c #x077c) (talk-to-kleiver #x078d) - (text-07b3 #x07b3) + (progress-secrets-unlimited-turbos #x07b3) (text-07b4 #x07b4) (text-07b5 #x07b5) (progress-language-portuguese #x07b8) @@ -9259,18 +9259,18 @@ (progress-title-commentary #x07d2) (text-07d3 #x07d3) (text-07d4 #x07d4) - (text-07d5 #x07d5) - (text-07d6 #x07d6) + (progress-secrets-fast-movie #x07d5) + (progress-secrets-slow-movie #x07d6) (text-07d7 #x07d7) (text-07d8 #x07d8) - (text-07d9 #x07d9) - (text-07da #x07da) - (text-07db #x07db) - (text-07dc #x07dc) + (progress-secrets-red-ammo-capacity #x07d9) + (progress-secrets-yellow-ammo-capacity #x07da) + (progress-secrets-blue-ammo-capacity #x07db) + (progress-secrets-dark-ammo-capacity #x07dc) (text-07dd #x07dd) - (text-07de #x07de) - (text-07df #x07df) - (text-07e0 #x07e0) + (progress-secrets-gungame-ratchet #x07de) + (progress-secrets-endless-light #x07df) + (progress-secrets-bad-weather #x07e0) (text-07e1 #x07e1) (text-07e2 #x07e2) (progress-title-jak3-mdl-viewer #x07e3) @@ -9280,7 +9280,7 @@ (text-07e7 #x07e7) (text-07e8 #x07e8) (text-07e9 #x07e9) - (text-07ea #x07ea) + (progress-secrets-kleever-diaper #x07ea) (text-07f6 #x07f6) (text-07f7 #x07f7) (text-07f8 #x07f8) @@ -9335,36 +9335,36 @@ (text-0831 #x0831) (text-0832 #x0832) (text-0833 #x0833) - (text-0834 #x0834) - (text-0835 #x0835) - (text-0836 #x0836) - (text-0837 #x0837) - (text-0838 #x0838) - (text-0839 #x0839) + (progress-secrets-weapon-upgrades #x0834) + (progress-secrets-cheats #x0835) + (progress-secrets-vehicle-upgrades #x0836) + (progress-secrets-crazy-stuff #x0837) + (progress-secrets-art-gallery #x0838) + (progress-secrets-expert-options #x0839) (text-083a #x083a) - (text-083b #x083b) - (text-083c #x083c) - (text-083d #x083d) - (text-083e #x083e) - (text-083f #x083f) - (text-0840 #x0840) - (text-0841 #x0841) - (text-0842 #x0842) - (text-0843 #x0843) - (text-0844 #x0844) - (text-0845 #x0845) - (text-0846 #x0846) - (text-0847 #x0847) - (text-0848 #x0848) - (text-0849 #x0849) - (text-084a #x084a) - (text-084b #x084b) - (text-084c #x084c) - (text-084d #x084d) + (progress-secrets-gun-upgrade-red-1 #x083b) + (progress-secrets-gun-upgrade-red-2 #x083c) + (progress-secrets-gun-upgrade-red-3 #x083d) + (progress-secrets-gun-upgrade-yellow-1 #x083e) + (progress-secrets-gun-upgrade-yellow-2 #x083f) + (progress-secrets-gun-upgrade-yellow-3 #x0840) + (progress-secrets-gun-upgrade-blue-1 #x0841) + (progress-secrets-gun-upgrade-blue-2 #x0842) + (progress-secrets-gun-upgrade-blue-3 #x0843) + (progress-secrets-gun-upgrade-dark-1 #x0844) + (progress-secrets-gun-upgrade-dark-2 #x0845) + (progress-secrets-gun-upgrade-dark-3 #x0846) + (progress-secrets-vehicle-fox #x0847) + (progress-secrets-vehicle-mirage #x0848) + (progress-secrets-vehicle-x-ride #x0849) + (progress-secrets-vehicle-hit-points #x084a) + (progress-secrets-board-fast #x084b) + (progress-secrets-darkjak-tracking #x084c) + (progress-secrets-daxter-pants #x084d) (progress-title-level-select-act-1 #x084e) (progress-title-level-select-act-2 #x084f) (progress-title-level-select-act-3 #x0850) - (text-0851 #x0851) + (progress-secrets-button-invis #x0851) (text-0852 #x0852) (text-0853 #x0853) (text-0856 #x0856) @@ -9984,7 +9984,7 @@ :size-assert #xd0 :flag-assert #xb000000d0 (:methods - (minimap-trail-method-9 () none) ;; 9 ;; (get-distance-with-path (_type_ vector vector) float) + (get-distance-with-path (_type_ vector vector) float) ;; 9 (minimap-trail-method-10 () none) ;; 10 ;; (reset (_type_) none) ) ) @@ -10042,9 +10042,9 @@ :flag-assert #x1c00000658 (:methods (minimap-method-9 () none) ;; 9 ;; (debug-draw (_type_) none) - (minimap-method-10 () none) ;; 10 ;; (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail) + (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail) ;; 10 (minimap-method-11 () none) ;; 11 ;; (get-icon-draw-pos (_type_ connection-minimap minimap-trail vector float vector) symbol) - (minimap-method-12 () none) ;; 12 ;; (add-icon! (_type_ process uint int vector int) connection-minimap) + (add-icon! (_type_ process uint int vector int) connection-minimap) ;; 12 (minimap-method-13 () none) ;; 13 ;; (free-trail-by-connection (_type_ connection-minimap) none) (minimap-method-14 () none) ;; 14 ;; (update-trails (_type_) none) (minimap-method-15 () none) ;; 15 ;; (draw-1 (_type_ dma-buffer vector4w symbol) none) @@ -10137,7 +10137,7 @@ (bigmap-method-13 () none) ;; 13 ;; (compress-all (_type_) int) (bigmap-method-14 () none) ;; 14 ;; (enable-drawing (_type_) none) (bigmap-method-15 () none) ;; 15 ;; (disable-drawing (_type_) int) - (bigmap-method-16 () none) ;; 16 ;; (dump-to-file (_type_) file-stream) + (bigmap-method-16 (_type_) none) ;; 16 ;; (dump-to-file (_type_) file-stream) (bigmap-method-17 () none) ;; 17 ;; (set-pos! (_type_ vector) int) (bigmap-method-18 () none) ;; 18 ;; (decompress-current-masks! (_type_) int) (bigmap-method-19 () none) ;; 19 ;; (compress-current-masks! (_type_) int) @@ -10161,7 +10161,7 @@ (feature2 2) (feature3 3) (feature4 4) - (feature5 5) + (gun 5) (gun-red-1 6) (gun-red-2 7) (gun-red-3 8) @@ -10176,7 +10176,7 @@ (gun-dark-3 17) (board 18) (feature19 19) - (feature20 20) + (sidekick 20) (feature21 21) (feature22 22) (gun-upgrade-yellow-ammo-1 23) @@ -10193,16 +10193,16 @@ (feature34 34) (feature35 35) (feature36 36) - (feature37 37) - (feature38 38) + (board-launch 37) + (board-trail 38) (feature39 39) - (feature40 40) + (darkjak 40) (darkjak-smack 41) (darkjak-bomb0 42) (darkjak-bomb1 43) (feature44 44) (feature45 45) - (feature46 46) + (lightjak 46) (lightjak-regen 47) (lightjak-swoop 48) (lightjak-freeze 49) @@ -10228,59 +10228,59 @@ :type uint64 :bitfield #t (hero-mode 0) - (gs1 1) - (gs2 2) - (gs3 3) - (gs4 4) - (gs5 5) - (gs6 6) - (gs7 7) - (gs8 8) - (gs9 9) - (gs10 10) - (gs11 11) - (gs12 12) - (gs13 13) - (gs14 14) - (screen-flip 15) - (gs16 16) - (gs17 17) - (gs18 18) - (gs19 19) + (scene-player-1 1) + (scene-player-2 2) + (scene-player-3 3) + (title-commentary 4) + (level-select-1 5) + (level-select-2 6) + (level-select-3 7) + (scrap-book-1 8) + (scrap-book-2 9) + (scrap-book-3 10) + (model-viewer-1 11) + (model-viewer-2 12) + (model-viewer-3 13) + (toggle-beard 14) + (hflip-screen 15) + (endless-ammo 16) + (invulnerable 17) + (endless-dark 18) + (endless-light 19) (gs20 20) (gs21 21) (gungame-ratchet 22) - (gs23 23) - (gs24 24) - (gs25 25) - (gs26 26) - (gs27 27) - (gs28 28) - (gs29 29) - (gs30 30) - (gs31 31) - (gs32 32) - (gs33 33) - (gs34 34) - (gs35 35) - (gs36 36) - (gs37 37) - (gs38 38) - (gs39 39) - (gs40 40) - (gs41 41) - (gs42 42) - (gs43 43) - (gs44 44) - (gs45 45) - (gs46 46) - (gs47 47) - (gs48 48) - (gs49 49) - (gs50 50) - (gs51 51) - (gs52 52) - (gs53 53) + (big-head 23) + (little-head 24) + (fast-movie 25) + (slow-movie 26) + (unlimited-turbos 27) + (vehicle-hit-points 28) + (board-fast 29) + (vehicle-fox 30) + (vehicle-mirage 31) + (vehicle-x-ride 32) + (kleever-diaper 33) + (bad-weather 34) + (fast-weather 35) + (daxter-pants 36) + (darkjak-tracking 37) + (commentary 38) + (jak-is-jak2 39) + (button-invis 40) + (statistics 41) + (gun-upgrade-red-1 42) + (gun-upgrade-red-2 43) + (gun-upgrade-red-3 44) + (gun-upgrade-yellow-1 45) + (gun-upgrade-yellow-2 46) + (gun-upgrade-yellow-3 47) + (gun-upgrade-blue-1 48) + (gun-upgrade-blue-2 49) + (gun-upgrade-blue-3 50) + (gun-upgrade-dark-1 51) + (gun-upgrade-dark-2 52) + (gun-upgrade-dark-3 53) (gun-upgrade-ammo-red 54) (gun-upgrade-ammo-yellow 55) (gun-upgrade-ammo-blue 56) @@ -12218,7 +12218,7 @@ This is only called when viewing stats. The vis-bits and culling registers are loaded during this time." (_type_) none) ;; 13 (debug-draw "Debug-draw a drawable and its children. Typically uses the debug-draw functions." (_type_) none) ;; 14 - (drawable-method-15 () none) ;; 15 ;; (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8)) + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8)) ;; 15 (collect-regions "Fill the region-prim-list with regions that intersect the sphere." (_type_ sphere int region-prim-list) none) ;; 16 ) ) @@ -12499,6 +12499,23 @@ (defenum traffic-spawn-flags :type uint32 :bitfield #t + (tsf0 0) + (tsf1 1) + (tsf2 2) + (tsf3 3) + (tsf4 4) + (tsf5 5) + (tsf6 6) + (tsf7 7) + (tsf8 8) + (tsf9 9) + (tsf10 10) + (tsf11 11) + (tsf12 12) + (tsf13 13) + (tsf14 14) + (tsf15 15) + (tsf16 16) ) ;; ---traffic-h:traffic-spawn-flags @@ -14844,7 +14861,7 @@ (num-strips uint32 :offset 76) (num-dps uint32 :offset 92) (kick-offset uint32 :offset 108) - (shader gcf-shader :dynamic :offset-assert 112) ;; guessed by decompiler + (shader gcf-shader :inline :dynamic :offset-assert 112) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x70 @@ -15776,6 +15793,7 @@ (disable-draw) (shdf06) (shdf07) + (shdf08) ) ;; ---shadow-cpu-h:shadow-flags @@ -16281,7 +16299,7 @@ (title 12) (title-movie 13) (continue-flag-14 14) - (continue-flag-15 15) + (copy-entity-pos 15) (continue-flag-16 16) (test 17) (record-path 18) @@ -16835,63 +16853,67 @@ ;; +++speech-h:speech-type (defenum speech-type :type int8 - (speech-type-0) - (speech-type-1) - (speech-type-2) - (speech-type-3) - (speech-type-4) - (speech-type-5) - (speech-type-6) - (speech-type-7) - (speech-type-8) - (speech-type-9) - (speech-type-10) - (speech-type-11) - (speech-type-12) - (speech-type-13) - (speech-type-14) - (speech-type-15) - (speech-type-16) - (speech-type-17) - (speech-type-18) - (speech-type-19) - (speech-type-20) - (speech-type-21) - (speech-type-22) - (speech-type-23) - (speech-type-24) - (speech-type-25) - (speech-type-26) - (speech-type-27) - (speech-type-28) - (speech-type-29) - (speech-type-30) - (speech-type-31) - (speech-type-32) - (speech-type-33) - (speech-type-34) - (speech-type-35) - (speech-type-36) - (speech-type-37) - (speech-type-38) - (speech-type-39) - (speech-type-40) - (speech-type-41) - (speech-type-42) - (speech-type-43) - (speech-type-44) - (speech-type-45) - (speech-type-46) - (speech-type-47) - (speech-type-48) - (speech-type-49) - (speech-type-50) - (speech-type-51) - (speech-type-52) - (speech-type-53) - (speech-type-54) - (speech-type-55) - (speech-type-56) + (none 0) + (guard-generic-battle 1) + (guard-generic-battle-b 2) + (guard-battle-victory 3) + (guard-battle-victory-b 4) + (guard-change-targets 5) + (guard-change-targets-b 6) + (guard-go-hostile 7) + (guard-go-hostile-b 8) + (guard-hit 9) + (guard-hit-b 10) + (guard-witness-death 11) + (guard-witness-death-b 12) + (guard-chatter 13) + (guard-chatter-b 14) + (guard-chatter-jak 15) + (guard-chatter-jak-b 16) + (guard-bumped-by-jak 17) + (guard-bumped-by-jak-b 18) + (civ-m-ambient 19) + (civ-m-alert 20) + (civ-m-cower 21) + (civ-m-touched-by-player 22) + (civ-m-shot-by-player 23) + (civ-m-avoiding-player-vehicle 24) + (civ-m-hit-by-player-vehicle 25) + (civ-m-player-stealing-vehicle 26) + (civ-f-ambient 27) + (civ-f-alert 28) + (civ-f-cower 29) + (civ-f-touched-by-player 30) + (civ-f-shot-by-player 31) + (civ-f-avoiding-player-vehicle 32) + (civ-f-hit-by-player-vehicle 33) + (race-jak-start 34) + (race-jak-lap 35) + (race-jak-last-lap 36) + (race-jak-hit 37) + (race-jak-got-hit 38) + (race-jak-ambient 39) + (race-jak-pass 40) + (race-jak-jump 41) + (race-jak-win 42) + (race-daxter-start 43) + (race-daxter-lap 44) + (race-daxter-last-lap 45) + (race-daxter-hit 46) + (race-daxter-got-hit 47) + (race-daxter-ambient 48) + (race-daxter-pass 49) + (race-daxter-jump 50) + (race-daxter-win 51) + (race-errol-start 52) + (race-errol-last-lap 53) + (race-errrol-hit 54) + (race-errol-got-hit 55) + (race-errol-ambient 56) + (race-errol-pass 57) + (race-errol-got-passed 58) + (race-errol-win 59) + (race-errol-lose 60) ) ;; ---speech-h:speech-type @@ -16933,12 +16955,12 @@ :flag-assert #xf00000064 ;; field speech-channel-flag is likely a value type. (:methods - (speech-channel-method-9 () none) ;; 9 ;; (speech-channel-method-9 (_type_ process-drawable speech-type) none) - (speech-channel-method-10 () none) ;; 10 ;; (speech-channel-method-10 (_type_ handle) none) - (speech-channel-method-11 () none) ;; 11 ;; (speech-channel-method-11 (_type_) none) - (speech-channel-method-12 () none) ;; 12 ;; (speech-channel-method-12 (_type_) none) - (speech-channel-method-13 () none) ;; 13 ;; (speech-channel-method-13 (_type_) none) - (speech-channel-method-14 () none) ;; 14 + (speech-channel-method-9 (_type_ process-drawable speech-type) int) ;; 9 + (speech-channel-method-10 (_type_ handle) none) ;; 10 + (speech-channel-method-11 (_type_) none) ;; 11 ;; (speech-channel-method-11 (_type_) none) + (reset-channel! (_type_) none) ;; 12 + (init! (_type_) none) ;; 13 ;; (speech-channel-method-13 (_type_) none) + (speech-channel-method-14 (_type_ speech-type float) none) ;; 14 ) ) @@ -16950,15 +16972,15 @@ :size-assert #x1d4 :flag-assert #x12000001d4 (:methods - (speech-control-method-9 () none) ;; 9 ;; (speech-control-method-9 (_type_) none) - (speech-control-method-10 () none) ;; 10 ;; (speech-table-set! (_type_ speech-type speech-type-info) none) - (speech-control-method-11 (_type_) none) ;; 11 ;; (speech-control-method-11 (_type_) none) - (speech-control-method-12 () none) ;; 12 ;; (speech-control-method-12 (_type_ process-drawable speech-type) none) - (speech-control-method-13 () none) ;; 13 ;; (speech-control-method-13 (_type_ handle) none) - (speech-control-method-14 () none) ;; 14 ;; (speech-control-method-14 (_type_) none) - (speech-control-method-15 () none) ;; 15 ;; (speech-control-method-15 (_type_ process-drawable) none) - (speech-control-method-16 () none) ;; 16 ;; (speech-control-method-16 (_type_) none) - (speech-control-method-17 () none) ;; 17 + (speech-table-reset! (_type_) none) ;; 9 + (speech-table-set! (_type_ speech-type speech-type-info) none) ;; 10 + (speech-control-method-11 (_type_) none) ;; 11 + (speech-control-method-12 (_type_ process-drawable speech-type) none) ;; 12 + (speech-control-method-13 (_type_ process-drawable speech-type int) none) ;; 13 + (speech-control-method-14 (_type_ handle) none) ;; 14 + (speech-control-method-15 (_type_) none) ;; 15 + (speech-control-method-16 (_type_) none) ;; 16 + (speech-control-method-17 (_type_ speech-type float) none) ;; 17 ) ) @@ -17691,6 +17713,8 @@ (defenum part-local-space-flags :type uint32 :bitfield #t + (pls0 0) + (pls1 1) ) ;; ---engines:part-local-space-flags @@ -18174,7 +18198,7 @@ (slope-up-traction float :offset 88) (align-speed float :offset 92) (slope-change-preserve float :offset 96) - (hook function 5 :offset-assert 128) + (hook function 5 :offset-assert 128 :score -1) (active-hook (function none) :offset 128) (touch-hook (function none) :offset 132) (impact-hook (function control-info (pointer float) vector none) :offset 136) @@ -18477,7 +18501,7 @@ ;; field actor-option is likely a value type. (:methods (new (symbol type process pickup-type float) _type_) ;; 0 - (fact-info-method-9 () none) ;; 9 ;; (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process)) + (drop-pickup (_type_ symbol process-tree fact-info int symbol) (pointer process)) ;; 9 (reset! (_type_ symbol) none) ;; 10 (pickup-collectable! (_type_ pickup-type float handle) float) ;; 11 ) @@ -18675,8 +18699,8 @@ :flag-assert #xe00000134 (:methods (new (symbol type process) _type_) ;; 0 - (align-control-method-9 () none) ;; 9 ;; (compute-alignment! (_type_) transformq) - (align-control-method-10 () none) ;; 10 ;; (align! (_type_ align-opts float float float) trsqv) + (compute-alignment! (_type_) transformq) ;; 9 + (align! (_type_ align-opts float float float) trsqv) ;; 10 (align-control-method-11 () none) ;; 11 ;; (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv) (align-control-method-12 () none) ;; 12 ;; (first-transform (_type_) transform) (align-control-method-13 () none) ;; 13 ;; (second-transform (_type_) transform) @@ -19094,6 +19118,7 @@ (test 24) ) +(declare-type touching-shapes-entry structure) (deftype attack-info (structure) "Information about an incoming attack." ((trans vector :inline :offset-assert 0) @@ -19128,9 +19153,9 @@ :flag-assert #xc000000a8 ;; field handle is likely a value type. (:methods - (attack-info-method-9 () none) ;; 9 ;; (attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none) - (attack-info-method-10 () none) ;; 10 ;; (compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info) - (attack-info-method-11 () none) ;; 11 ;; (combine! (_type_ attack-info process-drawable) attack-info) + (attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none) ;; 9 + (compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info) ;; 10 + (combine! (_type_ attack-info process-drawable) attack-info) ;; 11 ) ) @@ -19139,6 +19164,7 @@ (blend float 3 :offset-assert 4) ;; guessed by decompiler (group uint32 5 :offset-assert 16) ;; guessed by decompiler ) + :pack-me :method-count-assert 9 :size-assert #x24 :flag-assert #x900000024 @@ -19186,7 +19212,7 @@ ;; field key uses ~A with a signed load. field expr uses ~A with a signed load. (:methods (new (symbol type object process vector) _type_) ;; 0 - (script-context-method-9 () none) ;; 9 ;; (eval! (_type_ pair) object) + (eval! (_type_ pair) object) ;; 9 (script-context-method-10 () none) ;; 10 ;; (script-context-method-10 (_type_ object pair) object) (script-context-method-11 () none) ;; 11 ;; (script-context-method-11 (_type_ pair pair symbol) symbol) ) @@ -19333,7 +19359,7 @@ "Parameters used to set up a [[sync-info]]." ((sync-type symbol :offset-assert 0) ;; guessed by decompiler (sync-flags sync-flags :offset-assert 8) ;; sync-flags - (entity basic :offset-assert 16) + (entity entity-actor :offset-assert 16) (period uint32 :offset-assert 20) (percent float :offset-assert 24) (ease-in float :offset-assert 28) @@ -19357,9 +19383,9 @@ (:methods (sync-info-method-9 () none) ;; 9 ;; (get-current-phase-no-mod (_type_) float) (sync-info-method-10 () none) ;; 10 ;; (get-phase-offset (_type_) float) - (sync-info-method-11 () none) ;; 11 ;; (get-norm! (_type_ int) float) + (get-norm! (_type_ int) float) ;; 11 (sync-info-method-12 () none) ;; 12 ;; (get-scaled-val! (_type_ float int) float) - (sync-info-method-13 () none) ;; 13 ;; (initialize! (_type_ sync-info-params) none) + (initialize! (_type_ sync-info-params) none) ;; 13 (sync-info-method-14 () none) ;; 14 ;; (get-timeframe-offset! (_type_ time-frame) time-frame) (sync-info-method-15 () none) ;; 15 ;; (sync-now! (_type_ float) none) ) @@ -19495,8 +19521,8 @@ ;; pov-camera-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; +++pov-camera-h:pov-camera-flags -(defenum pov-camera-flags +;; +++pov-camera-h:pov-camera-flag +(defenum pov-camera-flag :bitfield #t :type int32 (notify-of-abort 0) @@ -19504,10 +19530,10 @@ (inherit-orientation 2) (pcf3 3) ) -;; ---pov-camera-h:pov-camera-flags +;; ---pov-camera-h:pov-camera-flag (deftype pov-camera (process-drawable) - ((flags pov-camera-flags :offset-assert 200) ;; pov-camera-flag + ((flags pov-camera-flag :offset-assert 200) ;; pov-camera-flag (debounce-start-time time-frame :offset-assert 208) ;; time-frame (notify-handle handle :offset-assert 216) ;; handle (anim-name string :offset-assert 224) ;; guessed by decompiler @@ -20286,6 +20312,7 @@ ) ;; ---collide-shape-h:collide-list-enum +(declare-type collide-query structure) (deftype collide-shape (trsqv) "The parent of all of an object's collide primitives. Most [[process-drawable]]s have a [[collide-shape]] that represents their root transform." @@ -20302,8 +20329,8 @@ (riders (inline-array collide-rider) :offset-assert 164) ;; guessed by decompiler (penetrate-using penetrate :offset-assert 168) (penetrated-by penetrate :offset-assert 176) - (unknown-word0 int32 :offset-assert 184) ;; added (enter process-drawable-art-error) - (unknown-word1 int32 :offset-assert 188) ;; added (enter process-drawable-art-error) + (backup-collide-as collide-spec :offset-assert 184) ;; added (enter process-drawable-art-error) + (backup-collide-with collide-spec :offset-assert 188) ;; added (enter process-drawable-art-error) (event-priority uint8 :offset 192) (rider-max-momentum float :offset-assert 196) ) @@ -20313,27 +20340,27 @@ ;; field penetrate is likely a value type. field penetrate is likely a value type. (:methods (new (symbol type process-drawable collide-list-enum) _type_) ;; 0 - (collide-shape-method-28 () none) ;; 28 ;; (move-by-vector! (_type_ vector) none) - (collide-shape-method-29 () none) ;; 29 ;; (move-to-point! (_type_ vector) none) + (move-by-vector! (_type_ vector) none) ;; 28 + (move-to-point! (_type_ vector) none) ;; 29 (collide-shape-method-30 () none) ;; 30 ;; (debug-draw (_type_) none) - (collide-shape-method-31 () none) ;; 31 ;; (fill-cache-for-shape (_type_ float collide-query) none) - (collide-shape-method-32 () none) ;; 32 ;; (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none) + (fill-cache-for-shape (_type_ float collide-query) none) ;; 31 + (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none) ;; 32 (collide-shape-method-33 () none) ;; 33 ;; (find-prim-by-id (_type_ uint) collide-shape-prim) (collide-shape-method-34 () none) ;; 34 ;; (find-prim-by-id-logtest (_type_ uint) collide-shape-prim) (detect-riders! (_type_) symbol) ;; 35 (collide-shape-method-36 () none) ;; 36 ;; (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol) - (collide-shape-method-37 () none) ;; 37 ;; (integrate-and-collide! (_type_ vector) none) + (integrate-and-collide! (_type_ vector) none) ;; 37 (find-collision-meshes (_type_) none) ;; 38 (collide-shape-method-39 () none) ;; 39 ;; (on-platform (_type_ collide-shape collide-query) symbol) - (collide-shape-method-40 () none) ;; 40 ;; (find-overlapping-shapes (_type_ overlaps-others-params) symbol) + (find-overlapping-shapes (_type_ overlaps-others-params) symbol) ;; 40 (collide-shape-method-41 () none) ;; 41 ;; (shove-to-closest-point-on-path (_type_ attack-info float) vector) (collide-shape-method-42 () none) ;; 42 ;; (should-push-away (_type_ collide-shape collide-query) symbol) (collide-shape-method-43 () none) ;; 43 ;; (pull-rider! (_type_ pull-rider-info) none) (pull-riders! (_type_) symbol) ;; 44 (do-push-aways (_type_) collide-spec) ;; 45 (update-transforms (_type_) none) ;; 46 - (collide-shape-method-47 () none) ;; 47 ;; (set-collide-with! (_type_ collide-spec) none) - (collide-shape-method-48 () none) ;; 48 ;; (set-collide-as! (_type_ collide-spec) none) + (set-collide-with! (_type_ collide-spec) none) ;; 47 + (set-collide-as! (_type_ collide-spec) none) ;; 48 (collide-shape-method-49 () none) ;; 49 ;; (modify-collide-as! (_type_ int collide-spec collide-spec) none) (collide-shape-method-50 () none) ;; 50 ;; (send-shoves (_type_ process touching-shapes-entry float float float) symbol) (collide-shape-method-51 () none) ;; 51 ;; (above-ground? (_type_ collide-query vector collide-spec float float float) symbol) @@ -20343,6 +20370,45 @@ ) ) +;; +++collide-shape-h:cshape-reaction-flags +(defenum cshape-reaction-flags + :bitfield #t + :type uint32 + (csrf00) + (csrf01) + (csrf02) + (csrf03) + (csrf04) + (csrf05) + (csrf06) + (csrf07) + (csrf08) + (csrf09) + (csrf10) + (csrf11) + (csrf12) + (csrf13) + (csrf14) + (csrf15) + (csrf16) + (csrf17) + (csrf18) + (csrf19) + (csrf20) + (csrf21) + (csrf22) + (csrf23) + (csrf24) + (csrf25) + (csrf26) + (csrf27) + (csrf28) + (csrf29) + (csrf30) + (csrf31) + ) +;; ---collide-shape-h:cshape-reaction-flags + ;; +++collide-shape-h:collide-status (defenum collide-status :bitfield #t @@ -20377,6 +20443,9 @@ (cur-pat pat-surface :offset-assert 276) ;; guessed by decompiler (ground-pat pat-surface :offset-assert 280) ;; guessed by decompiler (status collide-status :offset-assert 288) ;; collide-status + (old-status collide-status :offset-assert 296) + (prev-status collide-status :offset-assert 304) + (reaction-flag cshape-reaction-flags :offset-assert 312) (reaction (function control-info collide-query vector vector collide-status) :offset 316) ;; guessed by decompiler (no-reaction (function collide-shape-moving collide-query vector vector object) :offset-assert 320) ;; guessed by decompiler (local-normal vector :inline :offset-assert 336) @@ -20400,17 +20469,17 @@ ;; field penetrate is likely a value type. field penetrate is likely a value type. (:methods (new (symbol type process-drawable collide-list-enum) _type_) ;; 0 - (collide-shape-moving-method-55 () none) ;; 55 ;; (find-ground (_type_ collide-query collide-spec float float float) symbol) - (collide-shape-moving-method-56 () none) ;; 56 ;; (react-to-pat! (_type_ pat-surface) cshape-reaction-flags) + (find-ground (_type_ collide-query collide-spec float float float) symbol) ;; 55 + (react-to-pat! (_type_ pat-surface) cshape-reaction-flags) ;; 56 (collide-shape-moving-method-57 () none) ;; 57 ;; (integrate-no-collide! (_type_ vector) none) (collide-shape-moving-method-58 () none) ;; 58 ;; (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol) (collide-shape-moving-method-59 () none) ;; 59 ;; (move-above-ground (_type_ vector move-above-ground-params) none) (collide-shape-moving-method-60 () none) ;; 60 ;; (move-to-ground (_type_ float float symbol collide-spec) none) (collide-shape-moving-method-61 () none) ;; 61 ;; (move-to-ground-point (_type_ vector vector vector) none) - (collide-shape-moving-method-62 () none) ;; 62 ;; (compute-acc-due-to-gravity (_type_ vector float) vector) + (compute-acc-due-to-gravity (_type_ vector float) vector) ;; 62 (collide-shape-moving-method-63 () none) ;; 63 ;; (collide-shape-moving-method-63 (_type_ rigid-body float) none) (collide-shape-moving-method-64 () none) ;; 64 ;; (try-snap-to-surface (_type_ vector float float float) symbol) - (collide-shape-moving-method-65 () none) ;; 65 ;; (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol) + (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol) ;; 65 (collide-shape-moving-method-66 () none) ;; 66 ;; (step-collison! (_type_ vector vector float int) float) (collide-shape-moving-method-67 () none) ;; 67 ;; (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none) ) @@ -20431,7 +20500,11 @@ (defenum manipy-options :bitfield #t :type uint32 - (mo-0 0) + (mo0 0) + (mo1 1) + (mo2 2) + (mo3 3) + (mo4 4) ) ;; ---generic-obs-h:manipy-options @@ -20451,7 +20524,7 @@ (new-post-hook (function none) :offset-assert 288) (cur-post-hook (function none) :offset-assert 292) (clone-copy-trans symbol :offset-assert 296) - (shadow-backup basic :offset-assert 300) + (shadow-backup shadow-geo :offset-assert 300) (draw? symbol :offset-assert 304) (userdata uint64 :offset-assert 312) (prefix basic :offset-assert 320) @@ -20470,9 +20543,9 @@ "A process that spawns a specified particle group." ((root trsqv :offset-assert 128) ;; guessed by decompiler (part sparticle-launch-control :offset-assert 132) ;; guessed by decompiler - (path basic :offset-assert 136) + (path path-control :offset-assert 136) (sound ambient-sound :offset-assert 140) ;; guessed by decompiler - (sound-extra basic :offset-assert 144) + (sound-extra ambient-sound :offset-assert 144) (mode (pointer sparticle-launch-group) :offset-assert 148) ;; guessed by decompiler (enable symbol :offset-assert 152) ;; guessed by decompiler (path-pos float :offset-assert 156) @@ -20488,7 +20561,7 @@ active ) (:methods - (part-spawner-method-15 () none) ;; 15 ;; (is-in-view? (_type_) symbol) + (is-in-view? (_type_) symbol) ;; 15 ) ) @@ -20513,11 +20586,13 @@ :size-assert #x15c :flag-assert #x1200e0015c ;; field userdata uses ~A with a 64-bit load. + (:state-methods + active ;; 14 + linger ;; 15 + die ;; 16 + ) (:methods - (part-tracker-method-14 () none) ;; 14 ;; (active () _type_ :state) - (part-tracker-method-15 () none) ;; 15 ;; (notify-parent-of-death (_type_) none) - (part-tracker-method-16 () none) ;; 16 - (part-tracker-method-17 () none) ;; 17 + (notify-parent-of-death (_type_) none) ;; 17 ) ) @@ -20526,8 +20601,8 @@ (duration time-frame :offset-assert 8) (group sparticle-launch-group :offset-assert 16) (callback (function part-tracker vector) :offset-assert 20) - (target basic :offset-assert 24) - (mat-joint basic :offset-assert 28) + (target process-drawable :offset-assert 24) + (mat-joint object :offset-assert 28) ;; can be *launch-matrix* or joint idx ) :method-count-assert 9 :size-assert #x20 @@ -20540,8 +20615,8 @@ (duration time-frame :offset-assert 8) (group sparticle-launch-group :offset-assert 16) (callback (function part-tracker vector) :offset-assert 20) - (target basic :offset-assert 24) - (mat-joint basic :offset-assert 28) + (target process-drawable :offset-assert 24) + (mat-joint object :offset-assert 28) ;; can be *launch-matrix* or joint idx (subsample-num float :offset-assert 32) ) :method-count-assert 9 @@ -20550,8 +20625,10 @@ ;; field userdata uses ~A with a 64-bit load. field mat-joint uses ~A with a signed load. ) +(declare-type sparticle-subsampler basic) + (deftype part-tracker-subsampler (part-tracker) - ((subsampler basic :offset-assert 348) + ((subsampler sparticle-subsampler :offset-assert 348) ) :method-count-assert 18 :size-assert #x160 @@ -20580,10 +20657,12 @@ :size-assert #x130 :flag-assert #x1100b00130 ;; field userdata uses ~A with a 64-bit load. + (:state-methods + active ;; 14 + ) (:methods - (lightning-tracker-method-14 () none) ;; 14 ;; (active () _type_ :state) - (lightning-tracker-method-15 () none) ;; 15 ;; (notify-parent-of-death (_type_) none) - (lightning-tracker-method-16 () none) ;; 16 ;; (update (_type_) none) + (notify-parent-of-death (_type_) none) ;; 15 + (update (_type_) none) ;; 16 ) ) @@ -20593,13 +20672,13 @@ (event symbol :offset-assert 216) ;; guessed by decompiler (run-function (function object) :offset-assert 220) ;; guessed by decompiler (callback (function touch-tracker none) :offset-assert 224) ;; guessed by decompiler - (event-mode basic :offset-assert 228) + (event-mode symbol :offset-assert 228) ) :method-count-assert 21 :size-assert #xe8 :flag-assert #x15007000e8 - (:methods - (touch-tracker-method-20 () none) ;; 20 ;; (active () _type_ :state) + (:state-methods + active ;; 20 ) ) @@ -20614,12 +20693,14 @@ :method-count-assert 25 :size-assert #x11c :flag-assert #x1900a0011c + (:state-methods + idle ;; 20 + (active handle) ;; 21 + ) (:methods - (swingpole-method-20 () none) ;; 20 ;; (idle () _type_ :state) - (swingpole-method-21 () none) ;; 21 ;; (active (handle) _type_ :state) - (swingpole-method-22 () none) ;; 22 ;; (move-along-path (_type_) none) - (swingpole-method-23 () none) ;; 23 - (swingpole-method-24 () none) ;; 24 + (swingpole-method-22 (_type_) none) ;; 22 ;; (move-along-path (_type_) none) + (init-collision! (_type_) none) ;; 23 + (get-trans (_type_) vector) ;; 24 ) ) @@ -20674,7 +20755,7 @@ (damage-scale float :offset-assert 52) (vehicle-damage-factor float :offset-assert 56) (vehicle-impulse-factor float :offset-assert 60) - (ignore-proc uint64 :offset-assert 64) + (ignore-proc handle :offset-assert 64) ) :method-count-assert 9 :size-assert #x48 @@ -20692,10 +20773,12 @@ :method-count-assert 23 :size-assert #x168 :flag-assert #x1700f00168 + (:state-methods + explode ;; 20 + ) (:methods - (explosion-method-20 () none) ;; 20 ;; (explode () _type_ :state) (explosion-method-21 () none) ;; 21 ;; (setup-explosion-collision (_type_) none) - (explosion-method-22 () none) ;; 22 ;; (explosion-method-22 (_type_) none) + (explosion-method-22 (_type_) none) ;; 22 ) ) @@ -20715,13 +20798,15 @@ :method-count-assert 26 :size-assert #xcc :flag-assert #x1a005000cc + (:state-methods + active ;; 20 + ) (:methods - (simple-prim-method-20 () none) ;; 20 - (simple-prim-method-21 () none) ;; 21 - (simple-prim-method-22 () none) ;; 22 - (simple-prim-method-23 () none) ;; 23 - (simple-prim-method-24 () none) ;; 24 - (simple-prim-method-25 () none) ;; 25 + (init-strip! (_type_) none) ;; 21 + (strip-setup (_type_) none) ;; 22 + (get-alpha (_type_) int) ;; 23 + (allocate-trans-and-strip! "Allocate transform and strip." (_type_) prim-strip) ;; 24 + (get-color (_type_) rgba) ;; 25 ) ) @@ -20729,10 +20814,15 @@ (defenum task-arrow-flags :type uint32 :bitfield #t - (task-arrow-flag-00 0) - (task-arrow-flag-01 1) - (task-arrow-flag-02 2) - (task-arrow-flag-03 3) + (taf0 0) + (taf1 1) + (taf2 2) + (taf3 3) + (taf4 4) + (taf5 5) + (taf6 6) + (taf7 7) + (taf8 8) ) ;; ---generic-obs-h:task-arrow-flags @@ -20754,14 +20844,14 @@ :method-count-assert 15 :size-assert #x8c :flag-assert #xf0010008c - (:methods - (external-camera-controller-method-14 () none) ;; 14 + (:state-methods + active ;; 14 ) ) -(define-extern *simple-prim-additive* int) -(define-extern *simple-prim-alpha-blend* int) -(define-extern *simple-prim-subtractive* int) +(define-extern *simple-prim-additive* gs-alpha) +(define-extern *simple-prim-alpha-blend* gs-alpha) +(define-extern *simple-prim-subtractive* gs-alpha) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; trajectory-h ;; @@ -20805,7 +20895,7 @@ (new (symbol type process-drawable int float collide-spec) _type_) ;; 0 (initialize (_type_ process-drawable int float collide-spec) impact-control) ;; 9 (impact-control-method-10 () none) ;; 10 ;; (update-from-cspace (_type_) none) - (impact-control-method-11 () none) ;; 11 ;; (impact-control-method-11 (_type_ collide-query process pat-surface) float) + (impact-control-method-11 (_type_ collide-query process pat-surface) float) ;; 11 ) ) @@ -20819,7 +20909,7 @@ (new (symbol type vector vector) _type_) ;; 0 (initialize (_type_ vector vector) point-tracker) ;; 9 (point-tracker-method-10 () none) ;; 10 ;; (point-tracker-method-10 (_type_ vector vector vector float) vector) - (point-tracker-method-11 () none) ;; 11 ;; (point-tracker-method-11 (_type_ vector vector vector float) vector) + (point-tracker-method-11 (_type_ vector vector vector float) vector) ;; 11 ) ) @@ -20831,8 +20921,8 @@ :size-assert #x30 :flag-assert #xe00000030 (:methods - (combo-tracker-method-12 () none) ;; 12 ;; (combo-tracker-method-12 (_type_ vector vector process time-frame) combo-tracker) - (combo-tracker-method-13 () none) ;; 13 ;; (combo-tracker-method-13 (_type_ handle vector float vector float) basic) + (combo-tracker-method-12 (_type_ vector vector process time-frame) combo-tracker) ;; 12 + (combo-tracker-method-13 (_type_ handle vector float vector float) process-focusable) ;; 13 ) ) @@ -20884,8 +20974,229 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype control-info (collide-shape-moving) - ((pad uint8 5944) - ) + ((unknown-float00 float :overlay-at ground-impact-vel) + (unknown-float01 float :overlay-at surface-angle) + (unknown-float02 float :overlay-at poly-angle) + (unknown-float03 float :overlay-at touch-angle) + (transv-ctrl vector :inline :offset 480) + (target-transv vector :inline :offset 496) + (bent-gravity-normal vector :inline :offset 512) + (quat-for-control quaternion :inline :offset 528) + (override-quat quaternion :inline :offset 544) + (override-quat-alpha float :offset 560) + (ctrl-xz-vel float :offset 564) + (unknown-float003 float :offset 568) + (turn-go-the-long-way float :offset 572) + (velocity-after-thrust float :offset 576) + (turn-lockout-end-time time-frame :offset 584) + (turn-to-alt-heading vector :inline :offset 592) + (last-transv vector :inline :offset 608) + (last-quat-for-control quaternion :inline :offset 624) + (trans-log-trans vector 128 :inline :offset 640) + (trans-log-times time-frame 128 :offset 2688) + (trans-log-idx int32 :offset 3712) + (draw-offset vector :inline :offset 3728) + (cspace-offset vector :inline :offset 3744) + (anim-collide-offset-local vector :inline :offset 3760) + (anim-collide-offset-world vector :inline :offset 3776) + (old-anim-collide-offset-world vector :inline :offset 3792) + (anim-collide-offset-delta-world vector :inline :offset 3808) + (standard-dynamics dynamics :offset 3824) + (mod-surface surface :offset 3828) + (current-surface surface :offset 3832) + (prev-surf surface :offset 3836) + (time-of-last-surface-change time-frame :offset 3840) + (cpad cpad-info :offset 3848) + (turn-to-angle float :offset 3852) + (last-turn-to-angle float :offset 3856) + (turn-to-magnitude float :offset 3860) + (last-turn-to-magnitude float :offset 3864) + (to-target-pt-xz vector :inline :offset 3872) + (last-to-target-pt-xz vector :inline :offset 3888) + (turn-to-target vector :inline :offset 3904) + (last-turn-to-target vector :inline :offset 3920) + (turn-history-ctrl vector 7 :inline :offset 3936) + (pad-xz-dir vector :inline :offset 4064) + (last-pad-xz-dir vector :inline :offset 4080) + (pad-magnitude float :offset 4096) + (last-pad-magnitude float :offset 4100) + (time-of-last-pad-read time-frame :offset 4104) + (w-R-c matrix :inline :offset 4112) + (c-R-w matrix :inline :offset 4176) + (ctrl-orientation matrix :inline :offset 4240) + (pre-collide-local-normal vector :inline :offset 4320) + (camera-pos vector :inline :offset 4336) + (cam-R-w matrix :inline :offset 4352) + (update-cam-R-w-start-time int64 :offset 4416) + (force-turn-to-direction vector :inline :offset 4432) + (force-turn-to-speed float :offset 4448) + (unknown-floatiujh1bnb2n3i1 float :offset 4452) + (force-turn-to-strength float :offset 4456) + (tongue-counter int32 :offset 4460) + (collide-extra-velocity vector :inline :offset 4464) + (additional-decaying-velocity vector :inline :offset 4480) + (additional-decaying-velocity-end-time time-frame :offset 4496) + (additional-decaying-velocity-decay-start-time time-frame :offset 4504) + (gravity-normal vector :inline :offset 4512) + (last-gravity-normal vector :inline :offset 4528) + (last-trans-any-surf vector :inline :offset 4544) + (unknown-float16 float :overlay-at (-> last-trans-any-surf y)) + (ground-contact-normal vector :inline :offset 4560) + (last-trans-on-ground vector :inline :offset 4576) + (ground-contact-sphere-center vector :inline :offset 4592) + (transv-on-last-impact vector :inline :offset 4608) + (list-time-on-ground time-frame :offset 4624) + (ground-local-norm-dot-grav float :offset 4632) + (local-slope-z float :offset 4636) + (local-slope-x float :offset 4640) + (surface-slope-z float :offset 4644) + (surface-slope-x float :offset 4648) + (last-time-on-surface time-frame :offset 4656) + (normal-impact-vel float :offset 4664) + (last-time-touching-actor time-frame :offset 4672) + (wall-contact-pat pat-surface :offset 4680) + (wall-contact-pt vector :inline :offset 4688) + (wall-contact-poly-normal vector :inline :offset 4704) + (wall-contact-normal vector :inline :offset 4720) + (actor-contact-pt vector :inline :offset 4736) + (actor-contact-normal vector :inline :offset 4752) + (actor-contact-handle handle :offset 4768) + (gspot-pat-surfce pat-surface :offset 4776) + (gspot-slope-z float :offset 4780) + (gspot-slope-x float :offset 4784) + (ctrl-slope-heading float :offset 4788) + (ctrl-slope-z float :offset 4792) + (ctrl-slope-x float :offset 4796) + (unknown-word000 int32 :offset 4800) + (unknown-float002 float :offset 4804) + (unknown-float-n12iuh3n1 float :offset 4808) + (unknown-float-ki1jhbn23hj float :offset 4812) + (time-of-last-lc time-frame :offset 4816) + (low-coverage-pat-next1 pat-surface :offset 4828) + (low-coverage-dist-to-next2 float :offset 4832) + (low-coverage-pat-next2 pat-surface :offset 4836) + (low-coverage-slope-to-next1 float :offset 4824) + (low-coverage-norm-of-next1 vector :inline :offset 4848) + (low-coverage-norm-of-next2 vector :inline :offset 4864) + (low-coverage-overhang-plane-normal vector :inline :offset 4912) + (low-coverage-tangent vector :inline :offset 4928) + (low-coverage-tangent-xz vector :inline :offset 4944) + (btransv vector :inline :offset 4976) + (blocked-factor float :offset 4992) + (blocked-in-air-factor float :offset 4996) + (time-of-last-clear-wall-in-jump time-frame :offset 5000) + (time-of-last-lc-touch-edge time-frame :offset 5008) + (collision-spheres collide-shape-prim-sphere 10 :offset 5016) + (unknown-word02 int32 :offset 5064) + (last-roll-end-time time-frame :offset 5072) + (last-running-attack-end-time time-frame :offset 5080) + (last-hands-attempt-time time-frame :offset 5088) + (last-attack-end-time time-frame :offset 5096) + (last-feet-attempt-time time-frame :offset 5104) + (unknown-time-frame13 time-frame :offset 5112) + (last-time-of-stuck time-frame :offset 5120) + (bend-amount float :offset 5132) + (bend-target float :offset 5136) + (bend-speed float :offset 5140) + (ctrl-to-head-offset vector :inline :offset 5152) + (lhand-cspace cspace :offset 5168) + (rhand-cspace cspace :offset 5172) + (midpoint-of-hands vector :inline :offset 5184) + (ctrl-to-hands-offset vector :inline :offset 5200) + (sidekick-root cspace :inline :offset 5216) + (collide-mode symbol :offset 5248) + (collide-mode-transition float :offset 5252) + (duck-gun-tube-transision float :offset 5256) + (transv-history vector 15 :inline :offset 5264) + (average-xz-vel float :offset 5520) + (idx-of-fastest-xz-vel int32 :offset 5524) + (hand-to-edge-dist float :offset 5528) + (unknown-symbol000 symbol :offset 5532) + (edge-grab-edge-dir vector :inline :offset 5536) + (unknown-vector35 vector :inline :offset 5552) + (edge-grab-across-edge-dir vector :inline :offset 5568) + (last-successful-compute-edge-time time-frame :offset 5584) + (edge-grab-start-time time-frame :offset 5592) + (unknown-handle000 handle :offset 5600) + (anim-handle handle :offset 5608) + (unknown-word04 uint32 :offset 5616) + (unknown-spool-anim00 spool-anim :overlay-at unknown-word04) + (unknown-word05 int32 :overlay-at unknown-spool-anim00) + (unknown-symbol01 symbol :overlay-at unknown-word05) + (unknown-float34 float :overlay-at unknown-symbol01) + (did-move-to-pole-or-max-jump-height float :offset 5620) + (unknown-symbol03 float :offset 5624) + (unknown-float35 float :offset 5628) + (unknown-float36 float :offset 5632) + (unknown-float37 float :offset 5636) + (unknown-vector37 vector :inline :offset 5648) + (unknown-vector38 vector :inline :offset 5664) + (unknown-vector39 vector :inline :offset 5680) + (unknown-vector40 vector :inline :offset 5696) + (sliding-start-time time-frame :offset 5712) + (unknown-time-frame18 time-frame :offset 5720) + (unknown-sound-id00 sound-id :offset 5776) + (lightjak-sound-id sound-id :offset 5780) + (unknown-handle02 handle :offset 5792) + (impact-ctrl impact-control :inline :offset 5824) + (unknown-word06 int32 :offset 5832) + (unknown-vector41 vector :inline :offset 5888) + (last-trans-leaving-surf vector :inline :offset 5904) + (unknown-float38 float :overlay-at (-> last-trans-leaving-surf y)) + (highest-jump-mark vector :inline :offset 5920) + (unknown-float39 float :overlay-at (-> highest-jump-mark y)) + (unknown-time-frame19 time-frame :offset 5936) + (time-of-last-debug-float time-frame :offset 5944) + (danger-mode symbol :offset 5984) + (target-attack-id uint32 :offset 5988) + (attacked-by-id int32 :offset 5992) + (bomb-scale float :offset 5996) + (attack-count uint64 :offset 6000) + (send-attack-dest handle :offset 6008) + (send-attack-time time-frame :offset 6016) + (unknown-combo-tracker00 combo-tracker :inline :offset 6032) + (unknown-time-frame21 time-frame :offset 6072) + (unknown-dword07 int64 :offset 6096) + (unknown-dword08 int64 :offset 6104) + (unknown-dword09 int64 :offset 6112) + (unknown-dword10 int64 :offset 6120) + (jump-kind symbol :offset 6144) + (unknown-quaternion04 quaternion :inline :offset 6160) + (unknown-sound-id01 sound-id :offset 6176) + (unknown-float41 float :offset 6180) + (unknown-float42 float :offset 6184) + (history-idx uint16 :offset 6188) + (history-length uint16 :offset 6190) + (remaining-ctrl-iterations int32 :offset 6192) + (invul1-on-time time-frame :offset 6200) + (invul1-off-time time-frame :offset 6208) + (invul2-on-time time-frame :offset 6216) + (invul2-off-time time-frame :offset 6224) + (unknown-float43 float :offset 6232) + (unknown-float001 float :offset 6236) + (board-jump-and-swim-sound sound-id :offset 6240) + (bubbles-sound sound-id :offset 6244) + (unknown-time-frame26 time-frame :offset 6248) + (unknown-time-frame27 time-frame :offset 6256) + (yellow-eco-last-use-time int64 :offset 6264) + (align-xz-vel vector :inline :offset 6272) + (zx-vel-frac float :offset 6288) + (unknown-sound-id04 sound-id :offset 6292) + (unknown-float45 float :offset 6296) + (default-collide-as-all collide-spec :offset 6300) + (default-collide-as-fgnd collide-spec :offset 6304) + (default-collide-with-all collide-spec :offset 6308) + (default-collide-with-fgnd collide-spec :offset 6312) + (time-of-last-zero-input time-frame :offset 6320) + (time-of-last-nonzero-input time-frame :offset 6328) + (time-between-zero-inputs time-frame :offset 6336) + (time-of-last-debug-heal time-frame :offset 6368) + (last-nonzero-input-dir-targ quaternion :inline :offset 6384) + (time-of-last-wall-hide-first-check-pass time-frame :offset 6400) + (time-of-first-wall-hide-first-check-pass time-frame :offset 6408) + (pad uint8 4) + ) + :size-assert #x1914 :flag-assert #x4400001914 ) @@ -20961,8 +21272,8 @@ (get-head (_type_) touching-prims-entry) ;; 9 (get-next (_type_ touching-shapes-entry) touching-prims-entry) ;; 10 (touching-shapes-entry-method-11 () none) ;; 11 ;; (get-touched-shape (_type_ collide-shape) collide-shape) - (touching-shapes-entry-method-12 () none) ;; 12 ;; (prims-touching? (_type_ collide-shape uint) touching-prims-entry) - (touching-shapes-entry-method-13 () none) ;; 13 ;; (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic) + (prims-touching? (_type_ collide-shape uint) touching-prims-entry) ;; 12 + (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic) ;; 13 (touching-shapes-entry-method-14 () none) ;; 14 ;; (free-touching-prims-list (_type_) none) ) ) @@ -21030,7 +21341,7 @@ :size-assert #x1e4 :flag-assert #xb000001e4 (:methods - (edge-grab-info-method-9 () none) ;; 9 ;; (edge-grab-info-method-9 (_type_) symbol) + (edge-grab-info-method-9 (_type_) symbol) ;; 9 (edge-grab-info-method-10 () none) ;; 10 ;; (debug-draw (_type_) none) ) ) @@ -21190,6 +21501,32 @@ ;; process-focusable ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +++process-focusable:search-info-flag +(defenum search-info-flag + :type uint32 + :bitfield #t + (abort 0) + (crate 1) + (guard 2) + (attackable 3) + (enemy 4) + (attackable-priority 5) + (high-priority 6) + (on-screen 7) + (prefer-dist 8) + (prefer-angle 9) + (prefer-xz 10) + (cull-angle 11) + (cull-angle-simple 12) + (cull-xz 13) + (back-point 14) + (combo 15) + (probe 16) + (probe-camera 17) + (prefer-center 18) + ) +;; ---process-focusable:search-info-flag + ;; +++process-focusable:focus-status (defenum focus-status :type uint64 @@ -21211,7 +21548,7 @@ (pilot-riding 14) (flut 15) (tube 16) - (ice 17) + (light 17) (board 18) (gun 19) (pilot 20) ;; also racer? @@ -21225,7 +21562,10 @@ (indax 28) (arrestable 29) (teleporting 30) - (fs31 31) + (invulnerable 31) + (turret 32) + (no-gravity 33) + (gun-no-target 34) ) ;; ---process-focusable:focus-status @@ -21237,9 +21577,9 @@ :size-assert #xd0 :flag-assert #x1c005000d0 (:methods - (process-focusable-method-20 (_type_) int) ;; 20 + (process-mask->search-info-flag (_type_) search-info-flag) ;; 20 (get-trans "Get the `trans` for this process." (_type_ int) vector) ;; 21 - (get-quat "Get the quaternion for this process." (_type_) quaternion) ;; 22 + (get-quat "Get the quaternion for this process." (_type_ int) quaternion) ;; 22 (get-transv "Get the `transv` for this process." (_type_) vector) ;; 23 (time-to-apex-or-ground (_type_ int) int) ;; 24 (get-water-height (_type_) meters) ;; 25 @@ -21325,6 +21665,22 @@ (defenum effect-control-flag :type uint32 :bitfield #t + (ecf0 0) + (ecf1 1) + (ecf2 2) + (ecf3 3) + (ecf4 4) + (ecf5 5) + (ecf6 6) + (ecf7 7) + (ecf8 8) + (ecf9 9) + (ecf10 10) + (ecf11 11) + (ecf12 12) + (ecf13 13) + (ecf14 14) + (ecf15 15) ) ;; ---effect-control-h:effect-control-flag @@ -21344,10 +21700,10 @@ :flag-assert #xf00000024 (:methods (new (symbol type process-drawable) _type_) ;; 0 - (effect-control-method-9 () none) ;; 9 - (effect-control-method-10 () none) ;; 10 ;; (do-effect (_type_ symbol float int) none) + (effect-control-method-9 (_type_) none) ;; 9 + (do-effect (_type_ symbol float int) none) ;; 10 (effect-control-method-11 () none) ;; 11 ;; (do-effect-for-surface (_type_ symbol float int basic pat-surface) none) - (effect-control-method-12 () none) ;; 12 ;; (play-effect-sound (_type_ symbol float int basic sound-name) int) + (play-effect-sound (_type_ symbol float int basic sound-name) int) ;; 12 (set-channel-offset! (_type_ int) none) ;; 13 (effect-control-method-14 () none) ;; 14 ;; (play-effects-from-res-lump (_type_ float float float) none) ) @@ -21662,6 +22018,10 @@ ;; ragdoll-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(declare-type ragdoll basic) +(declare-type ragdoll-joint structure) +(declare-type ragdoll-proc process) + (deftype ragdoll-edit-info (structure) ((editing symbol :offset-assert 0) (current-func uint64 :offset-assert 8) @@ -21673,24 +22033,24 @@ (skel-visible uint64 :offset-assert 48) (current-joint int8 :offset-assert 56) (auto-setup-now basic :offset-assert 60) - (child-stack object 60 :offset-assert 64) + (child-stack ragdoll-joint 60 :offset-assert 64) (child-stack-num int8 :offset-assert 304) - (last-frame uint64 :offset-assert 312) - (last-frame-dur uint64 :offset-assert 320) + (last-frame time-frame :offset-assert 312) + (last-frame-dur time-frame :offset-assert 320) ) :method-count-assert 18 :size-assert #x148 :flag-assert #x1200000148 (:methods - (ragdoll-edit-info-method-9 () none) ;; 9 - (ragdoll-edit-info-method-10 () none) ;; 10 - (ragdoll-edit-info-method-11 () none) ;; 11 - (ragdoll-edit-info-method-12 () none) ;; 12 - (ragdoll-edit-info-method-13 () none) ;; 13 - (ragdoll-edit-info-method-14 () none) ;; 14 - (ragdoll-edit-info-method-15 () none) ;; 15 - (ragdoll-edit-info-method-16 () none) ;; 16 - (ragdoll-edit-info-method-17 () none) ;; 17 + (has-joint? (_type_ ragdoll-joint) symbol) ;; 9 + (ragdoll-edit-info-method-10 (_type_ object ragdoll-joint) symbol) ;; 10 + (fill-child-stack! "Fill the `child-stack` with the joints of the given ragdoll." (_type_ ragdoll) none) ;; 11 + (ragdoll-edit-info-method-12 (_type_) none) ;; 12 + (cycle-joints! "Cycle through joints based on controller input." (_type_ ragdoll) none) ;; 13 + (ragdoll-edit-info-method-14 (_type_ matrix vector (inline-array ragdoll-joint) ragdoll process-drawable) vector) ;; 14 + (ragdoll-edit-info-method-15 (_type_) none) ;; 15 + (ragdoll-edit-info-method-16 (_type_ ragdoll process-drawable) none) ;; 16 + (ragdoll-edit-info-method-17 (_type_ ragdoll process-drawable) none) ;; 17 ) ) @@ -21703,7 +22063,7 @@ (axial-slop float :offset-assert 48) (max-angle float :offset-assert 52) (coll-rad float :offset-assert 56) - (hit-sound uint128 :offset-assert 64) + (hit-sound sound-name :offset-assert 64) ) :method-count-assert 9 :size-assert #x50 @@ -21714,13 +22074,36 @@ ((orient-tform vector :inline :offset-assert 0) (scale vector :inline :offset-assert 16) (bg-collide-with collide-spec :offset-assert 32) - (joint-setup basic :offset-assert 36) + (joint-setup (array ragdoll-joint-setup) :offset-assert 36) ) :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 ) +;; +++ragdoll-h:ragdoll-joint-flag +(defenum ragdoll-joint-flag + :type uint32 + :bitfield #t + (rjf0 0) + (rjf1 1) + (rjf2 2) + (rjf3 3) + (rjf4 4) + (rjf5 5) + (rjf6 6) + (rjf7 7) + (rjf8 8) + (rjf9 9) + (rjf10 10) + (rjf11 11) + (rjf12 12) + (rjf13 13) + (rjf14 14) + (rjf15 15) + ) +;; ---ragdoll-h:ragdoll-joint-flag + (deftype ragdoll-joint (structure) ((quat quaternion :inline :offset-assert 0) (position vector :inline :offset-assert 16) @@ -21730,17 +22113,17 @@ (pre-tform vector :inline :offset-assert 80) (geo-tform vector :inline :offset-assert 96) (axial-slop float :offset-assert 112) - (max-angle float :offset-assert 116) + (max-angle degrees :offset-assert 116) (joint-length float :offset-assert 120) (coll-rad float :offset-assert 124) - (ragdoll-joint-flags uint32 :offset-assert 128) + (ragdoll-joint-flags ragdoll-joint-flag :offset-assert 128) (joint-type uint64 :offset-assert 136) (joint-index int8 :offset-assert 144) (parent-joint int8 :offset-assert 145) (parent-index int8 :offset-assert 146) (num-children int8 :offset-assert 147) (old-param0 basic :offset-assert 148) - (hit-sound uint128 :offset-assert 160) + (hit-sound sound-name :offset-assert 160) (ground-pat uint32 :offset-assert 176) (user0 int32 :offset-assert 180) (original-speed float :offset-assert 184) @@ -21750,8 +22133,31 @@ :flag-assert #x9000000bc ) +;; +++ragdoll-h:ragdoll-flag +(defenum ragdoll-flag + :type uint32 + :bitfield #t + (rf0 0) + (rf1 1) + (rf2 2) + (rf3 3) + (rf4 4) + (rf5 5) + (rf6 6) + (rf7 7) + (rf8 8) + (rf9 9) + (rf10 10) + (rf11 11) + (rf12 12) + (rf13 13) + (rf14 14) + (rf15 15) + ) +;; ---ragdoll-h:ragdoll-flag + (deftype ragdoll (basic) - ((ragdoll-joints ragdoll-joint 60 :inline :offset-assert 16) + ((ragdoll-joints ragdoll-joint 60 :inline :offset-assert 16) (num-joints uint8 :offset-assert 11536) (mirror matrix :inline :offset-assert 11552) (gravity vector :inline :offset-assert 11616) @@ -21764,17 +22170,17 @@ (compress-vel-parallel float :offset-assert 11692) (momentum float :offset-assert 11696) (maximum-stretch float :offset-assert 11700) - (turn-off-start uint64 :offset-assert 11704) - (turn-off-duration uint64 :offset-assert 11712) - (copy-velocity-start uint64 :offset-assert 11720) + (turn-off-start time-frame :offset-assert 11704) + (turn-off-duration time-frame :offset-assert 11712) + (copy-velocity-start time-frame :offset-assert 11720) (root-offset vector :inline :offset-assert 11728) (rotate-vel quaternion :inline :offset-assert 11744) (rotate-adj quaternion :inline :offset-assert 11760) (rotate-adj-count int8 :offset-assert 11776) - (ragdoll-flags uint32 :offset-assert 11780) + (ragdoll-flags ragdoll-flag :offset-assert 11780) (flex-blend float :offset-assert 11784) (stable-joints int8 :offset-assert 11788) - (ragdoll-joint-remap uint8 100 :offset-assert 11789) + (ragdoll-joint-remap uint8 100 :offset-assert 11789) (allow-destabilize uint64 :offset-assert 11896) (bg-collide-with uint32 :offset-assert 11904) (water-info water-info :inline :offset-assert 11920) @@ -21783,45 +22189,49 @@ :size-assert #x2ecc :flag-assert #x1a00002ecc (:methods - (ragdoll-method-9 () none) ;; 9 - (ragdoll-method-10 () none) ;; 10 - (ragdoll-method-11 () none) ;; 11 - (ragdoll-method-12 () none) ;; 12 - (ragdoll-method-13 () none) ;; 13 - (ragdoll-method-14 () none) ;; 14 - (ragdoll-method-15 () none) ;; 15 - (ragdoll-method-16 () none) ;; 16 - (ragdoll-method-17 () none) ;; 17 - (ragdoll-method-18 () none) ;; 18 - (ragdoll-method-19 () none) ;; 19 - (ragdoll-method-20 () none) ;; 20 - (ragdoll-method-21 () none) ;; 21 - (ragdoll-method-22 () none) ;; 22 - (ragdoll-method-23 () none) ;; 23 - (ragdoll-method-24 () none) ;; 24 - (ragdoll-method-25 () none) ;; 25 + (ragdoll-method-9 (_type_ matrix process-drawable) none) ;; 9 + (ragdoll-method-10 (_type_ process-drawable symbol vector symbol) none) ;; 10 + (turn-off-for-duration! (_type_ time-frame) none) ;; 11 + (get-parent-joint (_type_ (inline-array ragdoll-joint)) ragdoll-joint) ;; 12 + (ragdoll-method-13 (_type_ ragdoll-edit-info) none) ;; 13 + (ragdoll-method-14 (_type_) none) ;; 14 + (ragdoll-method-15 (_type_ process-drawable matrix) none) ;; 15 + (ragdoll-setup! "Set up this ragdoll with the given [[ragdoll-setup]]." (_type_ process-drawable ragdoll-setup) none) ;; 16 + (ragdoll-method-17 (_type_ process-drawable) none) ;; 17 + (ragdoll-method-18 (_type_) none) ;; 18 + (ragdoll-method-19 (_type_ vector int object vector) none) ;; 19 + (ragdoll-method-20 (_type_ vector) none) ;; 20 + (ragdoll-method-21 (_type_ vector vector float) vector) ;; 21 + (get-max-angle-for-joint-idx (_type_ int) degrees) ;; 22 + (ragdoll-method-23 (_type_ vector vector float symbol) none) ;; 23 + (ragdoll-method-24 (_type_ vector int) none) ;; 24 + (ragdoll-method-25 (_type_ process-drawable) none) ;; 25 ) ) (deftype ragdoll-proc (process) - ((ragdoll ragdoll :offset-assert 128) + ((parent (pointer process-drawable) :override) + (ragdoll ragdoll :offset-assert 128) (last-attack-id uint32 :offset-assert 132) ) :method-count-assert 20 :size-assert #x88 :flag-assert #x1400100088 + (:state-methods + idle ;; 14 + ) (:methods - (ragdoll-proc-method-14 () none) ;; 14 - (ragdoll-proc-method-15 () none) ;; 15 - (ragdoll-proc-method-16 () none) ;; 16 - (ragdoll-proc-method-17 () none) ;; 17 - (ragdoll-proc-method-18 () none) ;; 18 - (ragdoll-proc-method-19 () none) ;; 19 + (ragdoll-proc-method-15 (_type_ symbol vector symbol) none) ;; 15 + (ragdoll-proc-method-16 (_type_ int) none) ;; 16 + (ragdoll-proc-method-17 (_type_ matrix) none) ;; 17 + (ragdoll-proc-method-18 (_type_ ragdoll-edit-info process) none) ;; 18 + (ragdoll-proc-method-19 (_type_) none) ;; 19 ) ) +(declare-type wings process-drawable) (deftype wings-ragdoll-proc (ragdoll-proc) - () + ((parent (pointer wings) :override)) :method-count-assert 20 :size-assert #x88 :flag-assert #x1400100088 @@ -21833,13 +22243,49 @@ ;; projectile-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +++projectile-h:projectile-options (defenum projectile-options :bitfield #t :type uint64 - ) + (po0 0) + (po1 1) + (po2 2) + (po3 3) + (po4 4) + (po5 5) + (po6 6) + (po7 7) + (po8 8) + (po9 9) + (po10 10) + (po11 11) + (po12 12) + (po13 13) + (po14 14) + (po15 15) + (po16 16) + (po17 17) + (po18 18) + (po19 19) + (po20 20) + (po21 21) + (po22 22) + (po23 23) + (po24 24) + (po25 25) + (po26 26) + (po27 27) + (po28 28) + (po29 29) + (po30 30) + (po31 31) + ) +;; ---projectile-h:projectile-options (deftype projectile (process-drawable) - ((starting-pos vector :inline :offset-assert 208) + ((parent (pointer process-drawable) :override) + (root collide-shape-moving :override) + (starting-pos vector :inline :offset-assert 208) (starting-dir vector :inline :offset-assert 224) (target-pos vector :inline :offset-assert 240) (base-target-pos vector :inline :offset-assert 256) @@ -21875,28 +22321,30 @@ :method-count-assert 41 :size-assert #x200 :flag-assert #x2901800200 + (:state-methods + die ;; 20 + dissipate ;; 21 + impact ;; 22 + moving ;; 23 + ) (:methods - (projectile-method-20 () none) ;; 20 ;; (die () _type_ :state) - (projectile-method-21 () none) ;; 21 ;; (dissipate () _type_ :state) - (projectile-method-22 () none) ;; 22 ;; (impact () _type_ :state) - (projectile-method-23 () none) ;; 23 ;; (moving () _type_ :state) - (projectile-method-24 () none) ;; 24 ;; (draw-laser-sight (_type_) none) - (projectile-method-25 () none) ;; 25 ;; (spawn-impact-particles (_type_) none) - (projectile-method-26 () none) ;; 26 ;; (spawn-shell-particles (_type_) none) - (projectile-method-27 () none) ;; 27 ;; (unknown-particles (_type_) none) - (projectile-method-28 () none) ;; 28 ;; (play-impact-sound (_type_ projectile-options) none) - (projectile-method-29 () none) ;; 29 ;; (stop-sound! (_type_) none) - (projectile-method-30 () none) ;; 30 ;; (init-proj-collision! (_type_) none) - (projectile-method-31 () none) ;; 31 ;; (init-proj-settings! (_type_) none) - (projectile-method-32 () none) ;; 32 ;; (go-moving! (_type_) none) - (projectile-method-33 () none) ;; 33 ;; (go-sitting! (_type_) none) - (projectile-method-34 () none) ;; 34 ;; (kill-projectile! (_type_) symbol) - (projectile-method-35 () none) ;; 35 ;; (event-handler! (_type_ process int symbol event-message-block) object) - (projectile-method-36 () none) ;; 36 ;; (handle-proj-hit! (_type_ process event-message-block) object) - (projectile-method-37 () none) ;; 37 ;; (deal-damage! (_type_ process event-message-block) symbol) - (projectile-method-38 () none) ;; 38 ;; (made-impact? (_type_) symbol) - (projectile-method-39 () none) ;; 39 ;; (play-impact-sound! (_type_) none) - (projectile-method-40 () none) ;; 40 + (projectile-method-24 (_type_) none) ;; 24 ;; (draw-laser-sight (_type_) none) + (projectile-method-25 (_type_) none) ;; 25 ;; (spawn-impact-particles (_type_) none) + (projectile-method-26 (_type_) none) ;; 26 ;; (spawn-shell-particles (_type_) none) + (projectile-method-27 (_type_) none) ;; 27 ;; (unknown-particles (_type_) none) + (play-impact-sound (_type_ projectile-options) none) ;; 28 + (projectile-method-29 (_type_) none) ;; 29 ;; (stop-sound! (_type_) none) + (setup-collision! (_type_) none) ;; 30 + (projectile-method-31 (_type_) none) ;; 31 ;; (init-proj-settings! (_type_) none) + (projectile-method-32 (_type_) none) ;; 32 ;; (go-moving! (_type_) none) + (go-impact! (_type_) none) ;; 33 ;; (go-sitting! (_type_) none) + (projectile-method-34 (_type_) none) ;; 34 ;; (kill-projectile! (_type_) symbol) + (event-handler! (_type_ process int symbol event-message-block) object) ;; 35 + (handle-proj-hit! (_type_ process event-message-block) object) ;; 36 + (deal-damage! (_type_ process event-message-block) symbol) ;; 37 + (made-impact? (_type_) symbol) ;; 38 + (projectile-method-39 (_type_) none) ;; 39 ;; (play-impact-sound! (_type_) none) + (projectile-method-40 (_type_) int) ;; 40 ) ) @@ -21930,10 +22378,12 @@ :method-count-assert 44 :size-assert #x224 :flag-assert #x2c01b00224 + (:state-methods + sitting ;; 41 + ) (:methods - (projectile-bounce-method-41 () none) ;; 41 ;; (noop (_type_) none) - (projectile-bounce-method-42 () none) ;; 42 - (projectile-bounce-method-43 () none) ;; 43 + (projectile-bounce-method-42 (_type_) none) ;; 42 + (projectile-bounce-method-43 (_type_) none) ;; 43 ) ) @@ -21955,7 +22405,7 @@ (tf0 0) (tf1 1) (tf2 2) - (tf3 3) + (tinvuln1 3) (tf4 4) (tf5 5) (tf6 6) @@ -21971,22 +22421,84 @@ (tf16 16) (prevent-board 17) (prevent-gun 18) - (tf19 19) - (tf20 20) - (tf21 21) - (tf22 22) + (lleg-still 19) + (rleg-still 20) + (lleg-no-ik 21) + (rleg-no-ik 22) (prevent-double-jump 23) - (tf24 24) - (tf25 25) + (disable-attacks 24) + (tinvuln2 25) (tf26 26) (tf27 27) - (tf28 28) + (invisible 28) (tf29 29) (tf30 30) (tf31 31) ) ;; ---target-h:target-flags +;; +++target-h:darkjak-stage +(defenum darkjak-stage + :bitfield #t + :type uint32 + (force-on) + (active) + (bomb0) + (bomb1) + (invinc) + (giant) + (no-anim) + (disable-force-on) + (ds8 8) + (ds9 9) + ) +;; ---target-h:darkjak-stage + +;; +++target-h:lightjak-stage +(defenum lightjak-stage + :bitfield #t + :type uint32 + (ls0 0) + (ls1 1) + (ls2 2) + (regen 3) + (swoop 4) + (freeze 5) + (ls6 6) + (ls7 7) + (ls8 8) + (ls9 9) + (ls10 10) + (ls11 11) + (ls12 12) + (ls13 13) + (ls14 14) + (ls15 15) + ) +;; ---target-h:lightjak-stage + +;; +++target-h:target-geo +(defenum target-geo + :type int32 + (uninitialized -2) + (none -1) + (jakb 4) ;; jak 2 model + (jakb-old 5) ;; weird broken jak 2 model + (jakc 6) ;; jak 3 model + ) +;; ---target-h:target-geo + +;; +++target-h:target-anim +(defenum target-anim + :type int32 + (uninitialized -2) + (default 0) + (board 1) + (dark 2) + (light 3) + ) +;; ---target-h:target-anim + (declare-type sidekick process-drawable) (declare-type racer-info basic) (declare-type tube-info basic) @@ -22000,9 +22512,11 @@ (declare-type ladder-info basic) (declare-type darkjak-info basic) (declare-type lightjak-info basic) +(declare-type rigid-body-impact structure) (deftype target (process-focusable) ((control control-info :offset 128 :score 1) ;; guessed by decompiler + (fact fact-info-target :override) (skel2 joint-control :offset-assert 208) ;; guessed by decompiler (shadow-backup shadow-geo :offset-assert 212) ;; guessed by decompiler (target-flags target-flags :offset 188 :score 1) @@ -22015,7 +22529,7 @@ (arm-ik joint-mod-ik 2 :offset-assert 244) ;; guessed by decompiler (leg-ik joint-mod-ik 2 :offset-assert 252) ;; guessed by decompiler (foot joint-mod 2 :offset-assert 260) ;; guessed by decompiler - (cloth basic :offset-assert 268) + (cloth symbol :offset-assert 268) (init-time time-frame :offset-assert 272) ;; time-frame (teleport-time time-frame :offset-assert 280) ;; time-frame (state-hook-time time-frame :offset-assert 288) ;; time-frame @@ -22048,18 +22562,18 @@ (notify handle :offset-assert 2288) ;; handle (death-resetter resetter-spec :inline :offset-assert 2296) (mode-cache basic :offset-assert 2312) - (mode-param1 uint64 :offset-assert 2320) ;; handle + (mode-param1 handle :offset-assert 2320) ;; handle (mode-param2 uint64 :offset-assert 2328) (mode-param3 uint64 :offset-assert 2336) (major-mode-exit-hook basic :offset-assert 2344) (major-mode-event-hook basic :offset-assert 2348) (sub-mode-exit-hook basic :offset-assert 2352) - (ext-geo-control basic :offset-assert 2356) - (pending-ext-geo int32 :offset-assert 2360) - (ext-geo int32 :offset-assert 2364) - (ext-anim-control basic :offset-assert 2368) - (pending-ext-anim int32 :offset-assert 2372) - (ext-anim int32 :offset-assert 2376) + (ext-geo-control external-art-buffer :offset-assert 2356) + (pending-ext-geo target-geo :offset-assert 2360) + (ext-geo target-geo :offset-assert 2364) + (ext-anim-control external-art-buffer :offset-assert 2368) + (pending-ext-anim target-anim :offset-assert 2372) + (ext-anim target-anim :offset-assert 2376) (tobot-state state :offset-assert 2380) ;; guessed by decompiler (tobot? symbol :offset-assert 2384) ;; guessed by decompiler (tobot-recorder basic :offset-assert 2388) @@ -22100,186 +22614,225 @@ :flag-assert #x1e09800a00 ;; field mode-param2 uses ~A with a 64-bit load. field mode-param3 uses ~A with a 64-bit load. (:methods - (target-method-28 () none) ;; 28 ;; (init-target (_type_ continue-point symbol) none) - (target-method-29 () none) ;; 29 + (target-method-28 (_type_ collide-cache collide-edge-spec) none) ;; 28 + (target-init! (_type_ continue-point symbol) none) ;; 29 ) (:states - target-pole-flip-forward ;; associated process guessed by decompiler, old: (state float float float target) - target-play-anim ;; associated process guessed by decompiler, old: (state string handle target) - target-pole-flip-up-jump ;; associated process guessed by decompiler, old: (state float float target) - target-hit-ground-hard ;; associated process guessed by decompiler, old: (state float target) - target-clone-anim ;; associated process guessed by decompiler, old: (state handle target) - target-pole-cycle ;; associated process guessed by decompiler, old: (state handle target) - target-hide ;; associated process guessed by decompiler, old: (state target) - target-look-around ;; associated process guessed by decompiler, old: (state target) - target-stance-look-around ;; associated process guessed by decompiler, old: (state target) - target-pole-flip-up ;; associated process guessed by decompiler, old: (state object object float target) - target-stance-ambient ;; associated process guessed by decompiler, old: (state target) - target-blast-recover - target-load-wait ;; associated process guessed by decompiler, old: (state target) - target-edge-grab-off ;; associated process guessed by decompiler, old: (state target) - target-eco-powerup - target-launch ;; associated process guessed by decompiler, old: (state float symbol vector int target) - target-float ;; associated process guessed by decompiler, old: (state target) - target-gun-stance ;; associated process guessed by decompiler, old: (state target) - target-gun-walk ;; associated process guessed by decompiler, old: (state target) + ;; leftovers/undefined + target-ice-stance ;; jak 1 + target-ice-walk ;; jak 1 + target-yellow-jump-blast ;; jak 1 + target-carry-pickup ;; not defined + target-demo ;; not defined + ;; special states + target-startup + target-title ;; associated process guessed by decompiler, old: (state symbol target) + (target-credits int) + target-load-wait + target-hide + target-float + (target-grab symbol) + (target-play-anim string handle) ;; associated process guessed by decompiler, old: (state string handle target) + (target-clone-anim handle) ;; associated process guessed by decompiler, old: (state handle target) + (target-continue continue-point) ;; associated process guessed by decompiler, old: (state continue-point target) + (target-blast-recover rigid-body-impact) + (target-warp-in vector vector) ;; associated process guessed by decompiler, old: (state vector vector target target) + target-warp-out ;; associated process guessed by decompiler, old: (state vector vector target target) + target-launch-dir + (target-death symbol) ;; associated process guessed by decompiler, old: (state symbol target) + ;; general states + target-stance + target-stance-ambient + target-stance-look-around + target-look-around + target-walk + target-attack + target-running-attack + (target-attack-air symbol) + (target-attack-uppercut float float) ;; associated process guessed by decompiler, old: (state float float target) + (target-attack-uppercut-jump float float) ;; associated process guessed by decompiler, old: (state float float target) + target-roll + (target-roll-flip float float) + target-turn-around + (target-jump float float surface) + (target-jump-forward float float) + (target-high-jump float float object) + (target-double-jump float float) + (target-falling symbol) + target-slide-down + (target-flop float float float object) + (target-hit-ground symbol) + (target-flop-hit-ground symbol) + (target-hit-ground-hard float) + (target-duck-stance symbol) + (target-duck-walk symbol) + (target-duck-high-jump float float symbol) + (target-duck-high-jump-jump float float symbol) + (target-hit symbol attack-info) ;; associated process guessed by decompiler, old: (state symbol attack-info target) + target-slide-down-to-ground + ;; gun + target-gun-stance + target-gun-walk + ;; darkjak/lightjak + target-powerjak-get-on + ;; darkjak + (target-darkjak-get-on darkjak-stage) + target-darkjak-get-off + target-darkjak-running-attack target-darkjak-smack-charge - target-darkjak-get-on ;; associated process guessed by decompiler, old: (state darkjak-stage target) - target-darkjak-get-off ;; associated process guessed by decompiler, old: (state target) + target-darkjak-smack target-darkjak-bomb1 ;; associated process guessed by decompiler, old: (state float float target) - target-darkjak-bomb0 ;; associated process guessed by decompiler, old: (state target) - target-board-clone-anim ;; associated process guessed by decompiler, old: (state handle target) - target-edge-grab-jump ;; associated process guessed by decompiler, old: (state float float target) - target-board-get-off ;; associated process guessed by decompiler, old: (state object symbol target) + target-darkjak-bomb0 + (target-invisible-get-on handle time-frame) + ;; lightjak + (target-eco-powerup int float) + (target-lightjak-get-on lightjak-stage) + target-lightjak-get-off + (target-lightjak-regen int) + target-lightjak-freeze + target-lightjak-shield + (target-lightjak-swoop float) + (target-lightjak-swoop-again float) + (target-lightjak-swoop-falling symbol) + ;; board + (target-board-start handle) + target-board-get-on + (target-board-get-off handle symbol) + target-board-stance + (target-board-turn-to vector time-frame) target-board-turn-around - target-board-grab ;; associated process guessed by decompiler, old: (state symbol target) - target-board-get-on ;; associated process guessed by decompiler, old: (state target) - target-board-trickx ;; associated process guessed by decompiler, old: (state float float symbol target) - target-board-tricky - target-board-wall-kick ;; associated process guessed by decompiler, old: (state vector float target) - target-invisible-get-on - target-grab-ride - target-mech-grab ;; associated process guessed by decompiler, old: (state target) + (target-board-jump meters meters symbol) + target-board-jump-kick + (target-board-wall-kick vector float) + (target-board-hold float float symbol) + (target-board-ride-edge symbol) + (target-board-flip float float symbol) + target-board-duck-stance + (target-board-hit symbol attack-info) + target-board-hit-ground + target-board-falling + (target-board-grab symbol) + (target-board-trickx float float symbol) + (target-board-tricky float float symbol) + target-board-halfpipe + (target-board-grenade handle) + (target-board-clone-anim handle) + ;; flut + (target-flut-start handle symbol int) + target-flut-get-on + target-flut-get-off + target-flut-get-off-jump + target-flut-eject + target-flut-grab target-flut-stance - target-mech-get-up + target-flut-walk + target-flut-jump + target-flut-double-jump + target-flut-running-attack + target-flut-air-attack target-flut-air-attack-hit-ground - target-flut-get-off-jump - target-darkjak-smack - target-board-grenade ;; associated process guessed by decompiler, old: (state handle target) - target-board-hit-ground ;; associated process guessed by decompiler, old: (state target) - target-mech-carry-drop ;; associated process guessed by decompiler, old: (state target) - target-mech-punch ;; associated process guessed by decompiler, old: (state target) - target-lightjak-shield - target-mech-shield - target-mech-walk ;; associated process guessed by decompiler, old: (state target) - target-mech-get-off ;; associated process guessed by decompiler, old: (state target) - target-lightjak-swoop-again - target-tube ;; associated process guessed by decompiler, old: (state target) - target-flop ;; associated process guessed by decompiler, old: (state float float float target) - target-board-hold ;; associated process guessed by decompiler, old: (state float float symbol target) - target-mech-start ;; associated process guessed by decompiler, old: (state handle float symbol target) + target-flut-hit + target-flut-hit-ground + target-flut-falling + target-flut-kanga-catch target-flut-death - target-duck-high-jump-jump ;; associated process guessed by decompiler, old: (state float float symbol target) - target-mech-hit ;; associated process guessed by decompiler, old: (state symbol attack-info target) - target-hit-ground ;; associated process guessed by decompiler, old: (state symbol target) - target-swim-jump ;; associated process guessed by decompiler, old: (state float float target) - target-running-attack ;; associated process guessed by decompiler, old: (state target) - target-mech-stance ;; associated process guessed by decompiler, old: (state target) - target-slide-down ;; associated process guessed by decompiler, old: (state target) + target-flut-clone-anim + ;; mech + (target-mech-start handle float symbol) target-mech-get-on ;; associated process guessed by decompiler, old: (state handle target) + target-mech-get-off + target-mech-get-up + target-mech-grab + target-mech-stance + target-mech-walk + target-mech-jump ;; associated process guessed by decompiler, old: (state float float surface target) + target-mech-punch + target-mech-shield + target-mech-hit ;; associated process guessed by decompiler, old: (state symbol attack-info target) target-mech-hit-ground ;; associated process guessed by decompiler, old: (state symbol target) + target-mech-falling ;; associated process guessed by decompiler, old: (state symbol target) + target-mech-carry-pickup + target-mech-carry-stance + target-mech-carry-walk + target-mech-carry-jump ;; associated process guessed by decompiler, old: (state float float symbol target) + target-mech-carry-drag + target-mech-carry-drop + target-mech-carry-throw + target-mech-carry-hit-ground ;; associated process guessed by decompiler, old: (state symbol target) + target-mech-carry-falling target-mech-death ;; associated process guessed by decompiler, old: (state symbol target) - target-stance ;; associated process guessed by decompiler, old: (state target) - target-mech-carry-pickup ;; associated process guessed by decompiler, old: (state target) - target-pilot-impact ;; associated process guessed by decompiler, old: (state target) - target-pilot-get-on ;; associated process guessed by decompiler, old: (state target) - target-jump ;; associated process guessed by decompiler, old: (state float float surface target) - target-flut-kanga-catch - target-board-start ;; associated process guessed by decompiler, old: (state object target) - target-walk ;; associated process guessed by decompiler, old: (state target) - target-indax-attack ;; associated process guessed by decompiler, old: (state target) - target-pilot-edge-grab ;; associated process guessed by decompiler, old: (state pilot-edge-grab-info target) - target-warp-out ;; associated process guessed by decompiler, old: (state vector vector target target) - target-pilot-stance ;; associated process guessed by decompiler, old: (state target) + target-mech-clone-anim ;; associated process guessed by decompiler, old: (state handle target) + ;; pilot + (target-racing-start handle) + (target-grab-ride handle) + (target-pilot-edge-grab pilot-edge-grab-info) ;; associated process guessed by decompiler, old: (state pilot-edge-grab-info target) + (target-pilot-start handle symbol symbol) + target-pilot-get-on + target-pilot-get-off + target-pilot-stance + target-pilot-grab + target-pilot-impact + target-pilot-hit ;; associated process guessed by decompiler, old: (state symbol attack-info target) target-pilot-death ;; associated process guessed by decompiler, old: (state symbol target) - target-darkjak-running-attack ;; associated process guessed by decompiler, old: (state target) - target-indax-walk ;; associated process guessed by decompiler, old: (state target) - target-duck-walk ;; associated process guessed by decompiler, old: (state symbol target) - target-flop-hit-ground ;; associated process guessed by decompiler, old: (state symbol target) - target-attack-air ;; associated process guessed by decompiler, old: (state symbol target) - target-credits - target-mech-carry-walk ;; associated process guessed by decompiler, old: (state target) - target-indax-hang - target-title ;; associated process guessed by decompiler, old: (state symbol target) - target-grab ;; associated process guessed by decompiler, old: (state symbol target) - target-flut-eject - target-indax-death ;; associated process guessed by decompiler, old: (state symbol target) - target-indax-jump ;; associated process guessed by decompiler, old: (state float float surface target) - target-indax-trip ;; associated process guessed by decompiler, old: (state target) - target-indax-grab - target-duck-high-jump ;; associated process guessed by decompiler, old: (state float float symbol target) - target-pilot-start ;; associated process guessed by decompiler, old: (state handle symbol symbol target) - target-mech-carry-drag ;; associated process guessed by decompiler, old: (state target) + target-pilot-clone-anim ;; associated process guessed by decompiler, old: (state handle target) + target-pilot-daxter-perch + ;; indax + (target-indax-start handle object) ;; associated process guessed by decompiler, old: (state handle target) target-indax-get-off - target-powerjak-get-on - target-mech-carry-jump ;; associated process guessed by decompiler, old: (state float float symbol target) - target-indax-attack-air ;; associated process guessed by decompiler, old: (state symbol target) - target-duck-stance ;; associated process guessed by decompiler, old: (state symbol target) - target-mech-carry-stance ;; associated process guessed by decompiler, old: (state target) - target-pilot-grab ;; associated process guessed by decompiler, old: (state target) + target-indax-stance + target-indax-walk + target-indax-attack + target-indax-running-attack + target-indax-jump ;; associated process guessed by decompiler, old: (state float float surface target) target-indax-double-jump ;; associated process guessed by decompiler, old: (state float float target) - target-hit ;; associated process guessed by decompiler, old: (state symbol attack-info target) - target-indax-start ;; associated process guessed by decompiler, old: (state handle target) - target-continue ;; associated process guessed by decompiler, old: (state continue-point target) - target-mech-falling ;; associated process guessed by decompiler, old: (state symbol target) - target-pilot-daxter-perch - target-flut-grab - target-jump-forward ;; associated process guessed by decompiler, old: (state float float target) - target-pilot-hit ;; associated process guessed by decompiler, old: (state symbol attack-info target) - target-flut-hit-ground - target-death ;; associated process guessed by decompiler, old: (state symbol target) - target-flut-running-attack + target-indax-attack-air ;; associated process guessed by decompiler, old: (state symbol target) + target-indax-hang target-indax-falling ;; associated process guessed by decompiler, old: (state symbol target) - target-slide-down-to-ground ;; associated process guessed by decompiler, old: (state target) - target-flut-get-off - target-flut-falling - target-mech-carry-hit-ground ;; associated process guessed by decompiler, old: (state symbol target) - target-flut-start ;; associated process guessed by decompiler, old: (state handle target) - target-mech-jump ;; associated process guessed by decompiler, old: (state float float surface target) - target-flut-hit - target-flut-jump target-indax-hit ;; associated process guessed by decompiler, old: (state symbol attack-info target) target-indax-hit-ground ;; associated process guessed by decompiler, old: (state symbol target) - target-flut-double-jump - target-launch-dir - target-ladder - target-board-ride-edge ;; associated process guessed by decompiler, old: (state symbol target) - target-lightjak-regen - target-pilot-clone-anim ;; associated process guessed by decompiler, old: (state handle target) - target-lightjak-freeze - target-lightjak-swoop-falling - target-lightjak-get-on - target-indax-running-attack ;; associated process guessed by decompiler, old: (state target) - target-flut-get-on - target-lightjak-swoop + target-indax-trip + target-indax-grab + target-indax-death ;; associated process guessed by decompiler, old: (state symbol target) + ;; swim + target-wade-walk + target-wade-stance + target-swim-stance target-swim - target-board-flip ;; associated process guessed by decompiler, old: (state float float symbol target) - target-wade-walk ;; associated process guessed by decompiler, old: (state target) - target-wade-stance ;; associated process guessed by decompiler, old: (state target) - target-pilot-get-off ;; associated process guessed by decompiler, old: (state target) - target-indax-stance ;; associated process guessed by decompiler, old: (state target) - target-flut-walk - target-warp-in ;; associated process guessed by decompiler, old: (state vector vector target target) - target-flut-clone-anim - target-roll-flip ;; associated process guessed by decompiler, old: (state float float target) - target-attack-uppercut-jump ;; associated process guessed by decompiler, old: (state float float target) - target-edge-grab ;; associated process guessed by decompiler, old: (state target) - target-attack-uppercut ;; associated process guessed by decompiler, old: (state float float target) - target-board-stance ;; associated process guessed by decompiler, old: (state target) - target-lightjak-get-off - target-turn-around ;; associated process guessed by decompiler, old: (state target) - target-high-jump ;; associated process guessed by decompiler, old: (state float float object target) - target-pole-flip-forward-jump ;; associated process guessed by decompiler, old: (state float float target) - target-mech-carry-throw ;; associated process guessed by decompiler, old: (state target) - target-double-jump ;; associated process guessed by decompiler, old: (state float float target) - target-board-jump-kick ;; associated process guessed by decompiler, old: (state target) - target-falling ;; associated process guessed by decompiler, old: (state symbol target) - target-mech-carry-falling ;; associated process guessed by decompiler, old: (state target) - target-roll ;; associated process guessed by decompiler, old: (state target) - target-mech-clone-anim ;; associated process guessed by decompiler, old: (state handle target) - target-attack ;; associated process guessed by decompiler, old: (state target) - target-board-jump ;; associated process guessed by decompiler, old: (state meters meters symbol target) - target-board-halfpipe ;; associated process guessed by decompiler, old: (state target) - target-board-duck-stance ;; associated process guessed by decompiler, old: (state target) - target-board-hit ;; associated process guessed by decompiler, old: (state vector attack-info target) - target-board-falling ;; associated process guessed by decompiler, old: (state target) - target-flut-air-attack - target-board-turn-to ;; associated process guessed by decompiler, old: (state vector time-frame target) + target-swim-walk + target-swim-down + target-swim-up + (target-swim-jump float float) + (target-swim-jump-jump float float surface) + ;; pole + (target-pole-cycle handle) + (target-pole-flip-up float float float) + (target-pole-flip-up-jump float float) + (target-pole-flip-forward float float float) + (target-pole-flip-forward-jump float float) + (target-launch float symbol vector int) + ;; turret + (target-turret-get-on handle) + target-turret-get-off + (target-turret-stance handle) + target-turret-stance-fire + ;; edge grab + target-edge-grab + (target-edge-grab-jump float float symbol) + target-edge-grab-off + ;; ladder + (target-ladder-start handle) + target-ladder + ;; tube + (target-tube-start handle) + target-tube + ;; tobot + tobot-stance ) ) (deftype sidekick (process-drawable) - ((control control-info :offset 128 :score 1) ;; guessed by decompiler + ((parent (pointer target) :override) + (control control-info :offset 128 :score 1) ;; guessed by decompiler (anim-seed uint64 :offset 208) (shadow-in-movie? symbol :offset-assert 216) ;; guessed by decompiler (special-anim-time time-frame :offset-assert 224) ;; time-frame @@ -22699,13 +23252,13 @@ :flag-assert #x1a00008670 (:methods (collide-cache-method-9 () none) ;; 9 ;; (debug-draw (_type_) none) - (collide-cache-method-10 () none) ;; 10 ;; (fill-and-probe-using-line-sphere (_type_ collide-query) float) - (collide-cache-method-11 () none) ;; 11 ;; (fill-and-probe-using-spheres (_type_ collide-query) symbol) + (fill-and-probe-using-line-sphere (_type_ collide-query) float) ;; 10 + (fill-and-probe-using-spheres (_type_ collide-query) symbol) ;; 11 (collide-cache-method-12 () none) ;; 12 ;; (fill-using-bounding-box (_type_ collide-query) none) - (collide-cache-method-13 () none) ;; 13 ;; (fill-using-line-sphere (_type_ collide-query) none) + (fill-using-line-sphere (_type_ collide-query) none) ;; 13 (collide-cache-method-14 () none) ;; 14 ;; (fill-using-spheres (_type_ collide-query) none) (collide-cache-method-15 () none) ;; 15 ;; (reset (_type_) none) - (collide-cache-method-16 () none) ;; 16 ;; (probe-using-line-sphere (_type_ collide-query) float) + (probe-using-line-sphere (_type_ collide-query) float) ;; 16 (collide-cache-method-17 () none) ;; 17 ;; (probe-using-spheres (_type_ collide-query) symbol) (collide-cache-method-18 () none) ;; 18 ;; (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none) (collide-cache-method-19 () none) ;; 19 ;; (fill-from-fg-boxes (_type_) none) @@ -22764,17 +23317,17 @@ (start-pos vector :inline :offset-assert 208) (move-dist vector :inline :offset-assert 224) (rlength vector :inline :offset-assert 240) - (exit-planes plane 2 :offset-assert 256) ;; guessed by decompiler + (exit-planes plane 2 :inline :offset-assert 256) ;; guessed by decompiler (radius float :offset 268) (inv-mat matrix :inline :offset 288) - (spheres (inline-array sphere) :offset 112) ;; guessed by decompiler + (spheres (inline-array sphere) :offset 112 :score 1) ;; guessed by decompiler (num-spheres uint32 :offset 116) (solid-only symbol :offset 120) ;; guessed by decompiler (best-dist float :offset 112) - (best-other-prim collide-shape-prim :offset 116) ;; guessed by decompiler - (best-my-prim collide-shape-prim :offset 120) ;; guessed by decompiler + (best-other-prim collide-shape-prim :offset 116 :score 1) ;; guessed by decompiler + (best-my-prim collide-shape-prim :offset 120 :score 1) ;; guessed by decompiler (move-vec vector :inline :offset 224) - (best-u float :offset 112) + (best-u float :offset 112 :score -1) (action-mask collide-action :offset 352) ;; guessed by decompiler (local-box4w bounding-box4w :inline :offset-assert 368) (search-box bounding-box4w :inline :offset-assert 400) @@ -24198,8 +24751,10 @@ "Scratchpad memory layout for regions." ((region-prim-list region-prim-list :inline :offset-assert 0) (pos vector :inline :offset-assert 1296) - (ray vector :inline :offset 1328) - (region-enter-count int32 :offset 1360) + (exit-pos vector :inline :offset-assert 1312) ;; added + (ray vector :inline :offset-assert 1328) + (exit-ray vector :inline :offset-assert 1344) ;; added + (region-enter-count int32 :offset-assert 1360) (region-enter-list region 320 :offset-assert 1364) ;; guessed by decompiler (region-enter-prim-list drawable-region-sphere 320 :offset-assert 2644) ;; guessed by decompiler (region-exit-count int32 :offset-assert 3924) @@ -24216,10 +24771,10 @@ :size-assert #x2d60 :flag-assert #xd00002d60 (:methods - (region-prim-area-method-9 () none) ;; 9 ;; (track-entered-region! (_type_ drawable-region-sphere) none) - (region-prim-area-method-10 () none) ;; 10 ;; (track-exited-region! (_type_ drawable-region-sphere) none) - (region-prim-area-method-11 () none) ;; 11 ;; (track-inside-region! (_type_ drawable-region-sphere) none) - (region-prim-area-method-12 () none) ;; 12 ;; (track-start-region! (_type_ drawable-region-sphere) none) + (track-entered-region! (_type_ drawable-region-sphere) int) ;; 9 + (track-exited-region! (_type_ drawable-region-sphere) int) ;; 10 + (track-inside-region! (_type_ drawable-region-sphere) int) ;; 11 + (track-start-region! (_type_ drawable-region-sphere) int) ;; 12 ) ) @@ -24280,6 +24835,7 @@ (bit-12 12) (bit-13 13) (bit-14 14) + (bit-15 15) ) ;; ---entity-h:entity-perm-status @@ -24435,7 +24991,7 @@ ) (deftype actor-group (inline-array-class) - ((data actor-reference :dynamic :offset-assert 16) ;; guessed by decompiler + ((data actor-reference :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 @@ -24920,6 +25476,36 @@ :method-count-assert 14 :size-assert #xac0 :flag-assert #xe0a400ac0 + (:states + cam-no-trans + cam-really-fixed + cam-fixed + cam-fixed-read-entity + cam-pov + cam-pov180 + cam-pov-track + cam-eye + cam-standoff + cam-standoff-read-entity + cam-tube-sled + cam-spline + cam-decel + cam-endlessfall + cam-circular + cam-lookat + cam-string + cam-stick + cam-bike + cam-point-watch + cam-free-floating + cam-launcher-shortfall + cam-launcher-longfall + cam-remote + cam-turret + cam-scorpion-gun + cam-bt-gun + cam-power-game + ) ) (deftype camera-master (process) @@ -24968,8 +25554,8 @@ :size-assert #x928 :flag-assert #x1108b00928 (:methods - (camera-master-method-14 () none) ;; 14 ;; (camera-master-method-14 (_type_ vector) vector) - (camera-master-method-15 () none) ;; 15 ;; (camera-master-method-15 (_type_ vector) vector) + (camera-master-method-14 (_type_ vector) vector) ;; 14 + (camera-master-method-15 (_type_ vector) vector) ;; 15 (camera-master-method-16 () none) ;; 16 ;; (camera-master-method-16 (_type_ symbol) int) ) ) @@ -24993,12 +25579,100 @@ ;; +++sparticle-launcher-h:sp-field-id (defenum sp-field-id :type uint16 + ;; todo copied from jak 2 + (misc-fields-start 0) + (spt-texture 1) + (spt-anim 2) + (spt-anim-speed 3) + (spt-birth-func 4) + (spt-joint/refpoint 5) + (spt-num 6) + (spt-sound 7) + (misc-fields-end 8) + + (sprite-fields-start 9) + (spt-x 10) + (spt-y 11) + (spt-z 12) + (spt-scale-x 13) + (spt-rot-x 14) + (spt-rot-y 15) + (spt-rot-z 16) + (spt-scale-y 17) + (spt-r 18) + (spt-g 19) + (spt-b 20) + (spt-a 21) + (sprite-fields-end 22) + + (cpu-fields-start 23) + (spt-omega 24) + (spt-vel-x 25) + (spt-vel-y 26) + (spt-vel-z 27) + (spt-scalevel-x 28) + (spt-rotvel-x 29) + (spt-rotvel-y 30) + (spt-rotvel-z 31) + (spt-scalevel-y 32) + (spt-fade-r 33) + (spt-fade-g 34) + (spt-fade-b 35) + (spt-fade-a 36) + (spt-accel-x 37) + (spt-accel-y 38) + (spt-accel-z 39) + (spt-dummy 40) + (spt-quat-x 41) + (spt-quat-y 42) + (spt-quat-z 43) + (spt-quad-w 44) + (spt-friction 45) + (spt-timer 46) + (spt-flags 47) + (spt-userdata 48) + (spt-func 49) + (spt-next-time 50) + (spt-next-launcher 51) + (cpu-fields-end 52) + + (launch-fields-start 53) + (spt-launchrot-x 54) + (spt-launchrot-y 55) + (spt-launchrot-z 56) + (spt-launchrot-w 57) + (spt-conerot-x 58) + (spt-conerot-y 59) + (spt-conerot-z 60) + (spt-conerot-w 61) + (spt-rotate-x 62) + (spt-rotate-y 63) + (spt-rotate-z 64) + + (spt-conerot-radius 65) + (spt-mat-scale-x 66) + (spt-mat-scale-y 67) + (spt-mat-scale-z 68) + (launch-fields-end 69) + + (spt-scale 70) + (spt-scalevel 71) + (spt-end 72) ) ;; ---sparticle-launcher-h:sp-field-id ;; +++sparticle-launcher-h:sp-flag (defenum sp-flag :type uint16 + ;; todo copied from jak 2 + (int 0) ;; int + (float 1) ;; float + (float-int-rand 2) ;; float with int rand + (copy-from-other 3) ;; copy + (object 4) ;; label + (symbol 5) ;; symbol + (launcher 6) ;; launcher from id + (float-store 7) ;; float and store result in *sp-temp* ) ;; ---sparticle-launcher-h:sp-flag @@ -25006,7 +25680,7 @@ (defenum sp-group-item-flag :bitfield #t :type uint16 - (sp0) + (is-3d) (sp1) (sp2) (sp3) @@ -25029,6 +25703,9 @@ (defenum sp-launch-state-flags :bitfield #t :type uint16 + (sp0) + (sp1) + (sp2) ) ;; ---sparticle-launcher-h:sp-launch-state-flags @@ -25199,11 +25876,11 @@ (:methods (sparticle-launch-control-method-14 () none) ;; 14 ;; (kill-and-free-particles (_type_) none) (sparticle-launch-control-method-15 () none) ;; 15 ;; (kill-particles (_type_) none) - (sparticle-launch-control-method-16 () none) ;; 16 - (sparticle-launch-control-method-17 () none) ;; 17 - (sparticle-launch-control-method-18 () none) ;; 18 - (sparticle-launch-control-method-19 () none) ;; 19 - (sparticle-launch-control-method-20 () none) ;; 20 + (spawn (_type_ vector) object) ;; 16 + (sparticle-launch-control-method-17 (_type_ matrix) none) ;; 17 + (sparticle-launch-control-method-18 (_type_ cspace) none) ;; 18 + (kill-particles (_type_) none) ;; 19 + (sparticle-launch-control-method-20 (_type_ float) none) ;; 20 ) ) @@ -25212,7 +25889,7 @@ (sp-system sparticle-system :offset-assert 8) (sp-launcher sparticle-launcher :offset-assert 12) (spawn-mat matrix :inline :offset-assert 16) - (inited? basic :offset-assert 80) + (inited? symbol :offset-assert 80) ) :method-count-assert 11 :size-assert #x54 @@ -25220,7 +25897,7 @@ (:methods (new (symbol type sparticle-system sparticle-launcher float) _type_) (sparticle-subsampler-method-9 () none) ;; 9 - (sparticle-subsampler-method-10 () none) ;; 10 + (sparticle-subsampler-method-10 (_type_ matrix) none) ;; 10 ) ) @@ -25233,10 +25910,35 @@ (declare-type sprite-vec-data-2d structure) +;; +++sparticle-h:sp-cpuinfo-flag (defenum sp-cpuinfo-flag :bitfield #t :type uint32 - ) + ;; todo copied from jak 2 + (sp-cpuinfo-flag-0 0) + (sp-cpuinfo-flag-1 1) + (sp-cpuinfo-flag-2 2) ;; cleared after an aux has its func set to add-to-sprite-aux-lst + (sp-cpuinfo-flag-3 3) + (sp-cpuinfo-flag-4 4) + (sp-cpuinfo-flag-5 5) + (ready-to-launch 6) ;; maybe just just death? + (distort 7) ;; distort sprite + (aux-list 8) ;; prevents relaunch, adds to aux + (sp-cpuinfo-flag-9 9) + (level0 10) + (level1 11) + (sp-cpuinfo-flag-12 12) ;; required to relaunch + (sp-cpuinfo-flag-13 13) + (sp-cpuinfo-flag-14 14) + (glow 15) ;; glow sprite + (use-global-acc 16) + (launch-along-z 17) + (left-multiply-quat 18) + (right-multiply-quat 19) + (set-conerot 20) + (sp-cpuinfo-flag-21 21) + ) +;; ---sparticle-h:sp-cpuinfo-flag (deftype sparticle-cpuinfo (structure) "The per-particle information. This stays on the CPU, and isn't uploaded to the VU." @@ -26877,14 +27579,14 @@ :flag-assert #x2000000024 (:methods (new "Allocate a new path-control, set up the curve to point to the specified lump data." (symbol type process symbol float entity symbol) _type_) ;; 0 - (path-control-method-9 () none) ;; 9 ;; (debug-draw (_type_) none) + (path-control-method-9 (_type_) none) ;; 9 ;; (debug-draw (_type_) none) (path-control-method-10 () none) ;; 10 ;; (get-point-in-path! (_type_ vector float symbol) vector) (path-control-method-11 () none) ;; 11 ;; (get-random-point (_type_ vector) vector) (path-control-method-12 () none) ;; 12 ;; (displacement-between-two-points-copy! (_type_ vector float float) vector) (path-control-method-13 () none) ;; 13 ;; (displacement-between-two-points-normalized! (_type_ vector float) vector) - (path-control-method-14 () none) ;; 14 ;; (get-point-at-percent-along-path! (_type_ vector float symbol) vector) + (get-point-at-percent-along-path! (_type_ vector float symbol) vector) ;; 14 (path-control-method-15 () none) ;; 15 ;; (displacement-between-points-at-percent-scaled! (_type_ vector float float) vector) - (path-control-method-16 () none) ;; 16 ;; (displacement-between-points-at-percent-normalized! (_type_ vector float) vector) + (displacement-between-points-at-percent-normalized! (_type_ vector float) vector) ;; 16 (get-num-segments (_type_) float) ;; 17 (path-control-method-18 () none) ;; 18 ;; (total-distance (_type_) float) (get-num-verts (_type_) int) ;; 19 @@ -26893,7 +27595,7 @@ (path-control-method-22 () none) ;; 22 ;; (get-furthest-point-on-path (_type_ vector) float) (path-control-method-23 () none) ;; 23 ;; (get-path-percentage-at-furthest-point (_type_ vector) float) (path-control-method-24 () none) ;; 24 ;; (path-control-method-24 (_type_ vector) vector) - (path-control-method-25 () none) ;; 25 + (path-control-method-25 (_type_ vector) float) ;; 25 (path-control-method-26 () none) ;; 26 ;; (displacement-between-two-points! (_type_ vector float float) vector) (path-control-method-27 () none) ;; 27 (path-control-method-28 () none) ;; 28 @@ -28396,7 +29098,7 @@ ;; (define-extern sprite-add-3d-all function) ;; (function sprite-array-3d dma-buffer int none) ;; (define-extern sprite-draw function) ;; (function display none) ;; (define-extern sprite-allocate-user-hvdf function) ;; (function int) -;; (define-extern sprite-release-user-hvdf function) ;; (function int none) +(define-extern sprite-release-user-hvdf (function int none)) ;; (define-extern sprite-get-user-hvdf function) ;; (function int vector) ;; (define-extern *sprite-hvdf-data* object) ;; sprite-hvdf-data ;; (define-extern *sprite-hvdf-control* object) ;; sprite-hvdf-control @@ -28636,7 +29338,7 @@ ;; (define-extern get-debug-text-3d function) ;; (function debug-text-3d) ;; (define-extern debug-reset-buffers function) ;; (function symbol) ;; (define-extern debug-draw-buffers function) ;; (function symbol) -;; (define-extern add-debug-line function) ;; (function symbol bucket-id vector vector rgba symbol rgba symbol) +(define-extern add-debug-line (function symbol bucket-id vector vector rgba symbol rgba symbol)) ;; (define-extern add-debug-line2d function) ;; (function symbol bucket-id vector4w vector4w vector4w symbol) ;; (define-extern add-debug-box function) ;; (function symbol bucket-id vector vector rgba symbol) ;; (define-extern add-debug-box-with-transform function) ;; (function symbol bucket-id bounding-box matrix rgba symbol) @@ -28680,7 +29382,7 @@ ;; (define-extern render-boundary-quad function) ;; (define-extern render-boundary-tri function) ;; (function sky-vertex dma-buffer none) ;; (define-extern add-debug-bound-internal function) ;; (function dma-buffer (inline-array vector) int rgba rgba int none) -;; (define-extern add-debug-bound function) ;; (function bucket-id (inline-array vector) int rgba rgba int none) +(define-extern add-debug-bound (function bucket-id (inline-array vector) int rgba rgba int none)) ;; (define-extern cpu-delay function) ;; (function int none) ;; (define-extern qword-read-time function) ;; (function (array uint128) int int) ;; (define-extern bugfix? function) ;; (function symbol) @@ -28689,29 +29391,43 @@ ;; history ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++history:history-channel +(defenum history-channel + :type uint8 + (trans 0) + (transv 1) + (transv-in 2) + (transv-out 3) + (intersect 4) + (local-normal 5) + (surface-normal 6) + (collide-status 7) + (pat 8) + (time 9) + (friction 10) + ) +;; ---history:history-channel + (deftype history-elt (structure) ((record-tag-bytes uint8 4 :offset-assert 0) ;; guessed by decompiler - (record-tag uint32 :offset-assert 0) - (record-id uint16 :offset-assert 0) - (owner uint8 :offset-assert 2) - (channel uint8 :offset-assert 4) ;; history-channel - (timestamp uint64 :offset-assert 8) ;; time-frame + (record-tag uint32 :offset 0) + (record-id uint16 :offset 0) + (owner uint8 :offset 2) + (channel history-channel :offset 4) ;; history-channel + (timestamp time-frame :offset-assert 8) ;; time-frame (origin vector :inline :offset-assert 16) (bytes uint8 16 :offset-assert 32) ;; guessed by decompiler - (vector vector :inline :offset-assert 32) - (float float :offset-assert 32) - (collide-status uint64 :offset-assert 32) ;; collide-status - (collide-reaction-flag uint32 :offset-assert 40) - (pat pat-surface :offset-assert 32) ;; guessed by decompiler + (vector vector :inline :offset 32 :score 1) + (float float :offset 32) + (collide-status collide-status :offset 32) ;; collide-status + (collide-reaction-flag uint32 :offset 40) + (pat pat-surface :offset 32) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype history-iterator (basic) ((max-age uint32 :offset-assert 4) (owner uint8 :offset-assert 8) @@ -28726,35 +29442,32 @@ :flag-assert #xc00000028 ;; field out uses ~A with a signed load. (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type uint) _type_) - (history-iterator-method-9 () none) ;; 9 ;; (frame-counter-delta (_type_ history-elt) time-frame) - (history-iterator-method-10 () none) ;; 10 ;; (update-entries! (_type_) history-elt) - (history-iterator-method-11 () none) ;; 11 ;; (get-age (_type_ history-elt) float) + (new (symbol type uint) _type_) ;; 0 + (frame-counter-delta (_type_ history-elt) time-frame) ;; 9 + (update-entries! (_type_) history-elt) ;; 10 + (get-age (_type_ history-elt) float) ;; 11 ) ) -|# -#| (deftype history (basic) ((alloc-index int32 :offset-assert 4) (allocated-length int32 :offset-assert 8) - (elts history-elt :dynamic :offset-assert 16) ;; guessed by decompiler + (elts history-elt :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 11 :size-assert #x10 :flag-assert #xb00000010 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type int) _type_) - (history-method-9 () none) ;; 9 ;; (clear-record-tags! (_type_ history-channel uint uint) history-elt) - (history-method-10 () none) ;; 10 ;; (clear-history-entries! (_type_) none) + (new (symbol type int) _type_) ;; 0 + (clear-record-tags! (_type_ history-channel uint uint) history-elt) ;; 9 + (clear-history-entries! (_type_) none) ;; 10 ) ) -|# -;; (define-extern history-channel->string function) ;; (function history-channel string) -;; (define-extern *history* object) ;; history -;; (define-extern history-print function) ;; (function history-iterator none) -;; (define-extern history-draw function) ;; (function history-iterator none) +(define-extern history-channel->string (function history-channel string)) +(define-extern *history* history) +(define-extern history-print (function history-iterator none)) +(define-extern history-draw (function history-iterator none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; merc-vu1 ;; @@ -28966,7 +29679,7 @@ (define-extern vu-lights<-light-group! (function vu-lights light-group none)) ;; ;; (define-extern foreground-add-mtx-calc function) ;; (function bone-calculation (inline-array pris-mtx) bone-calc-flags bone-calculation) ;; (define-extern foreground-wrapup function) ;; (function none) -;; (define-extern *default-shadow-settings* object) ;; shadow-settings +(define-extern *default-shadow-settings* shadow-settings) ;; (define-extern foreground-shadow function) ;; (function draw-control (inline-array pris-mtx) pointer pointer) ;; (define-extern foreground-generic-merc-death function) ;; (function draw-control generic-merc-ctrl none) ;; (define-extern foreground-generic-merc-add-fragments function) ;; (function merc-effect pointer mercneric-chain pointer) @@ -29887,7 +30600,7 @@ (define-extern *part-group-id-table* (array sparticle-launch-group)) ;; (define-extern *sp-temp* object) ;; float ;; (define-extern lookup-part-group-by-name function) ;; (function string sparticle-launch-group) -;; (define-extern lookup-part-group-pointer-by-name function) ;; (function string (pointer object)) +(define-extern lookup-part-group-pointer-by-name (function string (pointer object))) (define-extern part-group-pointer? (function pointer symbol)) ;; (define-extern unlink-part-group-by-heap function) ;; (function kheap int) ;; (define-extern sp-init-fields! function) ;; (function (pointer float) (inline-array sp-field-init-spec) sp-field-id sp-field-id symbol (inline-array sp-field-init-spec)) @@ -29912,7 +30625,7 @@ ;; (define-extern sp-relaunch-particle-3d function) ;; (function object sparticle-launcher sparticle-cpuinfo sprite-vec-data-3d none) ;; (define-extern execute-particle-local-space-engine function) ;; (define-extern local-space-camera function) -;; (define-extern local-space-proc-joint function) +(define-extern local-space-proc-joint (function particle-local-space-info none)) ;; (define-extern execute-part-engine function) ;; (function none) ;; (define-extern sparticle-track-root function) ;; (function object sparticle-cpuinfo vector none) ;; (define-extern sparticle-track-root-prim function) ;; (function object sparticle-cpuinfo vector none) @@ -29945,9 +30658,9 @@ ;; (define-extern birth-func-set-parent-pntr function) ;; (define-extern birth-func-get-parent-quat function) ;; (define-extern spt-func-camera-facing-orbiter function) -;; (define-extern *particle-quat* object) ;; quaternion +(define-extern *particle-quat* quaternion) ;; (define-extern birth-func-set-quat function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern *particle-vel* object) ;; vector +(define-extern *particle-vel* vector) ;; (define-extern birth-func-set-vel function) ;; (function object sparticle-cpuinfo sparticle-launchinfo none) ;; (define-extern birth-func-texture-group function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) ;; (define-extern rot-to-particle function) @@ -29989,7 +30702,7 @@ ;; (define-extern sparticle-kill-it-level function) ;; (define-extern sparticle-60-to-50 function) ;; (function sparticle-system sparticle-cpuinfo pointer none) ;; (define-extern sparticle-50-to-60 function) ;; (function sparticle-system sparticle-cpuinfo pointer none) -;; (define-extern kill-all-particles-with-key function) ;; (function sparticle-launch-control none) +(define-extern kill-all-particles-with-key (function sparticle-launch-control none)) ;; (define-extern forall-particles-runner function) ;; (function (function sparticle-system sparticle-cpuinfo pointer none) sparticle-system none) ;; (define-extern forall-particles function) ;; (function function symbol symbol none) ;; (define-extern kill-all-particles-in-level function) ;; (function level int) @@ -31326,7 +32039,7 @@ ) |# -;; (define-extern get-intersect-point function) ;; (function vector touching-prims-entry collide-shape touching-shapes-entry vector) +(define-extern get-intersect-point (function vector touching-prims-entry collide-shape touching-shapes-entry vector)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-edge-grab ;; @@ -31368,9 +32081,9 @@ ;; (define-extern find-ground-point function) ;; (function control-info vector float float vector) ;; (define-extern target-attack-up function) ;; (function target symbol symbol none) -;; (define-extern collide-shape-moving-angle-set! function) ;; (function collide-shape-moving vector vector none) -;; (define-extern cshape-reaction-update-state function) ;; (function control-info collide-query vector none) -;; (define-extern cshape-reaction-default function) ;; (function control-info collide-query vector vector collide-status) +(define-extern collide-shape-moving-angle-set! (function collide-shape-moving vector vector none)) +(define-extern cshape-reaction-update-state (function control-info collide-query vector none)) +(define-extern cshape-reaction-default (function control-info collide-query vector vector collide-status)) ;; (define-extern cshape-reaction-just-move function) ;; (function control-info collide-query vector collide-status) ;; (define-extern collide-shape-draw-debug-marks function) ;; (function none) ;; (define-extern *col-timer* object) ;; stopwatch @@ -31495,18 +32208,17 @@ ;; water-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype water-control (basic) ((flags water-flag :offset-assert 4) ;; water-flags (process target :offset-assert 8) ;; guessed by decompiler (joint-index int32 :offset-assert 12) (top-y-offset float :offset-assert 16) (attack-id uint32 :offset-assert 20) - (enter-water-time uint64 :offset-assert 24) ;; time-frame - (wade-time uint64 :offset-assert 32) ;; time-frame - (on-water-time uint64 :offset-assert 40) ;; time-frame - (enter-swim-time uint64 :offset-assert 48) ;; time-frame - (swim-time uint64 :offset-assert 56) ;; time-frame + (enter-water-time time-frame :offset-assert 24) ;; time-frame + (wade-time time-frame :offset-assert 32) ;; time-frame + (on-water-time time-frame :offset-assert 40) ;; time-frame + (enter-swim-time time-frame :offset-assert 48) ;; time-frame + (swim-time time-frame :offset-assert 56) ;; time-frame (base-height meters :offset-assert 64) (wade-height meters :offset-assert 68) (swim-height meters :offset-assert 72) @@ -31515,57 +32227,53 @@ (collide-height meters :offset-assert 84) (height meters :offset-assert 88) (height-offset float 4 :offset-assert 92) ;; guessed by decompiler - (base-ocean-offset meters :offset-assert 92) - (real-ocean-offset meters :offset-assert 92) - (ocean-offset meters :offset-assert 96) - (bob-offset meters :offset-assert 100) - (align-offset meters :offset-assert 104) - (swim-depth meters :offset-assert 108) + (base-ocean-offset meters :offset 92) + (real-ocean-offset meters :offset 92) + (ocean-offset meters :offset 96) + (bob-offset meters :offset 100) + (align-offset meters :offset 104) + (swim-depth meters :offset 108) (bob smush-control :inline :offset-assert 112) - (ripple uint64 :offset-assert 144) ;; handle + (ripple handle :offset-assert 144) ;; handle (ripple-size meters :offset-assert 152) (wake-size meters :offset-assert 156) - (bottom vector 2 :offset-assert 160) ;; guessed by decompiler - (top vector 2 :offset-assert 192) ;; guessed by decompiler + (bottom vector 2 :inline :offset-assert 160) ;; guessed by decompiler + (top vector 2 :inline :offset-assert 192) ;; guessed by decompiler (enter-water-pos vector :inline :offset-assert 224) (drip-old-pos vector :inline :offset-assert 240) (drip-joint-index int32 :offset-assert 256) (drip-wetness float :offset-assert 260) - (drip-time uint64 :offset-assert 264) ;; time-frame + (drip-time time-frame :offset-assert 264) ;; time-frame (drip-speed float :offset-assert 272) (drip-height meters :offset-assert 276) (drip-mult float :offset-assert 280) - (distort-time uint64 :offset-assert 288) ;; time-frame - (enter-water-sound uint128 :offset-assert 304) + (distort-time time-frame :offset-assert 288) ;; time-frame + (enter-water-sound sound-name :offset-assert 304) (normal vector :inline :offset-assert 320) ) :method-count-assert 18 :size-assert #x150 :flag-assert #x1200000150 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type process int float float float) _type_) + (new (symbol type process int float float float) _type_) ;; 0 (water-control-method-9 () none) ;; 9 ;; (water-control-method-9 (_type_) none) (water-control-method-10 () none) ;; 10 ;; (water-control-method-10 (_type_) none) - (water-control-method-11 () none) ;; 11 ;; (start-bobbing! (_type_ float int int) none) - (water-control-method-12 () none) ;; 12 ;; (distance-from-surface (_type_) float) - (water-control-method-13 () none) ;; 13 ;; (spawn-ripples (_type_ float vector int vector symbol) none) - (water-control-method-14 () none) ;; 14 ;; (display-water-marks? (_type_) symbol) + (start-bobbing! (_type_ float int int) none) ;; 11 + (distance-from-surface (_type_) float) ;; 12 + (spawn-ripples (_type_ float vector int vector symbol) none) ;; 13 + (display-water-marks? (_type_) symbol) ;; 14 (water-control-method-15 () none) ;; 15 ;; (enter-water (_type_) none) (water-control-method-16 () none) ;; 16 ;; (water-control-method-16 (_type_) none) (water-control-method-17 () none) ;; 17 ) ) -|# -#| (deftype water-vol (process-hidden) () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; camera ;; @@ -31590,16 +32298,16 @@ ;; (define-extern parameter-ease-sin-clamp function) ;; (function float float) ;; (define-extern *cam-res-string* object) ;; string ;; (define-extern cam-slave-init-vars function) ;; (function none :behavior camera-slave) -;; (define-extern cam-slave-go function) ;; (function (state camera-slave) none :behavior camera-slave) -;; (define-extern cam-slave-init function) ;; (function (state camera-slave) entity none :behavior camera-slave) -;; (define-extern cam-standard-event-handler function) ;; (function process int symbol event-message-block object :behavior camera-slave) +(define-extern cam-slave-go (function (state camera-slave) none :behavior camera-slave)) +(define-extern cam-slave-init (function (state camera-slave) entity none :behavior camera-slave)) +(define-extern cam-standard-event-handler (function process int symbol event-message-block object :behavior camera-slave)) ;; (define-extern cam-curve-pos function) ;; (function vector vector curve symbol vector :behavior camera-slave) ;; (define-extern cam-curve-setup function) ;; (function vector none :behavior camera-slave) -;; (define-extern cam-calc-follow! function) ;; (function cam-rotation-tracker vector symbol vector) +(define-extern cam-calc-follow! (function cam-rotation-tracker vector symbol vector)) ;; (define-extern mat-remove-z-rot function) ;; (function matrix vector matrix) ;; (define-extern slave-matrix-blend-2 function) ;; (function matrix cam-slave-options-u32 vector matrix matrix) ;; (define-extern vector-into-frustum-nosmooth! function) ;; (function matrix vector float vector) -;; (define-extern slave-set-rotation! function) ;; (function cam-rotation-tracker vector cam-slave-options-u32 float symbol none) +(define-extern slave-set-rotation! (function cam-rotation-tracker vector cam-slave-options-u32 float symbol none)) ;; (define-extern v-slrp2! function) ;; (function vector vector vector float vector float vector) ;; (define-extern v-slrp3! function) ;; (function vector vector vector vector float vector) @@ -31609,12 +32317,12 @@ (define-extern position-in-front-of-camera! (function vector float float vector)) ;; (define-extern position-in-front-of-screen! function) ;; (function vector float vector vector) -;; (define-extern matrix-local->world function) ;; (function symbol symbol matrix) -;; (define-extern matrix-world->local function) ;; (function symbol object matrix) +(define-extern matrix-local->world (function symbol symbol matrix)) +(define-extern matrix-world->local (function symbol object matrix)) ;; (define-extern *camera-dummy-vector* object) ;; vector (define-extern camera-pos (function vector)) (define-extern math-camera-pos (function vector)) -;; (define-extern camera-matrix function) ;; (function matrix) +(define-extern camera-matrix (function matrix)) (define-extern math-camera-matrix (function matrix)) ;; (define-extern camera-angle function) ;; (function float) ;; (define-extern camera-teleport-to-entity function) ;; (function entity-actor symbol :behavior process) @@ -31734,28 +32442,12 @@ ) |# -;; (define-extern cam-no-trans state) -;; (define-extern cam-really-fixed state) ;; (state camera-slave) -;; (define-extern cam-fixed state) ;; (state camera-slave) -;; (define-extern cam-fixed-read-entity state) ;; (state camera-slave) -;; (define-extern cam-pov state) ;; (state camera-slave) -;; (define-extern cam-pov180 state) ;; (state camera-slave) -;; (define-extern cam-pov-track state) ;; (state camera-slave) ;; (define-extern cam-standoff-calc-trans function) ;; (function vector :behavior camera-slave) -;; (define-extern cam-standoff state) ;; (state camera-slave) -;; (define-extern cam-standoff-read-entity state) ;; (state camera-slave) ;; (define-extern *CAM_EYE-bank* cam-eye-bank) ;; cam-eye-bank -(define-extern cam-eye (state camera-slave)) ;; (define-extern cam-curve-closest-point function) -;; (define-extern cam-tube-sled state) -;; (define-extern cam-spline state) ;; (state camera-slave) -;; (define-extern cam-decel state) ;; (state camera-slave) -(define-extern cam-endlessfall (state camera-slave)) ;; (define-extern cam-circular-position-into-max-angle function) ;; (function vector vector float vector :behavior camera-slave) ;; (define-extern cam-circular-position function) ;; (function symbol vector :behavior camera-slave) ;; (define-extern cam-circular-code function) ;; (function float :behavior camera-slave) -;; (define-extern cam-circular state) ;; (state camera-slave) -;; (define-extern cam-lookat state) ;; (state camera-slave) ;; (define-extern *CAM_STRING-bank* cam-string-bank) ;; cam-string-bank ;; (define-extern cam-string-find-position-rel! function) ;; (function vector symbol) ;; (define-extern cam-string-set-position-rel! function) ;; (function vector cam-slave-options :behavior camera-slave) @@ -31777,14 +32469,11 @@ ;; (define-extern cam-string-move function) ;; (function object :behavior camera-slave) ;; (define-extern cam-string-code function) ;; (function vector :behavior camera-slave) ;; (define-extern set-string-params function) ;; (function vector :behavior camera-slave) -;; (define-extern cam-string state) ;; (state camera-slave) ;; (define-extern *CAM_STICK-bank* cam-stick-bank) ;; cam-stick-bank ;; (define-extern cam-stick-code function) ;; (function none :behavior camera-slave) -;; (define-extern cam-stick state) ;; (state camera-slave) ;; (define-extern *CAM_BIKE-bank* cam-bike-bank) ;; cam-bike-bank ;; (define-extern cam-calc-bike-follow! function) ;; (function cam-rotation-tracker vector symbol vector :behavior camera-slave) ;; (define-extern cam-bike-code function) ;; (function none :behavior camera-slave) -;; (define-extern cam-bike state) ;; (state camera-slave) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cam-states-dbg ;; @@ -31826,12 +32515,10 @@ |# ;; (define-extern *CAM_POINT_WATCH-bank* cam-point-watch-bank) ;; cam-point-watch-bank -;; (define-extern cam-point-watch state) ;; (state camera-slave) ;; (define-extern *CAM_FREE-bank* cam-free-bank) ;; cam-free-bank ;; (define-extern cam-mouse-input function) ;; (function vector vector float) ;; (define-extern cam-free-floating-input function) ;; (function vector vector symbol int vector) ;; (define-extern cam-free-floating-move function) ;; (function matrix vector vector int vector) -(define-extern cam-free-floating (state camera-slave)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cam-combiner ;; @@ -31864,35 +32551,42 @@ ;; vol-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype plane-volume (structure) ((volume-type symbol :offset-assert 0) ;; guessed by decompiler (point-count int16 :offset-assert 4) (normal-count int16 :offset-assert 6) - (first-point vector :offset-assert 8) ;; (pointer vector) - (first-normal vector :offset-assert 12) ;; (pointer vector) + (first-point (pointer vector) :offset-assert 8) ;; (pointer vector) + (first-normal (pointer vector) :offset-assert 12) ;; (pointer vector) (num-planes int32 :offset-assert 16) (plane (inline-array plane) :offset-assert 20) ;; guessed by decompiler ) + :pack-me :method-count-assert 12 :size-assert #x18 :flag-assert #xc00000018 (:methods - (plane-volume-method-9 () none) ;; 9 ;; (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume) - (plane-volume-method-10 () none) ;; 10 ;; (debug-draw (_type_) none) - (plane-volume-method-11 () none) ;; 11 ;; (point-in-vol? (_type_ vector float) symbol) + (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume) ;; 9 + (debug-draw (_type_) none) ;; 10 + (point-in-vol? (_type_ vector float) symbol) ;; 11 ) ) -|# -#| +;; +++vol-h:vol-flags +(defenum vol-flags + :bitfield #t + :type uint32 + (display?) + (vol-flags-1) + ) +;; ---vol-h:vol-flags + (deftype vol-control (basic) ((flags vol-flags :offset-assert 4) ;; guessed by decompiler (process process-drawable :offset-assert 8) ;; guessed by decompiler (pos-vol-count int32 :offset-assert 12) - (pos-vol plane-volume 32 :offset-assert 16) ;; guessed by decompiler + (pos-vol plane-volume 32 :inline :offset-assert 16) ;; guessed by decompiler (neg-vol-count int32 :offset-assert 784) - (neg-vol plane-volume 32 :offset-assert 788) ;; guessed by decompiler + (neg-vol plane-volume 32 :inline :offset-assert 788) ;; guessed by decompiler (debug-point vector-array :offset-assert 1556) ;; guessed by decompiler (debug-normal vector-array :offset-assert 1560) ;; guessed by decompiler ) @@ -31900,14 +32594,12 @@ :size-assert #x61c :flag-assert #xc0000061c (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type process-drawable) _type_) - (vol-control-method-9 () none) ;; 9 ;; (debug-draw (_type_) none) - (vol-control-method-10 () none) ;; 10 ;; (vol-control-method-10 (_type_ plane) symbol) - (vol-control-method-11 () none) ;; 11 ;; (should-display? (_type_) symbol) + (new (symbol type process-drawable) _type_) ;; 0 + (debug-draw (_type_) none) ;; 9 + (vol-control-method-10 (_type_ plane) symbol) ;; 10 + (should-display? (_type_) symbol) ;; 11 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cam-layout ;; @@ -32276,8 +32968,8 @@ ;; cam-start ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern cam-stop function) ;; (function symbol) -;; (define-extern cam-start function) ;; (function symbol none) +(define-extern cam-stop (function symbol)) +(define-extern cam-start (function symbol none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cloth-h ;; @@ -32584,69 +33276,58 @@ ;; curves ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype float-pair (structure) ((first float :offset-assert 0) (second float :offset-assert 4) - (x float :offset-assert 0) - (y float :offset-assert 4) + (x float :offset 0) + (y float :offset 4) ) :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype float-pair-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data float-pair :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype curve2d (basic) () :method-count-assert 10 :size-assert #x4 :flag-assert #xa00000004 (:methods - (curve2d-method-9 () none) ;; 9 + (curve2d-method-9 (_type_ float int) float) ;; 9 ) ) -|# -#| (deftype curve-color (basic) () :method-count-assert 10 :size-assert #x4 :flag-assert #xa00000004 (:methods - (curve-color-method-9 () none) ;; 9 + (curve-color-method-9 (_type_ float rgbaf int) rgbaf) ;; 9 ) ) -|# -#| (deftype curve2d-piecewise (curve2d) - ((pts basic :offset-assert 4) + ((pts float-pair-array :offset-assert 4) (default-loop-behavior uint64 :offset-assert 8) ) :method-count-assert 12 :size-assert #x10 :flag-assert #xc00000010 (:methods - (curve2d-piecewise-method-10 () none) ;; 10 - (curve2d-piecewise-method-11 () none) ;; 11 + (curve2d-piecewise-method-10 (_type_ int symbol uint) none) ;; 10 + (curve2d-piecewise-method-11 (_type_) none) ;; 11 ) ) -|# -#| (deftype curve2d-fast (curve2d) ((xs vector :inline :offset-assert 16) (ys vector :inline :offset-assert 32) @@ -32656,69 +33337,60 @@ :size-assert #x40 :flag-assert #xa00000040 ) -|# -#| (deftype curve-color-fast (curve-color) ((xs vector :inline :offset-assert 16) - (ys UNKNOWN 4 :offset-assert 32) + (ys vector 4 :inline :offset-assert 32) (one-over-x-deltas vector :inline :offset-assert 96) ) :method-count-assert 10 :size-assert #x70 :flag-assert #xa00000070 ) -|# -#| (deftype color-pair (structure) ((first float :offset-assert 0) (second rgbaf :inline :offset-assert 16) - (x float :offset-assert 0) - (y rgbaf :inline :offset-assert 16) + (x float :offset 0) + (y rgbaf :inline :offset 16) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype color-pair-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data color-pair :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype curve-color-piecewise (curve-color) - ((pts basic :offset-assert 4) + ((pts color-pair-array :offset-assert 4) (default-loop-behavior uint64 :offset-assert 8) ) :method-count-assert 11 :size-assert #x10 :flag-assert #xb00000010 (:methods - (curve-color-piecewise-method-10 () none) ;; 10 + (curve-color-piecewise-method-10 (_type_ int symbol uint) none) ;; 10 ) ) -|# -;; (define-extern rgbaf-lerp! function) -;; (define-extern evaluate-curve-fast function) -;; (define-extern evaluate-color-curve-fast function) -;; (define-extern rgba<-rgbaf function) -;; (define-extern *curve-unity* curve2d-fast) -;; (define-extern *curve-linear-up* curve2d-fast) -;; (define-extern *curve-linear-down* curve2d-fast) -;; (define-extern *curve-linear-up-hold* object) -;; (define-extern *curve-linear-up-down* curve2d-fast) -;; (define-extern *trail-color-curve-white* curve-color-fast) -;; (define-extern particle-color-curve-white* curve-color-fast) -;; (define-extern *trail-color-curve-red* curve-color-fast) +(define-extern rgbaf-lerp! (function rgbaf rgbaf rgbaf float rgbaf)) +(define-extern evaluate-curve-fast (function curve2d-fast rgbaf rgbaf float)) +(define-extern evaluate-color-curve-fast (function curve-color-fast rgbaf rgbaf rgbaf)) +(define-extern rgba<-rgbaf (function rgba rgbaf int)) +(define-extern *curve-unity* curve2d-fast) +(define-extern *curve-linear-up* curve2d-fast) +(define-extern *curve-linear-down* curve2d-fast) +(define-extern *curve-linear-up-hold* curve2d-piecewise) +(define-extern *curve-linear-up-down* curve2d-fast) +(define-extern *trail-color-curve-white* curve-color-fast) +(define-extern particle-color-curve-white* curve-color-fast) +(define-extern *trail-color-curve-red* curve-color-fast) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ambient ;; @@ -32736,18 +33408,18 @@ ;; speech ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern speech-type->string function) -;; (define-extern gui-status->string function) +(define-extern speech-type->string (function speech-type string)) +(define-extern gui-status->string (function gui-status string)) (define-extern *speech-control* speech-control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; region ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern region-tree-execute function) ;; (function symbol vector vector none) -;; (define-extern region-execute function) ;; (function none) -;; (define-extern region-prim-lookup-by-id function) ;; (function int symbol int drawable-region-prim) -;; (define-extern region-lookup-by-id function) ;; (function int region) +(define-extern region-tree-execute (function symbol vector vector none)) +(define-extern region-execute (function none)) +(define-extern region-prim-lookup-by-id (function int symbol int drawable-region-prim)) +(define-extern region-lookup-by-id (function int region)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; fma-sphere ;; @@ -32840,12 +33512,12 @@ ;; script ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern command-get-int function) ;; (function object int int) +(define-extern command-get-int (function object int int)) (define-extern command-get-float (function object float float)) ;; (define-extern command-get-time function) ;; (function object int time-frame) -;; (define-extern command-get-param function) ;; (function object object object) +(define-extern command-get-param (function object object object)) ;; (define-extern command-get-quoted-param function) ;; (function object object object) -;; (define-extern command-get-process function) ;; (function object process process) +(define-extern command-get-process (function object process process)) ;; (define-extern command-get-entity function) ;; (function object entity entity) ;; (define-extern command-get-trans function) ;; (function object vector vector) ;; (define-extern key-assoc function) ;; (function object pair vector4w pair) @@ -32858,57 +33530,55 @@ ;; generic-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(deftype mystery-cquery-type0 (structure) + "(event explode explosion)" + ((cquery collide-query :inline) + (explosion-trans vector :inline) + (proc-trans vector :inline) + (probe float) + (dist float) + ) + ) + (deftype target-start (process-hidden) () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 - (:states - target-startup ;; associated process guessed by decompiler, old: (state target) - ) ) -|# -#| (deftype camera-start (process-hidden) () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 ) -|# -#| (deftype cam-slope (process-hidden) () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 ) -|# -#| (deftype med-res-level (process-drawable) - ((level-name basic :offset-assert 200) - (part-mode basic :offset-assert 204) + ((level-name symbol :offset-assert 200) + (part-mode symbol :offset-assert 204) (index int32 :offset-assert 208) ) :method-count-assert 21 :size-assert #xd4 :flag-assert #x15006000d4 (:state-methods - idle ;; 20, old: (idle () _type_ :state) + idle ;; 20 ) ) -|# -#| (deftype launcher (process-drawable) ((spring-height meters :offset-assert 200) (camera state :offset-assert 204) ;; guessed by decompiler (active-distance float :offset-assert 208) - (seek-time uint64 :offset-assert 216) ;; time-frame + (seek-time time-frame :offset-assert 216) ;; time-frame (dest vector :inline :offset-assert 224) (sound-id sound-id :offset-assert 240) ;; guessed by decompiler ) @@ -32916,55 +33586,47 @@ :size-assert #xf4 :flag-assert #x17008000f4 (:state-methods - deactivated ;; 22, old: (deactivated () _type_ :state) - active ;; 21, old: (active () _type_ :state) - idle ;; 20, old: (idle () _type_ :state) + idle ;; 20 + active ;; 21 + deactivated ;; 22 ) ) -|# ;; simple-prim is already defined! -#| (deftype simple-prim-zbuf-mask (simple-prim) () :method-count-assert 26 :size-assert #xcc :flag-assert #x1a005000cc ) -|# -#| (deftype simple-prim-particle-binding (simple-prim) - ((color uint32 :offset-assert 204) - (lifetime uint64 :offset-assert 208) - (state-time uint64 :offset-assert 192) + ((color rgba :offset-assert 204) + (lifetime time-frame :offset-assert 208) ) :method-count-assert 28 - :size-assert #xe0 - :flag-assert #x1c006000e0 - (:methods - (simple-prim-particle-binding-method-27 () none) ;; 27 - ) + :size-assert #xd8 + :flag-assert #x1c006000d8 (:state-methods - active ;; 20 die ;; 26 ) + (:methods + (setup! "Set up this prim with the given particle info." (_type_ int sparticle-cpuinfo sparticle-launchinfo) none) ;; 27 + ) ) -|# -#| (deftype part-controller (process) - ((actor-group uint32 :offset-assert 124) - (actor-group-count int32 :offset-assert 128) - (spawn-delay uint64 :offset-assert 132) - (current-part-index uint16 :offset-assert 140) - (state-time uint64 :offset-assert 148) - (next-reset-time uint64 :offset-assert 156) - (reset-interval-min uint64 :offset-assert 164) - (reset-interval-max uint64 :offset-assert 172) - (particle-launchers basic :offset-assert 180) - (spawn-sound uint128 :offset-assert 188) + ((actor-group (pointer actor-group) :offset-assert 128) + (actor-group-count int32 :offset-assert 132) + (spawn-delay time-frame :offset-assert 136) + (current-part-index uint16 :offset-assert 144) + (state-time time-frame :offset-assert 152) + (next-reset-time time-frame :offset-assert 160) + (reset-interval-min time-frame :offset-assert 168) + (reset-interval-max time-frame :offset-assert 176) + (particle-launchers (array (pointer sparticle-launch-group)) :offset-assert 184) + (spawn-sound sound-name :offset-assert 192) ) :method-count-assert 15 :size-assert #xd0 @@ -32973,11 +33635,9 @@ active ;; 14 ) ) -|# -#| (deftype sound-controller (process) - ((spawn-sound uint128 :offset-assert 128) + ((spawn-sound sound-name :offset-assert 128) (sync sync-linear :inline :offset-assert 144) (prev-val float :offset-assert 160) (pos vector :inline :offset-assert 176) @@ -32990,27 +33650,24 @@ die ;; 15 ) ) -|# -#| (deftype sound-on-path (process-drawable) - ((spawn-sound uint128 :offset-assert 208) - (loop-sound uint32 :offset-assert 228) - (amb-sound basic :offset-assert 232) - (is-spooling? basic :offset-assert 236) + "An [[ambient-sound]] that is being moved along a path." + ((spawn-sound sound-name :offset-assert 208) + (loop-sound uint32 :offset 228) + (amb-sound ambient-sound :offset-assert 232) + (is-spooling? symbol :offset-assert 236) ) :method-count-assert 23 :size-assert #xf0 :flag-assert #x17007000f0 (:state-methods active ;; 20 - no-play ;; 22 die ;; 21 + no-play ;; 22 ) ) -|# -#| (deftype level-exit (process-drawable) ((minimap connection-minimap :offset-assert 200) (task-counter uint32 :offset-assert 204) @@ -33023,50 +33680,46 @@ active ;; 20 ) ) -|# -;; (define-extern *part-tracker-params-default* object) -;; (define-extern *part-tracker-subsampler-params-default* object) -;; (define-extern entity-lookup-part-group function) ;; (function entity-actor (pointer string) symbol (pointer sparticle-launch-group)) -;; (define-extern clone-anim-once function) ;; (function handle symbol string none :behavior process-drawable) -;; (define-extern clone-anim function) ;; (function handle symbol string none :behavior process-drawable) -;; (define-extern swingpole-init function) ;; (function int object :behavior swingpole) -;; (define-extern manipy-post function) ;; (function none :behavior manipy) -;; (define-extern manipy-init function) ;; (function vector entity-actor skeleton-group vector object none :behavior manipy) -;; (define-extern part-tracker-init-base function) -;; (define-extern part-tracker-subsampler-init function) -;; (define-extern part-tracker-init function) ;; (function sparticle-launch-group time-frame (function part-tracker none) (pointer process-drawable) process matrix none :behavior part-tracker) -;; (define-extern part-tracker-track-root function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern part-tracker-move-to-target function) ;; (function part-tracker vector) -;; (define-extern part-tracker-track-target function) ;; (function part-tracker vector) -;; (define-extern lightning-tracker-init function) ;; (function lightning-spec time-frame symbol process-drawable vector vector none :behavior lightning-tracker) +(define-extern *part-tracker-params-default* part-tracker-init-params) +(define-extern *part-tracker-subsampler-params-default* part-tracker-subsampler-init-params) +(define-extern entity-lookup-part-group (function entity-actor (pointer string) symbol (pointer sparticle-launch-group))) +(define-extern clone-anim-once (function handle symbol string none :behavior process-drawable)) +(define-extern clone-anim (function handle symbol string none :behavior process-drawable)) +(define-extern swingpole-init (function int object :behavior swingpole)) +(define-extern manipy-post (function none :behavior manipy)) +(define-extern manipy-init (function vector entity-actor skeleton-group vector manipy-options none :behavior manipy)) +(define-extern part-tracker-init-base (function sparticle-launch-group time-frame (function part-tracker vector) uint process-drawable object none :behavior part-tracker)) +(define-extern part-tracker-subsampler-init (function part-tracker-subsampler-init-params object :behavior part-tracker-subsampler)) +(define-extern part-tracker-init (function part-tracker-init-params object :behavior part-tracker)) +(define-extern part-tracker-track-root (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-tracker-move-to-target (function part-tracker vector)) +(define-extern part-tracker-track-target (function part-tracker vector)) +(define-extern lightning-tracker-init (function lightning-spec time-frame symbol process-drawable vector vector none :behavior lightning-tracker)) (define-extern process-grab? (function process symbol symbol :behavior process)) (define-extern process-release? (function process symbol :behavior process)) -;; (define-extern camera-look-at function) ;; (function pair uint process) -;; (define-extern ja-anim-done? function) ;; (function process symbol) -;; (define-extern camera-pov-from function) ;; (function pair uint process) -;; (define-extern cam-launcher-joystick function) ;; (function vector :behavior camera-slave) -;; (define-extern cam-launcher-shortfall state) ;; (state camera-slave) -;; (define-extern cam-launcher-long-joystick function) ;; (function vector :behavior camera-slave) -;; (define-extern cam-launcher-longfall state) ;; (state camera-slave) -;; (define-extern launcher-init-by-other function) ;; (function vector float int float none :behavior launcher) -;; (define-extern touch-tracker-init function) ;; (function vector float time-frame none :behavior touch-tracker) -;; (define-extern explosion-init-by-other function) ;; (function explosion-init-params object :behavior explosion) -;; (define-extern explosion-spawn-legacy-version function) -;; (define-extern explosion-spawn function) ;; (function process-drawable type explosion-init-params none) -;; (define-extern find-closest-solid-sphere-prim function) -;; (define-extern *explosion-debug-sphere* object) -;; (define-extern process-drawable-random-point! function) ;; (function process-drawable vector vector) -;; (define-extern process-drawable-pair-random-point! function) ;; (function process-drawable process-drawable vector float vector) -;; (define-extern simple-prim-init-by-other function) -;; (define-extern birth-func-simple-prim function) -;; (define-extern external-camera-controller-init-by-other function) +(define-extern camera-look-at (function pair uint process)) +(define-extern ja-anim-done? (function process symbol)) +(define-extern camera-pov-from (function pair uint process)) +(define-extern cam-launcher-joystick (function vector :behavior camera-slave)) +(define-extern cam-launcher-long-joystick (function vector :behavior camera-slave)) +(define-extern launcher-init-by-other (function vector float int float none :behavior launcher)) +(define-extern touch-tracker-init (function vector float time-frame none :behavior touch-tracker)) +(define-extern explosion-init-by-other (function explosion-init-params object :behavior explosion)) +(define-extern explosion-spawn-legacy-version (function process-drawable type explosion-init-params (pointer process))) +(define-extern explosion-spawn (function process-drawable type explosion-init-params none)) +(define-extern find-closest-solid-sphere-prim (function collide-shape vector collide-spec collide-shape-prim)) +(define-extern *explosion-debug-sphere* sphere) +(define-extern process-drawable-random-point! (function process-drawable vector vector)) +(define-extern process-drawable-pair-random-point! (function process-drawable process-drawable vector float vector)) +(define-extern simple-prim-init-by-other (function vector vector texture-id object :behavior simple-prim)) +(define-extern birth-func-simple-prim (function int sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern external-camera-controller-init-by-other (function entity time-frame symbol object :behavior external-camera-controller)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; lightning ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype lightning-globals (structure) ((gcf-buf uint16 :offset-assert 0) (vtx-buf uint16 :offset-assert 2) @@ -33075,61 +33728,57 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# (define-extern *lightning-spec-id-table* (array lightning-spec)) -;; (define-extern *lightning-gcf* object) ;; gcf-control -;; (define-extern lightning-fractal-gen function) ;; (function (inline-array vector) int int float lightning-spec none) -;; (define-extern lightning-uniform-gen function) ;; (function (inline-array vector) int int float lightning-spec none) -;; (define-extern lightning-trail-uniform-gen function) ;; (function (inline-array vector) (inline-array vector) float int symbol) -;; (define-extern lightning-trail-fractal-gen function) ;; (function (inline-array vector) (inline-array vector) int int float lightning-spec none) -;; (define-extern gs-packed-rgba-lerp! function) ;; (function gs-packed-rgba rgba rgba float gs-packed-rgba) -;; (define-extern lightning-fade function) ;; (function lightning-control int :behavior process) -;; (define-extern lightning-update function) ;; (function lightning-control symbol) -;; (define-extern lightning-draw function) ;; (function dma-buffer lightning-control lightning-globals symbol) -;; (define-extern lightning-start function) ;; (function float float (pointer process)) -;; (define-extern *lightning-globals* object) ;; lightning-globals -;; (define-extern *lightning* object) ;; symbol -;; (define-extern lightning-draw-all function) ;; (function none) -;; (define-extern unlink-lightning-spec-by-heap function) ;; (function kheap none) +(define-extern *lightning-gcf* gcf-control) +(define-extern lightning-fractal-gen (function (inline-array vector) int int float lightning-spec none)) +(define-extern lightning-uniform-gen (function (inline-array vector) int int float lightning-spec none)) +(define-extern lightning-trail-uniform-gen (function (inline-array vector) (inline-array vector) float int symbol)) +(define-extern lightning-trail-fractal-gen (function (inline-array vector) (inline-array vector) int int float lightning-spec none)) +(define-extern gs-packed-rgba-lerp! (function gs-packed-rgba rgba rgba float gs-packed-rgba)) +(define-extern lightning-fade (function lightning-control int :behavior process)) +(define-extern lightning-update (function lightning-control symbol)) +(define-extern lightning-draw (function dma-buffer lightning-control lightning-globals symbol)) +(define-extern lightning-start (function float float (pointer process))) +(define-extern *lightning-globals* lightning-globals) +(define-extern *lightning* symbol) +(define-extern lightning-draw-all (function none)) +(define-extern unlink-lightning-spec-by-heap (function kheap none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; light-trails-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype color-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data rgbaf :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype light-trail-composition (structure) ((color-mode uint64 :offset-assert 0) - (color-curve basic :offset-assert 8) + (color-curve curve-color-fast :offset-assert 8) (color-repeat-dist float :offset-assert 12) (alpha-1-mode uint64 :offset-assert 16) (alpha-2-mode uint64 :offset-assert 24) (base-alpha float :offset-assert 32) - (alpha-curve-1 basic :offset-assert 36) - (alpha-curve-2 basic :offset-assert 40) + (alpha-curve-1 curve-color-fast :offset-assert 36) + (alpha-curve-2 curve-color-fast :offset-assert 40) (alpha-repeat-dist float :offset-assert 44) (width-mode uint64 :offset-assert 48) (base-width float :offset-assert 56) - (width-curve basic :offset-assert 60) + (width-curve curve-color-fast :offset-assert 60) (width-repeat-dist float :offset-assert 64) (uv-mode uint64 :offset-assert 72) (uv-repeat-dist float :offset-assert 80) - (max-age uint64 :offset-assert 88) + (max-age time-frame :offset-assert 88) (tex-id uint32 :offset-assert 96) (lie-mode uint64 :offset-assert 104) (lie-vector vector :inline :offset-assert 112) - (zbuffer? basic :offset-assert 128) - (use-tape-mode? basic :offset-assert 132) + (zbuffer? symbol :offset-assert 128) + (use-tape-mode? symbol :offset-assert 132) (blend-mode uint64 :offset-assert 136) (frame-stagger uint8 :offset-assert 144) ) @@ -33137,32 +33786,26 @@ :size-assert #x91 :flag-assert #x900000091 ) -|# -#| (deftype light-trail-breadcrumb (structure) ((pos vector :inline :offset-assert 0) - (birth-time uint32 :offset-assert 12) + (birth-time uint32 :offset 12 :decomp-as time-frame) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype breadcrumb-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data light-trail-breadcrumb :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype light-trail (basic) - ((crumb-array basic :offset-assert 4) + ((crumb-array breadcrumb-array :offset-assert 4) (crumb-size uint8 :offset-assert 8) (crumb-count int16 :offset-assert 10) (max-crumb-count int16 :offset-assert 12) @@ -33171,32 +33814,30 @@ (end-marker uint64 :offset-assert 32) (decision uint64 :offset-assert 40) (total-distance-traveled float :offset-assert 48) - (strip basic :offset-assert 52) - (strip2 basic :offset-assert 56) - (cache-vector UNKNOWN 4 :offset-assert 64) + (strip prim-strip :offset-assert 52) + (strip2 prim-strip :offset-assert 56) + (cache-vector vector 4 :inline :offset-assert 64) ) :method-count-assert 22 :size-assert #x80 :flag-assert #x1600000080 (:methods - (light-trail-method-9 () none) ;; 9 - (light-trail-method-10 () none) ;; 10 - (light-trail-method-11 () none) ;; 11 - (light-trail-method-12 () none) ;; 12 - (light-trail-method-13 () none) ;; 13 - (light-trail-method-14 () none) ;; 14 - (light-trail-method-15 () none) ;; 15 - (light-trail-method-16 () none) ;; 16 - (light-trail-method-17 () none) ;; 17 - (light-trail-method-18 () none) ;; 18 - (light-trail-method-19 () none) ;; 19 - (light-trail-method-20 () none) ;; 20 - (light-trail-method-21 () none) ;; 21 + (light-trail-method-9 (_type_ light-trail-composition int) none) ;; 9 + (light-trail-method-10 (_type_) none) ;; 10 + (light-trail-method-11 (_type_ vector int) none) ;; 11 + (light-trail-method-12 (_type_) none) ;; 12 + (light-trail-method-13 (_type_) int) ;; 13 + (light-trail-method-14 (_type_) none) ;; 14 + (light-trail-method-15 (_type_) none) ;; 15 + (light-trail-method-16 (_type_) none) ;; 16 + (light-trail-method-17 (_type_ vector float float int float) none) ;; 17 + (light-trail-method-18 (_type_ vector vector vector vector) none) ;; 18 + (light-trail-method-19 (_type_) none) ;; 19 + (reset-crumbs! (_type_) none) ;; 20 + (light-trail-method-21 (_type_) none) ;; 21 ) ) -|# -#| (deftype weapon-trail-crumb (light-trail-breadcrumb) ((offset vector :inline :offset-assert 16) ) @@ -33204,22 +33845,18 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype weapon-trail (light-trail) () :method-count-assert 24 :size-assert #x80 :flag-assert #x1800000080 (:methods - (weapon-trail-method-22 () none) ;; 22 - (weapon-trail-method-23 () none) ;; 23 + (weapon-trail-method-22 (_type_) none) ;; 22 + (weapon-trail-method-23 (_type_) none) ;; 23 ) ) -|# -#| (deftype tread-trail-crumb (light-trail-breadcrumb) ((normal vector :inline :offset-assert 16) ) @@ -33227,35 +33864,29 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype tread-trail (light-trail) () :method-count-assert 24 :size-assert #x80 :flag-assert #x1800000080 (:methods - (tread-trail-method-22 () none) ;; 22 - (tread-trail-method-23 () none) ;; 23 + (tread-trail-method-22 (_type_) none) ;; 22 + (tread-trail-method-23 (_type_) none) ;; 23 ) ) -|# -#| (deftype light-trail-tracker-spawn-params (structure) ((appearance light-trail-composition :offset-assert 0) (max-num-crumbs int32 :offset-assert 4) - (tracked-obj uint64 :offset-assert 8) - (track-immediately? basic :offset-assert 16) + (tracked-obj handle :offset-assert 8) + (track-immediately? symbol :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -#| (deftype weapon-trail-tracker-spawn-params (light-trail-tracker-spawn-params) ((joint0 int16 :offset-assert 20) (joint1 int16 :offset-assert 22) @@ -33264,81 +33895,74 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype light-trail-tracker (process) - ((trail basic :offset-assert 128) - (tracked-object uint64 :offset-assert 136) - (offscreen? basic :offset-assert 144) - (offscreen-start-time uint64 :offset-assert 152) - (next-line-check-time uint64 :offset-assert 160) + ((trail light-trail :offset-assert 128) + (tracked-object handle :offset-assert 136) + (offscreen? symbol :offset-assert 144) + (offscreen-start-time time-frame :offset-assert 152) + (next-line-check-time time-frame :offset-assert 160) (last-add-frame-val uint32 :offset-assert 168) ) :method-count-assert 21 :size-assert #xac :flag-assert #x15003000ac + (:state-methods + tracking ;; 14 + die ;; 15 + ) (:methods - (light-trail-tracker-method-14 () none) ;; 14 - (light-trail-tracker-method-15 () none) ;; 15 - (light-trail-tracker-method-16 () none) ;; 16 - (light-trail-tracker-method-17 () none) ;; 17 - (light-trail-tracker-method-18 () none) ;; 18 - (light-trail-tracker-method-19 () none) ;; 19 - (light-trail-tracker-method-20 () none) ;; 20 + (light-trail-tracker-method-16 (_type_ process-focusable vector) vector) ;; 16 + (light-trail-tracker-method-17 (_type_ process-focusable) symbol) ;; 17 + (light-trail-tracker-method-18 (_type_ process-focusable) none) ;; 18 + (light-trail-tracker-method-19 (_type_) none) ;; 19 + (light-trail-tracker-method-20 (_type_ vector) none) ;; 20 ) ) -|# -#| (deftype weapon-trail-tracker (light-trail-tracker) - ((joint0 int16 :offset-assert 172) + ((trail weapon-trail :override) + (joint0 int16 :offset-assert 172) (joint1 int16 :offset-assert 174) - (state-time uint64 :offset-assert 176) + (state-time time-frame :offset-assert 176) ) :method-count-assert 22 :size-assert #xb8 :flag-assert #x16004000b8 - (:methods - (weapon-trail-tracker-method-21 () none) ;; 21 + (:state-methods + hang-on ;; 21 ) ) -|# -#| (deftype tread-trail-tracker (light-trail-tracker) - () + ((trail tread-trail :override) + ) :method-count-assert 21 :size-assert #xac :flag-assert #x15003000ac ) -|# -#| (deftype light-trail-tracker-water (light-trail-tracker) () :method-count-assert 21 :size-assert #xac :flag-assert #x15003000ac ) -|# -#| (deftype light-trail-tracker-projectile (light-trail-tracker) - ((state-time uint64 :offset-assert 176) + ((state-time time-frame :offset-assert 176) ) :method-count-assert 22 :size-assert #xb8 :flag-assert #x16004000b8 - (:methods - (light-trail-tracker-projectile-method-21 () none) ;; 21 + (:state-methods + hang-on ;; 21 ) ) -|# -;; (define-extern light-trail-tracker-init-by-other function) -;; (define-extern weapon-trail-tracker-init-by-other function) -;; (define-extern tread-trail-tracker-init-by-other function) +(define-extern light-trail-tracker-init-by-other (function light-trail-tracker-spawn-params object :behavior light-trail-tracker)) +(define-extern weapon-trail-tracker-init-by-other (function weapon-trail-tracker-spawn-params object :behavior weapon-trail-tracker)) +(define-extern tread-trail-tracker-init-by-other (function light-trail-tracker-spawn-params object :behavior tread-trail-tracker)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; lightning-new-h ;; @@ -33551,11 +34175,11 @@ ;; light-trails ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern compute-trail-scaled-t function) -;; (define-extern *dist-cache-array* object) -;; (define-extern *total-length* object) -;; (define-extern light-trail-tracker-common-post function) -;; (define-extern estimate-light-trail-mem-usage function) +(define-extern compute-trail-scaled-t (function uint float float float float float vector float)) +(define-extern *dist-cache-array* (pointer float)) +(define-extern *total-length* float) +(define-extern light-trail-tracker-common-post (function object :behavior light-trail-tracker)) +(define-extern estimate-light-trail-mem-usage (function light-trail none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; lightning-new ;; @@ -33573,15 +34197,29 @@ ;; carry-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++carry-h:carry-mode +(defenum carry-mode + :type uint8 + :bitfield #t + (carry 0) + (mech-carry 1) + (mech-drag 2) + (cm3) + (cm4) + (cm5) + (cm6) + (cm7) + ) +;; ---carry-h:carry-mode + (deftype carry-info (basic) ((process (pointer target) :offset-assert 4) ;; guessed by decompiler - (pickup-time uint64 :offset-assert 8) ;; time-frame + (pickup-time time-frame :offset-assert 8) ;; time-frame (other-value float :offset-assert 16) - (other uint64 :offset-assert 24) ;; handle + (other handle :offset-assert 24) ;; handle (point vector :inline :offset-assert 32) (normal vector :inline :offset-assert 48) - (max-angle deg :offset-assert 64) ;; degrees + (max-angle degrees :offset-assert 64) ;; degrees (max-distance meters :offset-assert 68) (max-pull meters :offset-assert 72) (min-pull meters :offset-assert 76) @@ -33593,7 +34231,7 @@ (face-dir int8 :offset-assert 94) (local-point vector :inline :offset-assert 96) (local-normal vector :inline :offset-assert 112) - (grab-quat vector :inline :offset-assert 128) ;; quaternion :inline + (grab-quat quaternion :inline :offset-assert 128) ;; quaternion :inline (grab-trans vector :inline :offset-assert 144) (hold-trans vector :inline :offset-assert 160) ) @@ -33602,45 +34240,56 @@ :flag-assert #x11000000b0 ;; field carry-mode is likely a value type. (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type process-drawable int vector vector float) _type_) - (carry-info-method-9 () none) ;; 9 ;; (carry-info-method-9 (_type_) none) - (carry-info-method-10 () none) ;; 10 ;; (distance-from-destination (_type_ carry-info) float) - (carry-info-method-11 () none) ;; 11 ;; (drag! (_type_ carry-info) none) - (carry-info-method-12 () none) ;; 12 ;; (drop-impl! (_type_ carry-info) none) - (carry-info-method-13 () none) ;; 13 ;; (carry-info-method-13 (_type_) symbol) - (carry-info-method-14 () none) ;; 14 ;; (carry! (_type_ carry-info vector vector) none) - (carry-info-method-15 () none) ;; 15 ;; (drop! (_type_ carry-info) none) - (carry-info-method-16 () none) ;; 16 ;; (translate! (_type_) symbol) + (new (symbol type process-drawable int vector vector float) _type_) ;; 0 + (carry-info-method-9 (_type_) none) ;; 9 + (distance-from-destination (_type_ carry-info) float) ;; 10 + (drag! (_type_ carry-info) none) ;; 11 + (drop-impl! (_type_ carry-info) none) ;; 12 + (carry-info-method-13 (_type_) symbol) ;; 13 + (carry! (_type_ carry-info vector vector) none) ;; 14 + (drop! (_type_ carry-info) none) ;; 15 + (translate! (_type_) symbol) ;; 16 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; pilot-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++pilot-h:vehicle-controls-flag +(defenum vehicle-controls-flag + :type uint8 + :bitfield #t + (vcf0 0) + (vcf1 1) + (vcf2 2) + (vcf3 3) + (vcf4 4) + (vcf5 5) + (vcf6 6) + (vcf7 7) + ) +;; ---pilot-h:vehicle-controls-flag + (deftype vehicle-controls (structure) ((steering float :offset-assert 0) (throttle float :offset-assert 4) (brake float :offset-assert 8) (lean-z float :offset-assert 12) (handbrake float :offset-assert 16) - (flags uint8 :offset-assert 20) - (prev-flags uint8 :offset-assert 21) - (pad0 UNKNOWN 2 :offset-assert 22) + (flags vehicle-controls-flag :offset-assert 20) + (prev-flags vehicle-controls-flag :offset-assert 21) + (pad0 uint8 2 :offset-assert 22) ) + :pack-me :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype pilot-info (basic) - ((entity basic :offset-assert 4) - (vehicle uint64 :offset-assert 8) ;; handle + ((entity entity :offset-assert 4) + (vehicle handle :offset-assert 8) ;; handle (left-right-bias float :offset-assert 16) (left-right-min float :offset-assert 20) (left-right-max float :offset-assert 24) @@ -33657,193 +34306,199 @@ (enable-cam-side-shift symbol :offset-assert 64) ;; guessed by decompiler (gun? symbol :offset-assert 68) ;; guessed by decompiler (controls vehicle-controls :inline :offset-assert 72) - (accel-array vector :inline :offset-assert 96) + (accel-array vector 8 :inline :offset-assert 96) (local-accel vector :inline :offset-assert 224) (pilot-trans vector :inline :offset-assert 240) (pilot-quat vector :inline :offset-assert 256) (pilot-scale vector :inline :offset-assert 272) - (underwater-time uint64 :offset-assert 288) + (underwater-time time-frame :offset-assert 288) (as-daxter? symbol :offset-assert 296) ;; guessed by decompiler - (art-group-backup basic :offset-assert 300) - (hud-health uint64 :offset-assert 304) - (hud-turbo uint64 :offset-assert 312) - (jumping? basic :offset-assert 320) + (art-group-backup art-group :offset-assert 300) + (hud-health handle :offset-assert 304) + (hud-turbo handle :offset-assert 312) + (jumping? symbol :offset-assert 320) ) :method-count-assert 9 :size-assert #x144 :flag-assert #x900000144 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; lightjak-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wings (process-drawable) - ((shadow-backup basic :offset-assert 208) - (ragdoll-proc uint64 :offset-assert 216) - (lock? basic :offset-assert 224) - (wing-part UNKNOWN 2 :offset-assert 228) + ((parent (pointer target) :override) + (shadow-backup shadow-geo :offset 208) + (ragdoll-proc handle :offset-assert 216) + (lock? symbol :offset-assert 224) + (wing-part sparticle-launch-control 2 :offset-assert 228) ) :method-count-assert 24 :size-assert #xec :flag-assert #x18007000ec - (:methods - (wings-method-20 () none) ;; 20 - (wings-method-21 () none) ;; 21 - (wings-method-22 () none) ;; 22 - (wings-method-23 () none) ;; 23 + (:state-methods + (idle symbol) + use + hidden + close ) ) -|# -#| (deftype lightjak-shield (process-drawable) - ((fade float :offset-assert 200) - (tone uint32 :offset-assert 204) + ((parent (pointer target) :override) + (fade float :offset-assert 200) + (tone rgba :offset-assert 204) ) :method-count-assert 23 :size-assert #xd0 :flag-assert #x17005000d0 - (:methods - (lightjak-shield-method-20 () none) ;; 20 - (lightjak-shield-method-21 () none) ;; 21 - (lightjak-shield-method-22 () none) ;; 22 + (:state-methods + open + close + hit ) ) -|# -#| (deftype lightjak-info (basic) - ((process uint32 :offset-assert 4) - (wings uint32 :offset-assert 8) - (get-off-lock basic :offset-assert 12) - (latch-out-time uint64 :offset-assert 16) - (start-time uint64 :offset-assert 24) + ((process (pointer target) :offset-assert 4) + (wings (pointer wings) :offset-assert 8) + (get-off-lock symbol :offset-assert 12) + (latch-out-time time-frame :offset-assert 16) + (start-time time-frame :offset-assert 24) (attack-id uint32 :offset-assert 32) - (lightjak-before-powerjak basic :offset-assert 36) - (attack-time uint64 :offset-assert 40) - (attack-count uint64 :offset-assert 48) - (stage uint32 :offset-assert 56) - (want-stage uint32 :offset-assert 60) + (lightjak-before-powerjak symbol :offset-assert 36) + (attack-time time-frame :offset-assert 40) + (attack-count time-frame :offset-assert 48) + (stage lightjak-stage :offset-assert 56) + (want-stage lightjak-stage :offset-assert 60) (get-on-latch uint32 :offset-assert 64) (tone uint32 :offset-assert 68) (on-off uint32 :offset-assert 72) (mode-sound-bank connection :offset-assert 76) (swoop-count int32 :offset-assert 80) - (freeze-control uint64 :offset-assert 88) - (freeze-screen uint64 :offset-assert 96) - (freeze-sound uint32 :offset-assert 104) - (shield uint32 :offset-assert 108) - (shield-start-time uint64 :offset-assert 112) - (shield-count-time uint64 :offset-assert 120) - (regen-start-time uint64 :offset-assert 128) - (regen-time uint64 :offset-assert 136) + (freeze-control handle :offset-assert 88) + (freeze-screen handle :offset-assert 96) + (freeze-sound sound-id :offset-assert 104) + (shield (pointer lightjak-shield) :offset-assert 108) + (shield-start-time time-frame :offset-assert 112) + (shield-count-time time-frame :offset-assert 120) + (regen-start-time time-frame :offset-assert 128) + (regen-time time-frame :offset-assert 136) ) :method-count-assert 9 :size-assert #x90 :flag-assert #x900000090 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gun-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype gun (process-drawable) - ((control control-info :offset-assert 128) ;; guessed by decompiler - (shadow-backup shadow-geo :offset-assert 208) ;; guessed by decompiler - (read-scale basic :offset-assert 212) - (gun-type int32 :offset-assert 216) ;; pickup-type + ((parent (pointer target) :override) + (control control-info :offset 128) ;; guessed by decompiler + (shadow-backup shadow-geo :offset 208) ;; guessed by decompiler + (read-scale symbol :offset-assert 212) + (gun-type pickup-type :offset-assert 216) ;; pickup-type (barrel joint-mod 2 :offset-assert 220) ;; guessed by decompiler (mag joint-mod 4 :offset-assert 228) ;; guessed by decompiler (mag-scale float 4 :offset-assert 244) ;; guessed by decompiler - (extra uint64 :offset-assert 264) + (extra handle :offset-assert 264) ) :method-count-assert 24 :size-assert #x110 :flag-assert #x1800900110 - (:methods - (gun-method-20 () none) ;; 20 ;; (idle () _type_ :state) - (gun-method-21 () none) ;; 21 ;; (use (symbol) _type_ :state) - (gun-method-22 () none) ;; 22 ;; (hidden () _type_ :state) - (gun-method-23 () none) ;; 23 ;; (die () _type_ :state) + (:state-methods + idle ;; 20 + (use symbol) ;; 21 + hidden ;; 22 + die ;; 23 ) ) -|# -#| +;; +++gun-h:gun-track-flags +(defenum gun-track-flags + :bitfield #t + :type uint16 + (gutflags-0) + (gutflags-1) + (gutflags-2) + (gutflags-3) + (gutflags-4) + ) +;; ---gun-h:gun-track-flags + (deftype gun-info (basic) ((process (pointer target) :offset-assert 4) ;; guessed by decompiler (gun (pointer gun) :offset-assert 8) ;; guessed by decompiler (gun-pos transformq :inline :offset-assert 16) - (gun-trans vector :inline :offset-assert 16) - (gun-quat vector :inline :offset-assert 32) ;; quaternion :inline - (gun-scale vector :inline :offset-assert 48) + (gun-trans vector :inline :offset 16) + (gun-quat quaternion :inline :offset 32) ;; quaternion :inline + (gun-scale vector :inline :offset 48) + (gun-type pickup-type :offset-assert 64) + (using-gun-type pickup-type :offset-assert 68) (active? symbol :offset-assert 72) ;; guessed by decompiler (latch? symbol :offset-assert 76) ;; guessed by decompiler (put-away? symbol :offset-assert 80) ;; guessed by decompiler - (surpress-time uint64 :offset-assert 88) ;; time-frame - (fire-time uint64 :offset-assert 96) ;; time-frame + (surpress-time time-frame :offset-assert 88) ;; time-frame + (fire-time time-frame :offset-assert 96) ;; time-frame (gun-delay-fire float :offset-assert 104) - (gun-time uint64 :offset-assert 112) ;; time-frame - (gun-get-on-time uint64 :offset-assert 120) ;; time-frame - (active-time uint64 :offset-assert 128) ;; time-frame + (gun-time time-frame :offset-assert 112) ;; time-frame + (gun-get-on-time time-frame :offset-assert 120) ;; time-frame + (active-time time-frame :offset-assert 128) ;; time-frame (fire-delay uint32 :offset-assert 136) (gun-control uint32 :offset-assert 140) - (gun-target uint32 :offset-assert 144) + (gun-target (pointer process-focusable) :offset-assert 144) (gun-daxter float :offset-assert 148) - (gun-select-time UNKNOWN 4 :offset-assert 152) - (gun-roty-rel deg :offset-assert 184) ;; degrees - (gun-roty deg :offset-assert 188) ;; degrees - (gun-roty-targ deg :offset-assert 192) ;; degrees + (gun-select-time time-frame 4 :offset-assert 152) + (gun-roty-rel degrees :offset-assert 184) ;; degrees + (gun-roty degrees :offset-assert 188) ;; degrees + (gun-roty-targ degrees :offset-assert 192) ;; degrees (hips joint-mod :offset-assert 196) ;; guessed by decompiler (upper-body joint-mod :offset-assert 200) ;; guessed by decompiler (chest joint-mod :offset-assert 204) ;; guessed by decompiler - (strip basic :offset-assert 208) + (strip prim-strip :offset-assert 208) (uv-slide float :offset-assert 212) - (fire-dir-rot deg :offset-assert 216) ;; degrees + (fire-dir-rot degrees :offset-assert 216) ;; degrees (fire-dir vector :inline :offset-assert 224) - (fire-point vector :inline :offset-assert 256) + (unk-vec vector :inline :offset-assert 240) + (fire-point vector :inline :offset 256) (fire-dir-backup vector :inline :offset-assert 272) (fire-dir-out vector :inline :offset-assert 288) (fire-pending int32 :offset-assert 304) - (fire-pending-time uint64 :offset-assert 312) ;; time-frame - (fire-start-time uint64 :offset-assert 320) ;; time-frame + (fire-pending-time time-frame :offset-assert 312) ;; time-frame + (fire-start-time time-frame :offset-assert 320) ;; time-frame (fire-charge float :offset-assert 328) - (fire-spin deg :offset-assert 332) ;; degrees - (fire-spinv deg :offset-assert 336) ;; degrees + (fire-spin degrees :offset-assert 332) ;; degrees + (fire-spinv degrees :offset-assert 336) ;; degrees (fire-chamber int32 :offset-assert 340) (fire-range meters :offset-assert 344) (laser-active? symbol :offset-assert 348) ;; guessed by decompiler (laser-point vector :inline :offset-assert 352) (laser-dir vector :inline :offset-assert 368) - (laser-hit-point vector :inline :offset-assert 400) - (track? uint16 :offset-assert 416) ;; gun-track-flags - (track-tilt deg :offset-assert 420) ;; degrees - (track-turn deg :offset-assert 424) ;; degrees + (unk-vec00 vector :inline :offset-assert 384) + (laser-hit-point vector :inline :offset 400) + (track? gun-track-flags :offset-assert 416) ;; gun-track-flags + (track-tilt degrees :offset-assert 420) ;; degrees + (track-turn degrees :offset-assert 424) ;; degrees (track-find-range meters :offset-assert 428) (track-turnv-range meters :offset-assert 432) (track-tilt-range meters :offset-assert 436) (track-turn-range meters :offset-assert 440) - (track-tilt-max deg :offset-assert 444) ;; degrees - (track-turn-max deg :offset-assert 448) ;; degrees + (track-tilt-max degrees :offset-assert 444) ;; degrees + (track-turn-max degrees :offset-assert 448) ;; degrees (track-angle-mult float :offset-assert 452) (track-beam-size float :offset-assert 456) (track-auto-fire symbol :offset-assert 460) ;; guessed by decompiler (track-require uint32 :offset-assert 464) - (track-target-hold-time uint64 :offset-assert 472) ;; time-frame - (track-start-time uint64 :offset-assert 480) ;; time-frame - (track-press-start-time uint64 :offset-assert 488) ;; time-frame - (track-target focus 2 :offset-assert 496) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + (track-target-hold-time time-frame :offset-assert 472) ;; time-frame + (track-start-time time-frame :offset-assert 480) ;; time-frame + (track-press-start-time time-frame :offset-assert 488) ;; time-frame + (track-target focus 2 :inline :offset-assert 496) ;; guessed by decompiler (track-trans vector :inline :offset-assert 528) (track-dir vector :inline :offset-assert 544) - (turn-fast-hold-time uint64 :offset-assert 560) ;; time-frame + (turn-fast-hold-time time-frame :offset-assert 560) ;; time-frame (blue-whine-sound-id sound-id :offset-assert 568) ;; guessed by decompiler (blue-whine-volume float :offset-assert 572) (mode-sound-bank connection :offset-assert 576) @@ -33854,29 +34509,27 @@ (top-anim-gun-height meters :offset-assert 648) (top-anim-blue-cycle float :offset-assert 652) (top-anim-low-high float :offset-assert 656) - (top-anim-extra-twistv deg :offset-assert 660) ;; degrees - (top-anim-tilt-up deg :offset-assert 664) ;; degrees + (top-anim-extra-twistv degrees :offset-assert 660) ;; degrees + (top-anim-tilt-up degrees :offset-assert 664) ;; degrees (attack-combo combo-tracker :inline :offset-assert 672) - (combo-window-start uint64 :offset-assert 720) ;; time-frame + (combo-window-start time-frame :offset-assert 720) ;; time-frame (combo-window-state symbol :offset-assert 728) ;; guessed by decompiler (combo-fire-delay uint32 :offset-assert 732) (charge-ammo float :offset-assert 736) - (charge-start-time uint64 :offset-assert 744) ;; time-frame - (charge-inc-time uint64 :offset-assert 752) ;; time-frame - (charge-active? uint64 :offset-assert 760) ;; handle - (part basic :offset-assert 768) + (charge-start-time time-frame :offset-assert 744) ;; time-frame + (charge-inc-time time-frame :offset-assert 752) ;; time-frame + (charge-active? handle :offset-assert 760) ;; handle + (part sparticle-launch-control :offset-assert 768) (ammo-required float :offset-assert 772) ) :method-count-assert 10 :size-assert #x308 :flag-assert #xa00000308 (:methods - (gun-info-method-9 () none) ;; 9 ;; (gun-info-method-9 (_type_) (inline-array vector)) + (gun-info-method-9 (_type_) vector) ;; 9 ) ) -|# -#| (deftype beam-info (structure) ((y-scale float :offset-assert 0) ) @@ -33884,101 +34537,151 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -;; (define-extern using-gun? function) ;; (function target symbol) -;; (define-extern enabled-gun? function) ;; (function target symbol) -;; (define-extern gun->ammo function) ;; (function pickup-type int) -;; (define-extern gun->eco function) -;; (define-extern *gun-shadow-control* shadow-control) ;; shadow-control +(define-extern using-gun? (function target symbol)) +(define-extern enabled-gun? (function target symbol)) +(define-extern gun->ammo (function pickup-type pickup-type)) +(define-extern gun->eco (function pickup-type pickup-type)) +(define-extern *gun-shadow-control* shadow-control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; board-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype board (process-drawable) - ((control control-info :offset-assert 128) ;; guessed by decompiler - (shadow-backup shadow-geo :offset-assert 208) ;; guessed by decompiler + ((parent (pointer target) :override) + (control control-info :offset 128) ;; guessed by decompiler + (shadow-backup shadow-geo :offset 208) ;; guessed by decompiler (main joint-mod :offset-assert 212) ;; guessed by decompiler - (in-head-time uint64 :offset-assert 216) + (in-head-time time-frame :offset-assert 216) ) :method-count-assert 23 :size-assert #xe0 :flag-assert #x17006000e0 - (:methods - (board-method-20 () none) ;; 20 ;; (idle (symbol) _type_ :state) - (board-method-21 () none) ;; 21 ;; (use () _type_ :state) - (board-method-22 () none) ;; 22 ;; (hidden () _type_ :state) + (:state-methods + (idle symbol) + use + hidden ) ) -|# -#| +;; +++board-h:board-tricks +(defenum board-tricks + :type uint32 + :bitfield #f + (none 0) + (board-spin 1) + (board-boost 2) + (board-flip 3) + (board-rail 4) + (board-rail-jump 5) + (board-nosegrab 6) + (board-board-spin 7) + (board-board-flip 8) + (board-noseflip 9) + (board-kickflip 10) + (board-kickspin 11) + (board-method 12) + (board-method-cross 13) + (board-backgrab 14) + (board-airwalk 15) + (board-jump 16) + (board-duck-jump 17) + (board-quick-jump 18) + (darkjak 19) + (darkjak-bomb0 20) + (darkjak-bomb1 21) + (darkjak-smack 22) + (darkjak-tracking 23) + (lightjak 24) + (lightjak-regen 25) + (lightjak-swoop 26) + (lightjak-freeze 27) + (lightjak-shield 28) + ) +;; ---board-h:board-tricks + (deftype board-info (basic) - ((board (pointer board) :offset-assert 4) ;; guessed by decompiler + ((board (pointer board) :offset-assert 4) (camera-interp float :offset-assert 8) - (process (pointer target) :offset-assert 12) ;; guessed by decompiler + (process (pointer target) :offset-assert 12) (board-trans vector :inline :offset-assert 16) (board-quat vector :inline :offset-assert 32) (board-scale vector :inline :offset-assert 48) - (main joint-mod :offset-assert 64) ;; guessed by decompiler - (upper-body joint-mod :offset-assert 68) ;; guessed by decompiler + (main joint-mod :offset-assert 64) + (upper-body joint-mod :offset-assert 68) + (mode-sound-bank connection :offset-assert 72) (sound-bank-knob float :offset-assert 76) (sound-air-knob float :offset-assert 80) - (wind-sound-id sound-id :offset-assert 84) ;; guessed by decompiler + (wind-sound-id sound-id :offset-assert 84) (wind-sound-pitch float :offset-assert 88) (wind-sound-volume float :offset-assert 92) - (engine-sound-id sound-id :offset-assert 96) ;; guessed by decompiler + (engine-sound-id sound-id :offset-assert 96) (engine-sound-pitch float :offset-assert 100) (engine-sound-volume float :offset-assert 104) - (bank-sound-id sound-id :offset-assert 108) ;; guessed by decompiler + (bank-sound-id sound-id :offset-assert 108) (bank-sound-pitch float :offset-assert 112) (bank-sound-volume float :offset-assert 116) - (ride-sound-id sound-id :offset-assert 120) ;; guessed by decompiler - (spin-sound-id sound-id :offset-assert 124) ;; guessed by decompiler + (ride-sound-id sound-id :offset-assert 120) + (spin-sound-id sound-id :offset-assert 124) (spin-sound-volume float :offset-assert 128) (spin-sound-pitch float :offset-assert 132) - (up-vector vector 2 :offset-assert 176) ;; guessed by decompiler + (turn-sound-id sound-id :offset-assert 136) + (trick-sound-id sound-id :offset-assert 140) + (jump-sound-id sound-id :offset-assert 144) + (eco-sound-id sound-id :offset-assert 148) + (eco-sound-volume float :offset-assert 152) + (charge-sound-id sound-id :offset-assert 156) + (adjust-time time-frame :offset-assert 160) + (up-vector vector 2 :inline :offset-assert 176) (slow-transv vector :inline :offset-assert 208) - (board-time uint64 :offset-assert 224) ;; time-frame - (board-get-on-time uint64 :offset-assert 232) ;; time-frame - (in-air-time uint64 :offset-assert 240) ;; time-frame - (stick-lock symbol :offset-assert 272) ;; guessed by decompiler - (stick-off symbol :offset-assert 276) ;; guessed by decompiler + (board-time time-frame :offset-assert 224) + (board-get-on-time time-frame :offset-assert 232) + (in-air-time time-frame :offset-assert 240) + (last-jump-time time-frame :offset-assert 248) + (jump-end-time time-frame :offset-assert 256) + (unk-time-frame01 time-frame :offset-assert 264) + (stick-lock symbol :offset-assert 272) + (stick-off symbol :offset-assert 276) (stance-info ground-tween-info :inline :offset-assert 280) - (mods-backup basic :offset-assert 316) + (mods-backup surface :offset-assert 316) (attack-id uint32 :offset-assert 320) - (latch? symbol :offset-assert 324) ;; guessed by decompiler - (unstuck-time uint64 :offset-assert 376) ;; time-frame + (latch? symbol :offset-assert 324) + (probe-intersect vector :inline :offset-assert 336) + (probe-normal vector :inline :offset-assert 352) + (probe-pat pat-surface :offset-assert 368) + (probe symbol :offset-assert 372) + (unstuck-time time-frame :offset-assert 376) (stuck-count int32 :offset-assert 384) (thrust-scale float :offset-assert 388) - (flip-time uint64 :offset-assert 392) ;; time-frame + (flip-time time-frame :offset-assert 392) (transv-max meters :offset-assert 400) - (turn-anim-tilt? symbol :offset-assert 404) ;; guessed by decompiler + (turn-anim-tilt? symbol :offset-assert 404) (turn-anim-mag float :offset-assert 408) (turn-anim-targ float :offset-assert 412) (turn-anim-frame float :offset-assert 416) + (unk-float000 float :offset-assert 420) + (unk-float001 float :offset-assert 424) (turn-anim-vel float :offset-assert 428) (turn-anim-duck float :offset-assert 432) (turn-anim-duck-vel float :offset-assert 436) (tilt-anim-frame vector :inline :offset-assert 448) (tilt-anim-targ vector :inline :offset-assert 464) - (smack-surface-time uint64 :offset-assert 480) ;; time-frame + (smack-surface-time time-frame :offset-assert 480) (smack-speed meters :offset-assert 488) (smack-normal vector :inline :offset-assert 496) - (glance-time uint64 :offset-assert 512) ;; time-frame + (glance-time time-frame :offset-assert 512) (glance-speed meters :offset-assert 520) (glance-in-transv vector :inline :offset-assert 528) (glance-out-transv vector :inline :offset-assert 544) (glance-normal vector :inline :offset-assert 560) - (on-flat-time uint64 :offset-assert 576) ;; time-frame - (jump-land-time uint64 :offset-assert 584) ;; time-frame + (on-flat-time time-frame :offset-assert 576) + (jump-land-time time-frame :offset-assert 584) (slip-factor float :offset-assert 592) (ground-on-dir vector :inline :offset-assert 608) - (ride-time uint64 :offset-assert 624) ;; time-frame - (ride-start-time uint64 :offset-assert 632) ;; time-frame - (ride-button-time uint64 :offset-assert 640) ;; time-frame + (ride-time time-frame :offset-assert 624) + (ride-start-time time-frame :offset-assert 632) + (ride-button-time time-frame :offset-assert 640) (ride-lean-targ float :offset-assert 648) (ride-lean float :offset-assert 652) (ride-leanv float :offset-assert 656) @@ -33987,17 +34690,15 @@ (ride-tilt float :offset-assert 668) (ride-tiltv float :offset-assert 672) (ride-tilt-mag float :offset-assert 676) - (ride-lock symbol :offset-assert 680) ;; guessed by decompiler - (ride-lock-on symbol :offset-assert 684) ;; guessed by decompiler + (ride-lock symbol :offset-assert 680) + (ride-lock-on symbol :offset-assert 684) (ride-speed meters :offset-assert 688) (ride-mode uint32 :offset-assert 692) - (ride-rot deg :offset-assert 696) ;; degrees - (ride-rot-old deg :offset-assert 700) ;; degrees - (ride-rot-abs degrees 2 :offset-assert 704) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (ride-rotv-abs deg :offset-assert 712) - (ride-touch-segment vector 2 :offset-assert 720) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + (ride-rot degrees :offset-assert 696) + (ride-rot-old degrees :offset-assert 700) + (ride-rot-abs degrees 2 :offset-assert 704) + (ride-rotv-abs degrees :offset-assert 712) + (ride-touch-segment vector 2 :inline :offset-assert 720) (ride-dir vector :inline :offset-assert 752) (ride-vertex-length int16 :offset-assert 768) (ride-vertex-length-old int16 :offset-assert 770) @@ -34006,66 +34707,81 @@ (ride-vertex-index float :offset-assert 776) (ride-vertex-index2 float :offset-assert 780) (ride-vertex-index-old float :offset-assert 784) - (ride-vertex vector 3 :offset-assert 800) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + (ride-vertex vector 3 :inline :offset-assert 800) (ride-segment vector :inline :offset-assert 848) (ride-dir-lean vector :inline :offset-assert 864) - (ride-pad-vector vector 1 :offset-assert 880) ;; guessed by decompiler - (ride-vertex-old vector 3 :offset-assert 896) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + (ride-pad-vector vector 1 :inline :offset-assert 880) + (ride-vertex-old vector 3 :inline :offset-assert 896) (ride-segment-old vector :inline :offset-assert 944) - (ride-vertex-trail vector 128 :offset-assert 960) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (halfpipe-side-time uint64 :offset-assert 3008) ;; time-frame - (halfpipe-jump-time uint64 :offset-assert 3016) ;; time-frame - (halfpipe-lip-time uint64 :offset-assert 3024) ;; time-frame - (halfpipe-time uint64 :offset-assert 3032) ;; time-frame - (halfpipe-gspot-time uint64 :offset-assert 3040) ;; time-frame - (halfpipe-lip-event symbol :offset-assert 3048) ;; guessed by decompiler - (spin-check-time uint64 :offset-assert 3056) ;; time-frame - (spin-time uint64 :offset-assert 3064) ;; time-frame - (spin-start-time uint64 :offset-assert 3072) ;; time-frame + (ride-vertex-trail vector 128 :inline :offset-assert 960) + (halfpipe-side-time time-frame :offset-assert 3008) + (halfpipe-jump-time time-frame :offset-assert 3016) + (halfpipe-lip-time time-frame :offset-assert 3024) + (halfpipe-time time-frame :offset-assert 3032) + (halfpipe-gspot-time time-frame :offset-assert 3040) + (halfpipe-lip-event symbol :offset-assert 3048) + (spin-check-time time-frame :offset-assert 3056) + (spin-time time-frame :offset-assert 3064) + (spin-start-time time-frame :offset-assert 3072) (spin-start-dir vector :inline :offset-assert 3088) (spin-control float :offset-assert 3104) - (spin-ground-start-time uint64 :offset-assert 3112) ;; time-frame - (spin-ground-time uint64 :offset-assert 3120) ;; time-frame - (spin-ground-press-time uint64 :offset-assert 3128) ;; time-frame + (spin-ground-start-time time-frame :offset-assert 3112) + (spin-ground-time time-frame :offset-assert 3120) + (spin-ground-press-time time-frame :offset-assert 3128) (flip-control float :offset-assert 3136) (flip-count int32 :offset-assert 3140) + (unk-time000 time-frame :offset 3152) + (tricky-time time-frame :offset-assert 3160) + (tricky-exit-time time-frame :offset-assert 3168) + (duck-start-time time-frame :offset-assert 3176) + (unk-float005 float :offset-assert 3184) + (unk-float006 float :offset-assert 3188) + (unk-float007 float :offset-assert 3192) (trickx-count int32 :offset-assert 3196) - (rotyv-max deg :offset-assert 3240) - (rotyv deg :offset-assert 3244) - (roty deg :offset-assert 3248) - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (upper-body-rotyv-max deg :offset-assert 3260) ;; degrees - (upper-body-rotyv deg :offset-assert 3264) ;; degrees - (upper-body-roty deg :offset-assert 3268) ;; degrees + (unk-time001 time-frame :offset 3208) + (hold-start-time time-frame :offset-assert 3216) + (hold-exit-time time-frame :offset-assert 3224) + (l2-start-time time-frame :offset-assert 3232) + (rotyv-max degrees :offset-assert 3240) + (rotyv degrees :offset-assert 3244) + (roty degrees :offset-assert 3248) + (roty-cum degrees :offset-assert 3252) + (unk-deg00 degrees :offset-assert 3256) + (upper-body-rotyv-max degrees :offset 3260) + (upper-body-rotyv degrees :offset-assert 3264) + (upper-body-roty degrees :offset-assert 3268) (cushion-base meters :offset-assert 3272) (cushion-offset meters :offset-assert 3276) (shock-offset meters :offset-assert 3280) (shock-offsetv meters :offset-assert 3284) (shock-rotx meters :offset-assert 3288) + (effect-part sparticle-launch-control :offset-assert 3292) + (charge-part sparticle-launch-control :offset-assert 3296) (trick-count int32 :offset-assert 3300) - (zap-start-time uint64 :offset-assert 3520) + (trick-array board-tricks 16 :offset-assert 3304) + (trick-points-array float 16 :offset 3368) + (trick-list board-tricks 16 :offset 3432) + (charge-start-time time-frame :offset 3496) + (charge-time time-frame :offset-assert 3504) + (charge-progress float :offset-assert 3512) + (zap-start-time time-frame :offset 3520) ) :method-count-assert 11 :size-assert #xdc8 :flag-assert #xb00000dc8 (:methods - (board-info-method-9 () none) ;; 9 ;; (add-to-trick-list (_type_ board-tricks float) none) - (board-info-method-10 () none) ;; 10 ;; (flush-trick-list (_type_) none) + (add-to-trick-list (_type_ board-tricks float) none) ;; 9 + (flush-trick-list (_type_) none) ;; 10 ) ) -|# -#| (deftype target-board-bank (basic) ((jump-height-min meters :offset-assert 4) (jump-height-max meters :offset-assert 8) (duck-jump-height-min meters :offset-assert 12) (duck-jump-height-max meters :offset-assert 16) (turn-frames float :offset-assert 20) - (wall-kick-window seconds :offset-assert 24) + (wall-kick-window time-frame :offset-assert 24) (cushion meters :offset-assert 32) (trickx-jump-height-min meters :offset-assert 36) (trickx-jump-height-max meters :offset-assert 40) @@ -34073,36 +34789,34 @@ (tricky-jump-height-max meters :offset-assert 48) (trickz-jump-height-min meters :offset-assert 52) (trickz-jump-height-max meters :offset-assert 56) - (charge-jump-time seconds :offset-assert 64) - (charge-jump-fade-time seconds :offset-assert 72) + (charge-jump-time time-frame :offset-assert 64) + (charge-jump-fade-time time-frame :offset-assert 72) (charge-jump-height meters :offset-assert 80) - (zap-duration uint64 :offset-assert 88) - (zap-reset-time uint64 :offset-assert 96) + (zap-duration time-frame :offset-assert 88) + (zap-reset-time time-frame :offset-assert 96) ) :method-count-assert 9 :size-assert #x68 :flag-assert #x900000068 ) -|# -;; (define-extern *TARGET_BOARD-bank* target-board-bank) ;; target-board-bank -;; (define-extern want-to-board? function) ;; (function symbol :behavior target) -;; (define-extern *board-shadow-control* shadow-control) ;; shadow-control +(define-extern *TARGET_BOARD-bank* target-board-bank) +(define-extern want-to-board? (function symbol :behavior target)) +(define-extern *board-shadow-control* shadow-control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; darkjak-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype darkjak-info (basic) ((process (pointer target) :offset-assert 4) ;; guessed by decompiler - (latch-out-time uint64 :offset-assert 8) + (latch-out-time time-frame :offset-assert 8) (attack-id uint32 :offset-assert 16) - (start-time uint64 :offset-assert 24) ;; time-frame - (attack-time uint64 :offset-assert 32) ;; time-frame + (start-time time-frame :offset-assert 24) ;; time-frame + (attack-time time-frame :offset-assert 32) ;; time-frame (attack-count uint64 :offset-assert 40) (lightning-count int32 :offset-assert 48) - (charge-effect uint64 :offset-assert 56) + (charge-effect handle :offset-assert 56) (stage darkjak-stage :offset-assert 64) ;; guessed by decompiler (want-stage darkjak-stage :offset-assert 68) ;; guessed by decompiler (clock-pos float :offset-assert 72) @@ -34120,66 +34834,67 @@ (darkjak-info-method-9 () none) ;; 9 ;; (update-clock! (_type_ int) none) ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; indax-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype indax-info (basic) - ((indax-start-time uint64 :offset-assert 8) ;; time-frame - (indax-time uint64 :offset-assert 16) ;; time-frame - (indax-hang-start-time uint64 :offset-assert 24) + ((indax-start-time time-frame :offset-assert 8) ;; time-frame + (indax-time time-frame :offset-assert 16) ;; time-frame + (indax-hang-start-time time-frame :offset-assert 24) (art-group-backup art-group :offset-assert 32) ;; guessed by decompiler + (pad object) ;; added ) :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; flut-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype flut-info (basic) - ((entity basic :offset-assert 4) + ((entity entity-actor :offset-assert 4) (flut-trans vector :inline :offset-assert 16) (flut-quat vector :inline :offset-assert 32) (flut-scale vector :inline :offset-assert 48) (prev-quat quaternion :inline :offset-assert 64) - (stick-lock basic :offset-assert 80) + (stick-lock symbol :offset-assert 80) (flap-sound-id uint32 :offset-assert 84) (mode-sound-bank connection :offset-assert 88) (mode basic :offset-assert 92) (color-index int32 :offset-assert 96) - (as-daxter? basic :offset-assert 100) - (art-group-backup basic :offset-assert 104) - (flut-start-time uint64 :offset-assert 112) - (wild-turn-time uint64 :offset-assert 120) - (wild-turn-rate deg :offset-assert 128) + (as-daxter? symbol :offset-assert 100) + (art-group-backup art-group :offset-assert 104) + (flut-start-time time-frame :offset-assert 112) + (wild-turn-time time-frame :offset-assert 120) + (wild-turn-rate degrees :offset-assert 128) (attack-id uint32 :offset-assert 132) ) :method-count-assert 9 :size-assert #x88 :flag-assert #x900000088 ) -|# -#| +;; +++flut-h:flut-flag +(defenum flut-flag + :type uint64 + :bitfield #t + ) +;; ---flut-h:flut-flag + (deftype flut (process-focusable) ((extra-trans vector :inline :offset-assert 208) (condition int32 :offset-assert 224) - (shadow-backup basic :offset-assert 228) - (rider uint64 :offset-assert 232) - (nav-sphere-handle uint64 :offset-assert 240) - (probe-time uint64 :offset-assert 248) + (shadow-backup shadow-geo :offset-assert 228) + (rider handle :offset-assert 232) + (nav-sphere-handle handle :offset-assert 240) + (probe-time time-frame :offset-assert 248) (count-lock basic :offset-assert 256) - (flags uint64 :offset-assert 264) + (flags flut-flag :offset-assert 264) (mode basic :offset-assert 272) (color-index int32 :offset-assert 276) (minimap connection-minimap :offset-assert 280) @@ -34197,8 +34912,6 @@ (flut-method-34 () none) ;; 34 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-util ;; @@ -34319,47 +35032,47 @@ :flag-assert #x9000002c4 ) -(define-extern *target-shadow-control* shadow-control) ;; shadow-control -(define-extern *TARGET-bank* target-bank) ;; target-bank -;; (define-extern target-start-attack function) ;; (function none :behavior target) -;; (define-extern target-danger-set! function) ;; (function symbol symbol none :behavior target) -;; (define-extern target-collide-set! function) ;; (function symbol float int :behavior target) -;; (define-extern target-skel-group function) -;; (define-extern debounce-speed function) ;; (function float float vector vector float :behavior target) -;; (define-extern target-align-vel-z-adjust function) ;; (function float float :behavior target) -;; (define-extern average-turn-angle function) ;; (function target float) -;; (define-extern can-play-stance-amibent? function) ;; (function symbol :behavior target) -;; (define-extern target-height-above-ground function) ;; (function float :behavior target) -;; (define-extern find-collision-below function) -;; (define-extern can-jump? function) ;; (function symbol symbol :behavior target) -;; (define-extern target-jump-go function) ;; (function none :behavior target) -;; (define-extern move-legs? function) ;; (function symbol :behavior target) -;; (define-extern jump-hit-ground-stuck? function) ;; (function symbol :behavior target) -;; (define-extern target-time-to-ground function) ;; (function time-frame :behavior target) -;; (define-extern fall-test function) ;; (function (state symbol target) float none :behavior target) -;; (define-extern slide-down-test function) ;; (function none :behavior target) -;; (define-extern smack-surface? function) ;; (function symbol symbol :behavior target) -;; (define-extern can-roll? function) ;; (function symbol :behavior target) -;; (define-extern can-duck? function) ;; (function symbol :behavior target) -;; (define-extern can-exit-duck? function) ;; (function target symbol) -;; (define-extern can-hands? function) ;; (function symbol symbol :behavior target) -;; (define-extern can-feet? function) ;; (function symbol symbol :behavior target) -;; (define-extern are-still? function) ;; (function symbol :behavior target) -;; (define-extern vector-local+! function) ;; (function vector vector vector :behavior target) -;; (define-extern move-forward function) ;; (function float vector :behavior target) -;; (define-extern set-forward-vel function) ;; (function float vector :behavior target) -;; (define-extern delete-back-vel function) ;; (function none :behavior target) -;; (define-extern set-side-vel function) ;; (function float vector :behavior target) -;; (define-extern target-timed-invulnerable function) ;; (function time-frame target int none) -;; (define-extern target-timed-invulnerable-off function) ;; (function target int none) -;; (define-extern target-log-attack function) ;; (function attack-info symbol symbol :behavior target) -;; (define-extern ground-tween-initialize function) ;; (function ground-tween-info uint uint uint uint uint uint float ground-tween-info :behavior target) -;; (define-extern ground-tween-update function) ;; (function ground-tween-info float float float none :behavior target) +(define-extern *target-shadow-control* shadow-control) +(define-extern *TARGET-bank* target-bank) +(define-extern target-start-attack (function none :behavior target)) +(define-extern target-danger-set! (function symbol symbol none :behavior target)) +(define-extern target-collide-set! (function symbol float int :behavior target)) +(define-extern target-skel-group (function skeleton-group)) +(define-extern debounce-speed (function float float vector vector float :behavior target)) +(define-extern target-align-vel-z-adjust (function float float :behavior target)) +(define-extern average-turn-angle (function target float)) +(define-extern can-play-stance-amibent? (function symbol :behavior target)) +(define-extern target-height-above-ground (function float :behavior target)) +(define-extern find-collision-below (function vector vector float symbol)) +(define-extern can-jump? (function symbol symbol :behavior target)) +(define-extern target-jump-go (function none :behavior target)) +(define-extern move-legs? (function symbol :behavior target)) +(define-extern jump-hit-ground-stuck? (function symbol :behavior target)) +(define-extern target-time-to-ground (function time-frame :behavior target)) +(define-extern fall-test (function (state symbol target) float none :behavior target)) +(define-extern slide-down-test (function none :behavior target)) +(define-extern smack-surface? (function symbol symbol :behavior target)) +(define-extern can-roll? (function symbol :behavior target)) +(define-extern can-duck? (function symbol :behavior target)) +(define-extern can-exit-duck? (function target symbol)) +(define-extern can-hands? (function symbol symbol :behavior target)) +(define-extern can-feet? (function symbol symbol :behavior target)) +(define-extern are-still? (function symbol :behavior target)) +(define-extern vector-local+! (function vector vector vector :behavior target)) +(define-extern move-forward (function float vector :behavior target)) +(define-extern set-forward-vel (function float vector :behavior target)) +(define-extern delete-back-vel (function none :behavior target)) +(define-extern set-side-vel (function float vector :behavior target)) +(define-extern target-timed-invulnerable (function time-frame target int none)) +(define-extern target-timed-invulnerable-off (function target int none)) +(define-extern target-log-attack (function attack-info symbol symbol :behavior target)) +(define-extern ground-tween-initialize (function ground-tween-info uint uint uint uint uint uint float ground-tween-info :behavior target)) +(define-extern ground-tween-update (function ground-tween-info float float float none :behavior target)) (define-extern target-pos (function int vector)) -;; (define-extern target-cam-pos function) ;; (function vector) -;; (define-extern target-rot function) ;; (function quaternion) -;; (define-extern external-target-spawn function) -;; (define-extern target-reset-on-task-finish function) +(define-extern target-cam-pos (function vector)) +(define-extern target-rot (function quaternion)) +(define-extern external-target-spawn (function vector quaternion process symbol manipy-options (pointer process))) +(define-extern target-reset-on-task-finish (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-part ;; @@ -34376,12 +35089,12 @@ ;; (define-extern spt-birth-func-part-droppings-for function) ;; (define-extern spt-birth-func-part-slide-droppings-for function) ;; (define-extern spt-birth-func-part-jump-droppings-for function) -;; (define-extern process-drawable-burn-effect function) ;; (function time-frame rgbaf :behavior target) +(define-extern process-drawable-burn-effect (function time-frame rgbaf :behavior target)) (define-extern lightning-probe-callback (function lightning-tracker none)) ;; (define-extern process-drawable-shock-effect-replace function) (define-extern process-drawable-shock-effect (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher int int float object)) ;; (define-extern process-drawable-shock-wall-effect function) ;; (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher symbol) -;; (define-extern process-drawable2-shock-effect function) ;; (function process-drawable process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher none) +(define-extern process-drawable2-shock-effect (function process-drawable process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher none)) ;; (define-extern process-drawable-shock-skel-effect function) ;; (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher float int int none) (define-extern *lightning-darkjak-pill* lightning-spec) @@ -34442,124 +35155,121 @@ ;; collide-reaction-target ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern poly-find-nearest-edge function) ;; (function nav-poly (inline-array vector) vector vector nav-poly) -;; (define-extern target-collision-low-coverage function) ;; (function control-info collide-query vector (pointer cshape-reaction-flags) (pointer collide-status) (pointer symbol) none) -;; (define-extern target-collision-reaction function) ;; (function control-info collide-query vector vector collide-status :behavior target) -;; (define-extern target-collision-no-reaction function) ;; (function control-info collide-query vector vector none) -;; (define-extern *collide-edge-board-spec* object) ;; collide-edge-spec +(define-extern poly-find-nearest-edge (function nav-poly (inline-array vector) vector vector nav-poly)) +(define-extern target-collision-low-coverage (function control-info collide-query vector (pointer cshape-reaction-flags) (pointer collide-status) (pointer symbol) none)) +(define-extern target-collision-reaction (function control-info collide-query vector vector collide-status :behavior target)) +(define-extern target-collision-no-reaction (function control-info collide-query vector vector none)) +(define-extern *collide-edge-board-spec* collide-edge-spec) (define-extern rail-surface-touch (function none :behavior target)) -(define-extern gravel-surface-touch (function none)) -(define-extern mushroom-surface-touch (function none)) +(define-extern gravel-surface-touch (function none :behavior target)) +(define-extern mushroom-surface-touch (function none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; logic-target ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern build-conversions function) ;; (function vector vector :behavior target) -;; (define-extern vector-turn-to function) ;; (function vector vector :behavior target) -;; (define-extern reverse-conversions function) ;; (function vector none :behavior target) -;; (define-extern draw-history function) ;; (function control-info none) -;; (define-extern target-history-print function) -;; (define-extern target-print-stats function) ;; (function target symbol symbol) -;; (define-extern read-pad function) ;; (function vector vector :behavior target) -;; (define-extern set-pad function) ;; (function vector vector :behavior target) -;; (define-extern warp-vector-into-surface! function) ;; (function vector vector vector matrix vector) -;; (define-extern vector<-pad-in-surface! function) ;; (function vector symbol vector :behavior target) -;; (define-extern vector<-pad-in-matrix! function) ;; (function vector cpad-info matrix none) -;; (define-extern local-pad-angle function) ;; (function float :behavior target) -;; (define-extern turn-around? function) ;; (function symbol :behavior target) -;; (define-extern wall-hide? function) ;; (function symbol :behavior target) -;; (define-extern target-log-trans function) ;; (function none :behavior target) -;; (define-extern target-move-dist function) ;; (function time-frame float :behavior target) -;; (define-extern turn-to-vector function) ;; (function vector float symbol :behavior target) -;; (define-extern target-bend-vel-turn function) ;; (function vector vector :behavior target) -;; (define-extern target-add-slide-factor function) ;; (function vector vector :behavior target) -;; (define-extern add-thrust function) ;; (function symbol :behavior target) -;; (define-extern add-gravity function) ;; (function vector :behavior target) -;; (define-extern target-compute-slopes function) ;; (function vector int :behavior target) -;; (define-extern do-rotations1 function) ;; (function quaternion :behavior target) -;; (define-extern *strafe-mode* object) -;; (define-extern do-rotations2 function) ;; (function int :behavior target) -;; (define-extern leg-ik-callback function) ;; (function joint-mod-ik object object vector none) -;; (define-extern target-update-ik function) ;; (function none :behavior target) -;; (define-extern pre-collide-setup function) ;; (function none :behavior target) -;; (define-extern level-setup function) ;; (function none :behavior target) -;; (define-extern flag-setup function) ;; (function none :behavior target) -;; (define-extern post-flag-setup function) ;; (function none :behavior target) -;; (define-extern bend-gravity function) ;; (function symbol :behavior target) -;; (define-extern target-compute-edge function) ;; (function none :behavior target) -;; (define-extern target-compute-edge-rider function) ;; (function none :behavior target) -;; (define-extern target-compute-pole function) ;; (function none :behavior target) -;; (define-extern target-calc-camera-pos function) ;; (function none :behavior target) -;; (define-extern joint-points function) ;; (function none :behavior target) -;; (define-extern do-target-gspot function) ;; (function none :behavior target) -;; (define-extern target-real-post function) ;; (function none :behavior target) -;; (define-extern target-post function) ;; (function none :behavior target) -;; (define-extern target-swim-post function) ;; (function none :behavior target) -;; (define-extern target-no-stick-post function) ;; (function none :behavior target) -;; (define-extern target-no-move-post function) ;; (function none :behavior target) -;; (define-extern target-no-ja-move-post function) ;; (function none :behavior target) -;; (define-extern reset-target-state function) ;; (function symbol target :behavior target) -;; (define-extern target-init function) ;; (function continue-point none :behavior target) -;; (define-extern tobot-init function) ;; (function symbol none :behavior target) +(define-extern build-conversions (function vector vector :behavior target)) +(define-extern vector-turn-to (function vector vector :behavior target)) +(define-extern reverse-conversions (function vector none :behavior target)) +(define-extern draw-history (function control-info none)) +(define-extern target-history-print function) +(define-extern target-print-stats (function target symbol symbol)) +(define-extern read-pad (function vector vector :behavior target)) +(define-extern set-pad (function vector vector :behavior target)) +(define-extern warp-vector-into-surface! (function vector vector vector matrix vector)) +(define-extern vector<-pad-in-surface! (function vector symbol vector :behavior target)) +(define-extern vector<-pad-in-matrix! (function vector cpad-info matrix none)) +(define-extern local-pad-angle (function float :behavior target)) +(define-extern turn-around? (function symbol :behavior target)) +(define-extern wall-hide? (function symbol :behavior target)) +(define-extern target-log-trans (function none :behavior target)) +(define-extern target-move-dist (function time-frame float :behavior target)) +(define-extern turn-to-vector (function vector float symbol :behavior target)) +(define-extern target-bend-vel-turn (function vector vector :behavior target)) +(define-extern target-add-slide-factor (function vector vector :behavior target)) +(define-extern add-thrust (function symbol :behavior target)) +(define-extern add-gravity (function vector :behavior target)) +(define-extern target-compute-slopes (function vector int :behavior target)) +(define-extern do-rotations1 (function quaternion :behavior target)) +(define-extern *strafe-mode* symbol) +(define-extern do-rotations2 (function int :behavior target)) +(define-extern leg-ik-callback (function joint-mod-ik object object vector none)) +(define-extern target-update-ik (function none :behavior target)) +(define-extern pre-collide-setup (function none :behavior target)) +(define-extern level-setup (function none :behavior target)) +(define-extern flag-setup (function none :behavior target)) +(define-extern post-flag-setup (function none :behavior target)) +(define-extern bend-gravity (function symbol :behavior target)) +(define-extern target-compute-edge (function none :behavior target)) +(define-extern target-compute-edge-rider (function none :behavior target)) +(define-extern target-compute-pole (function none :behavior target)) +(define-extern target-calc-camera-pos (function none :behavior target)) +(define-extern joint-points (function none :behavior target)) +(define-extern do-target-gspot (function none :behavior target)) +(define-extern target-real-post (function none :behavior target)) +(define-extern target-post (function none :behavior target)) +(define-extern target-swim-post (function none :behavior target)) +(define-extern target-no-stick-post (function none :behavior target)) +(define-extern target-no-move-post (function none :behavior target)) +(define-extern target-no-ja-move-post (function none :behavior target)) +(define-extern reset-target-state (function symbol target :behavior target)) +(define-extern target-init (function continue-point none :behavior target)) +(define-extern tobot-init (function symbol none :behavior target)) (define-extern stop (function symbol int)) (define-extern start (function symbol continue-point target)) -;; (define-extern tobot-start function) ;; (function symbol target) -;; (define-extern tobot-stop function) ;; (function int) -;; (define-extern *target-geo-control* object) -;; (define-extern *target-anim-control* object) +(define-extern tobot-start (function symbol target)) +(define-extern tobot-stance (state target)) +(define-extern tobot-stop (function int)) +(define-extern *target-geo-control* external-art-buffer) +(define-extern *target-anim-control* external-art-buffer) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sidekick ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *sidekick-remap* object) ;; pair -;; (define-extern cspace<-cspace+transformq! function) ;; (function cspace cspace transformq matrix) -;; (define-extern target-sidekick-setup function) ;; (function symbol none :behavior target) -;; (define-extern init-sidekick function) ;; (function none :behavior sidekick) +(define-extern *sidekick-remap* pair) +(define-extern cspace<-cspace+transformq! (function cspace cspace transformq matrix)) +(define-extern target-sidekick-setup (function symbol none :behavior target)) +(define-extern init-sidekick (function object :behavior sidekick)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; voicebox ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype camera-remote (camera-slave) () :method-count-assert 14 :size-assert #xac0 :flag-assert #xe0a400ac0 ) -|# -#| (deftype remote (process-drawable) - ((base-trans vector :inline :offset-assert 208) + ((parent (pointer camera-slave) :override) + (base-trans vector :inline :offset-assert 208) (focus focus :inline :offset-assert 224) (seeker cam-float-seeker :inline :offset-assert 236) - (start-time uint64 :offset-assert 264) ;; time-frame + (start-time time-frame :offset-assert 264) ;; time-frame (blend float :offset-assert 272) (twist float :offset-assert 276) - (speak-effect? basic :offset-assert 280) + (speak-effect? symbol :offset-assert 280) ) :method-count-assert 26 :size-assert #x11c :flag-assert #x1a00a0011c - (:methods - (remote-method-23 () none) ;; 23 ;; (init (_type_) none) - (remote-method-24 () none) ;; 24 ;; (get-track-pt-and-scale (_type_ vector) float) - (remote-method-25 () none) ;; 25 ;; (post-common (_type_) none) - ) (:state-methods - exit ;; 22, old: (exit () _type_ :state) - idle ;; 21, old: (idle () _type_ :state) enter ;; 20, old: (enter () _type_ :state) + idle ;; 21, old: (idle () _type_ :state) + exit ;; 22, old: (exit () _type_ :state) + ) + (:methods + (init (_type_) none) ;; 23 + (get-track-pt-and-scale (_type_ vector) float) ;; 24 + (post-common (_type_) none) ;; 25 ) ) -|# -#| (deftype voicebox (remote) - ((hint uint64 :offset-assert 288) ;; handle + ((hint handle :offset-assert 288) ;; handle ) :method-count-assert 26 :size-assert #x128 @@ -34568,36 +35278,33 @@ exit ;; 22 ) ) -|# -#| (deftype judge (remote) - ((total-time uint64 :offset-assert 288) ;; time-frame - (beep-time uint64 :offset-assert 296) ;; time-frame - (hud-timer uint64 :offset-assert 304) ;; handle + ((root collide-shape :override) + (total-time time-frame :offset-assert 288) ;; time-frame + (beep-time time-frame :offset-assert 296) ;; time-frame + (hud-timer handle :offset-assert 304) ;; handle (score uint8 :offset-assert 312) - (timer? basic :offset-assert 316) + (timer? symbol :offset-assert 316) ) :method-count-assert 28 :size-assert #x140 :flag-assert #x1c00c00140 - (:methods - (judge-method-27 () none) ;; 27 ;; (setup-collision (_type_) none) - ) (:state-methods - idle ;; 21 enter ;; 20 + idle ;; 21 wait ;; 26, old: (wait () _type_ :state) ) + (:methods + (setup-collision! (_type_) none) ;; 27 + ) ) -|# -;; (define-extern remote-track function) ;; (function none :behavior remote) -;; (define-extern cam-remote state) ;; (state camera-slave) -;; (define-extern voicebox-init-by-other function) ;; (function vector handle none :behavior voicebox) -;; (define-extern voicebox-spawn function) ;; (function process-drawable vector (pointer process)) -;; (define-extern judge-init-by-other function) ;; (function vector uint none :behavior judge) -;; (define-extern judge-spawn function) ;; (function process-tree vector uint (pointer judge)) +(define-extern remote-track (function none :behavior remote)) +(define-extern voicebox-init-by-other (function vector handle none :behavior voicebox)) +(define-extern voicebox-spawn (function process-drawable vector (pointer process))) +(define-extern judge-init-by-other (function vector uint symbol object :behavior judge)) +(define-extern judge-spawn (function process-tree vector uint object (pointer judge))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collectables-part ;; @@ -34619,12 +35326,11 @@ ;; find-nearest ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype search-info (structure) ((point vector :inline :offset-assert 0) (best-point vector :inline :offset-assert 16) - (match-handle uint64 :offset-assert 32) ;; handle - (match basic :offset-assert 40) + (match-handle handle :offset-assert 32) ;; handle + (match process-focusable :offset-assert 40) (best float :offset-assert 44) (radius float :offset-assert 48) (rating search-info-flag :offset-assert 52) @@ -34638,16 +35344,22 @@ :size-assert #x64 :flag-assert #x900000064 ) -|# -;; (define-extern *search-info* object) ;; search-info -;; (define-extern find-nearest-focusable function) ;; (function (array collide-shape) vector float search-info-flag search-info-flag vector vector float basic) +(define-extern *search-info* search-info) +(define-extern find-nearest-focusable (function (array collide-shape) vector float search-info-flag search-info-flag vector vector float process-focusable)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; task-arrow ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(deftype cquery-with-vec (structure) + "task-arrow::23" + ((cquery collide-query :inline) + (vec0 vector :inline) + (vec1 vector :inline) + ) + ) + (deftype task-arrow (process-drawable) ((pos vector :inline :offset-assert 208) (theta float :offset-assert 224) @@ -34658,73 +35370,71 @@ (flags task-arrow-flags :offset-assert 244) ;; guessed by decompiler (map-icon uint16 :offset-assert 248) (minimap connection-minimap :offset-assert 252) - (hud-dist uint64 :offset-assert 256) ;; handle + (hud-dist handle :offset-assert 256) ;; handle (base-quat quaternion :inline :offset-assert 272) (base-scale float :offset-assert 288) (rod-of-god-scale float :offset-assert 292) (moving symbol :offset-assert 296) ;; guessed by decompiler - (death-pending? basic :offset-assert 300) + (death-pending? symbol :offset-assert 300) (alpha float :offset-assert 304) - (choir-sound basic :offset-assert 308) + (choir-sound ambient-sound :offset-assert 308) (draw-back basic :offset-assert 312) ) :method-count-assert 25 :size-assert #x13c :flag-assert #x1900c0013c - (:methods - (task-arrow-method-23 () none) ;; 23 ;; (task-arrow-method-23 (_type_ vector) none) - (task-arrow-method-24 () none) ;; 24 ;; (draw-arrow (_type_) none) - ) (:state-methods + idle ;; 20, old: (idle () _type_ :state) die ;; 21, old: (die () _type_ :state) leave ;; 22, old: (leave () _type_ :state) - idle ;; 20, old: (idle () _type_ :state) + ) + (:methods + (task-arrow-method-23 (_type_ vector) none) ;; 23 + (draw-arrow (_type_) none) ;; 24 ) ) -|# -;; (define-extern task-arrow-init-by-other function) ;; (function task-arrow-params task-arrow :behavior task-arrow) -;; (define-extern task-arrow-spawn function) ;; (function task-arrow-params process-tree process) +(define-extern task-arrow-init-by-other (function task-arrow-params object :behavior task-arrow)) +(define-extern task-arrow-spawn (function task-arrow-params process-tree process)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; projectile ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern cshape-reaction-projectile function) ;; (function control-info collide-query vector vector collide-status) -;; (define-extern projectile-event-handler function) ;; (function process int symbol event-message-block projectile :behavior projectile) -;; (define-extern projectile-move-fill-all-dirs function) ;; (function projectile none) -;; (define-extern projectile-move-fill-line-sphere function) ;; (function projectile none) -;; (define-extern projectile-update-velocity-add-gravity function) ;; (function projectile none) -;; (define-extern projectile-update-velocity-space-wars function) ;; (function projectile none) -(define-extern projectile-init-by-other (function projectile-init-by-other-params projectile :behavior projectile)) -;; (define-extern projectile-bounce-update-velocity function) ;; (function projectile-bounce none :behavior projectile) -;; (define-extern projectile-bounce-falling-post function) ;; (function none :behavior projectile-bounce) -;; (define-extern projectile-bounce-move function) ;; (function projectile-bounce none) -;; (define-extern projectile-bounce-reaction function) ;; (function control-info collide-query vector vector collide-status) +(define-extern cshape-reaction-projectile (function control-info collide-query vector vector collide-status)) +(define-extern projectile-event-handler (function process int symbol event-message-block projectile :behavior projectile)) +(define-extern projectile-move-fill-all-dirs (function projectile none)) +(define-extern projectile-move-fill-line-sphere (function projectile none)) +(define-extern projectile-update-velocity-add-gravity (function projectile none)) +(define-extern projectile-update-velocity-space-wars (function projectile none)) +(define-extern projectile-init-by-other (function projectile-init-by-other-params object :behavior projectile)) +(define-extern projectile-bounce-update-velocity (function projectile-bounce none :behavior projectile)) +(define-extern projectile-bounce-falling-post (function none :behavior projectile-bounce)) +(define-extern projectile-bounce-move (function projectile-bounce none)) +(define-extern projectile-bounce-reaction (function control-info collide-query vector vector collide-status)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ragdoll ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern ragdoll-matrix-interp function) -;; (define-extern ragdoll-joint-callback function) -;; (define-extern ragdoll-other-joint-callback function) -;; (define-extern ragdoll-reflect-matrix function) -;; (define-extern ragdoll-proc-init-by-other function) +(define-extern ragdoll-matrix-interp function) +(define-extern ragdoll-joint-callback function) +(define-extern ragdoll-other-joint-callback function) +(define-extern ragdoll-reflect-matrix (function matrix vector vector vector)) +(define-extern ragdoll-proc-init-by-other (function ragdoll-setup object :behavior ragdoll-proc)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ragdoll-edit ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern matrix->axis-angle function) -;; (define-extern show-maya-skeleton function) -;; (define-extern ragdoll-print-default-joints function) +(define-extern matrix->axis-angle (function vector matrix float)) +(define-extern show-maya-skeleton (function process-drawable int int none)) +(define-extern ragdoll-print-default-joints (function process-drawable none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; lightjak-wings ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wings-ragdoll (ragdoll) ((which-chain int8 :offset-assert 11980) (chain-pos int8 :offset-assert 11981) @@ -34733,164 +35443,153 @@ :size-assert #x2ece :flag-assert #x1a00002ece ) -|# -;; (define-extern *jchar-wings-ragdoll-setup* object) -;; (define-extern wings-post function) -;; (define-extern wings-init function) -;; (define-extern wings-ragdoll-proc-init-by-other function) +(define-extern *jchar-wings-ragdoll-setup* ragdoll-setup) +(define-extern wings-post (function none :behavior wings)) +(define-extern wings-init (function symbol none :behavior wings)) +(define-extern wings-ragdoll-proc-init-by-other (function ragdoll-proc object :behavior wings-ragdoll-proc)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-handler ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern target-shoved function) ;; (function meters meters process (state object object target) object :behavior target) -;; (define-extern attack-mode-is-invinc function) ;; (function symbol symbol) -;; (define-extern target-attacked function) ;; (function symbol attack-info process touching-shapes-entry (state symbol attack-info target) object :behavior target) -;; (define-extern target-got-impact-impulse function) -;; (define-extern target-darkjak-effect-trans function) -;; (define-extern target-send-attack function) ;; (function process symbol touching-shapes-entry int int penetrate symbol :behavior target) -;; (define-extern target-generic-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-standard-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-dangerous-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-bonk-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-jump-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-walk-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-exit function) ;; (function none :behavior target) -;; (define-extern target-state-hook-exit function) ;; (function none :behavior target) -;; (define-extern target-effect-exit function) ;; (function none :behavior target) +(define-extern target-shoved (function meters meters process (state object object target) object :behavior target)) +(define-extern attack-mode-is-invinc (function symbol symbol symbol)) +(define-extern target-attacked (function symbol attack-info process touching-shapes-entry (state symbol attack-info target) object :behavior target)) +(define-extern target-got-impact-impulse (function rigid-body-impact symbol :behavior target)) +(define-extern target-darkjak-effect-trans (function handle (pointer process-drawable) (pointer time-frame) time-frame none :behavior target)) +(define-extern target-send-attack (function process symbol touching-shapes-entry int int penetrate symbol :behavior target)) +(define-extern target-generic-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-standard-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-dangerous-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-bonk-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-jump-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-walk-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-exit (function none :behavior target)) +(define-extern target-state-hook-exit (function none :behavior target)) +(define-extern target-effect-exit (function none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-anim ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern target-land-anim function) ;; (function art-element :behavior target) -;; (define-extern target-stance-anim function) ;; (function none :behavior target) -;; (define-extern target-stance-push function) ;; (function int none :behavior target) -;; (define-extern target-falling-anim function) ;; (function int time-frame symbol :behavior target) -;; (define-extern target-falling-anim-trans function) ;; (function none :behavior target) -;; (define-extern target-walk-anim function) ;; (function int none :behavior target) -;; (define-extern target-hit-ground-flop-anim function) ;; (function symbol symbol none :behavior target) -;; (define-extern target-hit-ground-anim function) ;; (function symbol symbol none :behavior target) -;; (define-extern target-attack-air-anim function) ;; (function none :behavior target) -;; (define-extern target-edge-grab-anim function) ;; (function float none :behavior target) +(define-extern target-land-anim (function art-element :behavior target)) +(define-extern target-stance-anim (function none :behavior target)) +(define-extern target-stance-push (function int none :behavior target)) +(define-extern target-falling-anim (function int time-frame symbol :behavior target)) +(define-extern target-falling-anim-trans (function none :behavior target)) +(define-extern target-walk-anim (function int none :behavior target)) +(define-extern target-hit-ground-flop-anim (function symbol symbol none :behavior target)) +(define-extern target-hit-ground-anim (function symbol symbol none :behavior target)) +(define-extern target-attack-air-anim (function none :behavior target)) +(define-extern target-edge-grab-anim (function float none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern target-falling-trans function) ;; (function symbol time-frame none :behavior target) -;; (define-extern *slide-down-mods* surface) ;; surface -;; (define-extern *slide-jump-mods* surface) ;; surface -;; (define-extern init-var-jump function) ;; (function float float symbol symbol vector float vector :behavior target) -;; (define-extern mod-var-jump function) ;; (function symbol symbol symbol vector vector :behavior target) -;; (define-extern *duck-mods* surface) ;; surface -;; (define-extern target-jump-top-anim function) ;; (function none :behavior target) -;; (define-extern *attack-mods* surface) ;; surface -;; (define-extern *attack-end-mods* object) ;; surface -;; (define-extern *attack-find-mods* object) -;; (define-extern *run-attack-mods* surface) ;; surface -;; (define-extern *jump-attack-mods* surface) ;; surface -;; (define-extern *uppercut-mods* object) ;; surface -;; (define-extern *uppercut-jump-mods* surface) ;; surface +(define-extern target-falling-trans (function symbol time-frame symbol none :behavior target)) +(define-extern *slide-down-mods* surface) +(define-extern *slide-jump-mods* surface) +(define-extern init-var-jump (function float float symbol symbol vector float vector :behavior target)) +(define-extern mod-var-jump (function symbol symbol symbol vector vector :behavior target)) +(define-extern *duck-mods* surface) +(define-extern target-jump-top-anim (function none :behavior target)) +(define-extern *attack-mods* surface) +(define-extern *attack-end-mods* surface) +(define-extern *attack-find-mods* surface) +(define-extern *run-attack-mods* surface) +(define-extern *jump-attack-mods* surface) +(define-extern *uppercut-mods* surface) +(define-extern *uppercut-jump-mods* surface) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target2 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *trip-mods* object) ;; surface -;; (define-extern *look-around-mods* object) ;; surface -;; (define-extern *hit-ground-hard-mods* object) ;; surface -;; (define-extern *hide-mods* surface) ;; surface -;; (define-extern *float-mods* object) ;; surface -;; (define-extern *blast-recover-mods* object) +(define-extern *trip-mods* surface) +(define-extern *look-around-mods* surface) +(define-extern *hit-ground-hard-mods* surface) +(define-extern *hide-mods* surface) +(define-extern *float-mods* surface) +(define-extern *blast-recover-mods* surface) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-swim ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern target-swim-tilt function) ;; (function float float float float float :behavior target) -;; (define-extern target-swim-stance object) ;; (state target) -;; (define-extern target-swim-walk object) ;; (state target) -;; (define-extern target-swim-down object) ;; (state target) -;; (define-extern target-swim-up object) ;; (state target) -;; (define-extern target-swim-jump-jump object) ;; (state float float surface target) +(define-extern target-swim-tilt (function float float float float float :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-darkjak ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype darkjak-ball (projectile) - ((impact? basic :offset-assert 512) + ((impact? symbol :offset-assert 512) (fire-point vector :inline :offset-assert 528) (explode-sound uint32 :offset-assert 544) (bolts basic :offset-assert 548) - (ball-pos UNKNOWN 2 :offset-assert 560) - (trail basic :offset-assert 592) - (ball1 basic :offset-assert 596) + (ball-pos vector 2 :inline :offset-assert 560) + (trail light-trail :offset-assert 592) + (ball1 sparticle-launch-control :offset-assert 596) (last-ground-height float :offset-assert 600) - (fire-sound uint32 :offset-assert 604) + (fire-sound sound-id :offset-assert 604) ) :method-count-assert 42 :size-assert #x260 :flag-assert #x2a01e00260 - (:methods - (darkjak-ball-method-41 () none) ;; 41 - ) (:state-methods impact ;; 22 ) + (:methods + (darkjak-ball-method-41 () none) ;; 41 + ) ) -|# -;; (define-extern darkjak-ball-slide-reaction function) -;; (define-extern darkjak-ball-move function) -;; (define-extern *darkjak-ball-lightning* object) -;; (define-extern *darkjak-ball-lightning-colors* array) -;; (define-extern sparticle-track-hadouken function) -;; (define-extern target-darkjak-setup function) ;; (function symbol none :behavior target) -;; (define-extern want-to-darkjak? function) ;; (function symbol :behavior target) -;; (define-extern *darkjak-trans-mods* object) ;; surface -;; (define-extern target-darkjak-end-mode function) ;; (function none :behavior target) -;; (define-extern target-darkjak-process function) ;; (function none :behavior target) -;; (define-extern target-darkjak-bomb-collide function) ;; (function float float none :behavior target) -;; (define-extern target-bomb1-fire-shot function) ;; (function (pointer handle) int int int none :behavior target) +(define-extern darkjak-ball-slide-reaction (function none :behavior darkjak-ball)) +(define-extern darkjak-ball-move (function none :behavior darkjak-ball)) +(define-extern *darkjak-ball-lightning* lightning-spec) +(define-extern *darkjak-ball-lightning-colors* (array rgba)) +(define-extern sparticle-track-hadouken (function none)) +(define-extern target-darkjak-setup (function symbol none :behavior target)) +(define-extern want-to-darkjak? (function symbol :behavior target)) +(define-extern *darkjak-trans-mods* surface) +(define-extern target-darkjak-end-mode (function symbol none :behavior target)) +(define-extern target-darkjak-process (function none :behavior target)) +(define-extern target-darkjak-bomb-collide (function float float none :behavior target)) +(define-extern target-bomb1-fire-shot (function (pointer handle) int int int none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-lightjak ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype freeze-screen (process-drawable) ((anim-frame float :offset-assert 200) (transition float :offset-assert 204) - (gui-id-1 uint32 :offset-assert 208) - (gui-id-2 uint32 :offset-assert 212) + (gui-id-1 sound-id :offset-assert 208) + (gui-id-2 sound-id :offset-assert 212) ) :method-count-assert 25 :size-assert #xd8 :flag-assert #x19006000d8 - (:methods - (freeze-screen-method-24 () none) ;; 24 - ) (:state-methods - die ;; 23 - deactive ;; 22 - active ;; 21 idle ;; 20 + active ;; 21 + (deactive symbol) ;; 22 + die ;; 23 + ) + (:methods + (freeze-screen-method-24 (_type_) none) ;; 24 ) ) -|# -#| (deftype freeze-control (process) - ((clock-pos float :offset-assert 128) - (freeze-screen uint64 :offset-assert 136) - (sound-id uint32 :offset-assert 144) - (tick-time uint64 :offset-assert 152) - (abort? basic :offset-assert 160) - (freeze-id uint32 :offset-assert 164) + ((clock-pos float :offset-assert 128) + (freeze-screen handle :offset-assert 136) + (sound-id sound-id :offset-assert 144) + (tick-time time-frame :offset-assert 152) + (abort? symbol :offset-assert 160) + (freeze-id sound-id :offset-assert 164) ) :method-count-assert 15 :size-assert #xa8 @@ -34899,73 +35598,67 @@ idle ;; 14 ) ) -|# -#| (deftype freeze-watcher (process) - ((old-clock basic :offset-assert 128) + ((old-clock clock :offset-assert 128) ) :method-count-assert 15 :size-assert #x84 :flag-assert #xf00100084 (:state-methods - active ;; 14 + (active clock) ;; 14 ) ) -|# -;; (define-extern point-off-screen function) -;; (define-extern *lightjak-trans-mods* object) -;; (define-extern want-to-powerjak? function) -;; (define-extern target-lightjak-setup function) -;; (define-extern want-to-lightjak? function) -;; (define-extern target-lightjak-end-mode function) -;; (define-extern target-lightjak-do-effect function) -;; (define-extern target-lightjak-process function) -;; (define-extern *lightjak-swoop-mods* surface) -;; (define-extern freeze-screen-init function) -;; (define-extern freeze-control-init function) -;; (define-extern freeze-watcher-init function) -;; (define-extern freeze-hit-begin function) -;; (define-extern freeze-hit-end function) -;; (define-extern *heal-mods* object) -;; (define-extern lightjak-shield-init function) +(define-extern point-off-screen (function vector vector)) +(define-extern *lightjak-trans-mods* surface) +(define-extern want-to-powerjak? (function symbol :behavior target)) +(define-extern target-lightjak-setup (function symbol none :behavior target)) +(define-extern want-to-lightjak? (function symbol :behavior target)) +(define-extern target-lightjak-end-mode (function symbol none :behavior target)) +(define-extern target-lightjak-do-effect (function none :behavior target)) +(define-extern target-lightjak-process (function none :behavior target)) +(define-extern *lightjak-swoop-mods* surface) +(define-extern freeze-screen-init (function vector quaternion entity object :behavior freeze-screen)) +(define-extern freeze-control-init (function sound-id object :behavior freeze-control)) +(define-extern freeze-watcher-init (function clock object :behavior freeze-watcher)) +(define-extern freeze-hit-begin (function none :behavior process)) +(define-extern freeze-hit-end (function none :behavior process)) +(define-extern *heal-mods* surface) +(define-extern lightjak-shield-init (function none :behavior lightjak-shield)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-invisible ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype invis-particle-joint (structure) ((joint int16 :offset-assert 0) (distance float :offset-assert 4) (size float :offset-assert 8) - (spawn? basic :offset-assert 12) + (spawn? symbol :offset-assert 12) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype dark-maker-idol (process-drawable) - ((humming-sound basic :offset-assert 200) + ((root collide-shape :override) + (humming-sound ambient-sound :offset-assert 200) ) :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc (:state-methods - active ;; 21 idle ;; 20 + active ;; 21 ) ) -|# -;; (define-extern target-invisible-start function) -;; (define-extern target-invisible-stop function) -;; (define-extern *invis-joint-list* array) -;; (define-extern target-invisible-process function) +(define-extern target-invisible-start (function time-frame none :behavior target)) +(define-extern target-invisible-stop (function none :behavior target)) +(define-extern *invis-joint-list* (array invis-particle-joint)) +(define-extern target-invisible-process (function none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-launch ;; @@ -34976,7 +35669,12 @@ ;; target-death ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(define-extern warp-gate type) +(define-extern htorpedo type) +(define-extern target-turret type) +(define-extern scorpion-gun-manager type) +(define-extern bt-gun-manager type) + (deftype kill-nearby-enemies-info (basic) ((dist float :offset-assert 4) (pos vector :inline :offset-assert 16) @@ -34985,133 +35683,120 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -;; (define-extern *auto-continue* object) ;; symbol -;; (define-extern next-continue function) ;; (function continue-point continue-point) -;; (define-extern arrive-at-continue function) -;; (define-extern apply-pos-from-entity function) -;; (define-extern target-continue-init-art function) -;; (define-extern *smack-mods* surface) ;; surface -;; (define-extern *smack-up-mods* surface) ;; surface -;; (define-extern velocity-set-to-target! function) ;; (function vector float attack-info vector :behavior target) -;; (define-extern target-hit-effect function) ;; (function attack-info none :behavior target) -;; (define-extern target-hit-push function) ;; (function vector matrix float float attack-info symbol :behavior target) -;; (define-extern target-hit-orient function) ;; (function attack-info vector symbol :behavior target) -;; (define-extern target-hit-setup-anim function) ;; (function attack-info none :behavior target) -;; (define-extern target-hit-move function) ;; (function attack-info symbol (function none :behavior target) float none :behavior target) -;; (define-extern *death-spool-array* array) ;; (array spool-anim) -;; (define-extern death-movie-remap function) ;; (function int int int) -;; (define-extern *kill-nearby-enemies-info* kill-nearby-enemies-info) ;; kill-nearby-enemies-info -;; (define-extern kill-nearby-enemies function) ;; (function vector float object) -;; (define-extern target-death-anim-trans function) ;; (function none :behavior target) -;; (define-extern target-death-anim function) ;; (function spool-anim none :behavior target) -;; (define-extern target-death-main function) ;; (function symbol none :behavior target) -;; (define-extern target-death-reset function) ;; (function symbol symbol none :behavior target) +(define-extern *auto-continue* symbol) +(define-extern next-continue (function continue-point continue-point)) +(define-extern arrive-at-continue (function continue-point none :behavior target)) +(define-extern apply-pos-from-entity (function continue-point none :behavior target)) +(define-extern target-continue-init-art (function none :behavior target)) +(define-extern *smack-mods* surface) +(define-extern *smack-up-mods* surface) +(define-extern velocity-set-to-target! (function vector float attack-info vector :behavior target)) +(define-extern target-hit-effect (function attack-info none :behavior target)) +(define-extern target-hit-push (function vector matrix float float attack-info symbol :behavior target)) +(define-extern target-hit-orient (function attack-info vector symbol :behavior target)) +(define-extern target-hit-setup-anim (function attack-info none :behavior target)) +(define-extern target-hit-move (function attack-info symbol (function none :behavior target) float none :behavior target)) +(define-extern *death-spool-array* (array spool-anim)) +(define-extern death-movie-remap (function int int int)) +(define-extern *kill-nearby-enemies-info* kill-nearby-enemies-info) +(define-extern kill-nearby-enemies (function vector float object)) +(define-extern target-death-anim-trans (function none :behavior target)) +(define-extern target-death-anim (function spool-anim none :behavior target)) +(define-extern target-death-main (function symbol none :behavior target)) +(define-extern target-death-reset (function symbol symbol none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-gun ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *gun-walk-mods* surface) ;; surface -;; (define-extern want-to-gun? function) ;; (function target symbol symbol :behavior process) -;; (define-extern target-gun-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-gun-setup function) ;; (function symbol none :behavior target) -;; (define-extern target-gun-init function) ;; (function pickup-type none :behavior target) -;; (define-extern target-gun-exit function) ;; (function symbol) -;; (define-extern target-gun-end-mode function) ;; (function symbol symbol :behavior target) -;; (define-extern quat<-gun! function) ;; (function quaternion quaternion quaternion) -;; (define-extern target-gun-ammo-out-pick function) ;; (function int :behavior target) -;; (define-extern target-gun-type-set! function) ;; (function pickup-type none :behavior target) -;; (define-extern target-gun-marking-menu function) ;; (function target none) -;; (define-extern target-gun-build-track-list function) ;; (function none :behavior target) -;; (define-extern target-gun-find-track function) ;; (function none :behavior target) -;; (define-extern target-top-anim-base-mode function) ;; (function int none :behavior target) -;; (define-extern target-gun-combo-start function) ;; (function int time-frame none :behavior target) -;; (define-extern target-gun-joint-pre0 function) ;; (function none :behavior target) -;; (define-extern target-gun-joint-pre function) ;; (function none :behavior target) -;; (define-extern target-gun-compute-pos function) ;; (function matrix :behavior target) -;; (define-extern target-gun-joint-points function) ;; (function none :behavior target) -;; (define-extern target-gun-fire function) ;; (function pickup-type none :behavior target) -;; (define-extern target-gun-check function) ;; (function none :behavior target) -;; (define-extern camera-rotate-to-vector function) ;; (function vector vector none) -;; (define-extern target-gun-real-post function) ;; (function none :behavior target) -;; (define-extern target-gun-post function) ;; (function none :behavior target) +(define-extern *gun-walk-mods* surface) +(define-extern want-to-gun? (function target symbol symbol :behavior process)) +(define-extern target-gun-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-gun-setup (function symbol none :behavior target)) +(define-extern target-gun-init (function pickup-type none :behavior target)) +(define-extern target-gun-exit (function symbol)) +(define-extern target-gun-end-mode (function symbol symbol :behavior target)) +(define-extern quat<-gun! (function quaternion quaternion quaternion)) +(define-extern target-gun-ammo-out-pick (function int :behavior target)) +(define-extern target-gun-type-set! (function pickup-type none :behavior target)) +(define-extern target-gun-marking-menu (function target none)) +(define-extern target-gun-build-track-list (function none :behavior target)) +(define-extern target-gun-find-track (function none :behavior target)) +(define-extern target-top-anim-base-mode (function int none :behavior target)) +(define-extern target-gun-combo-start (function int time-frame none :behavior target)) +(define-extern target-gun-joint-pre0 (function none :behavior target)) +(define-extern target-gun-joint-pre (function none :behavior target)) +(define-extern target-gun-compute-pos (function matrix :behavior target)) +(define-extern target-gun-joint-points (function none :behavior target)) +(define-extern target-gun-fire (function pickup-type none :behavior target)) +(define-extern target-gun-check (function none :behavior target)) +(define-extern camera-rotate-to-vector (function vector vector none)) +(define-extern target-gun-real-post (function none :behavior target)) +(define-extern target-gun-post (function none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gun-util ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype gun-eject (projectile-bounce) () :method-count-assert 44 :size-assert #x224 :flag-assert #x2c01b00224 ) -|# -#| (deftype gun-mag-yellow (projectile-bounce) () :method-count-assert 44 :size-assert #x224 :flag-assert #x2c01b00224 ) -|# -#| (deftype gun-mag-red (projectile-bounce) () :method-count-assert 44 :size-assert #x224 :flag-assert #x2c01b00224 ) -|# -#| (deftype gun-mag-blue (projectile-bounce) () :method-count-assert 44 :size-assert #x224 :flag-assert #x2c01b00224 ) -|# -#| (deftype gun-mag-dark (projectile-bounce) () :method-count-assert 44 :size-assert #x224 :flag-assert #x2c01b00224 ) -|# -#| (deftype last-gun-fire-time (structure) - ((last-fire-times UNKNOWN 12 :offset-assert 0) + ((last-fire-times time-frame 12 :offset-assert 0) ) :method-count-assert 9 :size-assert #x60 :flag-assert #x900000060 ) -|# -;; (define-extern *beam-info* object) ;; beam-info -;; (define-extern birth-func-setup-beam function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern birth-func-laser-pointer function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern draw-beam function) ;; (function sparticle-launcher vector vector symbol symbol none) -;; (define-extern gun-post function) ;; (function none :behavior gun) -;; (define-extern gun-init function) ;; (function none :behavior gun) -;; (define-extern do-fire-backcheck function) -;; (define-extern get-remaining-player-ammo function) -;; (define-extern adjust-player-ammo function) -;; (define-extern adjust-player-ammo-over-time function) -;; (define-extern truncate-player-ammo function) -;; (define-extern *last-gun-fire-time* object) -;; (define-extern compute-gun-fire-time-index function) -;; (define-extern get-last-fire-time function) -;; (define-extern set-last-fire-time function) +(define-extern *beam-info* beam-info) +(define-extern birth-func-setup-beam (function int sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-laser-pointer (function int sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern draw-beam (function sparticle-launcher vector vector symbol none)) +(define-extern gun-post (function none :behavior gun)) +(define-extern gun-init (function none :behavior gun)) +(define-extern do-fire-backcheck (function vector vector symbol)) +(define-extern get-remaining-player-ammo (function pickup-type float)) +(define-extern adjust-player-ammo (function int pickup-type float)) +(define-extern adjust-player-ammo-over-time (function int float pickup-type float float)) +(define-extern truncate-player-ammo (function pickup-type none)) +(define-extern *last-gun-fire-time* last-gun-fire-time) +(define-extern compute-gun-fire-time-index (function int int)) +(define-extern get-last-fire-time (function int time-frame)) +(define-extern set-last-fire-time (function int none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gun-blue-shot ;; @@ -35332,9 +36017,9 @@ ;; (define-extern *lightning-pts-cache* object) ;; (define-extern gun-fire-blue-2 function) ;; (define-extern gun-fire-blue-2-old function) -;; (define-extern target-gun-can-fire-blue? function) +(define-extern target-gun-can-fire-blue? (function pickup-type symbol :behavior target)) ;; (define-extern *last-fire-blue-time* object) -;; (define-extern target-gun-fire-blue function) ;; (function (pointer process) :behavior target) +(define-extern target-gun-fire-blue (function pickup-type (pointer process) :behavior target)) ;; (define-extern gun-blue-shot-move function) ;; (function gun-blue-shot none) ;; (define-extern cshape-reaction-blue-shot function) ;; (function control-info collide-query vector vector collide-status) @@ -35488,8 +36173,8 @@ ;; (define-extern gun-fire-yellow-3 function) ;; (define-extern gun-fire-yellow-2 function) ;; (define-extern gun-fire-yellow-1 function) -;; (define-extern target-gun-can-fire-yellow? function) -;; (define-extern target-gun-fire-yellow function) ;; (function (pointer process) :behavior target) +(define-extern target-gun-can-fire-yellow? (function pickup-type symbol :behavior target)) +(define-extern target-gun-fire-yellow (function pickup-type (pointer process) :behavior target)) ;; (define-extern someone-fire-yellow function) ;; (function process-drawable vector vector (pointer process)) ;; (define-extern gun-yellow-shot-move function) ;; (function gun-yellow-shot none) ;; (define-extern *last-hit-deflect-target-handle* object) @@ -35728,8 +36413,8 @@ ;; (define-extern red-3-sphere-init-by-other function) ;; (define-extern gun-fire-red-3 function) ;; (define-extern gun-fire-red-1 function) -;; (define-extern target-gun-can-fire-red? function) -;; (define-extern target-gun-fire-red function) ;; (function (pointer gun-red-shot) :behavior target) +(define-extern target-gun-can-fire-red? (function pickup-type symbol :behavior target)) +(define-extern target-gun-fire-red (function pickup-type (pointer process) :behavior target)) ;; (define-extern gun-red-shot-event-handler function) ;; (function process-drawable int symbol event-message-block object :behavior gun-red-shot) ;; (define-extern gun-red-shot-init-by-other function) ;; (function vector vector gun-red-shot :behavior gun-red-shot) @@ -35962,7 +36647,7 @@ ;; (define-extern *last-active-nuke* object) ;; (define-extern gun-dark-reaction function) ;; (define-extern nuke-move function) -;; (define-extern target-gun-can-fire-dark? function) +(define-extern target-gun-can-fire-dark? (function pickup-type symbol :behavior target)) ;; (define-extern gun-fire-dark-3 function) ;; (define-extern process-drawable-shock-effect-bullseye function) ;; (function process-focusable process-focusable matrix int sparticle-launcher sparticle-launcher sparticle-launcher none) ;; (define-extern gun-dark-shot-init-fizzle function) ;; (function vector none :behavior gun-dark-shot) @@ -35974,7 +36659,7 @@ ;; (define-extern gravity-ring-init-by-other function) ;; (define-extern gun-gravity-init-by-other function) ;; (define-extern gun-fire-dark-2 function) -;; (define-extern target-gun-fire-dark function) ;; (function (pointer process) :behavior target) +(define-extern target-gun-fire-dark (function pickup-type (pointer process) :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gun-states ;; @@ -35985,55 +36670,55 @@ ;; board-util ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern board-post function) ;; (function none :behavior board) -;; (define-extern board-init function) ;; (function none :behavior board) +(define-extern board-post (function none :behavior board)) +(define-extern board-init (function object :behavior board)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-board ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *board-walk-mods* surface) ;; surface -;; (define-extern *board-duck-mods* surface) ;; surface -;; (define-extern *board-air-mods* surface) ;; surface -;; (define-extern *board-jump-mods* surface) ;; surface -;; (define-extern *board-ride-jump-mods* surface) ;; surface -;; (define-extern *board-duck-jump-mods* object) ;; surface -;; (define-extern *board-spin-mods* object) ;; surface -;; (define-extern *board-spin-post-mods* object) ;; surface -;; (define-extern *board-flip-mods* object) ;; surface -;; (define-extern *board-wall-kick-mods* surface) ;; surface -;; (define-extern *board-halfpipe-mods* surface) ;; surface -;; (define-extern *board-turn-to-mods* surface) ;; surface -;; (define-extern *board-ride-mods* surface) ;; surface -;; (define-extern *collide-edge-board-halfpipe-spec* object) ;; collide-edge-spec -;; (define-extern target-board-green-eco-attack function) -;; (define-extern target-board-green-eco-use function) -;; (define-extern target-board-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern board-turn-around? function) -;; (define-extern target-board-setup function) ;; (function symbol none :behavior target) -;; (define-extern target-board-init function) ;; (function none :behavior target) -;; (define-extern target-board-exit function) ;; (function none :behavior target) -;; (define-extern target-board-falling-anim-trans function) ;; (function none :behavior target) -;; (define-extern board-on-ground? function) ;; (function symbol :behavior target) -;; (define-extern target-board-smack-surface? function) ;; (function symbol :behavior target) -;; (define-extern board-add-thrust function) ;; (function none :behavior target) -;; (define-extern segment-array-vector->index function) ;; (function (inline-array vector) int float float float) -;; (define-extern segment-array-index->vector function) ;; (function (inline-array vector) int float vector int) -;; (define-extern target-board-exit-check function) ;; (function none :behavior target) -;; (define-extern target-board-trail function) -;; (define-extern target-board-effect function) ;; (function none :behavior target) -;; (define-extern target-board-physics function) ;; (function vector none :behavior target) -;; (define-extern target-board-collision function) ;; (function none :behavior target) -;; (define-extern target-board-joint-points function) ;; (function none :behavior target) -;; (define-extern target-board-pre-move function) ;; (function none :behavior target) -;; (define-extern target-board-real-post function) ;; (function none :behavior target) -;; (define-extern probe-test function) ;; (function control-info vector pat-surface symbol) -;; (define-extern target-board-compute-edge function) ;; (function time-frame :behavior target) -;; (define-extern board-ride-add-thrust function) ;; (function vector float none :behavior target) -;; (define-extern target-board-ride-post function) ;; (function none :behavior target) -;; (define-extern target-board-post function) ;; (function none :behavior target) -;; (define-extern target-board-center-anim function) ;; (function none :behavior target) -;; (define-extern target-board-turn-anim function) ;; (function int none :behavior target) +(define-extern *board-walk-mods* surface) +(define-extern *board-duck-mods* surface) +(define-extern *board-air-mods* surface) +(define-extern *board-jump-mods* surface) +(define-extern *board-ride-jump-mods* surface) +(define-extern *board-duck-jump-mods* surface) +(define-extern *board-spin-mods* surface) +(define-extern *board-spin-post-mods* surface) +(define-extern *board-flip-mods* surface) +(define-extern *board-wall-kick-mods* surface) +(define-extern *board-halfpipe-mods* surface) +(define-extern *board-turn-to-mods* surface) +(define-extern *board-ride-mods* surface) +(define-extern *collide-edge-board-halfpipe-spec* collide-edge-spec) +(define-extern target-board-green-eco-attack (function symbol none :behavior target)) +(define-extern target-board-green-eco-use (function float none :behavior target)) +(define-extern target-board-handler (function process int symbol event-message-block object :behavior target)) +(define-extern board-turn-around? (function symbol :behavior target)) +(define-extern target-board-setup (function symbol none :behavior target)) +(define-extern target-board-init (function none :behavior target)) +(define-extern target-board-exit (function none :behavior target)) +(define-extern target-board-falling-anim-trans (function none :behavior target)) +(define-extern board-on-ground? (function symbol :behavior target)) +(define-extern target-board-smack-surface? (function symbol :behavior target)) +(define-extern board-add-thrust (function none :behavior target)) +(define-extern segment-array-vector->index (function (inline-array vector) int float float float)) +(define-extern segment-array-index->vector (function (inline-array vector) int float vector int)) +(define-extern target-board-exit-check (function none :behavior target)) +(define-extern target-board-trail (function none :behavior target)) +(define-extern target-board-effect (function none :behavior target)) +(define-extern target-board-physics (function vector none :behavior target)) +(define-extern target-board-collision (function none :behavior target)) +(define-extern target-board-joint-points (function none :behavior target)) +(define-extern target-board-pre-move (function none :behavior target)) +(define-extern target-board-real-post (function none :behavior target)) +(define-extern probe-test (function control-info vector pat-surface symbol)) +(define-extern target-board-compute-edge (function time-frame :behavior target)) +(define-extern board-ride-add-thrust (function vector float none :behavior target)) +(define-extern target-board-ride-post (function none :behavior target)) +(define-extern target-board-post (function none :behavior target)) +(define-extern target-board-center-anim (function none :behavior target)) +(define-extern target-board-turn-anim (function int none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; board-part ;; @@ -36046,22 +36731,23 @@ ;; board-states ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern vector-vector-angle function) ;; (function vector vector float) -;; (define-extern target-board-anim-trans function) ;; (function none :behavior target) -;; (define-extern target-board-spin-check function) ;; (function none :behavior target) -;; (define-extern target-board-halfpipe-trans function) ;; (function none :behavior target) -;; (define-extern target-board-resolve-points function) ;; (function none :behavior target) -;; (define-extern target-board-ground-check function) ;; (function none :behavior target) -;; (define-extern target-board-halfpipe-check function) ;; (function collide-action :behavior target) -;; (define-extern target-board-jump-trans function) ;; (function none :behavior target) +(define-extern grenade type) + +(define-extern vector-vector-angle (function vector vector float)) +(define-extern target-board-anim-trans (function none :behavior target)) +(define-extern target-board-spin-check (function none :behavior target)) +(define-extern target-board-halfpipe-trans (function none :behavior target)) +(define-extern target-board-resolve-points (function none :behavior target)) +(define-extern target-board-ground-check (function none :behavior target)) +(define-extern target-board-halfpipe-check (function collide-action :behavior target)) +(define-extern target-board-jump-trans (function none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mech-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype mech-info (basic) - ((entity basic :offset-assert 4) + ((entity entity-actor :offset-assert 4) (hud handle 1 :offset-assert 8) ;; guessed by decompiler (mech-trans vector :inline :offset-assert 16) (mech-quat vector :inline :offset-assert 32) @@ -36072,37 +36758,37 @@ (thrust-sound-id sound-id :offset-assert 76) ;; guessed by decompiler (drag-sound-id sound-id :offset-assert 80) ;; guessed by decompiler (whine-sound-id sound-id :offset-assert 84) ;; guessed by decompiler - (shield-sound-id uint32 :offset-assert 88) - (mech-start-time uint64 :offset-assert 96) ;; time-frame - (mech-time uint64 :offset-assert 104) ;; time-frame - (no-get-off-time uint64 :offset-assert 112) ;; time-frame + (shield-sound-id sound-id :offset-assert 88) + (mech-start-time time-frame :offset-assert 96) ;; time-frame + (mech-time time-frame :offset-assert 104) ;; time-frame + (no-get-off-time time-frame :offset-assert 112) ;; time-frame (stick-lock basic :offset-assert 120) (stick-off basic :offset-assert 124) (forward-vel meters :offset-assert 128) (jump-thrust meters :offset-assert 132) (jump-thrust-fuel float :offset-assert 136) - (unstuck-time uint64 :offset-assert 144) ;; time-frame + (unstuck-time time-frame :offset-assert 144) ;; time-frame (stuck-count int32 :offset-assert 152) (back-touch-point vector :inline :offset-assert 160) (back-touch-trans vector :inline :offset-assert 176) - (back-touch-time uint64 :offset-assert 192) ;; time-frame + (back-touch-time time-frame :offset-assert 192) ;; time-frame (attack-id uint32 :offset-assert 200) (shield-value float :offset-assert 204) (shield-max float :offset-assert 208) - (shield-handle uint64 :offset-assert 216) + (shield-handle handle :offset-assert 216) (walk-anim-leg int32 :offset-assert 224) (state-impact? symbol 1 :offset-assert 228) ;; guessed by decompiler - (state-impact impact-control 1 :offset-assert 240) ;; guessed by decompiler + (state-impact impact-control 1 :inline :offset-assert 240) ;; guessed by decompiler (thruster-flame-width meters :offset-assert 320) (thruster-flame-length meters :offset-assert 324) - (thruster-local-pos vector 2 :offset-assert 336) ;; guessed by decompiler - (exhaust-local-pos vector 2 :offset-assert 368) ;; guessed by decompiler - (exhaust-local-dir vector 2 :offset-assert 400) ;; guessed by decompiler - (smoke-local-pos vector 2 :offset-assert 432) ;; guessed by decompiler - (smoke-local-vel vector 2 :offset-assert 464) ;; guessed by decompiler + (thruster-local-pos vector 2 :inline :offset-assert 336) ;; guessed by decompiler + (exhaust-local-pos vector 2 :inline :offset-assert 368) ;; guessed by decompiler + (exhaust-local-dir vector 2 :inline :offset-assert 400) ;; guessed by decompiler + (smoke-local-pos vector 2 :inline :offset-assert 432) ;; guessed by decompiler + (smoke-local-vel vector 2 :inline :offset-assert 464) ;; guessed by decompiler (particle-system-2d basic :offset-assert 496) (particle-system-3d basic :offset-assert 500) - (part-thruster basic :offset-assert 504) + (part-thruster sparticle-launch-control :offset-assert 504) (part-thruster-scale-x sp-field-init-spec :offset-assert 508) (part-thruster-scale-y sp-field-init-spec :offset-assert 512) (part-quat quaternion :offset-assert 516) @@ -36112,9 +36798,8 @@ :size-assert #x20c :flag-assert #x90000020c ) -|# -;; (define-extern *mech-shadow-control* shadow-control) ;; shadow-control +(define-extern *mech-shadow-control* shadow-control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; menu ;; @@ -36286,8 +36971,8 @@ ;; (define-extern sphere-cull function) ;; (function vector symbol) ;; (define-extern guard-band-cull function) ;; (function vector symbol) -;; (define-extern sphere-in-view-frustum? function) ;; (function sphere symbol) -;; (define-extern line-in-view-frustum? function) ;; (function vector vector symbol) +(define-extern sphere-in-view-frustum? (function sphere symbol)) +(define-extern line-in-view-frustum? (function vector vector symbol)) ;; (define-extern vis-cull function) ;; (function int symbol) ;; (define-extern vis-cull-debug function) ;; (function work-area int symbol) ;; (define-extern error-sphere function) ;; (function drawable-error string none) @@ -36391,7 +37076,7 @@ (define-extern set-master-mode (function symbol none)) ;; (define-extern pause-allowed? function) ;; (function symbol) ;; (define-extern toggle-pause function) ;; (function int) -;; (define-extern *screen-filter* screen-filter) ;; screen-filter +(define-extern *screen-filter* screen-filter) ;; (define-extern *cheat-temp* object) ;; (pointer int32) (define-extern *master-exit* symbol) ;; (define-extern *progress-cheat* object) ;; symbol @@ -36471,74 +37156,16 @@ ;; entity ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype debug-actor-info (basic) - ((name basic :offset-assert 4) - (handle uint64 :offset-assert 8) ;; handle - (process basic :offset-assert 16) + ((name string :offset-assert 4) + (handle handle :offset-assert 8) ;; handle + (process process :offset-assert 16) (pid int32 :offset-assert 20) ) :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) -|# - -;; actor-group is already defined! - -#| -(deftype entity (res-lump) - ((trans vector :inline :offset-assert 28) - (aid uint32 :offset-assert 44) - ) - :method-count-assert 27 - :size-assert #x34 - :flag-assert #x1b00000034 - (:methods - (entity-method-22 () none) ;; 22 ;; (birth! (_type_) _type_) - (entity-method-23 () none) ;; 23 ;; (kill! (_type_) _type_) - (entity-method-24 () none) ;; 24 ;; (add-to-level! (_type_ level-group level actor-id) none) - (entity-method-25 () none) ;; 25 ;; (remove-from-level! (_type_ level-group) _type_) - (entity-method-26 () none) ;; 26 ;; (get-level (_type_) level) - ) - ) -|# - -#| -(deftype entity-nav-mesh (entity) - ((UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - ) - :method-count-assert 29 - :size-assert #x38 - :flag-assert #x1d00000038 - (:methods - (entity-nav-mesh-method-27 () none) ;; 27 ;; (initialize-nav-mesh! (_type_) none) - (entity-nav-mesh-method-28 () none) ;; 28 ;; (debug-draw (_type_) none) - ) - ) -|# - -#| -(deftype entity-actor (entity) - ((etype type :offset-assert 52) ;; guessed by decompiler - (task uint8 :offset-assert 56) ;; game-task - (kill-mask task-mask :offset-assert 48) ;; guessed by decompiler - (vis-id int16 :offset-assert 58) - (quat vector :inline :offset-assert 60) ;; quaternion :inline - ) - :method-count-assert 33 - :size-assert #x50 - :flag-assert #x2100000050 - (:methods - (entity-actor-method-27 () none) ;; 27 ;; (next-actor (_type_) entity-actor) - (entity-actor-method-28 () none) ;; 28 ;; (prev-actor (_type_) entity-actor) - (entity-actor-method-29 () none) ;; 29 ;; (debug-print (_type_ symbol type) none) - (entity-actor-method-30 () none) ;; 30 ;; (toggle-status (_type_ entity-perm-status symbol) none) - (entity-actor-method-31 () none) ;; 31 ;; (get-simple-travel-vector (_type_ vector vector vector object float) nav-mesh) - (entity-actor-method-32 () none) ;; 32 ;; (project-point-to-nav-mesh (_type_ vector vector nav-poly float) nav-poly) - ) - ) -|# (define-extern *spawn-actors* symbol) ;; (define-extern *compact-actors* object) ;; symbol @@ -36555,7 +37182,7 @@ ;; (define-extern entity-count function) ;; (function int) ;; (define-extern entity-remap-names function) ;; (function pair none) ;; (define-extern process-status-bits function) ;; (function process symbol none) -;; (define-extern process-entity-set! function) ;; (function process entity entity) +(define-extern process-entity-set! (function process entity entity)) (define-extern process-task-mask (function process task-mask)) ;; (define-extern update-actor-vis-box function) ;; (function process-drawable vector vector none) ;; (define-extern expand-bounding-box function) ;; (function vector vector vector vector none) @@ -36566,18 +37193,18 @@ ;; (define-extern debug-actor function) ;; (function string none) ;; (define-extern debug-actor-process function) ;; (define-extern draw-actor-marks function) ;; (function process none) -;; (define-extern init-entity function) ;; (function process entity-actor type none) +(define-extern init-entity (function process entity-actor type none)) ;; (define-extern entity-deactivate-handler function) ;; (function process entity-actor none) ;; (define-extern check-for-rougue-process function) ;; (function process int int level none) ;; (define-extern process-drawable-scale-from-entity! function) ;; (function process-drawable entity none) -;; (define-extern process-drawable-from-entity! function) ;; (function process-drawable entity-actor none) +(define-extern process-drawable-from-entity! (function process-drawable entity-actor none)) (define-extern reset-actors (function symbol none)) ;; (define-extern reset-cameras function) ;; (function none) -;; (define-extern entity-birth-no-kill function) ;; (function entity process) +(define-extern entity-birth-no-kill (function entity process)) ;; (define-extern entity-task-complete-on function) ;; (function entity none) ;; (define-extern entity-task-complete-off function) ;; (function entity none) (define-extern process-entity-status! (function process entity-perm-status symbol entity-perm-status)) -;; (define-extern find-nearest-entity function) ;; (function vector type entity) +(define-extern find-nearest-entity (function vector type entity)) ;; (define-extern entity-speed-test function) ;; (function string entity) ;; (define-extern dump-entity-remap function) ;; (function object object none) @@ -36590,7 +37217,7 @@ ;; vol ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern plane-volume-intersect-dist function) ;; (function vector vector vector float) +(define-extern plane-volume-intersect-dist (function vector vector vector float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; nav-engine ;; @@ -36686,7 +37313,7 @@ ;; (define-extern *debug-offset* object) ;; vector ;; (define-extern *nav-mesh-work* object) ;; nav-mesh-work ;; (define-extern *default-nav-mesh* nav-mesh) ;; nav-mesh -;; (define-extern nav-mesh-connect-from-ent function) ;; (function process-drawable symbol) +(define-extern nav-mesh-connect-from-ent (function process-drawable symbol)) ;; (define-extern connection-validate function) ;; (function connection none) ;; (define-extern connection-list-validate function) ;; (function (inline-array connection) symbol) ;; (define-extern nav-control-validate function) ;; (function process-drawable none) @@ -36768,7 +37395,7 @@ (define-extern *debug-effect-control* symbol) ;; (define-extern sound-name-with-material function) ;; (function string pat-surface string sound-name) (define-extern effect-param->sound-spec (function sound-spec (pointer float) int process-focusable sound-spec)) -;; (define-extern target-land-effect function) ;; (function none :behavior target) +(define-extern target-land-effect (function none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; water-part ;; @@ -36811,10 +37438,10 @@ ;; (define-extern part-water-splash-callback function) ;; (function part-tracker none) ;; (define-extern splash-spawn function) ;; (function float vector int none) ;; (define-extern rings-water-spawn function) ;; (function float vector vector float float none) -;; (define-extern water-info<-region function) ;; (function water-info drawable-region-prim collide-shape collide-action water-info) -;; (define-extern find-water-1 function) -;; (define-extern find-water-2 function) -;; (define-extern find-water-with-spheres function) +(define-extern water-info<-region (function water-info drawable-region-prim collide-shape collide-action water-info)) +(define-extern find-water-1 (function water-sphere water-info water-info symbol)) +(define-extern find-water-2 (function (inline-array water-sphere) int water-info water-info symbol)) +(define-extern find-water-with-spheres (function (inline-array water-sphere) int water-info object)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; water-flow ;; @@ -36887,126 +37514,123 @@ ;; gem-pool ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern get-gem-pool-size function) -;; (define-extern compare-gems function) -;; (define-extern gems-available? function) -;; (define-extern notify-gem-pickup function) +(define-extern get-gem-pool-size (function int float)) +(define-extern compare-gems (function int (pointer float) symbol)) +(define-extern gems-available? (function int symbol)) +(define-extern notify-gem-pickup (function uint symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collectables ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++collectables:collectable-flag +(defenum collectable-flag + :type uint32 + :bitfield #t + (bounce 0) ;; 1 + (fadeout 1) ;; 2 + (pickup 2) ;; 4 + (do-fadeout 3) ;; 8 + (suck-in 4) ;; 16 + (no-eco-blue 5) ;; 32 + (no-bob 6) ;; 64 + (no-distance-check-fadeout 7) ;; 128 + ) +;; ---collectables:collectable-flag + (deftype collectable (process-drawable) - ((pickup-type int32 :offset-assert 196) ;; pickup-type - (pickup-amount float :offset-assert 200) - (notify uint64 :offset-assert 204) ;; handle - (old-base vector :inline :offset-assert 220) - (base vector :inline :offset-assert 236) - (extra-trans vector :inline :offset-assert 252) - (jump-pos vector :inline :offset-assert 268) - (flags collectable-flag :offset-assert 284) - (birth-time uint64 :offset-assert 292) ;; seconds - (collect-timeout uint64 :offset-assert 300) ;; seconds - (fadeout-timeout uint64 :offset-assert 308) ;; seconds - (bob-offset uint64 :offset-assert 316) ;; seconds - (bob-amount float :offset-assert 324) - (pickup-handle uint64 :offset-assert 332) ;; handle - (actor-pause symbol :offset-assert 340) ;; guessed by decompiler - (collect-effect basic :offset-assert 344) - (collect-effect2 basic :offset-assert 348) - (target uint64 :offset-assert 356) ;; handle - (suck-time uint64 :offset-assert 364) ;; seconds - (suck-y-offset float :offset-assert 372) - (speed vector :inline :offset-assert 380) - (movie-pos-index int32 :offset-assert 396) + ((root collide-shape-moving :override) + (pickup-type pickup-type :offset-assert 200) ;; pickup-type + (pickup-amount float :offset-assert 204) + (notify handle :offset-assert 208) ;; handle + (old-base vector :inline :offset-assert 224) + (base vector :inline :offset-assert 240) + (extra-trans vector :inline :offset-assert 256) + (jump-pos vector :inline :offset-assert 272) + (flags collectable-flag :offset-assert 288) + (birth-time time-frame :offset-assert 296) ;; seconds + (collect-timeout time-frame :offset-assert 304) ;; seconds + (fadeout-timeout time-frame :offset-assert 312) ;; seconds + (bob-offset uint64 :offset-assert 320) ;; seconds + (bob-amount float :offset-assert 328) + (pickup-handle handle :offset-assert 336) ;; handle + (actor-pause symbol :offset-assert 344) ;; guessed by decompiler + (collect-effect sparticle-launch-group :offset-assert 348) + (collect-effect2 sparticle-launch-group :offset-assert 352) + (target handle :offset-assert 360) ;; handle + (suck-time time-frame :offset-assert 368) ;; seconds + (suck-y-offset float :offset-assert 376) + (speed vector :inline :offset-assert 384) + (movie-pos-index int32 :offset-assert 400) ) :method-count-assert 36 :size-assert #x194 :flag-assert #x2401200194 + (:state-methods + blocked ;; 20 + wait ;; 21 + deploy ;; 22 + (suck handle) ;; 23 + jump ;; 24 + fade ;; 25 + (pickup symbol handle) ;; 26 + die ;; 27 + (notice-blue handle) ;; 28 + ) (:methods - (collectable-method-29 () none) ;; 29 ;; (init-common (_type_ entity-actor pickup-type float) none) - (collectable-method-30 () none) ;; 30 ;; (initialize-effects (_type_ pickup-type) none) - (collectable-method-31 () none) ;; 31 ;; (go-to-initial-state (_type_) none) - (collectable-method-32 () none) ;; 32 ;; (initialize-options (_type_ int float fact-info) collectable) - (collectable-method-33 () none) ;; 33 ;; (initialize-allocations (_type_) none) - (collectable-method-34 () none) ;; 34 ;; (common-post (_type_) none) - (collectable-method-35 () none) ;; 35 ;; (do-pickup (_type_ handle) none) - ) - (:state-methods - die ;; 27, old: (die () _type_ :state) - pickup ;; 26, old: (pickup (symbol handle) _type_ :state) - notice-blue ;; 28, old: (notice-blue (handle) _type_ :state) - fade ;; 25, old: (fade () _type_ :state) - wait ;; 21, old: (wait () _type_ :state) - suck ;; 23, old: (suck (handle) _type_ :state) - deploy ;; 22, old: (deploy () _type_ :state) - jump ;; 24, old: (jump () _type_ :state) - blocked ;; 20, old: (blocked () _type_ :state) + (init-common (_type_ entity-actor pickup-type float) none) ;; 29 + (initialize-effects (_type_ pickup-type) none) ;; 30 + (go-to-initial-state (_type_) object) ;; 31 + (initialize-options (_type_ int float fact-info) collectable) ;; 32 + (initialize-allocations (_type_) none) ;; 33 + (common-post (_type_) none) ;; 34 + (do-pickup (_type_ handle) none) ;; 35 ) ) -|# -#| (deftype eco (collectable) - ((respawn-delay uint64 :offset-assert 408) + ((respawn-delay time-frame :offset-assert 408) ) :method-count-assert 36 :size-assert #x1a0 :flag-assert #x24012001a0 - (:state-methods - pickup ;; 26 - die ;; 27 - ) ) -|# -#| (deftype eco-yellow (eco) () :method-count-assert 36 :size-assert #x1a0 :flag-assert #x24012001a0 ) -|# -#| (deftype eco-red (eco) () :method-count-assert 36 :size-assert #x1a0 :flag-assert #x24012001a0 ) -|# -#| (deftype eco-blue (eco) () :method-count-assert 36 :size-assert #x1a0 :flag-assert #x24012001a0 ) -|# -#| (deftype eco-green (eco) () :method-count-assert 36 :size-assert #x1a0 :flag-assert #x24012001a0 ) -|# -#| (deftype health (collectable) () :method-count-assert 36 :size-assert #x194 :flag-assert #x2401200194 ) -|# -#| (deftype eco-pill (collectable) () :method-count-assert 36 @@ -37016,77 +37640,53 @@ wait ;; 21 ) ) -|# -#| (deftype money (collectable) () :method-count-assert 36 :size-assert #x194 :flag-assert #x2401200194 - (:state-methods - pickup ;; 26 - notice-blue ;; 28 - ) ) -|# -#| (deftype gem (money) - ((roty-speed deg :offset-assert 404) ;; degrees - (bounce-time uint64 :offset-assert 408) ;; seconds - (gem-pool uint8 :offset-assert 416) + ((roty-speed degrees :offset-assert 404) ;; degrees + (bounce-time time-frame :offset-assert 408) ;; seconds + (gem-pool uint8 :offset-assert 416) ) :method-count-assert 36 :size-assert #x1a1 :flag-assert #x24013001a1 - (:state-methods - deploy ;; 22 - suck ;; 23 - ) ) -|# -#| (deftype skill (money) () :method-count-assert 36 :size-assert #x194 :flag-assert #x2401200194 - (:state-methods - wait ;; 21 - ) ) -|# -#| + (deftype fuel-cell (process-hidden) () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 ) -|# -#| (deftype trick-point (collectable) () :method-count-assert 36 :size-assert #x194 :flag-assert #x2401200194 ) -|# -#| (deftype skate-point (trick-point) () :method-count-assert 36 :size-assert #x194 :flag-assert #x2401200194 ) -|# -#| (deftype ammo-collectable (collectable) ((ammo-effect basic :offset-assert 404) ) @@ -37097,122 +37697,108 @@ die ;; 27 ) ) -|# -#| (deftype ammo (ammo-collectable) () :method-count-assert 36 :size-assert #x198 :flag-assert #x2401200198 ) -|# -#| (deftype shield (ammo-collectable) () :method-count-assert 36 :size-assert #x198 :flag-assert #x2401200198 ) -|# -#| (deftype upgrade-collectable (ammo-collectable) () :method-count-assert 36 :size-assert #x198 :flag-assert #x2401200198 ) -|# -;; (define-extern initialize-eco-by-other function) ;; (function vector vector fact-info none :behavior eco) -;; (define-extern add-blue-shake function) ;; (function vector vector vector vector) -;; (define-extern check-blue-suck function) ;; (function process-drawable symbol :behavior eco) -;; (define-extern add-blue-motion function) ;; (function symbol symbol symbol symbol symbol :behavior eco) -;; (define-extern collectable-standard-event-handler function) ;; (function process int symbol event-message-block object :behavior collectable) -;; (define-extern money-init-by-other function) ;; (function vector vector fact-info entity-actor none :behavior money) -;; (define-extern money-init-by-other-no-bob function) ;; (function vector vector fact-info float entity-actor none :behavior money) -;; (define-extern *collectable-dummy-shadow-control* shadow-control) ;; shadow-control -;; (define-extern initialize-ammo-by-other function) ;; (function vector vector fact-info none :behavior ammo) -;; (define-extern initialize-upgrade-by-other function) ;; (function vector vector fact-info entity-actor none :behavior upgrade-collectable) -;; (define-extern verify-pickup-type function) +(define-extern initialize-eco-by-other (function vector vector fact-info object :behavior eco)) +(define-extern add-blue-shake (function vector vector vector vector)) +(define-extern check-blue-suck (function process-drawable symbol :behavior eco)) +(define-extern add-blue-motion (function symbol symbol symbol symbol symbol :behavior eco)) +(define-extern collectable-standard-event-handler (function process int symbol event-message-block object :behavior collectable)) +(define-extern money-init-by-other (function vector vector fact-info entity-actor time-frame object :behavior money)) +(define-extern money-init-by-other-no-bob (function vector vector fact-info float entity-actor object :behavior money)) +(define-extern *collectable-dummy-shadow-control* shadow-control) +(define-extern initialize-ammo-by-other (function vector vector fact-info object :behavior ammo)) +(define-extern initialize-upgrade-by-other (function vector vector fact-info entity-actor object :behavior upgrade-collectable)) +(define-extern verify-pickup-type (function pickup-type pickup-type)) (define-extern birth-pickup-at-point (function vector pickup-type float symbol process-tree fact-info (pointer process) :behavior process)) -;; (define-extern pickup-dark-set! function) -;; (define-extern pickup-light-set! function) -;; (define-extern pickup-ammo-set! function) -;; (define-extern gun-pickup-type->game-feature function) +(define-extern pickup-dark-set! (function fact-info (pointer pickup-type) (pointer float) int pickup-type)) +(define-extern pickup-light-set! (function fact-info (pointer pickup-type) (pointer float) int pickup-type)) +(define-extern pickup-ammo-set! (function fact-info (pointer pickup-type) (pointer float) int pickup-type)) +(define-extern gun-pickup-type->game-feature (function pickup-type game-feature)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vent ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype vent (process-drawable) - ((show-particles basic :offset-assert 200) - (collect-effect basic :offset-assert 204) - (collect-effect2 basic :offset-assert 208) - (collect-effect-time uint64 :offset-assert 216) - (blocker basic :offset-assert 224) - (block-func basic :offset-assert 228) - (pickup-handle uint64 :offset-assert 232) + ((root collide-shape :override) + (show-particles symbol :offset-assert 200) + (collect-effect sparticle-launch-group :offset-assert 204) + (collect-effect2 sparticle-launch-group :offset-assert 208) + (collect-effect-time time-frame :offset-assert 216) + (blocker entity-actor :offset-assert 224) + (block-func (function vent symbol) :offset-assert 228) + (pickup-handle handle :offset-assert 232) ) :method-count-assert 21 :size-assert #xf0 :flag-assert #x15007000f0 (:methods - (vent-method-20 () none) ;; 20 + (init! (_type_ entity-actor int) object) ;; 20 ) (:states vent-wait-for-touch vent-blocked - vent-pickup + (vent-pickup handle) ) ) -|# -#| (deftype ecovent (vent) () :method-count-assert 21 :size-assert #xf0 :flag-assert #x15007000f0 ) -|# -#| (deftype light-eco-vent (process-drawable) - ((part2 basic :offset-assert 200) - (pickup-time uint64 :offset-assert 208) - (touch-time uint64 :offset-assert 216) + ((part2 sparticle-launch-control :offset-assert 200) + (pickup-time time-frame :offset-assert 208) + (touch-time time-frame :offset-assert 216) ) :method-count-assert 22 :size-assert #xe0 :flag-assert #x16006000e0 (:state-methods - close ;; 21 - open ;; 20 + (open symbol) ;; 20 + (close symbol) ;; 21 ) ) -|# -#| (deftype dark-eco-vent (process-drawable) - ((part2 basic :offset-assert 200) - (pickup-time uint64 :offset-assert 208) - (touch-time uint64 :offset-assert 216) + ((part2 sparticle-launch-control :offset-assert 200) + (pickup-time time-frame :offset-assert 208) + (touch-time time-frame :offset-assert 216) ) :method-count-assert 22 :size-assert #xe0 :flag-assert #x16006000e0 (:state-methods - close ;; 21 - open ;; 20 + (open symbol) ;; 20 + (close symbol) ;; 21 ) ) -|# -;; (define-extern vent-standard-event-handler function) +(define-extern vent-standard-event-handler (function process int symbol event-message-block object :behavior vent)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; task-control ;; @@ -37338,7 +37924,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (define-extern pov-camera-play-and-reposition function) ;; (function art-joint-anim vector float none :behavior pov-camera) -;; (define-extern pov-camera-init-by-other function) ;; (function vector skeleton-group string pov-camera-flag process-drawable pair none :behavior pov-camera) +(define-extern pov-camera-init-by-other (function vector skeleton-group string pov-camera-flag process-drawable pair none :behavior pov-camera)) ;; (define-extern othercam-calc function) ;; (function float float) (define-extern othercam-init-by-other (function pov-camera int symbol symbol none :behavior othercam)) @@ -37347,20 +37933,19 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (define-extern cloud-track function) ;; (function process-tree process-tree (function vector none) time-frame time-frame time-frame none :behavior process) -;; (define-extern eco-blue-glow function) ;; (function vector none) +(define-extern eco-blue-glow (function vector none)) ;; (define-extern target-eco-process function) ;; (function none :behavior target) ;; (define-extern target-color-effect-process function) ;; (function none :behavior target) -;; (define-extern target-update-segs function) +(define-extern target-update-segs (function process-drawable none)) ;; (define-extern target-draw-process function) -;; (define-extern target-powerup-process function) ;; (function none :behavior target) -;; (define-extern target-powerup-effect function) ;; (function symbol none :behavior target) -;; (define-extern process-contact-action function) ;; (function process none :behavior target) +(define-extern target-powerup-process (function none :behavior target)) +(define-extern target-powerup-effect (function symbol none :behavior target)) +(define-extern process-contact-action (function process none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; crates ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype crate-bank (basic) ((COLLIDE_YOFF float :offset-assert 4) (COLLIDE_RADIUS float :offset-assert 8) @@ -37370,45 +37955,43 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype crate (process-focusable) - ((smush smush-control :inline :offset-assert 208) + ((root collide-shape-moving :override) + (fact fact-info-crate :override) + (smush smush-control :inline :offset-assert 208) (base vector :inline :offset-assert 240) (look symbol :offset-assert 256) ;; guessed by decompiler (defense symbol :offset-assert 260) ;; guessed by decompiler (incoming-attack-id uint32 :offset-assert 264) - (target uint64 :offset-assert 272) ;; handle + (target handle :offset-assert 272) ;; handle (child-count int32 :offset-assert 280) (victory-anim spool-anim :offset-assert 284) ;; guessed by decompiler ) :method-count-assert 43 :size-assert #x120 :flag-assert #x2b00a00120 - (:methods - (crate-method-36 () none) ;; 36 ;; (skel-init! (_type_) none) - (crate-method-37 () none) ;; 37 ;; (params-set! (_type_ symbol symbol) none) - (crate-method-38 () none) ;; 38 ;; (crate-method-38 (_type_) none) - (crate-method-39 () none) ;; 39 ;; (smush-update! (_type_) none) - (crate-method-40 () none) ;; 40 ;; (crate-method-40 (_type_) symbol) - (crate-method-41 () none) ;; 41 - (crate-method-42 () none) ;; 42 - ) (:state-methods - special-contents-die ;; 31, old: (bounce-on () _type_ :state) - die ;; 30, old: (special-contents-die () _type_ :state) - notice-blue ;; 33, old: (carry () _type_ :state) - bounce-on ;; 32, old: (notice-blue (handle) _type_ :state) - fall ;; 35, old: (crate-init! (_type_ entity-actor) none) - carry ;; 34, old: (fall () _type_ :state) - idle ;; 29, old: (die (symbol int) _type_ :state) - hide ;; 28, old: (idle () _type_ :state) + hide ;; 28 + idle ;; 29 + (die symbol int) ;; 30 + special-contents-die ;; 31 + bounce-on ;; 32 + (notice-blue handle) ;; 33 + carry ;; 34 + fall ;; 35 + ) + (:methods + (init! (_type_ entity-actor) none) ;; 36 + (init-skel! (_type_) none) ;; 37 + (init-collision! (_type_) none) ;; 38 + (params-set! (_type_ symbol symbol) none) ;; 39 + (go-initial-state (_type_) none) ;; 40 + (smush-update! (_type_) none) ;; 41 + (should-hide? (_type_) symbol) ;; 42 ) ) -|# -#| (deftype pickup-spawner (crate) ((blocker entity-actor :offset-assert 288) ;; guessed by decompiler ) @@ -37419,40 +38002,35 @@ idle ;; 29 ) ) -|# -#| (deftype urn-a (crate) () :method-count-assert 43 :size-assert #x120 :flag-assert #x2b00a00120 ) -|# -#| (deftype urn-b (crate) () :method-count-assert 43 :size-assert #x120 :flag-assert #x2b00a00120 ) -|# -#| (deftype urn-c (crate) () :method-count-assert 43 :size-assert #x120 :flag-assert #x2b00a00120 ) -|# -;; (define-extern *CRATE-bank* crate-bank) ;; crate-bank -;; (define-extern collectable-count function) -;; (define-extern crate-post function) ;; (function none :behavior crate) -;; (define-extern crate-standard-event-handler function) ;; (function process int symbol event-message-block object :behavior crate) -;; (define-extern crate-init-by-other function) ;; (function entity vector symbol fact-info-crate none :behavior crate) +(define-extern collectable type) + +(define-extern *CRATE-bank* crate-bank) +(define-extern collectable-count (function process-tree int :behavior crate)) +(define-extern crate-post (function none :behavior crate)) +(define-extern crate-standard-event-handler (function process int symbol event-message-block object :behavior crate)) +(define-extern crate-init-by-other (function entity vector symbol fact-info-crate object :behavior crate)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; hud ;; @@ -37481,11 +38059,11 @@ ;; (define-extern *hud-sprite-work* object) ;; hud-sprite-work ;; (define-extern hud-create-icon function) ;; (function hud int int (pointer manipy)) ;; (define-extern hud-hidden-event-handler function) -;; (define-extern hud-init-by-other function) ;; (function object :behavior hud) -;; (define-extern hide-hud function) ;; (function symbol none) +(define-extern hud-init-by-other (function object :behavior hud)) +(define-extern hide-hud (function symbol none)) ;; (define-extern enable-hud function) ;; (function none) ;; (define-extern hide-hud-quick function) ;; (function symbol none) -;; (define-extern show-hud function) ;; (function object none) +(define-extern show-hud (function object none)) (define-extern ready-hud (function symbol int none)) ;; (define-extern hud-hidden? function) ;; (function symbol) ;; (define-extern set-hud-piece-position! function) ;; (function hud-sprite int int none) @@ -37497,7 +38075,7 @@ ;; (define-extern *hud-skullgem* object) ;; (pointer hud-skullgem) ;; (define-extern *gun-arrow-table* object) -;; (define-extern activate-hud function) ;; (function target none) +(define-extern activate-hud (function target none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; secrets-menu ;; @@ -37710,7 +38288,7 @@ ;; (define-extern *minimap-texture-name-array* object) ;; minimap-texture-name-array ;; (define-extern *minimap-corner-array* object) ;; minimap-corner-array -;; (define-extern *minimap* object) ;; minimap +(define-extern *minimap* minimap) ;; (define-extern *minimap-class-list* object) ;; (inline-array minimap-class-node) ;; (define-extern lookup-minimap-texture-by-name function) ;; (function string string (pointer texture-page) texture) ;; (define-extern *minimap-table-entry-array* array) @@ -37988,7 +38566,6 @@ ;; viewer ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype viewer (process-drawable) ((janim art-joint-anim :offset-assert 200) ;; guessed by decompiler ) @@ -37999,18 +38576,18 @@ viewer-process ;; associated process guessed by decompiler, old: (state viewer) ) ) -|# -;; (define-extern *viewer-sg* skeleton-group) ;; skeleton-group -;; (define-extern viewer-string object) ;; string -;; (define-extern viewer-ja-name object) ;; string -;; (define-extern viewer-geo-name object) ;; string -;; (define-extern actor-get-arg! function) ;; (function string string string symbol) -;; (define-extern art-part-name function) ;; (function string string) -;; (define-extern init-viewer function) ;; (function string string none :behavior viewer) -;; (define-extern init-viewer-for-other function) ;; (function string vector entity-actor none :behavior viewer) -;; (define-extern add-a-bunch function) ;; (function string int int float process-tree entity-actor symbol) -;; (define-extern birth-viewer function) ;; (function process entity-actor object) +(define-extern *viewer* viewer) +(define-extern *viewer-sg* skeleton-group) +(define-extern viewer-string string) +(define-extern viewer-ja-name string) +(define-extern viewer-geo-name string) +(define-extern actor-get-arg! (function string string string symbol)) +(define-extern art-part-name (function string string)) +(define-extern init-viewer (function string string object :behavior viewer)) +(define-extern init-viewer-for-other (function string vector entity-actor object :behavior viewer)) +(define-extern add-a-bunch (function string int int float process-tree entity-actor symbol)) +(define-extern birth-viewer (function process entity-actor object)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; part-tester ;; @@ -45950,12 +46527,6 @@ setup ;; 29 idle ;; 28 ) - (:states - target-turret-stance-fire - target-turret-stance ;; associated process guessed by decompiler, old: (state handle target) - target-turret-get-on ;; associated process guessed by decompiler, old: (state handle target) - target-turret-get-off ;; associated process guessed by decompiler, old: (state target) - ) ) |# @@ -45964,7 +46535,6 @@ ;; (define-extern target-turret-active-post function) ;; (define-extern turret-handler function) ;; (function process int symbol event-message-block object :behavior base-turret) ;; (define-extern target-turret-blend-mat function) -;; (define-extern cam-turret state) ;; (state camera-slave) ;; (define-extern target-turret-get-on-play function) ;; (define-extern target-for-turret-get-on-play function) ;; (define-extern target-turret-get-off-play function) @@ -52427,7 +52997,7 @@ ;; (define-extern vehicle-manager-kill function) ;; (define-extern vehicle-init-by-other function) ;; (function traffic-object-spawn-params none :behavior vehicle) ;; (define-extern vehicle-spawn-hack function) -;; (define-extern vehicle-spawn function) ;; (function process type traffic-object-spawn-params process-drawable) +(define-extern vehicle-spawn (function process type traffic-object-spawn-params process-drawable)) ;; (define-extern type-from-vehicle-type function) ;; (function vehicle-type type) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -56687,7 +57257,7 @@ |# ;; (define-extern have-earned-vehicle-v-type? function) -;; (define-extern have-vehicle-v-type? function) +(define-extern have-vehicle-v-type? (function int symbol)) ;; (define-extern kill-player-process-init-by-other function) ;; (define-extern kill-player-process-spawn function) @@ -59275,7 +59845,6 @@ ;; (define-extern *scorpion-beast-spawn-info* array) ;; (define-extern scorpion-gun-manager-handler function) ;; (define-extern beast-post function) -;; (define-extern cam-scorpion-gun state) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; templed-obs ;; @@ -63270,7 +63839,6 @@ |# ;; (define-extern *ladder-mods* object) -;; (define-extern target-ladder-start object) ;; (define-extern target-ladder-stance object) ;; (define-extern target-ladder-walk-up object) ;; (define-extern target-ladder-walk-down object) @@ -66347,7 +66915,6 @@ ;; (define-extern bt-gun-manager-init-by-other function) ;; (define-extern bt-gun-manager-handler function) ;; (define-extern *fov-to-use* object) -;; (define-extern cam-bt-gun state) ;; (define-extern *bt-clamp-curve-x* object) ;; (define-extern *bt-accel-curve* object) ;; (define-extern bt-hellcat-init-by-other function) @@ -67249,7 +67816,6 @@ ;; (define-extern power-game-glyph-post function) ;; (define-extern power-game-glyph-init function) ;; (define-extern cam-power-game-update function) -;; (define-extern cam-power-game state) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ljkdxvin-texture ;; @@ -67323,7 +67889,6 @@ ;; (define-extern tube-sounds function) ;; (function sound-id :behavior target) ;; (define-extern tube-thrust function) ;; (function float float none :behavior target) ;; (define-extern target-tube-post function) ;; (function none :behavior target) -;; (define-extern target-tube-start object) ;; (state handle target) ;; (define-extern target-tube-turn-anim function) ;; (function none :behavior target) ;; (define-extern target-tube-walk object) ;; (define-extern target-tube-jump object) ;; (state float float target) diff --git a/decompiler/config/jak3/jak3_config.jsonc b/decompiler/config/jak3/jak3_config.jsonc index bc41146a9b0..7db1bb3cf8f 100644 --- a/decompiler/config/jak3/jak3_config.jsonc +++ b/decompiler/config/jak3/jak3_config.jsonc @@ -8,7 +8,7 @@ // if you want to filter to only some object names. // it will make the decompiler much faster. "allowed_objects": [], - "banned_objects": ["collide-shape", "spatial-hash", "entity"], + "banned_objects": ["collide-shape", "spatial-hash"], //////////////////////////// // CODE ANALYSIS OPTIONS @@ -45,6 +45,13 @@ // write out a json file containing the joint node mapping, run this with all objects allowed "dump_joint_geo_info": false, + // set to false to skip adding .STR files to the decompiler database + "read_spools": true, + // write out spool subtitle text, implies read_spools + "process_subtitle_text": false, + // write out spool subtitle images, implies read_spools + "process_subtitle_images": false, + /////////////////////////// // WEIRD OPTIONS /////////////////////////// @@ -93,6 +100,7 @@ "all_types_file": "decompiler/config/jak3/all-types.gc", "art_group_dump_file": "decompiler/config/jak3/ntsc_v1/art-group-info.min.json", "joint_node_dump_file": "decompiler/config/jak3/ntsc_v1/joint-node-info.min.json", + "process_stack_size_file": "decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc", // optional: a predetermined object file name map from a file. // this will make decompilation naming consistent even if you only run on some objects. diff --git a/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc b/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc index 006b7a5b823..8681a584f84 100644 --- a/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc @@ -37,5 +37,91 @@ ], "settings": [ [6, "(function engine-pers connection-pers object object symbol)"] + ], + "generic-obs": [[51, "(function symbol :behavior touch-tracker)"]], + "target-util": [ + [2, "(function none :behavior target)"], + [3, "(function none :behavior target)"], + [4, "(function none :behavior manipy)"], + [5, "(function none :behavior manipy)"], + [6, "(function none :behavior target)"] + ], + "logic-target": [ + [0, "(function external-art-buffer none)"], + [1, "(function external-art-buffer none)"] + ], + "sidekick": [[6, "(function object vector int string :behavior sidekick)"]], + "target-handler": [ + [10, "(function handle none :behavior target)"], + [14, "(function none :behavior target)"] + ], + "target-anim": [ + [3, "(function none :behavior target)"], + [4, "(function none :behavior target)"], + [7, "(function none :behavior target)"], + [8, "(function none :behavior target)"], + [13, "(function (pointer time-frame) none :behavior target)"], + [14, "(function none :behavior target)"], + [15, "(function none :behavior target)"], + [16, "(function none :behavior target)"], + [17, "(function none :behavior target)"] + ], + "target": [ + [1, "(function object :behavior target)"], + [7, "(function object :behavior target)"], + [18, "(function process-focusable object :behavior target)"], + [29, "(function surface surface surface int object :behavior target)"], + [35, "(function surface surface surface int object :behavior target)"], + [45, "(function surface surface surface int object :behavior target)"], + [46, "(function surface surface surface int object :behavior target)"], + [77, "(function surface surface surface int object :behavior target)"] + ], + "target2": [ + [12, "(function vector time-frame float object :behavior process)"], + [15, "(function object :behavior target)"], + [23, "(function object :behavior target)"], + [64, "(function symbol :behavior target)"] + ], + "target-lightjak": [[68, "(function symbol object :behavior target)"]], + "target-invisible": [[10, "(function object :behavior target)"]], + "target-death": [ + [1, "(function object :behavior target)"], + [2, "(function object :behavior target)"], + [3, "(function symbol object :behavior target)"], + [4, "(function object :behavior target)"], + [9, "(function handle object :behavior target)"], + [10, "(function object :behavior target)"], + [14, "(function process-drawable object)"], + [25, "(function surface surface surface int object :behavior target)"], + [26, "(function surface surface surface int object :behavior target)"], + [28, "(function continue-point object)"], + [34, "(function process symbol)"], + [35, "(function process symbol)"], + [36, "(function process symbol)"], + [37, "(function process symbol)"], + [38, "(function process symbol)"] + ], + "target-gun": [ + [15, "(function pickup-type pickup-type none :behavior target)"], + [16, "(function pickup-type none :behavior target)"], + [25, "(function surface surface surface int object :behavior target)"] + ], + "target-board": [ + [30, "(function surface surface surface int object :behavior target)"], + [31, "(function surface surface surface int object :behavior target)"], + [32, "(function surface surface surface int object :behavior target)"], + [33, "(function surface surface surface int object :behavior target)"], + [34, "(function surface surface surface int object :behavior target)"] + ], + "vent": [ + [26, "(function vent symbol)"], + [27, "(function vent symbol)"], + [28, "(function vent symbol)"], + [29, "(function vent symbol)"] + ], + "crates": [[35, "(function process symbol)"]], + "collectables": [ + [77, "(function part-tracker vector)"], + [78, "(function part-tracker vector)"] ] } diff --git a/decompiler/config/jak3/ntsc_v1/art-group-info.min.json b/decompiler/config/jak3/ntsc_v1/art-group-info.min.json index 4c9db5a3bc0..51fcc087f4d 100644 --- a/decompiler/config/jak3/ntsc_v1/art-group-info.min.json +++ b/decompiler/config/jak3/ntsc_v1/art-group-info.min.json @@ -1 +1 @@ -{"air-train-ag":[[3,"air-train-idle-ja"],[2,"air-train-shadow-mg"],[1,"air-train-lod0-mg"],[0,"air-train-lod0-jg"]],"air-train-fma-ag":[[3,"air-train-fma-idle-ja"],[2,"air-train-fma-shadow-mg"],[1,"air-train-fma-lod0-mg"],[0,"air-train-fma-lod0-jg"]],"arena-token-ag":[[3,"arena-token-idle-ja"],[2,"arena-token-shadow-mg"],[1,"arena-token-lod0-mg"],[0,"arena-token-lod0-jg"]],"ashelin-ag":[[41,"ashelin-tumble-right-land-ja"],[40,"ashelin-tumble-right-loop-ja"],[39,"ashelin-tumble-right-start-ja"],[38,"ashelin-cartwheel-left-land-ja"],[37,"ashelin-cartwheel-left-loop-ja"],[36,"ashelin-cartwheel-left-start-ja"],[35,"ashelin-back-spring-land-ja"],[34,"ashelin-back-spring-loop-ja"],[33,"ashelin-back-spring-start-ja"],[32,"ashelin-standing-turn-right-ja"],[31,"ashelin-standing-turn-left-ja"],[30,"ashelin-standing-to-waiting-ja"],[29,"ashelin-standing-idle-ja"],[12,"ashelin-knocked-right-die0-ja"],[11,"ashelin-knocked-right-land0-ja"],[10,"ashelin-knocked-right0-ja"],[9,"ashelin-knocked-back-die0-ja"],[8,"ashelin-knocked-back-land0-ja"],[7,"ashelin-knocked-back0-ja"],[6,"ashelin-run0-ja"],[5,"ashelin-jog0-ja"],[4,"ashelin-walk0-ja"],[3,"ashelin-idle0-ja"],[2,"ashelin-shadow-mg"],[1,"ashelin-lod0-mg"],[0,"ashelin-lod0-jg"],[13,"ashelin-blue-hit-front0-ja"],[14,"ashelin-blue-hit-front1-ja"],[15,"ashelin-blue-hit-front2-ja"],[16,"ashelin-blue-hit-front-land0-ja"],[17,"ashelin-blue-hit-front-land1-ja"],[18,"ashelin-blue-hit-front-land2-ja"],[19,"ashelin-blue-hit-back0-ja"],[20,"ashelin-blue-hit-back1-ja"],[21,"ashelin-blue-hit-back2-ja"],[22,"ashelin-blue-hit-back-land0-ja"],[23,"ashelin-blue-hit-back-land1-ja"],[24,"ashelin-blue-hit-back-land2-ja"],[25,"ashelin-blue-hit-recover-ja"],[26,"ashelin-die-in-place0-ja"],[27,"ashelin-waiting-to-standing-ja"],[28,"ashelin-standing-fire-ja"]],"ashelin-effect-ag":[[2,"ashelin-effect-idle-ja"],[1,"ashelin-effect-lod0-mg"],[0,"ashelin-effect-lod0-jg"]],"ashelin-highres-ag":[[5,"ashelin-highres-ashelin-walk-ja"],[4,"ashelin-highres-idle-stand-ja"],[3,"ashelin-highres-idle-ja"],[2,"ashelin-highres-shadow-mg"],[1,"ashelin-highres-lod0-mg"],[0,"ashelin-highres-lod0-jg"]],"babak-ag":[[2,"babak-babak-idle-ja"],[1,"babak-lod0-mg"],[0,"babak-lod0-jg"]],"barge-ag":[[2,"barge-idle-ja"],[1,"barge-lod0-mg"],[0,"barge-lod0-jg"]],"baron-highres-ag":[[3,"baron-highres-baron-idle-ja"],[2,"baron-highres-idle-ja"],[1,"baron-highres-lod0-mg"],[0,"baron-highres-lod0-jg"]],"battle-amulet-ag":[[2,"battle-amulet-idle-ja"],[1,"battle-amulet-lod0-mg"],[0,"battle-amulet-lod0-jg"]],"beacon-ag":[[2,"beacon-idle-ja"],[1,"beacon-lod0-mg"],[0,"beacon-lod0-jg"]],"beam-generator-ag":[[3,"beam-generator-idle-ja"],[2,"beam-generator-shadow-mg"],[1,"beam-generator-lod0-mg"],[0,"beam-generator-lod0-jg"]],"beast-rider-ag":[[14,"beast-rider-death0-ja"],[13,"beast-rider-run-limp0-ja"],[0,"beast-rider-lod0-jg"],[1,"beast-rider-lod0-mg"],[2,"beast-rider-shadow-mg"],[3,"beast-rider-idle-ja"],[4,"beast-rider-run1-ja"],[5,"beast-rider-run-attack-ja"],[6,"beast-rider-turn180-ja"],[7,"beast-rider-fall-forward-ja"],[8,"beast-rider-down-idle1-ja"],[9,"beast-rider-down-idle2-ja"],[10,"beast-rider-get-up-ja"],[11,"beast-rider-down-hits0-ja"],[12,"beast-rider-down-hits0-jitter-ja"]],"bikea-ag":[[5,"bikea-idle-ja"],[4,"bikea-shadow-mg"],[3,"bikea-lod2-mg"],[2,"bikea-lod1-mg"],[1,"bikea-lod0-mg"],[0,"bikea-lod0-jg"]],"bikeb-ag":[[5,"bikeb-idle-ja"],[4,"bikeb-shadow-mg"],[3,"bikeb-lod2-mg"],[2,"bikeb-lod1-mg"],[1,"bikeb-lod0-mg"],[0,"bikeb-lod0-jg"]],"bikec-ag":[[5,"bikec-idle-ja"],[4,"bikec-shadow-mg"],[3,"bikec-lod2-mg"],[2,"bikec-lod1-mg"],[1,"bikec-lod0-mg"],[0,"bikec-lod0-jg"]],"billy-ag":[[2,"billy-billy-idle-ja"],[1,"billy-lod0-mg"],[0,"billy-lod0-jg"]],"bird-lady-ag":[[2,"bird-lady-bird-lady-idle-ja"],[1,"bird-lady-lod0-mg"],[0,"bird-lady-lod0-jg"]],"blocking-plane-ag":[[2,"blocking-plane-idle-ja"],[1,"blocking-plane-lod0-mg"],[0,"blocking-plane-lod0-jg"]],"blue-gun-mod-one-ag":[[2,"blue-gun-mod-one-idle-ja"],[1,"blue-gun-mod-one-lod0-mg"],[0,"blue-gun-mod-one-lod0-jg"]],"blue-gun-mod-three-ag":[[2,"blue-gun-mod-three-idle-ja"],[1,"blue-gun-mod-three-lod0-mg"],[0,"blue-gun-mod-three-lod0-jg"]],"blue-two-upgrade-ag":[[2,"blue-two-upgrade-idle-ja"],[1,"blue-two-upgrade-lod0-mg"],[0,"blue-two-upgrade-lod0-jg"]],"bluesage-ag":[[2,"bluesage-bluesage-idle-ja"],[1,"bluesage-lod0-mg"],[0,"bluesage-lod0-jg"]],"board-ag":[[5,"board-board-idle-ja"],[4,"board-close-ja"],[3,"board-open-ja"],[2,"board-shadow-mg"],[1,"board-lod0-mg"],[0,"board-lod0-jg"]],"bomb-bot-movie-ag":[[2,"bomb-bot-movie-idle-ja"],[1,"bomb-bot-movie-lod0-mg"],[0,"bomb-bot-movie-lod0-jg"]],"bombbot-ag":[[3,"bombbot-idle-ja"],[2,"bombbot-shadow-mg"],[1,"bombbot-lod0-mg"],[0,"bombbot-lod0-jg"]],"bombbot-bomb-ag":[[5,"bombbot-bomb-idle-ja"],[4,"bombbot-bomb-shadow-mg"],[3,"bombbot-bomb-lod2-mg"],[2,"bombbot-bomb-lod1-mg"],[1,"bombbot-bomb-lod0-mg"],[0,"bombbot-bomb-lod0-jg"]],"breastplate-ag":[[2,"breastplate-idle-ja"],[1,"breastplate-lod0-mg"],[0,"breastplate-lod0-jg"]],"broken-mdaxter-ag":[[2,"broken-mdaxter-idle-ja"],[1,"broken-mdaxter-lod0-mg"],[0,"broken-mdaxter-lod0-jg"]],"brutter-highres-ag":[[2,"brutter-highres-brutter-idle-ja"],[1,"brutter-highres-lod0-mg"],[0,"brutter-highres-lod0-jg"]],"bt-grunt-ag":[[18,"bt-grunt-closeup-idle-ja"],[17,"bt-grunt-close-attack1-ja"],[16,"bt-grunt-close-attack0-ja"],[15,"bt-grunt-mech-double-pound-ja"],[14,"bt-grunt-mech-punch-left-ja"],[13,"bt-grunt-mech-head-butt-ja"],[0,"bt-grunt-lod0-jg"],[1,"bt-grunt-lod0-mg"],[2,"bt-grunt-shadow-mg"],[3,"bt-grunt-idle-ja"],[4,"bt-grunt-idle2-ja"],[5,"bt-grunt-notice-ja"],[6,"bt-grunt-jump-wind-up-ja"],[7,"bt-grunt-jump-in-air-ja"],[8,"bt-grunt-jump-land-ja"],[9,"bt-grunt-ragdoll-ja"],[10,"bt-grunt-mech-lunge-ja"],[11,"bt-grunt-mech-grab-ja"],[12,"bt-grunt-mech-idle0-ja"]],"bt-jinx-ag":[[4,"bt-jinx-ride-ja"],[3,"bt-jinx-idle-ja"],[2,"bt-jinx-shadow-mg"],[1,"bt-jinx-lod0-mg"],[0,"bt-jinx-lod0-jg"]],"bt-roboguard-ag":[[14,"bt-roboguard-knocked-big-land-ja"],[13,"bt-roboguard-knocked-big-ja"],[0,"bt-roboguard-lod0-jg"],[1,"bt-roboguard-lod0-mg"],[2,"bt-roboguard-shadow-mg"],[3,"bt-roboguard-idle0-ja"],[4,"bt-roboguard-idle1-ja"],[5,"bt-roboguard-idle-shoot0-loop-ja"],[6,"bt-roboguard-idle-shoot0-turn-l0-ja"],[7,"bt-roboguard-idle-shoot0-turn-l1-ja"],[8,"bt-roboguard-idle-shoot0-turn-r0-ja"],[9,"bt-roboguard-idle-shoot0-turn-r1-ja"],[10,"bt-roboguard-walk-ja"],[11,"bt-roboguard-knocked-small-ja"],[12,"bt-roboguard-knocked-small-land-ja"]],"bt-sig-ag":[[7,"bt-sig-ride-ja"],[6,"bt-sig-pilot-car-up-down-ja"],[5,"bt-sig-pilot-car-turn-back-ja"],[4,"bt-sig-pilot-car-turn-front-ja"],[3,"bt-sig-idle-ja"],[2,"bt-sig-shadow-mg"],[1,"bt-sig-lod0-mg"],[0,"bt-sig-lod0-jg"]],"bt-torn-ag":[[3,"bt-torn-ride-ja"],[2,"bt-torn-idle-ja"],[1,"bt-torn-lod0-mg"],[0,"bt-torn-lod0-jg"]],"bt-wasp-ag":[[10,"bt-wasp-knocked0-recover-ja"],[9,"bt-wasp-knocked0-ja"],[8,"bt-wasp-shoot0-ja"],[7,"bt-wasp-fly-back-ja"],[6,"bt-wasp-fly-forward-ja"],[5,"bt-wasp-fly-left-ja"],[4,"bt-wasp-fly-right-ja"],[3,"bt-wasp-idle-ja"],[2,"bt-wasp-shadow-mg"],[1,"bt-wasp-lod0-mg"],[0,"bt-wasp-lod0-jg"]],"burning-bush-ag":[[2,"burning-bush-idle-ja"],[1,"burning-bush-lod0-mg"],[0,"burning-bush-lod0-jg"]],"cara-ag":[[5,"cara-idle-ja"],[4,"cara-shadow-mg"],[3,"cara-lod2-mg"],[2,"cara-lod1-mg"],[1,"cara-lod0-mg"],[0,"cara-lod0-jg"]],"carb-ag":[[5,"carb-idle-ja"],[4,"carb-shadow-mg"],[3,"carb-lod2-mg"],[2,"carb-lod1-mg"],[1,"carb-lod0-mg"],[0,"carb-lod0-jg"]],"carc-ag":[[5,"carc-idle-ja"],[4,"carc-shadow-mg"],[3,"carc-lod2-mg"],[2,"carc-lod1-mg"],[1,"carc-lod0-mg"],[0,"carc-lod0-jg"]],"catapult-ag":[[37,"catapult-debris-rearpanel-d-lod0-mg"],[36,"catapult-debris-rearpanel-d-lod0-jg"],[35,"catapult-debris-rearpanel-c-lod0-mg"],[34,"catapult-debris-rearpanel-c-lod0-jg"],[33,"catapult-debris-rearpanel-b-lod0-mg"],[32,"catapult-debris-rearpanel-b-lod0-jg"],[31,"catapult-debris-rearpanel-a-lod0-mg"],[30,"catapult-debris-rearpanel-a-lod0-jg"],[29,"catapult-debris-midpanel-d-lod0-mg"],[12,"catapult-debris-bumper-lod0-jg"],[11,"catapult-debris-bar-lod0-mg"],[10,"catapult-debris-bar-lod0-jg"],[9,"catapult-debris-smlspike-lod0-mg"],[8,"catapult-debris-smlspike-lod0-jg"],[7,"catapult-debris-longspike-lod0-mg"],[6,"catapult-debris-longspike-lod0-jg"],[5,"catapult-debris-panel-lod0-mg"],[4,"catapult-debris-panel-lod0-jg"],[3,"catapult-wheel-idle-ja"],[2,"catapult-wheel-shadow-mg"],[1,"catapult-wheel-lod0-mg"],[0,"catapult-wheel-lod0-jg"],[13,"catapult-debris-bumper-lod0-mg"],[14,"catapult-debris-frontpanel-a-lod0-jg"],[15,"catapult-debris-frontpanel-a-lod0-mg"],[16,"catapult-debris-frontpanel-b-lod0-jg"],[17,"catapult-debris-frontpanel-b-lod0-mg"],[18,"catapult-debris-frontpanel-c-lod0-jg"],[19,"catapult-debris-frontpanel-c-lod0-mg"],[20,"catapult-debris-frontpanel-d-lod0-jg"],[21,"catapult-debris-frontpanel-d-lod0-mg"],[22,"catapult-debris-midpanel-a-lod0-jg"],[23,"catapult-debris-midpanel-a-lod0-mg"],[24,"catapult-debris-midpanel-b-lod0-jg"],[25,"catapult-debris-midpanel-b-lod0-mg"],[26,"catapult-debris-midpanel-c-lod0-jg"],[27,"catapult-debris-midpanel-c-lod0-mg"],[28,"catapult-debris-midpanel-d-lod0-jg"]],"catapult-target-ag":[[3,"catapult-target-idle-ja"],[2,"catapult-target-shadow-mg"],[1,"catapult-target-lod0-mg"],[0,"catapult-target-lod0-jg"]],"cav-airlock-door-ag":[[2,"cav-airlock-door-idle-ja"],[1,"cav-airlock-door-lod0-mg"],[0,"cav-airlock-door-lod0-jg"]],"cav-break-bridge-ag":[[2,"cav-break-bridge-idle-ja"],[1,"cav-break-bridge-lod0-mg"],[0,"cav-break-bridge-lod0-jg"]],"cav-eco-lg-ag":[[20,"cav-eco-lg-sml-walk-alt-ja"],[19,"cav-eco-lg-sml-walk-ja"],[18,"cav-eco-lg-sml-attack-ja"],[17,"cav-eco-lg-sml-turn-right-ja"],[16,"cav-eco-lg-sml-turn-left-ja"],[15,"cav-eco-lg-med-walk-ja"],[14,"cav-eco-lg-med-attack-ja"],[13,"cav-eco-lg-ball-to-idle-ja"],[0,"cav-eco-lg-lod0-jg"],[1,"cav-eco-lg-lod0-mg"],[2,"cav-eco-lg-idle-ja"],[3,"cav-eco-lg-walk-ja"],[4,"cav-eco-lg-split-top-ja"],[5,"cav-eco-lg-split-bottom-ja"],[6,"cav-eco-lg-turn-left-ja"],[7,"cav-eco-lg-turn-right-ja"],[8,"cav-eco-lg-attack-ja"],[9,"cav-eco-lg-attack-alt-ja"],[10,"cav-eco-lg-victory-ja"],[11,"cav-eco-lg-victory-alt-ja"],[12,"cav-eco-lg-ball-ja"]],"cav-exit-door-ag":[[4,"cav-exit-door-open-ja"],[3,"cav-exit-door-idle-ja"],[2,"cav-exit-door-lod1-mg"],[1,"cav-exit-door-lod0-mg"],[0,"cav-exit-door-lod0-jg"]],"cav-minecar-ag":[[2,"cav-minecar-idle-ja"],[1,"cav-minecar-lod0-mg"],[0,"cav-minecar-lod0-jg"]],"cav-pillar-ag":[[23,"cav-pillar-debris-d-idle-ja"],[22,"cav-pillar-debris-d-lod0-mg"],[21,"cav-pillar-debris-d-lod0-jg"],[20,"cav-pillar-debris-c-idle-ja"],[19,"cav-pillar-debris-c-lod0-mg"],[18,"cav-pillar-debris-c-lod0-jg"],[17,"cav-pillar-debris-b-idle-ja"],[16,"cav-pillar-debris-b-lod0-mg"],[15,"cav-pillar-debris-b-lod0-jg"],[14,"cav-pillar-debris-a-idle-ja"],[13,"cav-pillar-debris-a-lod0-mg"],[0,"cav-pillar-lod0-jg"],[1,"cav-pillar-lod0-mg"],[2,"cav-pillar-idle-ja"],[3,"cav-pillar-b-lod0-jg"],[4,"cav-pillar-b-lod0-mg"],[5,"cav-pillar-b-idle-ja"],[6,"cav-pillar-c-lod0-jg"],[7,"cav-pillar-c-lod0-mg"],[8,"cav-pillar-c-idle-ja"],[9,"cav-pillar-d-lod0-jg"],[10,"cav-pillar-d-lod0-mg"],[11,"cav-pillar-d-idle-ja"],[12,"cav-pillar-debris-a-lod0-jg"]],"cav-prebot-break-ag":[[6,"cav-prebot-break-a-idle-ja"],[5,"cav-prebot-break-a-lod0-mg"],[4,"cav-prebot-break-a-lod0-jg"],[2,"cav-prebot-break-idle-ja"],[1,"cav-prebot-break-lod0-mg"],[0,"cav-prebot-break-lod0-jg"]],"cav-railblocker-ag":[[5,"cav-railblocker-explode-idle-ja"],[4,"cav-railblocker-explode-lod0-mg"],[3,"cav-railblocker-explode-lod0-jg"],[2,"cav-railblocker-idle-ja"],[1,"cav-railblocker-lod0-mg"],[0,"cav-railblocker-lod0-jg"]],"cipher-ag":[[2,"cipher-idle-ja"],[1,"cipher-lod0-mg"],[0,"cipher-lod0-jg"]],"citizen-chick-ag":[[27,"citizen-chick-riding-stance-ja"],[26,"citizen-chick-shuffle-ja"],[25,"citizen-chick-get-up-from-back-ja"],[24,"citizen-chick-get-up-from-front-ja"],[23,"citizen-chick-knocked-back-land-ja"],[22,"citizen-chick-knocked-back-ja"],[21,"citizen-chick-knocked-front-land-ja"],[20,"citizen-chick-knocked-front-ja"],[19,"citizen-chick-blue-hit-back-ja"],[18,"citizen-chick-blue-hit-front-ja"],[17,"citizen-chick-dive-forward-ja"],[16,"citizen-chick-cover-head-end-ja"],[15,"citizen-chick-cover-head-loop-ja"],[14,"citizen-chick-cover-head-start-ja"],[13,"citizen-chick-hit-the-deck-ja"],[0,"citizen-chick-lod0-jg"],[1,"citizen-chick-lod0-mg"],[2,"citizen-chick-lod2-mg"],[3,"citizen-chick-shadow-mg"],[4,"citizen-chick-walk-ja"],[5,"citizen-chick-walk2-ja"],[6,"citizen-chick-walk3-ja"],[7,"citizen-chick-run-ja"],[8,"citizen-chick-run2-ja"],[9,"citizen-chick-run3-ja"],[10,"citizen-chick-idle-ja"],[11,"citizen-chick-panic-run-ja"],[12,"citizen-chick-tread-water-ja"]],"citizen-fat-ag":[[32,"citizen-fat-tread-water-ja"],[31,"citizen-fat-riding-stance-ja"],[30,"citizen-fat-cover-head-end-ja"],[29,"citizen-fat-cover-head-loop-ja"],[12,"citizen-fat-shuffle-ja"],[11,"citizen-fat-walk-ja"],[10,"citizen-fat-out-of-breath-ja"],[9,"citizen-fat-idle-to-out-of-breath-ja"],[8,"citizen-fat-arms-crossed-ja"],[7,"citizen-fat-idle-to-arms-crossed-ja"],[6,"citizen-fat-arms-hips-ja"],[5,"citizen-fat-idle-to-arms-hips-ja"],[4,"citizen-fat-idle-ja"],[3,"citizen-fat-shadow-mg"],[2,"citizen-fat-lod2-mg"],[1,"citizen-fat-lod0-mg"],[0,"citizen-fat-lod0-jg"],[13,"citizen-fat-walk2-ja"],[14,"citizen-fat-walk3-ja"],[15,"citizen-fat-run-ja"],[16,"citizen-fat-run2-ja"],[17,"citizen-fat-panic-run-ja"],[18,"citizen-fat-dive-forward-ja"],[19,"citizen-fat-hit-the-deck-ja"],[20,"citizen-fat-knocked-front-ja"],[21,"citizen-fat-knocked-front-land-ja"],[22,"citizen-fat-knocked-back-ja"],[23,"citizen-fat-knocked-back-land-ja"],[24,"citizen-fat-get-up-from-front-ja"],[25,"citizen-fat-get-up-from-back-ja"],[26,"citizen-fat-blue-hit-front-ja"],[27,"citizen-fat-blue-hit-back-ja"],[28,"citizen-fat-cover-head-start-ja"]],"citizen-norm-ag":[[34,"citizen-norm-knocked-from-bike-ja"],[33,"citizen-norm-knocked-from-car-ja"],[32,"citizen-norm-get-in-car-ja"],[31,"citizen-norm-car-stance-ja"],[30,"citizen-norm-bike-stance-ja"],[29,"citizen-norm-tread-water-ja"],[12,"citizen-norm-walk-ja"],[11,"citizen-norm-shuffle-ja"],[10,"citizen-norm-out-of-breath-ja"],[9,"citizen-norm-idle-to-out-of-breath-ja"],[8,"citizen-norm-arms-crossed-ja"],[7,"citizen-norm-idle-to-arms-crossed-ja"],[6,"citizen-norm-arms-hips-ja"],[5,"citizen-norm-idle-to-arms-hips-ja"],[4,"citizen-norm-idle-ja"],[3,"citizen-norm-shadow-mg"],[2,"citizen-norm-lod2-mg"],[1,"citizen-norm-lod0-mg"],[0,"citizen-norm-lod0-jg"],[13,"citizen-norm-walk2-ja"],[14,"citizen-norm-run-ja"],[15,"citizen-norm-panic-run-ja"],[16,"citizen-norm-dive-forward-ja"],[17,"citizen-norm-hit-the-deck-ja"],[18,"citizen-norm-knocked-front-ja"],[19,"citizen-norm-knocked-front-land-ja"],[20,"citizen-norm-knocked-back-ja"],[21,"citizen-norm-knocked-back-land-ja"],[22,"citizen-norm-get-up-from-front-ja"],[23,"citizen-norm-get-up-from-back-ja"],[24,"citizen-norm-blue-hit-ja"],[25,"citizen-norm-blue-hit-land-death-ja"],[26,"citizen-norm-cover-head-start-ja"],[27,"citizen-norm-cover-head-loop-ja"],[28,"citizen-norm-cover-head-end-ja"]],"citizen-norm-rider-ag":[[5,"citizen-norm-rider-car-stance-ja"],[4,"citizen-norm-rider-bike-stance-ja"],[3,"citizen-norm-rider-idle-ja"],[2,"citizen-norm-rider-lod2-mg"],[1,"citizen-norm-rider-lod0-mg"],[0,"citizen-norm-rider-lod0-jg"]],"city-flitter-ag":[[17,"city-flitter-blue-hit0-ja"],[16,"city-flitter-knocked-land-upright-ja"],[15,"city-flitter-knocked-land0-ja"],[14,"city-flitter-knocked0-ja"],[13,"city-flitter-die-in-place-ja"],[0,"city-flitter-lod0-jg"],[1,"city-flitter-lod0-mg"],[2,"city-flitter-lod1-mg"],[3,"city-flitter-shadow-mg"],[4,"city-flitter-idle-ja"],[5,"city-flitter-ambush-jump-ja"],[6,"city-flitter-ambush-land-ja"],[7,"city-flitter-walk-ja"],[8,"city-flitter-move-ja"],[9,"city-flitter-turn-ja"],[10,"city-flitter-attack-ja"],[11,"city-flitter-attack-high-ja"],[12,"city-flitter-die-falling-ja"]],"city-grunt-ag":[[15,"city-grunt-ragdoll-ja"],[14,"city-grunt-getup-back-ja"],[13,"city-grunt-getup-front-ja"],[0,"city-grunt-lod0-jg"],[1,"city-grunt-lod0-mg"],[2,"city-grunt-lod1-mg"],[3,"city-grunt-shadow-mg"],[4,"city-grunt-idle-ja"],[5,"city-grunt-patrol1-ja"],[6,"city-grunt-notice-ja"],[7,"city-grunt-charge0-ja"],[8,"city-grunt-attack0-ja"],[9,"city-grunt-bite-ja"],[10,"city-grunt-jump-wind-up-ja"],[11,"city-grunt-jump-in-air-ja"],[12,"city-grunt-jump-land-ja"]],"collectables-ag":[[27,"collectables-warp-time-end-ja"],[26,"collectables-warp-time-idle-ja"],[25,"collectables-warp-time-lod0-mg"],[24,"collectables-warp-time-lod0-jg"],[23,"collectables-skill-idle-ja"],[22,"collectables-skill-shadow-mg"],[21,"collectables-skill-lod2-mg"],[20,"collectables-skill-lod1-mg"],[19,"collectables-skill-lod0-mg"],[18,"collectables-skill-lod0-jg"],[17,"collectables-generic-ripples-cycle-ja"],[16,"collectables-generic-ripples-idle-ja"],[15,"collectables-generic-ripples-lod0-mg"],[14,"collectables-generic-ripples-lod0-jg"],[13,"collectables-generic-blast-fade-ja"],[0,"collectables-bomb-blast-lod0-jg"],[1,"collectables-bomb-blast-lod0-mg"],[2,"collectables-bomb-blast-idle-ja"],[3,"collectables-health-lod0-jg"],[4,"collectables-health-lod0-mg"],[5,"collectables-health-idle-ja"],[6,"collectables-gem-lod0-jg"],[7,"collectables-gem-lod0-mg"],[8,"collectables-gem-lod1-mg"],[9,"collectables-gem-idle-ja"],[10,"collectables-generic-blast-lod0-jg"],[11,"collectables-generic-blast-lod0-mg"],[12,"collectables-generic-blast-idle-ja"]],"com-airlock-inner-ag":[[2,"com-airlock-inner-idle-ja"],[1,"com-airlock-inner-lod0-mg"],[0,"com-airlock-inner-lod0-jg"]],"com-airlock-outer-ag":[[2,"com-airlock-outer-idle-ja"],[1,"com-airlock-outer-lod0-mg"],[0,"com-airlock-outer-lod0-jg"]],"com-airlock-outer-mhcity-ag":[[2,"com-airlock-outer-mhcity-idle-ja"],[1,"com-airlock-outer-mhcity-lod0-mg"],[0,"com-airlock-outer-mhcity-lod0-jg"]],"com-power-box-ag":[[10,"com-power-box-debris-tubes-lod0-mg"],[9,"com-power-box-debris-tubes-lod0-jg"],[8,"com-power-box-debris-paneltop-lod0-mg"],[7,"com-power-box-debris-paneltop-lod0-jg"],[6,"com-power-box-debris-panelwires-lod0-mg"],[5,"com-power-box-debris-panelwires-lod0-jg"],[4,"com-power-box-debris-piece-lod0-mg"],[3,"com-power-box-debris-piece-lod0-jg"],[2,"com-power-box-idle-ja"],[1,"com-power-box-lod0-mg"],[0,"com-power-box-lod0-jg"]],"com-rod-of-god-ag":[[2,"com-rod-of-god-idle-ja"],[1,"com-rod-of-god-lod0-mg"],[0,"com-rod-of-god-lod0-jg"]],"comb-energy-ring-ag":[[3,"comb-energy-ring-idle-ja"],[2,"comb-energy-ring-lod1-mg"],[1,"comb-energy-ring-lod0-mg"],[0,"comb-energy-ring-lod0-jg"]],"comb-obstacle-ag":[[6,"comb-obstacle-explode-idle-ja"],[5,"comb-obstacle-explode-lod0-mg"],[4,"comb-obstacle-explode-lod0-jg"],[3,"comb-obstacle-idle-ja"],[2,"comb-obstacle-lod1-mg"],[1,"comb-obstacle-lod0-mg"],[0,"comb-obstacle-lod0-jg"]],"comb-pillar-ag":[[7,"comb-pillar-explode-idle-ja"],[6,"comb-pillar-explode-lod0-mg"],[5,"comb-pillar-explode-lod0-jg"],[4,"comb-pillar-idle-ja"],[3,"comb-pillar-lod2-mg"],[2,"comb-pillar-lod1-mg"],[1,"comb-pillar-lod0-mg"],[0,"comb-pillar-lod0-jg"]],"comb-rail-rider-ag":[[3,"comb-rail-rider-idle-ja"],[2,"comb-rail-rider-shadow-mg"],[1,"comb-rail-rider-lod0-mg"],[0,"comb-rail-rider-lod0-jg"]],"comb-sentinel-ag":[[5,"comb-sentinel-explode-idle-ja"],[4,"comb-sentinel-explode-lod0-mg"],[3,"comb-sentinel-explode-lod0-jg"],[2,"comb-sentinel-idle-ja"],[1,"comb-sentinel-lod0-mg"],[0,"comb-sentinel-lod0-jg"]],"crate-ag":[[3,"crate-idle-ja"],[2,"crate-krimson-lod1-mg"],[1,"crate-krimson-lod0-mg"],[0,"crate-krimson-lod0-jg"]],"crimson-guard-ag":[[55,"crimson-guard-shield-sidle-ja"],[54,"crimson-guard-shield-advance-ja"],[53,"crimson-guard-shield-flinch-ja"],[52,"crimson-guard-shield-hit-knock-ja"],[51,"crimson-guard-shield-shuffle-ja"],[50,"crimson-guard-shield-walk-ja"],[49,"crimson-guard-shield-fire-loop-ja"],[48,"crimson-guard-shield-fire-ja"],[47,"crimson-guard-shield-idle-ja"],[46,"crimson-guard-shield-pull-out-ja"],[45,"crimson-guard-cock-gun-ja"],[44,"crimson-guard-grenade-reload-ja"],[43,"crimson-guard-knocked-from-bike-ja"],[42,"crimson-guard-knocked-from-car-ja"],[41,"crimson-guard-jump-left-ja"],[40,"crimson-guard-jump-right-ja"],[39,"crimson-guard-die-falling-ja"],[38,"crimson-guard-jump-high-ja"],[37,"crimson-guard-grenade-attack-ja"],[36,"crimson-guard-car-stance-ja"],[35,"crimson-guard-bike-stance-ja"],[34,"crimson-guard-get-up-back-ja"],[33,"crimson-guard-get-up-front-ja"],[32,"crimson-guard-knocked-back-land-ja"],[31,"crimson-guard-knocked-back-ja"],[30,"crimson-guard-attack-shoot-knee-end-ja"],[29,"crimson-guard-attack-shoot-knee-ja"],[12,"crimson-guard-blue-hit-land-death-ja"],[11,"crimson-guard-blue-hit-land-ja"],[10,"crimson-guard-blue-hit-ja"],[9,"crimson-guard-knocked-land-ja"],[8,"crimson-guard-knocked-ja"],[7,"crimson-guard-notice-ja"],[6,"crimson-guard-run-ja"],[5,"crimson-guard-walk-ja"],[4,"crimson-guard-idle-ja"],[3,"crimson-guard-shadow-mg"],[2,"crimson-guard-lod2-mg"],[1,"crimson-guard-lod0-mg"],[0,"crimson-guard-lod0-jg"],[13,"crimson-guard-yellow-hit0-ja"],[14,"crimson-guard-yellow-hit0-land-ja"],[15,"crimson-guard-yellow-hit1-ja"],[16,"crimson-guard-yellow-hit1-land-ja"],[17,"crimson-guard-die-ja"],[18,"crimson-guard-rifle-butt-ja"],[19,"crimson-guard-idle-to-stab-idle-ja"],[20,"crimson-guard-stab-idle-loop-ja"],[21,"crimson-guard-stab-idle-to-attack-ja"],[22,"crimson-guard-stab-attack-ja"],[23,"crimson-guard-stab-attack-to-stab-idle-ja"],[24,"crimson-guard-stab-idle-to-idle-ja"],[25,"crimson-guard-stab-shuffle-ja"],[26,"crimson-guard-gun-attack-ja"],[27,"crimson-guard-attack-shoot-knee-start-ja"],[28,"crimson-guard-attack-shoot-knee-loop-ja"]],"crimson-guard-highres-ag":[[3,"crimson-guard-highres-idle-ja"],[2,"crimson-guard-highres-shadow-mg"],[1,"crimson-guard-highres-lod0-mg"],[0,"crimson-guard-highres-lod0-jg"]],"crocadog-highres-ag":[[2,"crocadog-highres-idle-ja"],[1,"crocadog-highres-lod0-mg"],[0,"crocadog-highres-lod0-jg"]],"cty-dax-missile-ag":[[3,"cty-dax-missile-idle-ja"],[2,"cty-dax-missile-lod1-mg"],[1,"cty-dax-missile-lod0-mg"],[0,"cty-dax-missile-lod0-jg"]],"cty-dax-missile-launcher-ag":[[4,"cty-dax-missile-launcher-rise-ja"],[3,"cty-dax-missile-launcher-idle-ja"],[2,"cty-dax-missile-launcher-lod1-mg"],[1,"cty-dax-missile-launcher-lod0-mg"],[0,"cty-dax-missile-launcher-lod0-jg"]],"cty-decoy-ag":[[7,"cty-decoy-explode-idle-ja"],[6,"cty-decoy-explode-lod0-mg"],[5,"cty-decoy-explode-lod0-jg"],[4,"cty-decoy-open-idle-ja"],[3,"cty-decoy-open-ja"],[2,"cty-decoy-idle-ja"],[1,"cty-decoy-lod0-mg"],[0,"cty-decoy-lod0-jg"]],"cty-door-ag":[[3,"cty-door-idle-ja"],[2,"cty-door-lod1-mg"],[1,"cty-door-lod0-mg"],[0,"cty-door-lod0-jg"]],"cty-elevator-ag":[[2,"cty-elevator-idle-ja"],[1,"cty-elevator-lod0-mg"],[0,"cty-elevator-lod0-jg"]],"cty-explode-barrel-ag":[[2,"cty-explode-barrel-idle-ja"],[1,"cty-explode-barrel-lod0-mg"],[0,"cty-explode-barrel-lod0-jg"]],"cty-fruit-stand-ag":[[2,"cty-fruit-stand-idle-ja"],[1,"cty-fruit-stand-lod0-mg"],[0,"cty-fruit-stand-lod0-jg"]],"cty-homing-missile-ag":[[2,"cty-homing-missile-idle-ja"],[1,"cty-homing-missile-lod0-mg"],[0,"cty-homing-missile-lod0-jg"]],"cty-missile-launcher-ag":[[4,"cty-missile-launcher-recoil-ja"],[3,"cty-missile-launcher-idle-ja"],[2,"cty-missile-launcher-lod1-mg"],[1,"cty-missile-launcher-lod0-mg"],[0,"cty-missile-launcher-lod0-jg"]],"cty-port-mine-ag":[[6,"cty-port-mine-explode-idle-ja"],[5,"cty-port-mine-explode-lod0-mg"],[4,"cty-port-mine-explode-lod0-jg"],[3,"cty-port-mine-idle-ja"],[2,"cty-port-mine-lod1-mg"],[1,"cty-port-mine-lod0-mg"],[0,"cty-port-mine-lod0-jg"]],"cty-remote-ag":[[2,"cty-remote-idle-ja"],[1,"cty-remote-lod0-mg"],[0,"cty-remote-lod0-jg"]],"cty-sniper-battery-ag":[[5,"cty-sniper-battery-explode-idle-ja"],[4,"cty-sniper-battery-explode-lod0-mg"],[3,"cty-sniper-battery-explode-lod0-jg"],[2,"cty-sniper-battery-idle-ja"],[1,"cty-sniper-battery-lod0-mg"],[0,"cty-sniper-battery-lod0-jg"]],"cty-sniper-button-ag":[[5,"cty-sniper-button-popup-ja"],[4,"cty-sniper-button-pushdown-ja"],[3,"cty-sniper-button-idle-ja"],[2,"cty-sniper-button-lod1-mg"],[1,"cty-sniper-button-lod0-mg"],[0,"cty-sniper-button-lod0-jg"]],"cty-sniper-button-top-ag":[[5,"cty-sniper-button-top-popup-ja"],[4,"cty-sniper-button-top-pushdown-ja"],[3,"cty-sniper-button-top-idle-ja"],[2,"cty-sniper-button-top-lod1-mg"],[1,"cty-sniper-button-top-lod0-mg"],[0,"cty-sniper-button-top-lod0-jg"]],"cty-sniper-core-ag":[[7,"cty-sniper-core-explode-idle-ja"],[6,"cty-sniper-core-explode-lod0-mg"],[5,"cty-sniper-core-explode-lod0-jg"],[4,"cty-sniper-core-retract-ja"],[3,"cty-sniper-core-open-ja"],[2,"cty-sniper-core-idle-ja"],[1,"cty-sniper-core-lod0-mg"],[0,"cty-sniper-core-lod0-jg"]],"cty-sniper-turret-ag":[[10,"cty-sniper-turret-explode-idle-ja"],[9,"cty-sniper-turret-explode-lod0-mg"],[8,"cty-sniper-turret-explode-lod0-jg"],[7,"cty-sniper-turret-collapse-ja"],[6,"cty-sniper-turret-deactivate-ja"],[5,"cty-sniper-turret-activate-ja"],[4,"cty-sniper-turret-barrelfire-ja"],[3,"cty-sniper-turret-idle-ja"],[2,"cty-sniper-turret-lod1-mg"],[1,"cty-sniper-turret-lod0-mg"],[0,"cty-sniper-turret-lod0-jg"]],"cty-sniper-turret-reticle-ag":[[4,"cty-sniper-turret-reticle-locked-ja"],[3,"cty-sniper-turret-reticle-idle-ja"],[2,"cty-sniper-turret-reticle-shadow-mg"],[1,"cty-sniper-turret-reticle-lod0-mg"],[0,"cty-sniper-turret-reticle-lod0-jg"]],"ctycrate-ag":[[6,"ctycrate-idle-ja"],[5,"ctycrate-metal-lod1-mg"],[4,"ctycrate-metal-lod0-mg"],[3,"ctycrate-metal-lod0-jg"],[2,"ctycrate-blue-lod1-mg"],[1,"ctycrate-blue-lod0-mg"],[0,"ctycrate-blue-lod0-jg"]],"ctyinda-evil-streetlamp-ag":[[2,"ctyinda-evil-streetlamp-idle-ja"],[1,"ctyinda-evil-streetlamp-lod0-mg"],[0,"ctyinda-evil-streetlamp-lod0-jg"]],"ctypal-base-break-ag":[[2,"ctypal-base-break-idle-ja"],[1,"ctypal-base-break-lod0-mg"],[0,"ctypal-base-break-lod0-jg"]],"ctypal-cable-break-ag":[[2,"ctypal-cable-break-idle-ja"],[1,"ctypal-cable-break-lod0-mg"],[0,"ctypal-cable-break-lod0-jg"]],"ctypal-ctyfarma-ag":[[2,"ctypal-ctyfarma-idle-ja"],[1,"ctypal-ctyfarma-lod0-mg"],[0,"ctypal-ctyfarma-lod0-jg"]],"ctypal-palace-break-ag":[[22,"ctypal-palace-break-e-idle-ja"],[21,"ctypal-palace-break-e-lod0-mg"],[20,"ctypal-palace-break-e-lod0-jg"],[18,"ctypal-palace-break-d-idle-ja"],[17,"ctypal-palace-break-d-lod0-mg"],[0,"ctypal-palace-break-lod0-jg"],[13,"ctypal-palace-break-c-lod0-mg"],[1,"ctypal-palace-break-lod0-mg"],[14,"ctypal-palace-break-c-idle-ja"],[2,"ctypal-palace-break-idle-ja"],[4,"ctypal-palace-break-a-lod0-jg"],[5,"ctypal-palace-break-a-lod0-mg"],[6,"ctypal-palace-break-a-idle-ja"],[8,"ctypal-palace-break-b-lod0-jg"],[9,"ctypal-palace-break-b-lod0-mg"],[10,"ctypal-palace-break-b-idle-ja"],[12,"ctypal-palace-break-c-lod0-jg"],[16,"ctypal-palace-break-d-lod0-jg"]],"ctypal-rail-ag":[[2,"ctypal-rail-idle-ja"],[1,"ctypal-rail-lod0-mg"],[0,"ctypal-rail-lod0-jg"]],"ctypal-support-break-ag":[[2,"ctypal-support-break-idle-ja"],[1,"ctypal-support-break-lod0-mg"],[0,"ctypal-support-break-lod0-jg"]],"ctyport-mine-ag":[[2,"ctyport-mine-idle-ja"],[1,"ctyport-mine-lod0-mg"],[0,"ctyport-mine-lod0-jg"]],"ctyslumc-flag-ag":[[2,"ctyslumc-flag-idle-ja"],[1,"ctyslumc-flag-lod0-mg"],[0,"ctyslumc-flag-lod0-jg"]],"ctywide-arrow-ag":[[2,"ctywide-arrow-idle-ja"],[1,"ctywide-arrow-lod0-mg"],[0,"ctywide-arrow-lod0-jg"]],"dark-eco-vent-ag":[[4,"dark-eco-vent-close-open-ja"],[3,"dark-eco-vent-lod2-mg"],[2,"dark-eco-vent-lod1-mg"],[1,"dark-eco-vent-lod0-mg"],[0,"dark-eco-vent-lod0-jg"]],"dark-maker-idol-ag":[[2,"dark-maker-idol-idle-ja"],[1,"dark-maker-idol-lod0-mg"],[0,"dark-maker-idol-lod0-jg"]],"dark-maker-idol-break-ag":[[2,"dark-maker-idol-break-idle-ja"],[1,"dark-maker-idol-break-lod0-mg"],[0,"dark-maker-idol-break-lod0-jg"]],"dark-maker-idol-fma-ag":[[2,"dark-maker-idol-fma-idle-ja"],[1,"dark-maker-idol-fma-lod0-mg"],[0,"dark-maker-idol-fma-lod0-jg"]],"darkjak-highres-ag":[[5,"darkjak-highres-idle-ja"],[4,"darkjak-highres-jakcfma0-scarf-cg"],[3,"darkjak-highres-jakcfma0-sash-cg"],[2,"darkjak-highres-jakcfma0-skirt-cg"],[1,"darkjak-highres-lod0-mg"],[0,"darkjak-highres-lod0-jg"]],"daxter-ag":[[91,"daxter-tentacle-attack-ja"],[398,"daxter-fldax-death-cactus-ja"],[397,"daxter-fldax-finish-ja"],[396,"daxter-fldax-run-squash-ja"],[395,"daxter-fldax-walk-ja"],[394,"daxter-fldax-wild-run-right-ja"],[393,"daxter-fldax-wild-run-left-ja"],[392,"daxter-fldax-get-off-ja"],[391,"daxter-fldax-idle-ja"],[390,"daxter-fldax-get-on-ja"],[389,"daxter-fldax-jump-forward-loop-ja"],[388,"daxter-fldax-jump-forward-ja"],[387,"daxter-fldax-deatha-ja"],[386,"daxter-fldax-smack-surface-end-ja"],[385,"daxter-fldax-smack-surface-ja"],[384,"daxter-fldax-wild-run-ja"],[334,"daxter-pilot-wcar-snake-jump-ja"],[333,"daxter-pilot-wcar-snake-out-ja"],[332,"daxter-pilot-wcar-snake-loop-ja"],[331,"daxter-pilot-wcar-snake-in-ja"],[119,"daxter-tube-jump-land-ja"],[118,"daxter-tube-turn-ja"],[376,"daxter-flut-death-drown-ja"],[375,"daxter-flut-deathb-ja"],[373,"daxter-flut-run-squash-ja"],[372,"daxter-flut-deatha-ja"],[371,"daxter-flut-smack-surface-end-ja"],[370,"daxter-flut-smack-surface-ja"],[369,"daxter-flut-hit-back-end-ja"],[368,"daxter-flut-hit-back-ja"],[367,"daxter-flut-get-off-ja"],[366,"daxter-flut-get-on-ja"],[365,"daxter-flut-air-attack-land-ja"],[364,"daxter-flut-air-attack-loop-ja"],[363,"daxter-flut-air-attack-ja"],[362,"daxter-flut-running-attack-end-ja"],[361,"daxter-flut-running-attack-ja"],[360,"daxter-flut-double-jump-ja"],[359,"daxter-flut-jump-forward-land-ja"],[358,"daxter-flut-jump-forward-loop-ja"],[357,"daxter-flut-jump-forward-ja"],[356,"daxter-flut-jump-land-ja"],[355,"daxter-flut-jump-loop-ja"],[354,"daxter-flut-jump-ja"],[353,"daxter-flut-run-ja"],[352,"daxter-flut-jog-ja"],[351,"daxter-flut-walk-ja"],[574,"daxter-ladder-switch-ja"],[572,"daxter-ladder-fall-ja"],[568,"daxter-ladder-slide-start-ja"],[374,"daxter-flut-kanga-catch-ja"],[324,"daxter-pilot-bike-smack-right-ja"],[323,"daxter-pilot-bike-smack-left-ja"],[306,"daxter-pilot-bike-get-off-ja"],[305,"daxter-pilot-bike-smack-shock-ja"],[304,"daxter-pilot-bike-up-down-ja"],[302,"daxter-pilot-bike-smack-back-ja"],[301,"daxter-pilot-bike-smack-front-ja"],[300,"daxter-pilot-bike-turn-back-ja"],[299,"daxter-pilot-bike-turn-front-ja"],[293,"daxter-pilot-car-turn-back-ja"],[292,"daxter-pilot-car-turn-front-ja"],[291,"daxter-pilot-bike-get-on-ja"],[328,"daxter-pilot-wcar-turn-back-ja"],[327,"daxter-pilot-wcar-turn-front-ja"],[326,"daxter-pilot-car-smack-right-ja"],[325,"daxter-pilot-car-smack-left-ja"],[307,"daxter-pilot-eject-loop-ja"],[303,"daxter-pilot-car-up-down-ja"],[298,"daxter-pilot-car-smack-shock-ja"],[295,"daxter-pilot-car-smack-back-ja"],[294,"daxter-pilot-car-smack-front-ja"],[290,"daxter-pilot-car-get-on-ja"],[289,"daxter-pilot-car-get-off-ja"],[322,"daxter-pilot-gun-dark-takeout-ja"],[321,"daxter-pilot-gun-blue-takeout-ja"],[320,"daxter-pilot-gun-yellow-takeout-ja"],[319,"daxter-pilot-gun-blue-blue-ja"],[318,"daxter-pilot-gun-yellow-blue-ja"],[317,"daxter-pilot-gun-red-blue-ja"],[316,"daxter-pilot-gun-red-yellow-ja"],[315,"daxter-pilot-gun-red-dark-ja"],[314,"daxter-pilot-gun-dark-fire-ja"],[313,"daxter-pilot-gun-yellow-fire-ja"],[312,"daxter-pilot-gun-red-fire-ja"],[311,"daxter-pilot-gun-blue-idle-ja"],[310,"daxter-pilot-gun-yellow-idle-ja"],[309,"daxter-pilot-gun-dark-idle-ja"],[287,"daxter-gun-attack-butt-end-alt1-ja"],[571,"daxter-ladder-jump-ja"],[30,"daxter-edge-grab-stance1-ja"],[154,"daxter-board-hit-ja"],[281,"daxter-gun-yellow-fire-3-ja"],[24,"daxter-jump-short-land-ja"],[538,"daxter-pidax-car-crash-back-ja"],[280,"daxter-gun-red-fire-2-ja"],[564,"daxter-ladder-stance-ja"],[23,"daxter-jump-loop-ja"],[537,"daxter-pidax-car-crash-front-ja"],[271,"daxter-gun-front-jump-land-ja"],[14,"daxter-run-squash-weak-ja"],[528,"daxter-indax-hang-get-on-ja"],[270,"daxter-gun-front-jump-ja"],[13,"daxter-run-squash-ja"],[527,"daxter-indax-hang-walk-to-stance-ja"],[269,"daxter-gun-front-run-ja"],[12,"daxter-walk-down-ja"],[526,"daxter-indax-hang-attack-ja"],[253,"daxter-gun-duck-roll-end-ja"],[510,"daxter-indax-run-right-ja"],[252,"daxter-gun-duck-roll-ja"],[509,"daxter-indax-run-left-ja"],[251,"daxter-gun-edge-grab-to-jump-ja"],[508,"daxter-indax-run-down-ja"],[250,"daxter-gun-edge-grab-off-ja"],[507,"daxter-indax-run-up-ja"],[249,"daxter-gun-attack-upperbutt-blue-ja"],[506,"daxter-indax-tube-jump-land-ja"],[248,"daxter-gun-jump-land-side-ja"],[505,"daxter-indax-tube-turn-ja"],[247,"daxter-gun-jump-land-ja"],[504,"daxter-indax-death-shock-ja"],[246,"daxter-gun-attack-butt-blue-end-ja"],[503,"daxter-indax-death-freeze-ja"],[245,"daxter-gun-attack-butt-blue-ja"],[502,"daxter-indax-trip-land-ja"],[244,"daxter-gun-attack-butt-end-ja"],[501,"daxter-indax-trip-ja"],[243,"daxter-gun-attack-butt-ja"],[500,"daxter-indax-running-attack-end-ja"],[242,"daxter-gun-blue-to-front-hop-ja"],[499,"daxter-indax-run-squash-hands-ja"],[241,"daxter-gun-front-to-blue-hop-ja"],[498,"daxter-indax-jump-forward-hands-land-ja"],[240,"daxter-gun-front-to-side-hop-ja"],[497,"daxter-indax-jump-forward-hands-loop-ja"],[239,"daxter-gun-transformation-twirl-ja"],[496,"daxter-indax-jump-forward-hands-ja"],[238,"daxter-gun-side-to-front-hop-ja"],[495,"daxter-indax-running-attack-ja"],[237,"daxter-gun-attack-upperbutt-ja"],[494,"daxter-indax-death-eaten-ja"],[236,"daxter-gun-blue-takeout-ja"],[493,"daxter-indax-death-kill-ja"],[235,"daxter-gun-yellow-takeout-ja"],[492,"daxter-indax-death-fall-ja"],[234,"daxter-gun-dark-takeout-ja"],[491,"daxter-indax-death-squashed-ja"],[233,"daxter-gun-red-takeout-ja"],[490,"daxter-indax-hit-roll-ja"],[232,"daxter-gun-run-blue-ja"],[489,"daxter-indax-hit-back-ja"],[231,"daxter-gun-walk-side-ja"],[488,"daxter-indax-hit-front-ja"],[230,"daxter-gun-yellow-fire-ja"],[487,"daxter-indax-run-to-stance-ja"],[229,"daxter-gun-dark-fire-ja"],[486,"daxter-indax-attack-spin-air-ja"],[228,"daxter-gun-blue-fire-single-ja"],[485,"daxter-indax-run-squash-ja"],[227,"daxter-gun-blue-fire-ja"],[484,"daxter-indax-jump-forward-land-ja"],[226,"daxter-gun-red-fire-ja"],[483,"daxter-indax-jump-forward-loop-ja"],[225,"daxter-gun-stance-blue-ja"],[482,"daxter-indax-jump-forward-ja"],[224,"daxter-gun-stance-yellow-ja"],[481,"daxter-indax-run-look-back-ja"],[222,"daxter-gun-blue-to-yellow-ja"],[479,"daxter-indax-attack-spin-ja"],[221,"daxter-gun-attack-from-stance-blue-end-ja"],[478,"daxter-indax-jump-land-ja"],[220,"daxter-gun-attack-from-stance-blue-ja"],[477,"daxter-indax-jump-loop-ja"],[219,"daxter-gun-attack-from-stance-end-ja"],[476,"daxter-indax-jump-ja"],[218,"daxter-gun-attack-from-stance-ja"],[475,"daxter-indax-run-ja"],[217,"daxter-gun-yellow-highlow-ja"],[474,"daxter-indax-walk-ja"],[216,"daxter-gun-yellow-fire-low-ja"],[473,"daxter-indax-stance-ja"],[215,"daxter-gun-stance-yellow-low-ja"],[282,"daxter-gun-blue-fire-2-ja"],[566,"daxter-ladder-down-ja"],[25,"daxter-jump-forward-ja"],[539,"daxter-pidax-car-crash-left-ja"],[569,"daxter-ladder-slide-loop-ja"],[28,"daxter-launch-jump-loop-ja"],[152,"daxter-board-jump-loop-ja"],[279,"daxter-gun-red-fire-fast-ja"],[22,"daxter-painful-land-end-ja"],[536,"daxter-pidax-car-up-down-ja"],[151,"daxter-board-jump-ja"],[149,"daxter-board-turn-ja"],[148,"daxter-board-duck-turn-ja"],[275,"daxter-gun-side-jump-land-ja"],[532,"daxter-indax-hang-dummy8-ja"],[562,"daxter-ladder-up-ja"],[21,"daxter-painful-land-ja"],[535,"daxter-pidax-car-turn-back-ja"],[147,"daxter-board-stance-ja"],[274,"daxter-gun-side-jump-ja"],[531,"daxter-indax-hang-dummy7-ja"],[20,"daxter-jump-land-ja"],[534,"daxter-pidax-car-turn-front-ja"],[273,"daxter-gun-walk-blue-ja"],[530,"daxter-indax-hang-dummy6-ja"],[560,"daxter-ladder-get-on-ja"],[19,"daxter-jump-ja"],[533,"daxter-indax-hang-dummy9-ja"],[268,"daxter-gun-front-walk-ja"],[11,"daxter-walk-up-ja"],[525,"daxter-indax-hang-dodge-off-ja"],[267,"daxter-gun-hit-elec-ja"],[10,"daxter-walk-ja"],[524,"daxter-indax-hang-dodge-loop-ja"],[283,"daxter-gun-blue-stance-2-ja"],[540,"daxter-pidax-car-crash-right-ja"],[570,"daxter-ladder-slide-stop-ja"],[29,"daxter-edge-grab-stance0-ja"],[286,"daxter-gun-attack-from-stance-end-alt1-ja"],[254,"daxter-gun-roll-flip-ja"],[511,"daxter-indax-dummy0-ja"],[257,"daxter-gun-flop-down-loop-ja"],[514,"daxter-indax-dummy3-ja"],[59,"daxter-roll-flip-land-ja"],[284,"daxter-gun-side-to-side-hop-1-ja"],[0,"daxter-lod0-jg"],[541,"daxter-pidax-missile-turn-front-ja"],[255,"daxter-gun-roll-flip-land-ja"],[512,"daxter-indax-dummy1-ja"],[542,"daxter-pidax-missile-turn-back-ja"],[1,"daxter-lod0-mg"],[258,"daxter-gun-flop-down-land-ja"],[515,"daxter-indax-dummy4-ja"],[60,"daxter-trip-ja"],[256,"daxter-gun-flop-down-ja"],[513,"daxter-indax-dummy2-ja"],[543,"daxter-pidax-missile-jump-ja"],[2,"daxter-shadow-mg"],[259,"daxter-gun-hit-from-front-ja"],[516,"daxter-indax-dummy5-ja"],[61,"daxter-hit-elec-ja"],[573,"daxter-ladder-jump-on-ja"],[32,"daxter-falling-to-edge-grab-ja"],[544,"daxter-pidax-missile-jump-loop-ja"],[3,"daxter-run-to-stance-ja"],[260,"daxter-gun-hit-from-back-ja"],[517,"daxter-indax-dummy6-ja"],[62,"daxter-hit-from-front-ja"],[518,"daxter-indax-dummy7-ja"],[63,"daxter-hit-from-back-ja"],[546,"daxter-pidax-missile-up-down-ja"],[5,"daxter-stance-loop-ja"],[519,"daxter-indax-hang-stance-ja"],[64,"daxter-hit-up-ja"],[35,"daxter-edge-grab-to-jump-ja"],[520,"daxter-indax-hang-walk-ja"],[65,"daxter-deatha-ja"],[36,"daxter-edge-grab-off-ja"],[521,"daxter-indax-hang-walk-start-ja"],[66,"daxter-death-painful-land-ja"],[37,"daxter-attack-from-stance-ja"],[214,"daxter-gun-stance-ja"],[8,"daxter-run-up-ja"],[522,"daxter-indax-hang-turn-around-ja"],[67,"daxter-smack-surface-ja"],[9,"daxter-run-down-ja"],[523,"daxter-indax-hang-dodge-on-ja"],[68,"daxter-smack-surface-end-ja"],[69,"daxter-shocked-ja"],[38,"daxter-attack-from-stance-end-ja"],[40,"daxter-attack-from-stance-run-end-ja"],[297,"daxter-pilot-gun-blue-fire-single-ja"],[42,"daxter-attack-from-jump-ja"],[43,"daxter-attack-from-jump-loop-ja"],[44,"daxter-attack-from-jump-end-ja"],[45,"daxter-attack-punch-ja"],[46,"daxter-attack-punch-end-ja"],[48,"daxter-attack-uppercut-ja"],[49,"daxter-flop-down-ja"],[50,"daxter-flop-down-loop-ja"],[51,"daxter-flop-down-land-ja"],[308,"daxter-pilot-gun-red-idle-ja"],[52,"daxter-moving-flop-down-ja"],[53,"daxter-moving-flop-down-loop-ja"],[55,"daxter-flop-jump-ja"],[223,"daxter-gun-stance-dark-ja"],[480,"daxter-indax-attack-spin-end-ja"],[350,"daxter-flut-idle-ja"],[56,"daxter-duck-roll-ja"],[57,"daxter-duck-roll-end-ja"],[58,"daxter-roll-flip-ja"],[157,"daxter-board-turn-left-ja"],[158,"daxter-board-turn-right-ja"],[159,"daxter-board-turn-up-ja"],[160,"daxter-board-turn-down-ja"],[161,"daxter-board-hit-forward-ja"],[166,"daxter-board-get-on-ja"],[167,"daxter-board-get-off-ja"],[424,"daxter-darkjak-get-on-fast-ja"],[173,"daxter-board-air-turn-ja"],[185,"daxter-board-hit-elec-ja"],[442,"daxter-powerjak-get-on-loop-ja"],[186,"daxter-board-get-on-land-ja"],[443,"daxter-lightjak-get-on-ja"],[187,"daxter-board-get-off-pre-ja"],[444,"daxter-lightjak-get-off-ja"],[190,"daxter-board-hit-get-off-ja"],[420,"daxter-darkjak-get-off-ja"],[427,"daxter-darkjak-get-off-end-ja"],[434,"daxter-darkjak-get-on-fast-loop-ja"],[441,"daxter-powerjak-get-on-ja"],[446,"daxter-lightjak-get-on-loop-ja"],[97,"daxter-wade-shallow-walk-ja"],[98,"daxter-wade-deep-walk-ja"],[99,"daxter-swim-stance-ja"],[100,"daxter-swim-walk-ja"],[101,"daxter-swim-walk-to-down-ja"],[102,"daxter-swim-down-ja"],[103,"daxter-swim-down-to-up-ja"],[104,"daxter-swim-up-ja"],[105,"daxter-swim-up-to-stance-ja"],[106,"daxter-swim-jump-ja"],[107,"daxter-death-swim-ja"],[108,"daxter-death-swim-loop-ja"],[109,"daxter-death-swim-end-ja"],[110,"daxter-pole-cycle-ja"],[111,"daxter-pole-cycle2-ja"],[112,"daxter-pole-flip-up-ja"],[113,"daxter-pole-flip-forward-ja"],[114,"daxter-pole-jump-loop-ja"],[4,"daxter-run-to-stance-loop-ja"],[545,"daxter-pidax-missile-get-off-prep-ja"],[288,"daxter-pilot-gun-red-takeout-ja"],[6,"daxter-run-to-stance-fast-ja"],[547,"daxter-pidax-missile-crash-left-ja"],[7,"daxter-run-ja"],[548,"daxter-pidax-missile-crash-right-ja"],[341,"daxter-turret-stance-ja"],[342,"daxter-turret-get-off-ja"],[343,"daxter-turret-get-on-ja"],[344,"daxter-turret-for-stance-ja"],[345,"daxter-turret-for-get-off-ja"],[346,"daxter-turret-for-get-on-ja"],[347,"daxter-turret-for-stance-left-ja"],[348,"daxter-turret-for-stance-right-ja"],[349,"daxter-turret-for-fire-ja"],[529,"daxter-indax-hang-dummy5-ja"],[329,"daxter-pilot-glider-turn-front-ja"],[330,"daxter-pilot-glider-turn-back-ja"],[296,"daxter-pilot-gun-blue-fire-ja"]],"daxter-highres-ag":[[3,"daxter-highres-daxter-walk-ja"],[2,"daxter-highres-shadow-mg"],[1,"daxter-highres-lod0-mg"],[0,"daxter-highres-lod0-jg"]],"daxter-pac-man-ag":[[9,"daxter-pac-man-eat-ja"],[8,"daxter-pac-man-zip-up-ja"],[7,"daxter-pac-man-zip-down-ja"],[6,"daxter-pac-man-death-2-ja"],[5,"daxter-pac-man-death-1-ja"],[4,"daxter-pac-man-victory-ja"],[3,"daxter-pac-man-idle-fast-ja"],[2,"daxter-pac-man-idle-ja"],[1,"daxter-pac-man-lod0-mg"],[0,"daxter-pac-man-lod0-jg"]],"des-beast-ag":[[16,"des-beast-death1-ja"],[15,"des-beast-death0-ja"],[14,"des-beast-run-limp0-ja"],[13,"des-beast-down-hits0-jitter-ja"],[0,"des-beast-lod0-jg"],[1,"des-beast-lod0-mg"],[2,"des-beast-shadow-mg"],[3,"des-beast-idle-ja"],[4,"des-beast-jog0-ja"],[5,"des-beast-run1-ja"],[6,"des-beast-run-attack-ja"],[7,"des-beast-turn180-ja"],[8,"des-beast-fall-forward-ja"],[9,"des-beast-down-idle1-ja"],[10,"des-beast-down-idle2-ja"],[11,"des-beast-get-up-ja"],[12,"des-beast-down-hits0-ja"]],"des-burning-bush-ag":[[2,"des-burning-bush-idle-ja"],[1,"des-burning-bush-lod0-mg"],[0,"des-burning-bush-lod0-jg"]],"des-cactus-a-ag":[[8,"des-cactus-a-explode-idle-ja"],[7,"des-cactus-a-explode-lod0-mg"],[6,"des-cactus-a-explode-lod0-jg"],[5,"des-cactus-a-idle-ja"],[4,"des-cactus-a-lod3-mg"],[3,"des-cactus-a-lod2-mg"],[2,"des-cactus-a-lod1-mg"],[1,"des-cactus-a-lod0-mg"],[0,"des-cactus-a-lod0-jg"]],"des-cactus-b-ag":[[8,"des-cactus-b-explode-idle-ja"],[7,"des-cactus-b-explode-lod0-mg"],[6,"des-cactus-b-explode-lod0-jg"],[5,"des-cactus-b-idle-ja"],[4,"des-cactus-b-lod3-mg"],[3,"des-cactus-b-lod2-mg"],[2,"des-cactus-b-lod1-mg"],[1,"des-cactus-b-lod0-mg"],[0,"des-cactus-b-lod0-jg"]],"des-cactus-obstacle-ag":[[2,"des-cactus-obstacle-idle-ja"],[1,"des-cactus-obstacle-lod0-mg"],[0,"des-cactus-obstacle-lod0-jg"]],"des-draw-bridge-ag":[[4,"des-draw-bridge-down-ja"],[3,"des-draw-bridge-idle-ja"],[2,"des-draw-bridge-shadow-mg"],[1,"des-draw-bridge-lod0-mg"],[0,"des-draw-bridge-lod0-jg"]],"des-garage-door-ag":[[3,"des-garage-door-open-ja"],[2,"des-garage-door-idle-ja"],[1,"des-garage-door-lod0-mg"],[0,"des-garage-door-lod0-jg"]],"des-glider-ring-ag":[[3,"des-glider-ring-expand-ja"],[2,"des-glider-ring-idle-ja"],[1,"des-glider-ring-lod0-mg"],[0,"des-glider-ring-lod0-jg"]],"des-jump-bridge-ag":[[4,"des-jump-bridge-80meterup-ja"],[3,"des-jump-bridge-60meterup-ja"],[2,"des-jump-bridge-idle-ja"],[1,"des-jump-bridge-lod0-mg"],[0,"des-jump-bridge-lod0-jg"]],"des-rally-bollard-ag":[[3,"des-rally-bollard-idle-ja"],[2,"des-rally-bollard-lod1-mg"],[1,"des-rally-bollard-lod0-mg"],[0,"des-rally-bollard-lod0-jg"]],"des-terraformer-break-ag":[[6,"des-terraformer-break-a-idle-ja"],[5,"des-terraformer-break-a-lod0-mg"],[4,"des-terraformer-break-a-lod0-jg"],[2,"des-terraformer-break-idle-ja"],[1,"des-terraformer-break-lod0-mg"],[0,"des-terraformer-break-lod0-jg"]],"des-train-barrier-ag":[[2,"des-train-barrier-idle-ja"],[1,"des-train-barrier-lod0-mg"],[0,"des-train-barrier-lod0-jg"]],"des-train-bollard-ag":[[2,"des-train-bollard-idle-ja"],[1,"des-train-bollard-lod0-mg"],[0,"des-train-bollard-lod0-jg"]],"des-train-stones-ag":[[2,"des-train-stones-idle-ja"],[1,"des-train-stones-lod0-mg"],[0,"des-train-stones-lod0-jg"]],"desert-eggwall-ag":[[2,"desert-eggwall-idle-ja"],[1,"desert-eggwall-lod0-mg"],[0,"desert-eggwall-lod0-jg"]],"desert-eggwall-break-ag":[[6,"desert-eggwall-break-a-idle-ja"],[5,"desert-eggwall-break-a-lod0-mg"],[4,"desert-eggwall-break-a-lod0-jg"],[2,"desert-eggwall-break-idle-ja"],[1,"desert-eggwall-break-lod0-mg"],[0,"desert-eggwall-break-lod0-jg"]],"desert-transport-ag":[[5,"desert-transport-close-ja"],[4,"desert-transport-open-ja"],[3,"desert-transport-idle-ja"],[2,"desert-transport-shadow-mg"],[1,"desert-transport-lod0-mg"],[0,"desert-transport-lod0-jg"]],"desw-eco-tank-ag":[[5,"desw-eco-tank-debris-idle-ja"],[4,"desw-eco-tank-debris-lod0-mg"],[3,"desw-eco-tank-debris-lod0-jg"],[2,"desw-eco-tank-idle-ja"],[1,"desw-eco-tank-lod0-mg"],[0,"desw-eco-tank-lod0-jg"]],"desw-snake-stump-ag":[[2,"desw-snake-stump-idle-ja"],[1,"desw-snake-stump-lod0-mg"],[0,"desw-snake-stump-lod0-jg"]],"dm-debris-ag":[[7,"dm-debris-d-lod0-mg"],[6,"dm-debris-d-lod0-jg"],[5,"dm-debris-c-lod0-mg"],[4,"dm-debris-c-lod0-jg"],[3,"dm-debris-b-lod0-mg"],[2,"dm-debris-b-lod0-jg"],[1,"dm-debris-a-lod0-mg"],[0,"dm-debris-a-lod0-jg"]],"dm-mine-spider-ag":[[10,"dm-mine-spider-knocked-explode-ja"],[9,"dm-mine-spider-anticipate-explode-ja"],[8,"dm-mine-spider-run-stop-ja"],[7,"dm-mine-spider-run-ja"],[6,"dm-mine-spider-idle-ja"],[5,"dm-mine-spider-climb-end-ja"],[4,"dm-mine-spider-climb-ja"],[3,"dm-mine-spider-climb-start-ja"],[2,"dm-mine-spider-shadow-mg"],[1,"dm-mine-spider-lod0-mg"],[0,"dm-mine-spider-lod0-jg"]],"dm-mine-spider-spawner-ag":[[2,"dm-mine-spider-spawner-idle-ja"],[1,"dm-mine-spider-spawner-lod0-mg"],[0,"dm-mine-spider-spawner-lod0-jg"]],"dm-missile-ag":[[2,"dm-missile-idle-ja"],[1,"dm-missile-lod0-mg"],[0,"dm-missile-lod0-jg"]],"dm-missile-target-ag":[[3,"dm-missile-target-idle-ja"],[2,"dm-missile-target-shadow-mg"],[1,"dm-missile-target-lod0-mg"],[0,"dm-missile-target-lod0-jg"]],"dm-robot-ag":[[9,"dm-robot-knock3-ja"],[8,"dm-robot-knock2-ja"],[7,"dm-robot-knock1-ja"],[6,"dm-robot-standup-ja"],[5,"dm-robot-walk-ja"],[4,"dm-robot-ball-ja"],[3,"dm-robot-idle-ja"],[2,"dm-robot-shadow-mg"],[1,"dm-robot-lod0-mg"],[0,"dm-robot-lod0-jg"]],"dm-ship-ag":[[2,"dm-ship-idle-ja"],[1,"dm-ship-lod0-mg"],[0,"dm-ship-lod0-jg"]],"dm-ship-break-ag":[[2,"dm-ship-break-idle-ja"],[1,"dm-ship-break-lod0-mg"],[0,"dm-ship-break-lod0-jg"]],"dm-ship-tent-brk-ag":[[2,"dm-ship-tent-brk-idle-ja"],[1,"dm-ship-tent-brk-lod0-mg"],[0,"dm-ship-tent-brk-lod0-jg"]],"dm-spines-ag":[[2,"dm-spines-idle-ja"],[1,"dm-spines-lod0-mg"],[0,"dm-spines-lod0-jg"]],"dm-tentacle-ag":[[11,"dm-tentacle-explode-idle-ja"],[10,"dm-tentacle-explode-lod0-mg"],[9,"dm-tentacle-explode-lod0-jg"],[8,"dm-tentacle-spit-ja"],[7,"dm-tentacle-whip-ja"],[6,"dm-tentacle-sweep-ja"],[5,"dm-tentacle-strike-ja"],[4,"dm-tentacle-idle2-ja"],[3,"dm-tentacle-idle-ja"],[2,"dm-tentacle-shadow-mg"],[1,"dm-tentacle-lod0-mg"],[0,"dm-tentacle-lod0-jg"]],"dm-urchin-ag":[[7,"dm-urchin-explode-idle-ja"],[6,"dm-urchin-explode-lod0-mg"],[5,"dm-urchin-explode-lod0-jg"],[4,"dm-urchin-shudder-ja"],[3,"dm-urchin-pulse-ja"],[2,"dm-urchin-idle-ja"],[1,"dm-urchin-lod0-mg"],[0,"dm-urchin-lod0-jg"]],"dogat-ag":[[9,"dogat-knocked-forward-land-ja"],[8,"dogat-knocked-forward-ja"],[7,"dogat-run0-ja"],[6,"dogat-idle-eat-ja"],[5,"dogat-idle-situp-ja"],[4,"dogat-idle-sit-ja"],[3,"dogat-idle-ja"],[2,"dogat-shadow-mg"],[1,"dogat-lod0-mg"],[0,"dogat-lod0-jg"]],"dp-bipedal-ag":[[41,"dp-bipedal-turret-jump-off-end-ja"],[40,"dp-bipedal-turret-jump-off-jump-ja"],[39,"dp-bipedal-turret-jump-off-start-ja"],[38,"dp-bipedal-turret-jump-on-end-ja"],[37,"dp-bipedal-turret-jump-on-start-ja"],[36,"dp-bipedal-turret-knocked-right0-ja"],[35,"dp-bipedal-turret-knocked-left0-ja"],[34,"dp-bipedal-turret-shoot0-ja"],[33,"dp-bipedal-turret-idle-right-ja"],[32,"dp-bipedal-turret-idle-left-ja"],[31,"dp-bipedal-turret-idle-down-ja"],[30,"dp-bipedal-turret-idle-up-ja"],[29,"dp-bipedal-turret-idle-middle-ja"],[12,"dp-bipedal-shield-out-ja"],[11,"dp-bipedal-attack-throw0-end-ja"],[10,"dp-bipedal-attack-throw0-middle-ja"],[9,"dp-bipedal-attack-throw0-start-ja"],[8,"dp-bipedal-attack-close0-end-ja"],[7,"dp-bipedal-attack-close0-middle-ja"],[6,"dp-bipedal-attack-close0-start-ja"],[5,"dp-bipedal-walk0-ja"],[4,"dp-bipedal-run0-ja"],[3,"dp-bipedal-idle0-ja"],[2,"dp-bipedal-shadow-mg"],[1,"dp-bipedal-lod0-mg"],[0,"dp-bipedal-lod0-jg"],[13,"dp-bipedal-shield-out-idle-ja"],[14,"dp-bipedal-shield-in-ja"],[15,"dp-bipedal-shield-up-recoil0-ja"],[16,"dp-bipedal-getup0-start-ja"],[17,"dp-bipedal-getup0-end-ja"],[18,"dp-bipedal-warp-in0-ja"],[19,"dp-bipedal-warp-in1-ja"],[20,"dp-bipedal-jump0-start-ja"],[21,"dp-bipedal-jump0-fall-ja"],[22,"dp-bipedal-jump0-land-ja"],[23,"dp-bipedal-knocked-yellow-right-ja"],[24,"dp-bipedal-knocked-yellow-right-land-ja"],[25,"dp-bipedal-knocked-yellow-left-ja"],[26,"dp-bipedal-knocked-yellow-left-land-ja"],[27,"dp-bipedal-knocked-blue0-ja"],[28,"dp-bipedal-ragdoll-ja"]],"dummy1-ag":[[1,"dummy1-lod0-mg"],[0,"dummy1-lod0-jg"]],"dummy2-ag":[[1,"dummy2-lod0-mg"],[0,"dummy2-lod0-jg"]],"dummy3-ag":[[1,"dummy3-lod0-mg"],[0,"dummy3-lod0-jg"]],"dummy4-ag":[[1,"dummy4-lod0-mg"],[0,"dummy4-lod0-jg"]],"eco-canister-ag":[[2,"eco-canister-dark-idle-ja"],[1,"eco-canister-dark-lod0-mg"],[0,"eco-canister-dark-lod0-jg"]],"eco-crystal-dark-ag":[[2,"eco-crystal-dark-idle-ja"],[1,"eco-crystal-dark-lod0-mg"],[0,"eco-crystal-dark-lod0-jg"]],"eco-crystal-light-ag":[[2,"eco-crystal-light-idle-ja"],[1,"eco-crystal-light-lod0-mg"],[0,"eco-crystal-light-lod0-jg"]],"eco-crystal-sphere-ag":[[2,"eco-crystal-sphere-idle-ja"],[1,"eco-crystal-sphere-lod0-mg"],[0,"eco-crystal-sphere-lod0-jg"]],"eco-crystal-sphere-simple-ag":[[2,"eco-crystal-sphere-simple-idle-ja"],[1,"eco-crystal-sphere-simple-lod0-mg"],[0,"eco-crystal-sphere-simple-lod0-jg"]],"egg-spider-ag":[[13,"egg-spider-knocked-red-land-ja"],[0,"egg-spider-lod0-jg"],[1,"egg-spider-lod0-mg"],[2,"egg-spider-lod1-mg"],[3,"egg-spider-lod2-mg"],[4,"egg-spider-shadow-mg"],[5,"egg-spider-idle-ja"],[6,"egg-spider-walk-ja"],[7,"egg-spider-crawl-from-ground-ja"],[8,"egg-spider-jump-car-ja"],[9,"egg-spider-land-car-ja"],[10,"egg-spider-bite-car-ja"],[11,"egg-spider-attack-jump-ja"],[12,"egg-spider-knocked-red-ja"]],"errol-ag":[[3,"errol-errol-idle-ja"],[2,"errol-idle-ja"],[1,"errol-lod0-mg"],[0,"errol-lod0-jg"]],"errol-effect-ag":[[2,"errol-effect-idle-ja"],[1,"errol-effect-lod0-mg"],[0,"errol-effect-lod0-jg"]],"errol-highres-ag":[[3,"errol-highres-errol-walk-ja"],[2,"errol-highres-shadow-mg"],[1,"errol-highres-lod0-mg"],[0,"errol-highres-lod0-jg"]],"errol-lowres-ag":[[15,"errol-lowres-run-to-idle-ja"],[14,"errol-lowres-run-ccw-ja"],[13,"errol-lowres-run-cw-ja"],[0,"errol-lowres-lod0-jg"],[1,"errol-lowres-lod0-mg"],[2,"errol-lowres-lod1-mg"],[3,"errol-lowres-idle30-ja"],[4,"errol-lowres-idle60-ja"],[5,"errol-lowres-idle-hit-console-ja"],[6,"errol-lowres-idle-hit-console-2-ja"],[7,"errol-lowres-idle-throw-ja"],[8,"errol-lowres-idle-yell-ja"],[9,"errol-lowres-idle-yell-1-ja"],[10,"errol-lowres-idle-knocked-ja"],[11,"errol-lowres-idle-to-run-cw-ja"],[12,"errol-lowres-idle-to-run-ccw-ja"]],"evilbro-ag":[[3,"evilbro-evilbro-idle-ja"],[2,"evilbro-shadow-mg"],[1,"evilbro-lod0-mg"],[0,"evilbro-lod0-jg"]],"evilsis-ag":[[3,"evilsis-evilsis-idle-ja"],[2,"evilsis-shadow-mg"],[1,"evilsis-lod0-mg"],[0,"evilsis-lod0-jg"]],"explorer-ag":[[3,"explorer-explorer-idle-ja"],[2,"explorer-shadow-mg"],[1,"explorer-lod0-mg"],[0,"explorer-lod0-jg"]],"fac-break-fence-a-ag":[[6,"fac-break-fence-a-explode-idle-ja"],[5,"fac-break-fence-a-explode-lod0-mg"],[4,"fac-break-fence-a-explode-lod0-jg"],[3,"fac-break-fence-a-idle-ja"],[2,"fac-break-fence-a-lod1-mg"],[1,"fac-break-fence-a-lod0-mg"],[0,"fac-break-fence-a-lod0-jg"]],"fac-break-fence-b-ag":[[6,"fac-break-fence-b-explode-idle-ja"],[5,"fac-break-fence-b-explode-lod0-mg"],[4,"fac-break-fence-b-explode-lod0-jg"],[3,"fac-break-fence-b-idle-ja"],[2,"fac-break-fence-b-lod1-mg"],[1,"fac-break-fence-b-lod0-mg"],[0,"fac-break-fence-b-lod0-jg"]],"fac-break-fence-c-ag":[[6,"fac-break-fence-c-explode-idle-ja"],[5,"fac-break-fence-c-explode-lod0-mg"],[4,"fac-break-fence-c-explode-lod0-jg"],[3,"fac-break-fence-c-idle-ja"],[2,"fac-break-fence-c-lod1-mg"],[1,"fac-break-fence-c-lod0-mg"],[0,"fac-break-fence-c-lod0-jg"]],"fac-break-floor-ag":[[6,"fac-break-floor-explode-idle-ja"],[5,"fac-break-floor-explode-lod0-mg"],[4,"fac-break-floor-explode-lod0-jg"],[3,"fac-break-floor-idle-ja"],[2,"fac-break-floor-lod1-mg"],[1,"fac-break-floor-lod0-mg"],[0,"fac-break-floor-lod0-jg"]],"fac-drop-plat-ag":[[2,"fac-drop-plat-idle-ja"],[1,"fac-drop-plat-lod0-mg"],[0,"fac-drop-plat-lod0-jg"]],"fac-elevator-a-ag":[[5,"fac-elevator-a-gate_down-ja"],[4,"fac-elevator-a-gate_up-ja"],[3,"fac-elevator-a-idle-ja"],[2,"fac-elevator-a-lod1-mg"],[1,"fac-elevator-a-lod0-mg"],[0,"fac-elevator-a-lod0-jg"]],"fac-fire-torch-ag":[[2,"fac-fire-torch-idle-ja"],[1,"fac-fire-torch-lod0-mg"],[0,"fac-fire-torch-lod0-jg"]],"fac-fma-breaking-bits-ag":[[2,"fac-fma-breaking-bits-idle-ja"],[1,"fac-fma-breaking-bits-lod0-mg"],[0,"fac-fma-breaking-bits-lod0-jg"]],"fac-gun-tower-ag":[[7,"fac-gun-tower-break-idle-ja"],[6,"fac-gun-tower-break-lod0-mg"],[5,"fac-gun-tower-break-lod0-jg"],[4,"fac-gun-tower-dooropen-ja"],[3,"fac-gun-tower-idle-ja"],[2,"fac-gun-tower-lod1-mg"],[1,"fac-gun-tower-lod0-mg"],[0,"fac-gun-tower-lod0-jg"]],"fac-gun-tower-base-ag":[[14,"fac-gun-tower-base-broken-west-idle-ja"],[13,"fac-gun-tower-base-broken-west-lod0-mg"],[0,"fac-gun-tower-base-lod0-jg"],[1,"fac-gun-tower-base-lod0-mg"],[2,"fac-gun-tower-base-idle-ja"],[3,"fac-gun-tower-base-broken-north-lod0-jg"],[4,"fac-gun-tower-base-broken-north-lod0-mg"],[5,"fac-gun-tower-base-broken-north-idle-ja"],[6,"fac-gun-tower-base-broken-south-lod0-jg"],[7,"fac-gun-tower-base-broken-south-lod0-mg"],[8,"fac-gun-tower-base-broken-south-idle-ja"],[9,"fac-gun-tower-base-broken-east-lod0-jg"],[10,"fac-gun-tower-base-broken-east-lod0-mg"],[11,"fac-gun-tower-base-broken-east-idle-ja"],[12,"fac-gun-tower-base-broken-west-lod0-jg"]],"fac-gun-tower-turret-ag":[[9,"fac-gun-tower-turret-explode-idle-ja"],[8,"fac-gun-tower-turret-explode-lod0-mg"],[7,"fac-gun-tower-turret-explode-lod0-jg"],[6,"fac-gun-tower-turret-updown-ja"],[5,"fac-gun-tower-turret-shoot-ja"],[4,"fac-gun-tower-turret-idle-ja"],[3,"fac-gun-tower-turret-lod2-mg"],[2,"fac-gun-tower-turret-lod1-mg"],[1,"fac-gun-tower-turret-lod0-mg"],[0,"fac-gun-tower-turret-lod0-jg"]],"fac-lorez-ag":[[2,"fac-lorez-idle-ja"],[1,"fac-lorez-lod0-mg"],[0,"fac-lorez-lod0-jg"]],"fac-move-plat-a-ag":[[2,"fac-move-plat-a-idle-ja"],[1,"fac-move-plat-a-lod0-mg"],[0,"fac-move-plat-a-lod0-jg"]],"fac-move-plat-b-ag":[[2,"fac-move-plat-b-idle-ja"],[1,"fac-move-plat-b-lod0-mg"],[0,"fac-move-plat-b-lod0-jg"]],"fac-punch-wall-ag":[[4,"fac-punch-wall-drop-ja"],[3,"fac-punch-wall-idle-ja"],[2,"fac-punch-wall-lod1-mg"],[1,"fac-punch-wall-lod0-mg"],[0,"fac-punch-wall-lod0-jg"]],"fac-robopod-ag":[[8,"fac-robopod-explode-idle-ja"],[7,"fac-robopod-explode-lod0-mg"],[6,"fac-robopod-explode-lod0-jg"],[5,"fac-robopod-close-ja"],[4,"fac-robopod-open-ja"],[3,"fac-robopod-idle-ja"],[2,"fac-robopod-lod1-mg"],[1,"fac-robopod-lod0-mg"],[0,"fac-robopod-lod0-jg"]],"fac-robotank-ag":[[9,"fac-robotank-explode-idle-ja"],[8,"fac-robotank-explode-lod0-mg"],[7,"fac-robotank-explode-lod0-jg"],[6,"fac-robotank-fire-end-ja"],[5,"fac-robotank-fire-start-ja"],[4,"fac-robotank-idle-ja"],[3,"fac-robotank-lod2-mg"],[2,"fac-robotank-lod1-mg"],[1,"fac-robotank-lod0-mg"],[0,"fac-robotank-lod0-jg"]],"fac-robotank-top-ag":[[9,"fac-robotank-top-explode-idle-ja"],[8,"fac-robotank-top-explode-lod0-mg"],[7,"fac-robotank-top-explode-lod0-jg"],[6,"fac-robotank-top-fire-end-ja"],[5,"fac-robotank-top-fire-start-ja"],[4,"fac-robotank-top-idle-ja"],[3,"fac-robotank-top-lod2-mg"],[2,"fac-robotank-top-lod1-mg"],[1,"fac-robotank-top-lod0-mg"],[0,"fac-robotank-top-lod0-jg"]],"fac-rotfan-ag":[[4,"fac-rotfan-spin-ja"],[3,"fac-rotfan-idle-ja"],[2,"fac-rotfan-lod1-mg"],[1,"fac-rotfan-lod0-mg"],[0,"fac-rotfan-lod0-jg"]],"fac-switch-ag":[[2,"fac-switch-idle-ja"],[1,"fac-switch-lod0-mg"],[0,"fac-switch-lod0-jg"]],"fac-target-ag":[[9,"fac-target-explode-idle-ja"],[8,"fac-target-explode-lod0-mg"],[7,"fac-target-explode-lod0-jg"],[6,"fac-target-desend-ja"],[5,"fac-target-rotate-ja"],[4,"fac-target-idle-ja"],[3,"fac-target-lod2-mg"],[2,"fac-target-lod1-mg"],[1,"fac-target-lod0-mg"],[0,"fac-target-lod0-jg"]],"fac-warp-effect-ag":[[2,"fac-warp-effect-idle-ja"],[1,"fac-warp-effect-lod0-mg"],[0,"fac-warp-effect-lod0-jg"]],"faccar-ag":[[11,"faccar-idle-ja"],[10,"faccar-shadow-mg"],[9,"faccar-lod0-mg"],[8,"faccar-lod0-jg"],[7,"faccar-wheel-blur-idle-ja"],[6,"faccar-wheel-blur-shadow-mg"],[5,"faccar-wheel-blur-lod0-mg"],[4,"faccar-wheel-blur-lod0-jg"],[3,"faccar-wheel-idle-ja"],[2,"faccar-wheel-shadow-mg"],[1,"faccar-wheel-lod0-mg"],[0,"faccar-wheel-lod0-jg"]],"farm-beetree-ag":[[5,"farm-beetree-explode-idle-ja"],[4,"farm-beetree-explode-lod0-mg"],[3,"farm-beetree-explode-lod0-jg"],[2,"farm-beetree-idle-ja"],[1,"farm-beetree-lod0-mg"],[0,"farm-beetree-lod0-jg"]],"farm-cabbage-ag":[[5,"farm-cabbage-explode-idle-ja"],[4,"farm-cabbage-explode-lod0-mg"],[3,"farm-cabbage-explode-lod0-jg"],[2,"farm-cabbage-idle-ja"],[1,"farm-cabbage-lod0-mg"],[0,"farm-cabbage-lod0-jg"]],"farm-chilirots-ag":[[5,"farm-chilirots-explode-idle-ja"],[4,"farm-chilirots-explode-lod0-mg"],[3,"farm-chilirots-explode-lod0-jg"],[2,"farm-chilirots-idle-ja"],[1,"farm-chilirots-lod0-mg"],[0,"farm-chilirots-lod0-jg"]],"farm-marrow-ag":[[5,"farm-marrow-explode-idle-ja"],[4,"farm-marrow-explode-lod0-mg"],[3,"farm-marrow-explode-lod0-jg"],[2,"farm-marrow-idle-ja"],[1,"farm-marrow-lod0-mg"],[0,"farm-marrow-lod0-jg"]],"farm-small-cabbage-ag":[[5,"farm-small-cabbage-explode-idle-ja"],[4,"farm-small-cabbage-explode-lod0-mg"],[3,"farm-small-cabbage-explode-lod0-jg"],[2,"farm-small-cabbage-idle-ja"],[1,"farm-small-cabbage-lod0-mg"],[0,"farm-small-cabbage-lod0-jg"]],"farm-sprinkler-barrels-ag":[[2,"farm-sprinkler-barrels-idle-ja"],[1,"farm-sprinkler-barrels-lod0-mg"],[0,"farm-sprinkler-barrels-lod0-jg"]],"farmer-ag":[[2,"farmer-farmer-idle-ja"],[1,"farmer-lod0-mg"],[0,"farmer-lod0-jg"]],"fisher-ag":[[2,"fisher-fisher-idle-ja"],[1,"fisher-lod0-mg"],[0,"fisher-lod0-jg"]],"flamer-lava-ag":[[23,"flamer-lava-explode-idle-ja"],[22,"flamer-lava-explode-lod0-mg"],[21,"flamer-lava-explode-lod0-jg"],[20,"flamer-lava-blue-hit2-ja"],[19,"flamer-lava-blue-hit1-ja"],[18,"flamer-lava-blue-hit0-ja"],[17,"flamer-lava-die-in-place-ja"],[16,"flamer-lava-knock-back-land-ja"],[15,"flamer-lava-die-ja"],[14,"flamer-lava-knock-back-fall-ja"],[13,"flamer-lava-knock-back-ja"],[0,"flamer-lava-lod0-jg"],[1,"flamer-lava-lod0-mg"],[2,"flamer-lava-lod1-mg"],[3,"flamer-lava-lod2-mg"],[4,"flamer-lava-shadow-mg"],[5,"flamer-lava-idle-ja"],[6,"flamer-lava-fly-right-ja"],[7,"flamer-lava-fly-left-ja"],[8,"flamer-lava-fly-forward-ja"],[9,"flamer-lava-fly-back-ja"],[10,"flamer-lava-fly-straight-ja"],[11,"flamer-lava-shoot-ja"],[12,"flamer-lava-shoot1-ja"]],"flitter-ag":[[23,"flitter-blue-hit0-ja"],[22,"flitter-knocked-land-upright-ja"],[21,"flitter-knocked-land0-ja"],[20,"flitter-knocked0-ja"],[19,"flitter-die-in-place-ja"],[18,"flitter-die-falling-ja"],[17,"flitter-attack-high-ja"],[16,"flitter-attack-ja"],[15,"flitter-turn-ja"],[14,"flitter-move-ja"],[13,"flitter-walk-ja"],[0,"flitter-lod0-jg"],[1,"flitter-lod0-mg"],[2,"flitter-lod1-mg"],[3,"flitter-lod2-mg"],[4,"flitter-shadow-mg"],[5,"flitter-idle-ja"],[6,"flitter-idle-look-left-ja"],[7,"flitter-idle-look-left-hold-ja"],[8,"flitter-idle-look-right-ja"],[9,"flitter-idle-look-right-hold-ja"],[10,"flitter-ambush-jump-ja"],[11,"flitter-ambush-land-ja"],[12,"flitter-notice-ja"]],"flut-saddle-ag":[[51,"flut-saddle-fldax-death-cactus-ja"],[50,"flut-saddle-fldax-finish-ja"],[49,"flut-saddle-fldax-run-squash-ja"],[48,"flut-saddle-fldax-walk-ja"],[47,"flut-saddle-fldax-wild-run-right-ja"],[46,"flut-saddle-fldax-wild-run-left-ja"],[45,"flut-saddle-fldax-get-off-ja"],[44,"flut-saddle-fldax-idle-ja"],[43,"flut-saddle-fldax-get-on-ja"],[42,"flut-saddle-fldax-jump-forward-loop-ja"],[41,"flut-saddle-fldax-jump-forward-ja"],[40,"flut-saddle-fldax-deatha-ja"],[39,"flut-saddle-fldax-smack-surface-end-ja"],[38,"flut-saddle-fldax-smack-surface-ja"],[37,"flut-saddle-fldax-wild-run-ja"],[3,"flut-saddle-flut-idle-ja"],[15,"flut-saddle-flut-running-attack-end-ja"],[13,"flut-saddle-flut-double-jump-ja"],[12,"flut-saddle-flut-jump-forward-land-ja"],[11,"flut-saddle-flut-jump-forward-loop-ja"],[10,"flut-saddle-flut-jump-forward-ja"],[9,"flut-saddle-flut-jump-land-ja"],[8,"flut-saddle-flut-jump-loop-ja"],[7,"flut-saddle-flut-jump-ja"],[6,"flut-saddle-flut-run-ja"],[5,"flut-saddle-flut-jog-ja"],[4,"flut-saddle-flut-walk-ja"],[14,"flut-saddle-flut-running-attack-ja"],[27,"flut-saddle-flut-kanga-catch-ja"],[16,"flut-saddle-flut-air-attack-ja"],[17,"flut-saddle-flut-air-attack-loop-ja"],[18,"flut-saddle-flut-air-attack-land-ja"],[19,"flut-saddle-flut-get-on-ja"],[20,"flut-saddle-flut-get-off-ja"],[21,"flut-saddle-flut-hit-back-ja"],[22,"flut-saddle-flut-hit-back-end-ja"],[23,"flut-saddle-flut-smack-surface-ja"],[24,"flut-saddle-flut-smack-surface-end-ja"],[25,"flut-saddle-flut-deatha-ja"],[26,"flut-saddle-flut-run-squash-ja"],[28,"flut-saddle-flut-deathb-ja"],[29,"flut-saddle-flut-death-drown-ja"],[0,"flut-saddle-lod0-jg"],[1,"flut-saddle-lod0-mg"],[2,"flut-saddle-shadow-mg"]],"flut-wild-ag":[[12,"flut-wild-idle-leaper-ja"],[11,"flut-wild-ragdoll-ja"],[10,"flut-wild-jump-land-ja"],[9,"flut-wild-jump-loop-ja"],[8,"flut-wild-jump-ja"],[7,"flut-wild-run-squash-ja"],[6,"flut-wild-run-ja"],[5,"flut-wild-jog-ja"],[4,"flut-wild-walk-ja"],[3,"flut-wild-idle-ja"],[2,"flut-wild-shadow-mg"],[1,"flut-wild-lod0-mg"],[0,"flut-wild-lod0-jg"]],"flutflut-ag":[[2,"flutflut-flutflut-walk-ja"],[1,"flutflut-lod0-mg"],[0,"flutflut-lod0-jg"]],"flyingsaw-ag":[[2,"flyingsaw-idle-ja"],[1,"flyingsaw-lod0-mg"],[0,"flyingsaw-lod0-jg"]],"fma-gun-ag":[[3,"fma-gun-idle-ja"],[2,"fma-gun-shadow-mg"],[1,"fma-gun-lod0-mg"],[0,"fma-gun-lod0-jg"]],"for-break-bridge-ag":[[14,"for-break-bridge-board-explode-idle-ja"],[13,"for-break-bridge-board-explode-lod0-mg"],[0,"for-break-bridge-board-a-lod0-jg"],[1,"for-break-bridge-board-a-lod0-mg"],[2,"for-break-bridge-board-a-idle-ja"],[3,"for-break-bridge-board-b-lod0-jg"],[4,"for-break-bridge-board-b-lod0-mg"],[5,"for-break-bridge-board-b-idle-ja"],[6,"for-break-bridge-board-c-lod0-jg"],[7,"for-break-bridge-board-c-lod0-mg"],[8,"for-break-bridge-board-c-idle-ja"],[9,"for-break-bridge-board-d-lod0-jg"],[10,"for-break-bridge-board-d-lod0-mg"],[11,"for-break-bridge-board-d-idle-ja"],[12,"for-break-bridge-board-explode-lod0-jg"]],"for-pillar-ag":[[2,"for-pillar-idle-ja"],[1,"for-pillar-lod0-mg"],[0,"for-pillar-lod0-jg"]],"for-statue-ag":[[10,"for-statue-debris-eye-lod0-mg"],[9,"for-statue-debris-eye-lod0-jg"],[8,"for-statue-debris-chunk-lod0-mg"],[7,"for-statue-debris-chunk-lod0-jg"],[6,"for-statue-debris-arrow-lod0-mg"],[5,"for-statue-debris-arrow-lod0-jg"],[4,"for-statue-open-eyes-ja"],[3,"for-statue-rise-ja"],[2,"for-statue-idle-ja"],[1,"for-statue-lod0-mg"],[0,"for-statue-lod0-jg"]],"for-t-fma-ag":[[2,"for-t-fma-idle-ja"],[1,"for-t-fma-lod0-mg"],[0,"for-t-fma-lod0-jg"]],"for-telescope-ag":[[2,"for-telescope-idle-ja"],[1,"for-telescope-lod0-mg"],[0,"for-telescope-lod0-jg"]],"for-telescope-fma-ag":[[2,"for-telescope-fma-idle-ja"],[1,"for-telescope-fma-lod0-mg"],[0,"for-telescope-fma-lod0-jg"]],"for-tower-ag":[[2,"for-tower-idle-ja"],[1,"for-tower-lod0-mg"],[0,"for-tower-lod0-jg"]],"for-tower-fma-ag":[[2,"for-tower-fma-idle-ja"],[1,"for-tower-fma-lod0-mg"],[0,"for-tower-fma-lod0-jg"]],"for-turret-ag":[[8,"for-turret-explode-idle-ja"],[7,"for-turret-explode-lod0-mg"],[6,"for-turret-explode-lod0-jg"],[5,"for-turret-shoot-ja"],[4,"for-turret-idle-ja"],[3,"for-turret-lod2-mg"],[2,"for-turret-lod1-mg"],[1,"for-turret-lod0-mg"],[0,"for-turret-lod0-jg"]],"fort-entry-gate-ag":[[2,"fort-entry-gate-idle-ja"],[1,"fort-entry-gate-lod0-mg"],[0,"fort-entry-gate-lod0-jg"]],"fox-ag":[[11,"fox-idle-ja"],[10,"fox-shadow-mg"],[9,"fox-lod0-mg"],[8,"fox-lod0-jg"],[7,"fox-wheel-blur-idle-ja"],[6,"fox-wheel-blur-shadow-mg"],[5,"fox-wheel-blur-lod0-mg"],[4,"fox-wheel-blur-lod0-jg"],[3,"fox-wheel-idle-ja"],[2,"fox-wheel-shadow-mg"],[1,"fox-wheel-lod0-mg"],[0,"fox-wheel-lod0-jg"]],"freehq-sml-door-ag":[[2,"freehq-sml-door-idle-ja"],[1,"freehq-sml-door-lod0-mg"],[0,"freehq-sml-door-lod0-jg"]],"gambler-ag":[[2,"gambler-gambler-idle-ja"],[1,"gambler-lod0-mg"],[0,"gambler-lod0-jg"]],"gauntlets-ag":[[2,"gauntlets-idle-ja"],[1,"gauntlets-lod0-mg"],[0,"gauntlets-lod0-jg"]],"gekko-ag":[[36,"gekko-ragdoll-pose-ja"],[35,"gekko-jump0-land-ja"],[34,"gekko-jump0-in-air-ja"],[33,"gekko-jump0-start-ja"],[32,"gekko-death-standing0-ja"],[31,"gekko-knocked-death0-ja"],[30,"gekko-knocked-red0-land-ja"],[29,"gekko-knocked-red0-ja"],[12,"gekko-turn-left0-ja"],[11,"gekko-wall-shoot0-ja"],[10,"gekko-wall-turn-idle0-ja"],[9,"gekko-wall-turn-right0-ja"],[8,"gekko-wall-turn-left0-ja"],[7,"gekko-wall-run0-b-ja"],[6,"gekko-wall-run0-a-ja"],[5,"gekko-wall-idle1-ja"],[4,"gekko-wall-idle0-ja"],[3,"gekko-idle-ja"],[2,"gekko-shadow-mg"],[1,"gekko-lod0-mg"],[0,"gekko-lod0-jg"],[13,"gekko-turn-right0-ja"],[14,"gekko-run0-a-ja"],[15,"gekko-run0-b-ja"],[16,"gekko-jump-to-ground-start-ja"],[17,"gekko-jump-to-ground-in-air-ja"],[18,"gekko-jump-to-ground-end-ja"],[19,"gekko-wall-knocked0-ja"],[20,"gekko-wall-knocked1-ja"],[21,"gekko-turn-hop0-ja"],[22,"gekko-turn-hop0-land-ja"],[23,"gekko-wall-knocked-to-ground0-ja"],[24,"gekko-idle0-ja"],[25,"gekko-idle1-ja"],[26,"gekko-attack0-start-ja"],[27,"gekko-attack0-mid-ja"],[28,"gekko-attack0-land-ja"]],"geologist-ag":[[2,"geologist-geologist-idle-ja"],[1,"geologist-lod0-mg"],[0,"geologist-lod0-jg"]],"grunt-ag":[[27,"grunt-ragdoll-ja"],[26,"grunt-getup-back-ja"],[25,"grunt-getup-front-ja"],[24,"grunt-jump-land-ja"],[23,"grunt-jump-in-air-ja"],[22,"grunt-jump-wind-up-ja"],[21,"grunt-celebrate-finish-ja"],[20,"grunt-celebrate-start-ja"],[19,"grunt-taunt-ja"],[18,"grunt-attack1-ja"],[17,"grunt-attack0-ja"],[16,"grunt-charge2-ja"],[15,"grunt-charge1-ja"],[14,"grunt-charge0-ja"],[13,"grunt-notice-ja"],[0,"grunt-lod0-jg"],[1,"grunt-lod0-mg"],[2,"grunt-lod1-mg"],[3,"grunt-lod2-mg"],[4,"grunt-shadow-mg"],[5,"grunt-idle-ja"],[6,"grunt-idle1-look-right-ja"],[7,"grunt-idle1-look-right-hold-ja"],[8,"grunt-idle1-look-left-ja"],[9,"grunt-idle1-look-left-hold-ja"],[10,"grunt-idle1-left-to-idle-ja"],[11,"grunt-patrol0-ja"],[12,"grunt-patrol1-ja"]],"grunt-head-ag":[[2,"grunt-head-idle-ja"],[1,"grunt-head-lod0-mg"],[0,"grunt-head-lod0-jg"]],"gun-ag":[[52,"gun-gun-dark-fire-3-ja"],[51,"gun-gun-dark-fire-2-ja"],[50,"gun-gun-dark2-dark3-ja"],[49,"gun-gun-dark1-dark2-ja"],[48,"gun-gun-blue1-blue2-ja"],[47,"gun-gun-yellow2-yellow3-ja"],[46,"gun-gun-red-fire-3-ja"],[45,"gun-gun-blue-fire-3-single-ja"],[44,"gun-gun-red1-red2-ja"],[43,"gun-gun-blue-red-ja"],[42,"gun-gun-yellow-fire-2-ja"],[41,"gun-gun-blue-fire-3-ja"],[40,"gun-gun-blue-dark-ja"],[39,"gun-gun-yellow-red-ja"],[38,"gun-gun-yellow-blue-ja"],[37,"gun-gun-dark-yellow-ja"],[36,"gun-gun-red-blue-ja"],[35,"gun-gun-red-yellow-ja"],[34,"gun-gun-red-dark-ja"],[33,"gun-gun-blue-fire-2-ja"],[32,"gun-gun-yellow-fire-3-ja"],[31,"gun-gun-red-fire-2-ja"],[30,"gun-gun-yellow-fire-ja"],[29,"gun-gun-dark-fire-ja"],[28,"gun-gun-blue-fire-single-ja"],[27,"gun-gun-blue-fire-ja"],[24,"gun-idle-blue3-ja"],[83,"gun-nuke-lod0-jg"],[23,"gun-idle-blue2-ja"],[82,"gun-nuke-sphere-fade-ja"],[22,"gun-idle-blue-ja"],[81,"gun-nuke-sphere-idle-ja"],[21,"gun-idle-yellow3-ja"],[80,"gun-nuke-sphere-lod0-mg"],[20,"gun-idle-yellow2-ja"],[79,"gun-nuke-sphere-lod0-jg"],[19,"gun-idle-yellow-ja"],[78,"gun-red-sphere-fade-ja"],[18,"gun-idle-dark3-ja"],[77,"gun-red-sphere-burst-ja"],[17,"gun-idle-dark2-ja"],[76,"gun-red-sphere-idle-ja"],[16,"gun-idle-dark-ja"],[75,"gun-red-sphere-lod0-mg"],[15,"gun-idle-red3-ja"],[74,"gun-red-sphere-lod0-jg"],[14,"gun-idle-red2-ja"],[73,"gun-grenade-idle-ja"],[13,"gun-idle-red-ja"],[72,"gun-grenade-lod1-mg"],[0,"gun-ammo-yellow-lod0-jg"],[1,"gun-ammo-yellow-lod0-mg"],[2,"gun-ammo-red-lod0-jg"],[61,"gun-red-cone-lod0-jg"],[3,"gun-ammo-red-lod0-mg"],[62,"gun-red-cone-lod0-mg"],[4,"gun-ammo-blue-lod0-jg"],[63,"gun-red-cone-idle-ja"],[5,"gun-ammo-blue-lod0-mg"],[64,"gun-red-burst-lod0-jg"],[6,"gun-ammo-dark-lod0-jg"],[65,"gun-red-burst-lod0-mg"],[7,"gun-ammo-dark-lod0-mg"],[66,"gun-red-burst-idle-ja"],[8,"gun-ammo-idle-ja"],[67,"gun-saucer-lod0-jg"],[9,"gun-lod0-jg"],[68,"gun-saucer-lod0-mg"],[10,"gun-lod0-mg"],[69,"gun-saucer-idle-ja"],[11,"gun-shadow-mg"],[70,"gun-grenade-lod0-jg"],[12,"gun-idle-ja"],[71,"gun-grenade-lod0-mg"],[84,"gun-nuke-lod0-mg"],[25,"gun-gun-yellow-fire-low-ja"],[85,"gun-nuke-idle-ja"],[26,"gun-gun-red-fire-ja"],[86,"gun-suck-lod0-jg"],[87,"gun-suck-lod0-mg"],[88,"gun-suck-idle-ja"],[89,"gun-dark-2-ring-lod0-jg"],[90,"gun-dark-2-ring-lod0-mg"],[91,"gun-dark-2-ring-shadow-mg"],[92,"gun-dark-2-ring-idle-ja"]],"gun-cit-a-ag":[[5,"gun-cit-a-explode-idle-ja"],[4,"gun-cit-a-explode-lod0-mg"],[3,"gun-cit-a-explode-lod0-jg"],[2,"gun-cit-a-idle-ja"],[1,"gun-cit-a-lod0-mg"],[0,"gun-cit-a-lod0-jg"]],"gun-cit-b-ag":[[5,"gun-cit-b-explode-idle-ja"],[4,"gun-cit-b-explode-lod0-mg"],[3,"gun-cit-b-explode-lod0-jg"],[2,"gun-cit-b-idle-ja"],[1,"gun-cit-b-lod0-mg"],[0,"gun-cit-b-lod0-jg"]],"gun-cit-c-ag":[[5,"gun-cit-c-explode-idle-ja"],[4,"gun-cit-c-explode-lod0-mg"],[3,"gun-cit-c-explode-lod0-jg"],[2,"gun-cit-c-idle-ja"],[1,"gun-cit-c-lod0-mg"],[0,"gun-cit-c-lod0-jg"]],"gun-cit-d-ag":[[5,"gun-cit-d-explode-idle-ja"],[4,"gun-cit-d-explode-lod0-mg"],[3,"gun-cit-d-explode-lod0-jg"],[2,"gun-cit-d-idle-ja"],[1,"gun-cit-d-lod0-mg"],[0,"gun-cit-d-lod0-jg"]],"gun-clank-ag":[[5,"gun-clank-explode-idle-ja"],[4,"gun-clank-explode-lod0-mg"],[3,"gun-clank-explode-lod0-jg"],[2,"gun-clank-idle-ja"],[1,"gun-clank-lod0-mg"],[0,"gun-clank-lod0-jg"]],"gun-kg-bomb-ag":[[5,"gun-kg-bomb-explode-idle-ja"],[4,"gun-kg-bomb-explode-lod0-mg"],[3,"gun-kg-bomb-explode-lod0-jg"],[2,"gun-kg-bomb-idle-ja"],[1,"gun-kg-bomb-lod0-mg"],[0,"gun-kg-bomb-lod0-jg"]],"gun-kg-target-ag":[[6,"gun-kg-target-explode-idle-ja"],[5,"gun-kg-target-explode-lod0-mg"],[4,"gun-kg-target-explode-lod0-jg"],[3,"gun-kg-target-recoil-ja"],[2,"gun-kg-target-idle-ja"],[1,"gun-kg-target-lod0-mg"],[0,"gun-kg-target-lod0-jg"]],"gun-kg-target-b-ag":[[5,"gun-kg-target-b-explode-idle-ja"],[4,"gun-kg-target-b-explode-lod0-mg"],[3,"gun-kg-target-b-explode-lod0-jg"],[2,"gun-kg-target-b-idle-ja"],[1,"gun-kg-target-b-lod0-mg"],[0,"gun-kg-target-b-lod0-jg"]],"gun-kg-target-bonus-ag":[[5,"gun-kg-target-bonus-explode-idle-ja"],[4,"gun-kg-target-bonus-explode-lod0-mg"],[3,"gun-kg-target-bonus-explode-lod0-jg"],[2,"gun-kg-target-bonus-idle-ja"],[1,"gun-kg-target-bonus-lod0-mg"],[0,"gun-kg-target-bonus-lod0-jg"]],"gun-kg-target-c-ag":[[5,"gun-kg-target-c-explode-idle-ja"],[4,"gun-kg-target-c-explode-lod0-mg"],[3,"gun-kg-target-c-explode-lod0-jg"],[2,"gun-kg-target-c-idle-ja"],[1,"gun-kg-target-c-lod0-mg"],[0,"gun-kg-target-c-lod0-jg"]],"gun-kg-target-d-ag":[[5,"gun-kg-target-d-explode-idle-ja"],[4,"gun-kg-target-d-explode-lod0-mg"],[3,"gun-kg-target-d-explode-lod0-jg"],[2,"gun-kg-target-d-idle-ja"],[1,"gun-kg-target-d-lod0-mg"],[0,"gun-kg-target-d-lod0-jg"]],"gun-npc-ag":[[4,"gun-npc-idle-res-gun-ja"],[3,"gun-npc-idle-clean-gun-ja"],[2,"gun-npc-shadow-mg"],[1,"gun-npc-lod0-mg"],[0,"gun-npc-lod0-jg"]],"gun-rachet-ag":[[5,"gun-rachet-explode-idle-ja"],[4,"gun-rachet-explode-lod0-mg"],[3,"gun-rachet-explode-lod0-jg"],[2,"gun-rachet-idle-ja"],[1,"gun-rachet-lod0-mg"],[0,"gun-rachet-lod0-jg"]],"gun-rc-four-eyes-ag":[[5,"gun-rc-four-eyes-explode-idle-ja"],[4,"gun-rc-four-eyes-explode-lod0-mg"],[3,"gun-rc-four-eyes-explode-lod0-jg"],[2,"gun-rc-four-eyes-idle-ja"],[1,"gun-rc-four-eyes-lod0-mg"],[0,"gun-rc-four-eyes-lod0-jg"]],"gun-rc-one-eye-ag":[[5,"gun-rc-one-eye-explode-idle-ja"],[4,"gun-rc-one-eye-explode-lod0-mg"],[3,"gun-rc-one-eye-explode-lod0-jg"],[2,"gun-rc-one-eye-idle-ja"],[1,"gun-rc-one-eye-lod0-mg"],[0,"gun-rc-one-eye-lod0-jg"]],"gun-rc-three-eyes-ag":[[5,"gun-rc-three-eyes-explode-idle-ja"],[4,"gun-rc-three-eyes-explode-lod0-mg"],[3,"gun-rc-three-eyes-explode-lod0-jg"],[2,"gun-rc-three-eyes-idle-ja"],[1,"gun-rc-three-eyes-lod0-mg"],[0,"gun-rc-three-eyes-lod0-jg"]],"gun-rc-three-eyes-bonus-ag":[[5,"gun-rc-three-eyes-bonus-explode-idle-ja"],[4,"gun-rc-three-eyes-bonus-explode-lod0-mg"],[3,"gun-rc-three-eyes-bonus-explode-lod0-jg"],[2,"gun-rc-three-eyes-bonus-idle-ja"],[1,"gun-rc-three-eyes-bonus-lod0-mg"],[0,"gun-rc-three-eyes-bonus-lod0-jg"]],"gun-rc-two-eyes-ag":[[5,"gun-rc-two-eyes-explode-idle-ja"],[4,"gun-rc-two-eyes-explode-lod0-mg"],[3,"gun-rc-two-eyes-explode-lod0-jg"],[2,"gun-rc-two-eyes-idle-ja"],[1,"gun-rc-two-eyes-lod0-mg"],[0,"gun-rc-two-eyes-lod0-jg"]],"handcuffs-ag":[[2,"handcuffs-idle-ja"],[1,"handcuffs-lod0-mg"],[0,"handcuffs-lod0-jg"]],"hellcat-ag":[[5,"hellcat-idle-ja"],[4,"hellcat-shadow-mg"],[3,"hellcat-lod2-mg"],[2,"hellcat-lod1-mg"],[1,"hellcat-lod0-mg"],[0,"hellcat-lod0-jg"]],"hellcat-lowres-fma-ag":[[2,"hellcat-lowres-fma-idle-ja"],[1,"hellcat-lowres-fma-lod0-mg"],[0,"hellcat-lowres-fma-lod0-jg"]],"hellcat-tower-ag":[[2,"hellcat-tower-idle-ja"],[1,"hellcat-tower-lod0-mg"],[0,"hellcat-tower-lod0-jg"]],"hemisplosion-ag":[[2,"hemisplosion-idle-ja"],[1,"hemisplosion-lod0-mg"],[0,"hemisplosion-lod0-jg"]],"hip-door-a-ag":[[2,"hip-door-a-idle-ja"],[1,"hip-door-a-lod0-mg"],[0,"hip-door-a-lod0-jg"]],"hud-ring-ag":[[5,"hud-ring-part-idle-ja"],[4,"hud-ring-part-lod0-mg"],[3,"hud-ring-part-lod0-jg"],[2,"hud-ring-idle-ja"],[1,"hud-ring-lod0-mg"],[0,"hud-ring-lod0-jg"]],"interceptor-ag":[[19,"interceptor-idle-ja"],[18,"interceptor-shadow-mg"],[17,"interceptor-lod0-mg"],[16,"interceptor-lod0-jg"],[15,"interceptor-debris-panel-lod0-mg"],[14,"interceptor-debris-panel-lod0-jg"],[13,"interceptor-debris-rod-lod0-mg"],[0,"interceptor-wheel-lod0-jg"],[1,"interceptor-wheel-lod0-mg"],[2,"interceptor-wheel-shadow-mg"],[3,"interceptor-wheel-idle-ja"],[4,"interceptor-wheel-blur-lod0-jg"],[5,"interceptor-wheel-blur-lod0-mg"],[6,"interceptor-wheel-blur-shadow-mg"],[7,"interceptor-wheel-blur-idle-ja"],[8,"interceptor-debris-ring-lod0-jg"],[9,"interceptor-debris-ring-lod0-mg"],[10,"interceptor-debris-nut-lod0-jg"],[11,"interceptor-debris-nut-lod0-mg"],[12,"interceptor-debris-rod-lod0-jg"]],"interceptor-b-ag":[[11,"interceptor-b-idle-ja"],[10,"interceptor-b-shadow-mg"],[9,"interceptor-b-lod0-mg"],[8,"interceptor-b-lod0-jg"],[7,"interceptor-b-wheel-blur-idle-ja"],[6,"interceptor-b-wheel-blur-shadow-mg"],[5,"interceptor-b-wheel-blur-lod0-mg"],[4,"interceptor-b-wheel-blur-lod0-jg"],[3,"interceptor-b-wheel-idle-ja"],[2,"interceptor-b-wheel-shadow-mg"],[1,"interceptor-b-wheel-lod0-mg"],[0,"interceptor-b-wheel-lod0-jg"]],"interceptor-wheel-fma-ag":[[3,"interceptor-wheel-fma-idle-ja"],[2,"interceptor-wheel-fma-shadow-mg"],[1,"interceptor-wheel-fma-lod0-mg"],[0,"interceptor-wheel-fma-lod0-jg"]],"jak-highres-ag":[[4,"jak-highres-jakb-walk-ja"],[3,"jak-highres-idle-ja"],[2,"jak-highres-shadow-mg"],[1,"jak-highres-lod0-mg"],[0,"jak-highres-lod0-jg"]],"jak-one-ag":[[2,"jak-one-idle-ja"],[1,"jak-one-lod0-mg"],[0,"jak-one-lod0-jg"]],"jakb-ag":[[109,"jakb-tentacle-attack-ja"],[275,"jakb-pilot-wcar-snake-jump-ja"],[274,"jakb-pilot-wcar-snake-out-ja"],[273,"jakb-pilot-wcar-snake-loop-ja"],[272,"jakb-pilot-wcar-snake-in-ja"],[136,"jakb-tube-jump-land-ja"],[135,"jakb-tube-turn-ja"],[432,"jakb-flut-death-drown-ja"],[431,"jakb-flut-deathb-ja"],[429,"jakb-flut-run-squash-ja"],[428,"jakb-flut-deatha-ja"],[427,"jakb-flut-smack-surface-end-ja"],[426,"jakb-flut-smack-surface-ja"],[425,"jakb-flut-hit-back-end-ja"],[424,"jakb-flut-hit-back-ja"],[423,"jakb-flut-get-off-ja"],[422,"jakb-flut-get-on-ja"],[421,"jakb-flut-air-attack-land-ja"],[420,"jakb-flut-air-attack-loop-ja"],[419,"jakb-flut-air-attack-ja"],[418,"jakb-flut-running-attack-end-ja"],[417,"jakb-flut-running-attack-ja"],[416,"jakb-flut-double-jump-ja"],[415,"jakb-flut-jump-forward-land-ja"],[414,"jakb-flut-jump-forward-loop-ja"],[413,"jakb-flut-jump-forward-ja"],[412,"jakb-flut-jump-land-ja"],[411,"jakb-flut-jump-loop-ja"],[410,"jakb-flut-jump-ja"],[409,"jakb-flut-run-ja"],[408,"jakb-flut-jog-ja"],[407,"jakb-flut-walk-ja"],[536,"jakb-ladder-switch-ja"],[535,"jakb-ladder-jump-on-ja"],[534,"jakb-ladder-fall-ja"],[533,"jakb-ladder-jump-ja"],[532,"jakb-ladder-slide-stop-ja"],[531,"jakb-ladder-slide-loop-ja"],[530,"jakb-ladder-slide-start-ja"],[528,"jakb-ladder-down-ja"],[352,"jakb-gun-side-to-side-hop-1-ja"],[351,"jakb-gun-blue-stance-2-ja"],[350,"jakb-gun-blue-fire-2-ja"],[349,"jakb-gun-yellow-fire-3-ja"],[348,"jakb-gun-red-fire-2-ja"],[347,"jakb-gun-red-fire-fast-ja"],[343,"jakb-gun-side-jump-land-ja"],[86,"jakb-shocked-ja"],[342,"jakb-gun-side-jump-ja"],[85,"jakb-smack-surface-end-ja"],[341,"jakb-gun-walk-blue-ja"],[84,"jakb-smack-surface-ja"],[324,"jakb-gun-flop-down-ja"],[67,"jakb-flop-down-land-ja"],[317,"jakb-gun-attack-upperbutt-blue-ja"],[60,"jakb-attack-from-jump-end-ja"],[311,"jakb-gun-attack-butt-ja"],[54,"jakb-attack-from-stance-end-ja"],[309,"jakb-gun-front-to-blue-hop-ja"],[52,"jakb-edge-grab-off-ja"],[304,"jakb-gun-blue-takeout-ja"],[47,"jakb-edge-grab-stance1-ja"],[303,"jakb-gun-yellow-takeout-ja"],[46,"jakb-edge-grab-stance0-ja"],[298,"jakb-gun-yellow-fire-ja"],[41,"jakb-jump-short-land-ja"],[297,"jakb-gun-dark-fire-ja"],[40,"jakb-jump-loop-ja"],[289,"jakb-gun-attack-from-stance-blue-end-ja"],[288,"jakb-gun-attack-from-stance-blue-ja"],[31,"jakb-run-squash-weak-ja"],[287,"jakb-gun-attack-from-stance-end-ja"],[30,"jakb-run-squash-ja"],[286,"jakb-gun-attack-from-stance-ja"],[29,"jakb-walk-left-ja"],[339,"jakb-gun-front-jump-land-ja"],[82,"jakb-deatha-ja"],[338,"jakb-gun-front-jump-ja"],[81,"jakb-hit-up-ja"],[337,"jakb-gun-front-run-ja"],[80,"jakb-hit-from-back-ja"],[83,"jakb-death-painful-land-ja"],[336,"jakb-gun-front-walk-ja"],[79,"jakb-hit-from-front-ja"],[295,"jakb-gun-blue-fire-ja"],[38,"jakb-painful-land-ja"],[294,"jakb-gun-red-fire-ja"],[37,"jakb-jump-land-ja"],[293,"jakb-gun-stance-blue-ja"],[36,"jakb-jump-ja"],[39,"jakb-painful-land-end-ja"],[296,"jakb-gun-blue-fire-single-ja"],[292,"jakb-gun-stance-yellow-ja"],[164,"jakb-board-stance-ja"],[291,"jakb-gun-stance-dark-ja"],[290,"jakb-gun-blue-to-yellow-ja"],[285,"jakb-gun-yellow-highlow-ja"],[28,"jakb-walk-right-ja"],[282,"jakb-gun-stance-ja"],[25,"jakb-walk-ja"],[27,"jakb-walk-down-ja"],[284,"jakb-gun-yellow-fire-low-ja"],[26,"jakb-walk-up-ja"],[283,"jakb-gun-stance-yellow-low-ja"],[540,"jakb-wings-lightjak-get-off-ja"],[406,"jakb-flut-idle-ja"],[24,"jakb-run-left-ja"],[0,"jakb-lod0-jg"],[257,"jakb-pilot-gun-red-yellow-ja"],[313,"jakb-gun-attack-butt-blue-ja"],[56,"jakb-attack-from-stance-run-end-ja"],[59,"jakb-attack-from-jump-loop-ja"],[316,"jakb-gun-jump-land-side-ja"],[42,"jakb-jump-forward-ja"],[299,"jakb-gun-walk-side-ja"],[13,"jakb-dummy107-ja"],[270,"jakb-pilot-glider-turn-front-ja"],[326,"jakb-gun-flop-down-land-ja"],[69,"jakb-moving-flop-down-loop-ja"],[72,"jakb-duck-roll-ja"],[1,"jakb-lod0-mg"],[258,"jakb-pilot-gun-red-blue-ja"],[314,"jakb-gun-attack-butt-blue-end-ja"],[14,"jakb-dummy108-ja"],[271,"jakb-pilot-glider-turn-back-ja"],[327,"jakb-gun-hit-from-front-ja"],[73,"jakb-duck-roll-end-ja"],[15,"jakb-dummy109-ja"],[328,"jakb-gun-hit-from-back-ja"],[71,"jakb-flop-jump-ja"],[74,"jakb-roll-flip-ja"],[45,"jakb-launch-jump-loop-ja"],[302,"jakb-gun-dark-takeout-ja"],[16,"jakb-run-to-stance-ja"],[75,"jakb-roll-flip-land-ja"],[17,"jakb-run-to-stance-loop-ja"],[76,"jakb-trip-ja"],[18,"jakb-stance-loop-ja"],[77,"jakb-hit-elec-ja"],[19,"jakb-run-to-stance-fast-ja"],[78,"jakb-hit-from-front-alt1-ja"],[335,"jakb-gun-hit-elec-ja"],[20,"jakb-run-ja"],[21,"jakb-run-up-ja"],[22,"jakb-run-down-ja"],[23,"jakb-run-right-ja"],[300,"jakb-gun-run-blue-ja"],[301,"jakb-gun-red-takeout-ja"],[48,"jakb-falling-to-edge-grab-ja"],[305,"jakb-gun-attack-upperbutt-ja"],[51,"jakb-edge-grab-to-jump-ja"],[308,"jakb-gun-front-to-side-hop-ja"],[306,"jakb-gun-side-to-front-hop-ja"],[307,"jakb-gun-transformation-twirl-ja"],[53,"jakb-attack-from-stance-ja"],[310,"jakb-gun-blue-to-front-hop-ja"],[312,"jakb-gun-attack-butt-end-ja"],[58,"jakb-attack-from-jump-ja"],[315,"jakb-gun-jump-land-ja"],[61,"jakb-attack-punch-ja"],[318,"jakb-gun-edge-grab-off-ja"],[62,"jakb-attack-punch-end-ja"],[319,"jakb-gun-edge-grab-to-jump-ja"],[64,"jakb-attack-uppercut-ja"],[321,"jakb-gun-duck-roll-end-ja"],[65,"jakb-flop-down-ja"],[322,"jakb-gun-roll-flip-ja"],[320,"jakb-gun-duck-roll-ja"],[66,"jakb-flop-down-loop-ja"],[323,"jakb-gun-roll-flip-land-ja"],[68,"jakb-moving-flop-down-ja"],[325,"jakb-gun-flop-down-loop-ja"],[165,"jakb-board-duck-turn-ja"],[166,"jakb-board-turn-ja"],[168,"jakb-board-jump-ja"],[169,"jakb-board-jump-loop-ja"],[171,"jakb-board-hit-ja"],[174,"jakb-board-turn-left-ja"],[175,"jakb-board-turn-right-ja"],[176,"jakb-board-turn-up-ja"],[177,"jakb-board-turn-down-ja"],[178,"jakb-board-hit-forward-ja"],[183,"jakb-board-get-on-ja"],[184,"jakb-board-get-off-ja"],[190,"jakb-board-air-turn-ja"],[202,"jakb-board-hit-elec-ja"],[203,"jakb-board-get-on-land-ja"],[204,"jakb-board-get-off-pre-ja"],[207,"jakb-board-hit-get-off-ja"],[458,"jakb-darkjak-get-off-ja"],[462,"jakb-darkjak-get-on-fast-ja"],[465,"jakb-darkjak-get-off-end-ja"],[472,"jakb-darkjak-get-on-fast-loop-ja"],[479,"jakb-powerjak-get-on-ja"],[480,"jakb-powerjak-get-on-loop-ja"],[481,"jakb-lightjak-get-on-ja"],[482,"jakb-lightjak-get-off-ja"],[484,"jakb-lightjak-get-on-loop-ja"],[115,"jakb-wade-shallow-walk-ja"],[372,"jakb-mech-punch-r-ja"],[116,"jakb-wade-deep-walk-ja"],[373,"jakb-mech-punch-b-ja"],[117,"jakb-swim-stance-ja"],[374,"jakb-mech-carry-pickup-low-ja"],[118,"jakb-swim-walk-ja"],[375,"jakb-mech-carry-pickup-high-ja"],[119,"jakb-swim-walk-to-down-ja"],[376,"jakb-mech-carry-stance-ja"],[120,"jakb-swim-down-ja"],[377,"jakb-mech-carry-walk-ja"],[121,"jakb-swim-down-to-up-ja"],[378,"jakb-mech-carry-jump-ja"],[122,"jakb-swim-up-ja"],[379,"jakb-mech-carry-jump-loop-ja"],[123,"jakb-swim-up-to-stance-ja"],[380,"jakb-mech-carry-jump-land-ja"],[124,"jakb-swim-jump-ja"],[381,"jakb-mech-carry-throw-ja"],[125,"jakb-death-swim-ja"],[382,"jakb-mech-carry-turn45-ja"],[126,"jakb-death-swim-loop-ja"],[383,"jakb-mech-push-ja"],[127,"jakb-death-swim-end-ja"],[384,"jakb-mech-pull-ja"],[128,"jakb-pole-cycle-ja"],[385,"jakb-mech-drag-pickup-ja"],[129,"jakb-pole-flip-up-ja"],[386,"jakb-mech-hit-front-ja"],[130,"jakb-pole-flip-forward-ja"],[387,"jakb-mech-get-off-ja"],[131,"jakb-pole-jump-loop-ja"],[388,"jakb-mech-get-on-ja"],[397,"jakb-turret-stance-ja"],[398,"jakb-turret-get-off-ja"],[399,"jakb-turret-get-on-ja"],[400,"jakb-turret-for-stance-ja"],[401,"jakb-turret-for-get-off-ja"],[402,"jakb-turret-for-get-on-ja"],[403,"jakb-turret-for-stance-left-ja"],[404,"jakb-turret-for-stance-right-ja"],[405,"jakb-turret-for-fire-ja"],[362,"jakb-mech-stance-ja"],[363,"jakb-mech-run-ja"],[364,"jakb-mech-walk-ja"],[365,"jakb-mech-turn90-ja"],[366,"jakb-mech-jump-ja"],[367,"jakb-mech-jump-thrust-ja"],[368,"jakb-mech-jump-loop-ja"],[369,"jakb-mech-jump-land-ja"],[370,"jakb-mech-turn20-ja"],[371,"jakb-mech-punch-l-ja"],[389,"jakb-mech-death-a-ja"],[390,"jakb-mech-death-b-ja"],[391,"jakb-mech-punch-u-ja"],[229,"jakb-pilot-gun-red-takeout-ja"],[237,"jakb-pilot-gun-blue-fire-ja"],[238,"jakb-pilot-gun-blue-fire-single-ja"],[249,"jakb-pilot-gun-red-idle-ja"],[250,"jakb-pilot-gun-dark-idle-ja"],[251,"jakb-pilot-gun-yellow-idle-ja"],[252,"jakb-pilot-gun-blue-idle-ja"],[253,"jakb-pilot-gun-red-fire-ja"],[254,"jakb-pilot-gun-yellow-fire-ja"],[255,"jakb-pilot-gun-dark-fire-ja"],[256,"jakb-pilot-gun-red-dark-ja"],[259,"jakb-pilot-gun-yellow-blue-ja"],[260,"jakb-pilot-gun-blue-blue-ja"],[261,"jakb-pilot-gun-yellow-takeout-ja"],[262,"jakb-pilot-gun-blue-takeout-ja"],[263,"jakb-pilot-gun-dark-takeout-ja"],[230,"jakb-pilot-car-get-off-ja"],[231,"jakb-pilot-car-get-on-ja"],[235,"jakb-pilot-car-smack-front-ja"],[236,"jakb-pilot-car-smack-back-ja"],[239,"jakb-pilot-car-smack-shock-ja"],[244,"jakb-pilot-car-up-down-ja"],[248,"jakb-pilot-eject-loop-ja"],[266,"jakb-pilot-car-smack-left-ja"],[267,"jakb-pilot-car-smack-right-ja"],[524,"jakb-ladder-up-ja"],[268,"jakb-pilot-wcar-turn-front-ja"],[269,"jakb-pilot-wcar-turn-back-ja"],[526,"jakb-ladder-stance-ja"],[232,"jakb-pilot-bike-get-on-ja"],[233,"jakb-pilot-car-turn-front-ja"],[234,"jakb-pilot-car-turn-back-ja"],[240,"jakb-pilot-bike-turn-front-ja"],[241,"jakb-pilot-bike-turn-back-ja"],[242,"jakb-pilot-bike-smack-front-ja"],[243,"jakb-pilot-bike-smack-back-ja"],[245,"jakb-pilot-bike-up-down-ja"],[246,"jakb-pilot-bike-smack-shock-ja"],[247,"jakb-pilot-bike-get-off-ja"],[264,"jakb-pilot-bike-smack-left-ja"],[265,"jakb-pilot-bike-smack-right-ja"],[522,"jakb-ladder-get-on-ja"],[430,"jakb-flut-kanga-catch-ja"]],"jakc-feet-ag":[[6,"jakc-feet-idle-ja"],[5,"jakc-feet-jakcfma0-scarf-cg"],[4,"jakc-feet-jakcfma0-sash-cg"],[3,"jakc-feet-jakcfma0-skirt-cg"],[2,"jakc-feet-shadow-mg"],[1,"jakc-feet-lod0-mg"],[0,"jakc-feet-lod0-jg"]],"jakc-highres-ag":[[7,"jakc-highres-jakc-walk-ja"],[6,"jakc-highres-idle-ja"],[5,"jakc-highres-jakcfma0-scarf-cg"],[4,"jakc-highres-jakcfma0-sash-cg"],[3,"jakc-highres-jakcfma0-skirt-cg"],[2,"jakc-highres-shadow-mg"],[1,"jakc-highres-lod0-mg"],[0,"jakc-highres-lod0-jg"]],"jakc-scarf-ag":[[2,"jakc-scarf-idle-ja"],[1,"jakc-scarf-lod0-mg"],[0,"jakc-scarf-lod0-jg"]],"jakc-wings-ag":[[2,"jakc-wings-idle-ja"],[1,"jakc-wings-lod0-mg"],[0,"jakc-wings-lod0-jg"]],"jakthreelogo-ag":[[2,"jakthreelogo-idle-ja"],[1,"jakthreelogo-lod0-mg"],[0,"jakthreelogo-lod0-jg"]],"jinx-ag":[[35,"jinx-kneel-knocked-right-ja"],[34,"jinx-kneel-knocked-left-ja"],[33,"jinx-kneel-up-ja"],[32,"jinx-kneel-loop1-ja"],[31,"jinx-kneel-loop0-ja"],[30,"jinx-kneel-fix-ja"],[29,"jinx-kneel-down-ja"],[12,"jinx-turn-left50-end0-ja"],[11,"jinx-turn-left-start0-ja"],[10,"jinx-run0-ja"],[9,"jinx-walk0-ja"],[8,"jinx-die-in-place0-ja"],[7,"jinx-knocked-land0-ja"],[6,"jinx-knocked0-ja"],[5,"jinx-blue-hit-front0-ja"],[4,"jinx-idle1-ja"],[3,"jinx-idle0-ja"],[2,"jinx-shadow-mg"],[1,"jinx-lod0-mg"],[0,"jinx-lod0-jg"],[13,"jinx-turn-left100-end0-ja"],[14,"jinx-turn-left150-end0-ja"],[15,"jinx-kick0-ja"],[16,"jinx-kick1-ja"],[17,"jinx-in-car-back-ja"],[18,"jinx-in-car-front-ja"],[19,"jinx-get-in-car-start-ja"],[20,"jinx-get-in-car-jump-ja"],[21,"jinx-get-in-car-land-ja"],[22,"jinx-get-in-car-sit-ja"],[23,"jinx-get-in-car-sit-end-ja"],[24,"jinx-get-out-car-start-ja"],[25,"jinx-get-out-car-getup-ja"],[26,"jinx-get-out-car-start-jump-ja"],[27,"jinx-get-out-car-jump-ja"],[28,"jinx-get-out-car-land-ja"]],"jinx-highres-ag":[[4,"jinx-highres-jinx-walk-ja"],[3,"jinx-highres-idle-hiphog-ja"],[2,"jinx-highres-idle-ja"],[1,"jinx-highres-lod0-mg"],[0,"jinx-highres-lod0-jg"]],"kanga-lizard-ag":[[11,"kanga-lizard-flut-kanga-catch-ja"],[10,"kanga-lizard-run-squash-ja"],[9,"kanga-lizard-jump-land-ja"],[8,"kanga-lizard-jump-ja"],[7,"kanga-lizard-notice-ja"],[6,"kanga-lizard-run-ja"],[5,"kanga-lizard-jog-ja"],[4,"kanga-lizard-ambient-ja"],[3,"kanga-lizard-idle-ja"],[2,"kanga-lizard-shadow-mg"],[1,"kanga-lizard-lod0-mg"],[0,"kanga-lizard-lod0-jg"]],"keira-highres-ag":[[4,"keira-highres-keira-idle-ja"],[3,"keira-highres-idle-ja"],[2,"keira-highres-shadow-mg"],[1,"keira-highres-lod0-mg"],[0,"keira-highres-lod0-jg"]],"keira-simple-ag":[[2,"keira-simple-idle-ja"],[1,"keira-simple-lod0-mg"],[0,"keira-simple-lod0-jg"]],"kg-debris-ag":[[7,"kg-debris-d-lod0-mg"],[6,"kg-debris-d-lod0-jg"],[5,"kg-debris-c-lod0-mg"],[4,"kg-debris-c-lod0-jg"],[3,"kg-debris-b-lod0-mg"],[2,"kg-debris-b-lod0-jg"],[1,"kg-debris-a-lod0-mg"],[0,"kg-debris-a-lod0-jg"]],"kg-fighter-ag":[[7,"kg-fighter-explode-idle-ja"],[6,"kg-fighter-explode-lod0-mg"],[5,"kg-fighter-explode-lod0-jg"],[4,"kg-fighter-idle-ja"],[3,"kg-fighter-lod2-mg"],[2,"kg-fighter-lod1-mg"],[1,"kg-fighter-lod0-mg"],[0,"kg-fighter-lod0-jg"]],"kg-flying-turret-ag":[[4,"kg-flying-turret-fire-ja"],[3,"kg-flying-turret-hover-ja"],[2,"kg-flying-turret-idle-ja"],[1,"kg-flying-turret-lod0-mg"],[0,"kg-flying-turret-lod0-jg"]],"kg-grunt-ag":[[47,"kg-grunt-jump-land-ja"],[46,"kg-grunt-jump-in-air-ja"],[45,"kg-grunt-jump-wind-up-ja"],[44,"kg-grunt-blue-land-ja"],[43,"kg-grunt-blue-hit5-ja"],[42,"kg-grunt-blue-hit4-ja"],[41,"kg-grunt-blue-hit3-ja"],[40,"kg-grunt-blue-hit2-ja"],[39,"kg-grunt-blue-hit1-ja"],[38,"kg-grunt-blue-hit0-ja"],[37,"kg-grunt-yellow-hit3-ja"],[36,"kg-grunt-yellow-hit2-ja"],[35,"kg-grunt-yellow-hit1-ja"],[34,"kg-grunt-yellow-hit0-ja"],[33,"kg-grunt-bite-ja"],[32,"kg-grunt-die-falling-ja"],[31,"kg-grunt-celebrate-finish-ja"],[30,"kg-grunt-celebrate-start-ja"],[29,"kg-grunt-explode-land0-ja"],[12,"kg-grunt-patrol1-ja"],[11,"kg-grunt-patrol0-ja"],[10,"kg-grunt-idle1-left-to-idle-ja"],[9,"kg-grunt-idle1-look-left-hold-ja"],[8,"kg-grunt-idle1-look-left-ja"],[7,"kg-grunt-idle1-look-right-hold-ja"],[6,"kg-grunt-idle1-look-right-ja"],[5,"kg-grunt-idle-ja"],[4,"kg-grunt-shadow-mg"],[3,"kg-grunt-lod2-mg"],[2,"kg-grunt-lod1-mg"],[1,"kg-grunt-lod0-mg"],[0,"kg-grunt-lod0-jg"],[13,"kg-grunt-notice-ja"],[14,"kg-grunt-charge0-ja"],[15,"kg-grunt-charge1-ja"],[16,"kg-grunt-charge2-ja"],[17,"kg-grunt-attack0-ja"],[18,"kg-grunt-attack1-ja"],[19,"kg-grunt-death-in-place-ja"],[20,"kg-grunt-taunt-ja"],[21,"kg-grunt-turn-ja"],[22,"kg-grunt-knocked0-ja"],[23,"kg-grunt-knocked-land0-ja"],[24,"kg-grunt-knocked1-ja"],[25,"kg-grunt-knocked-land1-ja"],[26,"kg-grunt-knocked2-ja"],[27,"kg-grunt-knocked-land2-ja"],[28,"kg-grunt-explode0-ja"]],"kg-hopper-ag":[[36,"kg-hopper-hop-attack-land-ja"],[35,"kg-hopper-hop-attack-air-ja"],[34,"kg-hopper-hop-attack-start-ja"],[33,"kg-hopper-hop-land-ja"],[32,"kg-hopper-hop-air-ja"],[31,"kg-hopper-hop-start-ja"],[30,"kg-hopper-knocked2-land-ja"],[29,"kg-hopper-knocked2-ja"],[12,"kg-hopper-jump-start-right-ja"],[11,"kg-hopper-jump-start-left-ja"],[10,"kg-hopper-jump-start-ja"],[9,"kg-hopper-turn-ja"],[8,"kg-hopper-notice-alt-ja"],[7,"kg-hopper-notice-ja"],[6,"kg-hopper-idle-look-right-ja"],[5,"kg-hopper-idle-look-left-ja"],[4,"kg-hopper-idle-ja"],[3,"kg-hopper-shadow-mg"],[2,"kg-hopper-lod1-mg"],[1,"kg-hopper-lod0-mg"],[0,"kg-hopper-lod0-jg"],[13,"kg-hopper-jump-ja"],[14,"kg-hopper-jump-land-ja"],[15,"kg-hopper-jump-attack-ja"],[16,"kg-hopper-jump-attack-land-ja"],[17,"kg-hopper-jump-attack2-ja"],[18,"kg-hopper-jump-attack2-land-ja"],[19,"kg-hopper-die-ja"],[20,"kg-hopper-die-falling-ja"],[21,"kg-hopper-blue-hit0-ja"],[22,"kg-hopper-blue-hit1-ja"],[23,"kg-hopper-blue-hit2-ja"],[24,"kg-hopper-blue-hit-land-ja"],[25,"kg-hopper-knocked0-ja"],[26,"kg-hopper-knocked0-land-ja"],[27,"kg-hopper-knocked1-ja"],[28,"kg-hopper-knocked1-land-ja"]],"kg-pickup-ag":[[3,"kg-pickup-idle-ja"],[2,"kg-pickup-shadow-mg"],[1,"kg-pickup-lod0-mg"],[0,"kg-pickup-lod0-jg"]],"kg-robot-transport-ag":[[3,"kg-robot-transport-idle-ja"],[2,"kg-robot-transport-shadow-mg"],[1,"kg-robot-transport-lod0-mg"],[0,"kg-robot-transport-lod0-jg"]],"kg-robot-transport-bomb-ag":[[2,"kg-robot-transport-bomb-idle-ja"],[1,"kg-robot-transport-bomb-lod0-mg"],[0,"kg-robot-transport-bomb-lod0-jg"]],"kg-robot-transport-break-ag":[[3,"kg-robot-transport-break-break-ja"],[2,"kg-robot-transport-break-idle-ja"],[1,"kg-robot-transport-break-lod0-mg"],[0,"kg-robot-transport-break-lod0-jg"]],"kid-ag":[[3,"kid-idle-ja"],[2,"kid-shadow-mg"],[1,"kid-lod0-mg"],[0,"kid-lod0-jg"]],"kid-highres-ag":[[2,"kid-highres-kid-walk-ja"],[1,"kid-highres-lod0-mg"],[0,"kid-highres-lod0-jg"]],"kidmedallion-ag":[[2,"kidmedallion-idle-ja"],[1,"kidmedallion-lod0-mg"],[0,"kidmedallion-lod0-jg"]],"king-highres-ag":[[10,"king-highres-damus-walk-ja"],[9,"king-highres-idle-wasdoors-ja"],[8,"king-highres-idle-breathe-forward-ja"],[7,"king-highres-idle-lean-forward-ja"],[6,"king-highres-idle-breathe-back-ja"],[5,"king-highres-idle-lean-back-ja"],[4,"king-highres-idle-ja"],[3,"king-highres-king-kingskirt-cg"],[2,"king-highres-shadow-mg"],[1,"king-highres-lod0-mg"],[0,"king-highres-lod0-jg"]],"king-rider-ag":[[5,"king-rider-pilot-car-up-down-ja"],[4,"king-rider-pilot-car-turn-back-ja"],[3,"king-rider-pilot-car-turn-front-ja"],[2,"king-rider-idle-ja"],[1,"king-rider-lod0-mg"],[0,"king-rider-lod0-jg"]],"kleever-highres-ag":[[14,"kleever-highres-kleever-walk-ja"],[13,"kleever-highres-idle-shift-b-ja"],[0,"kleever-highres-lod0-jg"],[1,"kleever-highres-lod0-mg"],[2,"kleever-highres-shadow-mg"],[3,"kleever-highres-kleever-R1-cg"],[4,"kleever-highres-kleever-L1-cg"],[5,"kleever-highres-kleever-Center-cg"],[6,"kleever-highres-kleever-R2-cg"],[7,"kleever-highres-kleever-L2-cg"],[8,"kleever-highres-idle-ja"],[9,"kleever-highres-idle-city-chase-ja"],[10,"kleever-highres-idle-breathing-a-ja"],[11,"kleever-highres-idle-shift-a-ja"],[12,"kleever-highres-idle-breathing-b-ja"]],"kleever-rider-ag":[[5,"kleever-rider-pilot-car-up-down-ja"],[4,"kleever-rider-pilot-car-turn-back-ja"],[3,"kleever-rider-pilot-car-turn-front-ja"],[2,"kleever-rider-idle-ja"],[1,"kleever-rider-lod0-mg"],[0,"kleever-rider-lod0-jg"]],"kor-highres-ag":[[3,"kor-highres-kor-idle-ja"],[2,"kor-highres-idle-ja"],[1,"kor-highres-lod0-mg"],[0,"kor-highres-lod0-jg"]],"krew-ag":[[2,"krew-idle-ja"],[1,"krew-lod0-mg"],[0,"krew-lod0-jg"]],"krimson-wall-ag":[[4,"krimson-wall-idle-ja"],[3,"krimson-wall-lod2-mg"],[2,"krimson-wall-lod1-mg"],[1,"krimson-wall-lod0-mg"],[0,"krimson-wall-lod0-jg"]],"krimson-wall-break-ag":[[28,"krimson-wall-break-b-idle-3-ja"],[26,"krimson-wall-break-b-end-2-ja"],[25,"krimson-wall-break-b-idle-2-ja"],[23,"krimson-wall-break-b-end-ja"],[22,"krimson-wall-break-b-idle-ja"],[19,"krimson-wall-break-a-end-3-ja"],[29,"krimson-wall-break-b-end-3-ja"],[0,"krimson-wall-break-lod0-jg"],[13,"krimson-wall-break-a-end-ja"],[1,"krimson-wall-break-lod0-mg"],[2,"krimson-wall-break-idle-ja"],[15,"krimson-wall-break-a-idle-2-ja"],[3,"krimson-wall-break-end-ja"],[16,"krimson-wall-break-a-end-2-ja"],[5,"krimson-wall-break-idle-2-ja"],[18,"krimson-wall-break-a-idle-3-ja"],[6,"krimson-wall-break-end-2-ja"],[8,"krimson-wall-break-idle-3-ja"],[9,"krimson-wall-break-end-3-ja"],[12,"krimson-wall-break-a-idle-ja"]],"ladder-ag":[[2,"ladder-idle-ja"],[1,"ladder-lod0-mg"],[0,"ladder-lod0-jg"]],"leggings-ag":[[2,"leggings-idle-ja"],[1,"leggings-lod0-mg"],[0,"leggings-lod0-jg"]],"leggings-fma-ag":[[2,"leggings-fma-idle-ja"],[1,"leggings-fma-lod0-mg"],[0,"leggings-fma-lod0-jg"]],"lfac-hanger-door-ag":[[2,"lfac-hanger-door-idle-ja"],[1,"lfac-hanger-door-lod0-mg"],[0,"lfac-hanger-door-lod0-jg"]],"light-eco-vent-ag":[[4,"light-eco-vent-close-open-ja"],[3,"light-eco-vent-lod2-mg"],[2,"light-eco-vent-lod1-mg"],[1,"light-eco-vent-lod0-mg"],[0,"light-eco-vent-lod0-jg"]],"manta-ag":[[22,"manta-glide-end-ja"],[21,"manta-attack-end-ja"],[20,"manta-attack-start-ja"],[19,"manta-falling-death-land-phase-out-ja"],[18,"manta-falling-death-land-ja"],[17,"manta-falling-death-fade-ja"],[16,"manta-falling-death-ja"],[15,"manta-knocked-blue-recover-ja"],[14,"manta-knocked-blue-ja"],[13,"manta-knocked0-ja"],[0,"manta-lod0-jg"],[1,"manta-lod0-mg"],[2,"manta-shadow-mg"],[3,"manta-idle0-ja"],[4,"manta-idle1-ja"],[5,"manta-go-alert-ja"],[6,"manta-alert-idle-ja"],[7,"manta-alert-to-fly-ja"],[8,"manta-flap-ja"],[9,"manta-flap1-ja"],[10,"manta-flap-fast-ja"],[11,"manta-flap-back-ja"],[12,"manta-land-ja"]],"mantis-ag":[[35,"mantis-ragdoll-ja"],[34,"mantis-hop-left-land-ja"],[33,"mantis-hop-left-ja"],[32,"mantis-roll-left-ja"],[31,"mantis-roll-right-land-ja"],[30,"mantis-roll-right-ja"],[29,"mantis-attack1-land-ja"],[12,"mantis-hop-backward-wind-up-ja"],[11,"mantis-hop-forward-go-ja"],[10,"mantis-hop-forward-wind-up-ja"],[9,"mantis-run0-ja"],[8,"mantis-idle1-to-idle0-ja"],[7,"mantis-idle0-to-idle1-ja"],[6,"mantis-idle1-ja"],[5,"mantis-idle0-ja"],[4,"mantis-shadow-mg"],[3,"mantis-lod2-mg"],[2,"mantis-lod1-mg"],[1,"mantis-lod0-mg"],[0,"mantis-lod0-jg"],[13,"mantis-hop-backward-go-ja"],[14,"mantis-hop-backward-land-ja"],[15,"mantis-flip-forward-wind-up-ja"],[16,"mantis-flip-forward-go-ja"],[17,"mantis-flip-forward-land-ja"],[18,"mantis-flip-backward-wind-up-ja"],[19,"mantis-flip-backward-go-ja"],[20,"mantis-flip-backward-land-ja"],[21,"mantis-ground-jump-out-ja"],[22,"mantis-ground-jump-out-land-ja"],[23,"mantis-ground-crawl-out-ja"],[24,"mantis-death0-ja"],[25,"mantis-attack0-ja"],[26,"mantis-attack0-land-ja"],[27,"mantis-attack1-wind-up-ja"],[28,"mantis-attack1-go-ja"]],"marauder-male-ag":[[34,"marauder-male-die-ja"],[33,"marauder-male-turn-ja"],[32,"marauder-male-attack-shoot0-end-ja"],[31,"marauder-male-attack-shoot0-shoot-ja"],[30,"marauder-male-attack-shoot0-start-ja"],[29,"marauder-male-run2-ja"],[12,"marauder-male-jump-out-car-land-ja"],[11,"marauder-male-jump-out-car-ja"],[10,"marauder-male-jump-land-ja"],[9,"marauder-male-jump-ja"],[8,"marauder-male-jump-start-ja"],[7,"marauder-male-run1-ja"],[6,"marauder-male-run0-ja"],[5,"marauder-male-walk0-ja"],[4,"marauder-male-idle1-ja"],[3,"marauder-male-idle0-ja"],[2,"marauder-male-shadow-mg"],[1,"marauder-male-lod0-mg"],[0,"marauder-male-lod0-jg"],[13,"marauder-male-attack-run0-start-ja"],[14,"marauder-male-attack-run0-ja"],[15,"marauder-male-attack-jump0-start-ja"],[16,"marauder-male-attack-jump0-ja"],[17,"marauder-male-attack-jump0-land-ja"],[18,"marauder-male-celebrate0-ja"],[19,"marauder-male-ragdoll-ja"],[20,"marauder-male-knocked-back0-ja"],[21,"marauder-male-knocked-back0-land-ja"],[22,"marauder-male-knocked-death-ja"],[23,"marauder-male-knocked-death-land-ja"],[24,"marauder-male-knocked-forward0-ja"],[25,"marauder-male-knocked-forward0-land-ja"],[26,"marauder-male-knocked-forward-death-ja"],[27,"marauder-male-knocked-forward-death-land-ja"],[28,"marauder-male-drown-lava-ja"]],"market-basket-a-ag":[[2,"market-basket-a-idle-ja"],[1,"market-basket-a-lod0-mg"],[0,"market-basket-a-lod0-jg"]],"market-basket-b-ag":[[2,"market-basket-b-idle-ja"],[1,"market-basket-b-lod0-mg"],[0,"market-basket-b-lod0-jg"]],"market-crate-ag":[[2,"market-crate-idle-ja"],[1,"market-crate-lod0-mg"],[0,"market-crate-lod0-jg"]],"market-sack-a-ag":[[2,"market-sack-a-idle-ja"],[1,"market-sack-a-lod0-mg"],[0,"market-sack-a-lod0-jg"]],"market-sack-b-ag":[[2,"market-sack-b-idle-ja"],[1,"market-sack-b-lod0-mg"],[0,"market-sack-b-lod0-jg"]],"mayor-ag":[[2,"mayor-mayor-pace-ja"],[1,"mayor-lod0-mg"],[0,"mayor-lod0-jg"]],"mech-ag":[[44,"mech-target-idle-ja"],[43,"mech-target-lod0-mg"],[42,"mech-target-lod0-jg"],[41,"mech-explode-idle-ja"],[40,"mech-explode-lod0-mg"],[39,"mech-explode-lod0-jg"],[3,"mech-mech-idle-ja"],[2,"mech-shadow-mg"],[1,"mech-lod0-mg"],[0,"mech-lod0-jg"],[33,"mech-mech-punch-u-ja"],[16,"mech-mech-carry-pickup-low-ja"],[15,"mech-mech-punch-b-ja"],[14,"mech-mech-punch-r-ja"],[13,"mech-mech-punch-l-ja"],[12,"mech-mech-turn20-ja"],[11,"mech-mech-jump-land-ja"],[10,"mech-mech-jump-loop-ja"],[9,"mech-mech-jump-thrust-ja"],[8,"mech-mech-jump-ja"],[7,"mech-mech-turn90-ja"],[6,"mech-mech-walk-ja"],[5,"mech-mech-run-ja"],[4,"mech-mech-stance-ja"],[17,"mech-mech-carry-pickup-high-ja"],[18,"mech-mech-carry-stance-ja"],[19,"mech-mech-carry-walk-ja"],[20,"mech-mech-carry-jump-ja"],[21,"mech-mech-carry-jump-loop-ja"],[22,"mech-mech-carry-jump-land-ja"],[23,"mech-mech-carry-throw-ja"],[24,"mech-mech-carry-turn45-ja"],[25,"mech-mech-push-ja"],[26,"mech-mech-pull-ja"],[27,"mech-mech-drag-pickup-ja"],[28,"mech-mech-hit-front-ja"],[29,"mech-mech-get-off-ja"],[30,"mech-mech-get-on-ja"],[31,"mech-mech-death-a-ja"],[32,"mech-mech-death-b-ja"]],"mecha-daxter-ag":[[2,"mecha-daxter-idle-ja"],[1,"mecha-daxter-lod0-mg"],[0,"mecha-daxter-lod0-jg"]],"mh-bat-ag":[[7,"mh-bat-attack0-ja"],[6,"mh-bat-attack0-windup-ja"],[5,"mh-bat-fly-glide0-ja"],[4,"mh-bat-fly-fast0-ja"],[3,"mh-bat-ragdoll-ja"],[2,"mh-bat-shadow-mg"],[1,"mh-bat-lod0-mg"],[0,"mh-bat-lod0-jg"]],"mh-centipede-ag":[[10,"mh-centipede-explode-idle-ja"],[9,"mh-centipede-explode-lod0-mg"],[8,"mh-centipede-explode-lod0-jg"],[7,"mh-centipede-shoot-ja"],[6,"mh-centipede-breach-2-ja"],[5,"mh-centipede-breach-1-ja"],[4,"mh-centipede-breach-ja"],[3,"mh-centipede-idle-ja"],[2,"mh-centipede-shadow-mg"],[1,"mh-centipede-lod0-mg"],[0,"mh-centipede-lod0-jg"]],"mh-communicator-ag":[[3,"mh-communicator-activate-ja"],[2,"mh-communicator-idle-ja"],[1,"mh-communicator-lod0-mg"],[0,"mh-communicator-lod0-jg"]],"mh-flyer-ag":[[10,"mh-flyer-ragdoll-ja"],[9,"mh-flyer-fly-fast0-jitter-ja"],[8,"mh-flyer-glide0-jitter-ja"],[7,"mh-flyer-fly0-jitter-ja"],[6,"mh-flyer-fly-fast0-ja"],[5,"mh-flyer-glide0-ja"],[4,"mh-flyer-fly0-ja"],[3,"mh-flyer-shadow-mg"],[2,"mh-flyer-lod1-mg"],[1,"mh-flyer-lod0-mg"],[0,"mh-flyer-lod0-jg"]],"mh-flyer-missile-ag":[[2,"mh-flyer-missile-idle-ja"],[1,"mh-flyer-missile-lod0-mg"],[0,"mh-flyer-missile-lod0-jg"]],"mh-plant-ag":[[7,"mh-plant-burrow-ja"],[6,"mh-plant-pop-up-ja"],[5,"mh-plant-swell-ja"],[4,"mh-plant-throb-ja"],[3,"mh-plant-idle-ja"],[2,"mh-plant-lod1-mg"],[1,"mh-plant-lod0-mg"],[0,"mh-plant-lod0-jg"]],"mh-spawner-ag":[[2,"mh-spawner-idle-ja"],[1,"mh-spawner-lod0-mg"],[0,"mh-spawner-lod0-jg"]],"mhcity-claw-finger-small-ag":[[3,"mhcity-claw-finger-small-open-ja"],[2,"mhcity-claw-finger-small-idle-ja"],[1,"mhcity-claw-finger-small-lod0-mg"],[0,"mhcity-claw-finger-small-lod0-jg"]],"mhcity-dark-eco-door-ag":[[2,"mhcity-dark-eco-door-idle-ja"],[1,"mhcity-dark-eco-door-lod0-mg"],[0,"mhcity-dark-eco-door-lod0-jg"]],"mhcity-dark-eco-door-break-ag":[[4,"mhcity-dark-eco-door-break-explode-ja"],[3,"mhcity-dark-eco-door-break-crack-ja"],[2,"mhcity-dark-eco-door-break-idle-ja"],[1,"mhcity-dark-eco-door-break-lod0-mg"],[0,"mhcity-dark-eco-door-break-lod0-jg"]],"mhcity-dark-eco-nodule-ag":[[2,"mhcity-dark-eco-nodule-idle-ja"],[1,"mhcity-dark-eco-nodule-lod0-mg"],[0,"mhcity-dark-eco-nodule-lod0-jg"]],"mhcity-de-tower-egg-ag":[[3,"mhcity-de-tower-egg-hit-ja"],[2,"mhcity-de-tower-egg-idle-ja"],[1,"mhcity-de-tower-egg-lod0-mg"],[0,"mhcity-de-tower-egg-lod0-jg"]],"mhcity-eco-dark-tower-ag":[[7,"mhcity-eco-dark-tower-straight-ja"],[6,"mhcity-eco-dark-tower-spit-loop-b-ja"],[5,"mhcity-eco-dark-tower-spit-loop-a-ja"],[4,"mhcity-eco-dark-tower-spit-b-ja"],[3,"mhcity-eco-dark-tower-spit-a-ja"],[2,"mhcity-eco-dark-tower-idle-ja"],[1,"mhcity-eco-dark-tower-lod0-mg"],[0,"mhcity-eco-dark-tower-lod0-jg"]],"mhcity-grunt-egg-b-ag":[[4,"mhcity-grunt-egg-b-idle2-ja"],[3,"mhcity-grunt-egg-b-idle-ja"],[2,"mhcity-grunt-egg-b-lod1-mg"],[1,"mhcity-grunt-egg-b-lod0-mg"],[0,"mhcity-grunt-egg-b-lod0-jg"]],"mhcity-grunt-egg-c-ag":[[4,"mhcity-grunt-egg-c-idle2-ja"],[3,"mhcity-grunt-egg-c-idle-ja"],[2,"mhcity-grunt-egg-c-lod1-mg"],[1,"mhcity-grunt-egg-c-lod0-mg"],[0,"mhcity-grunt-egg-c-lod0-jg"]],"mhcity-puffer-ag":[[4,"mhcity-puffer-spit-loop-ja"],[3,"mhcity-puffer-spit-ja"],[2,"mhcity-puffer-idle-ja"],[1,"mhcity-puffer-lod0-mg"],[0,"mhcity-puffer-lod0-jg"]],"mhcity-puffer-large-ag":[[4,"mhcity-puffer-large-spit-loop-ja"],[3,"mhcity-puffer-large-spit-ja"],[2,"mhcity-puffer-large-idle-ja"],[1,"mhcity-puffer-large-lod0-mg"],[0,"mhcity-puffer-large-lod0-jg"]],"mhcity-tower-door-ag":[[2,"mhcity-tower-door-idle-ja"],[1,"mhcity-tower-door-lod0-mg"],[0,"mhcity-tower-door-lod0-jg"]],"mhcity-tower-door-break-ag":[[2,"mhcity-tower-door-break-idle-ja"],[1,"mhcity-tower-door-break-lod0-mg"],[0,"mhcity-tower-door-break-lod0-jg"]],"mhcity-twitch-blade-ag":[[2,"mhcity-twitch-blade-idle-ja"],[1,"mhcity-twitch-blade-lod0-mg"],[0,"mhcity-twitch-blade-lod0-jg"]],"mhcity-vein-writhing-large-ag":[[2,"mhcity-vein-writhing-large-idle-ja"],[1,"mhcity-vein-writhing-large-lod0-mg"],[0,"mhcity-vein-writhing-large-lod0-jg"]],"mhcity-vein-writhing-small-ag":[[2,"mhcity-vein-writhing-small-idle-ja"],[1,"mhcity-vein-writhing-small-lod0-mg"],[0,"mhcity-vein-writhing-small-lod0-jg"]],"mhcity-vine-wriggler-ag":[[2,"mhcity-vine-wriggler-idle-ja"],[1,"mhcity-vine-wriggler-lod0-mg"],[0,"mhcity-vine-wriggler-lod0-jg"]],"mhcity-vine-wriggler-big-ag":[[2,"mhcity-vine-wriggler-big-idle-ja"],[1,"mhcity-vine-wriggler-big-lod0-mg"],[0,"mhcity-vine-wriggler-big-lod0-jg"]],"min-airlock-door-ag":[[2,"min-airlock-door-idle-ja"],[1,"min-airlock-door-lod0-mg"],[0,"min-airlock-door-lod0-jg"]],"min-bomb-elevator-ag":[[2,"min-bomb-elevator-idle-ja"],[1,"min-bomb-elevator-lod0-mg"],[0,"min-bomb-elevator-lod0-jg"]],"min-bomb-train-ag":[[6,"min-bomb-train-mine-boss-train-3-ja"],[5,"min-bomb-train-mine-boss-train-2-ja"],[4,"min-bomb-train-mine-boss-train-1-ja"],[3,"min-bomb-train-idle-ja"],[2,"min-bomb-train-shadow-mg"],[1,"min-bomb-train-lod0-mg"],[0,"min-bomb-train-lod0-jg"]],"min-bomb-train-debris-ag":[[7,"min-bomb-train-debris-d-lod0-mg"],[6,"min-bomb-train-debris-d-lod0-jg"],[5,"min-bomb-train-debris-c-lod0-mg"],[4,"min-bomb-train-debris-c-lod0-jg"],[3,"min-bomb-train-debris-b-lod0-mg"],[2,"min-bomb-train-debris-b-lod0-jg"],[1,"min-bomb-train-debris-a-lod0-mg"],[0,"min-bomb-train-debris-a-lod0-jg"]],"min-boss-elev-ag":[[2,"min-boss-elev-idle-ja"],[1,"min-boss-elev-lod0-mg"],[0,"min-boss-elev-lod0-jg"]],"min-bridge-ag":[[3,"min-bridge-move-ja"],[2,"min-bridge-idle-ja"],[1,"min-bridge-lod0-mg"],[0,"min-bridge-lod0-jg"]],"min-crane-ag":[[2,"min-crane-idle-ja"],[1,"min-crane-lod0-mg"],[0,"min-crane-lod0-jg"]],"min-crane-switch-ag":[[2,"min-crane-switch-idle-ja"],[1,"min-crane-switch-lod0-mg"],[0,"min-crane-switch-lod0-jg"]],"min-door-ag":[[2,"min-door-idle-ja"],[1,"min-door-lod0-mg"],[0,"min-door-lod0-jg"]],"min-door-break-ag":[[2,"min-door-break-idle-ja"],[1,"min-door-break-lod0-mg"],[0,"min-door-break-lod0-jg"]],"min-elev-doors-ag":[[3,"min-elev-doors-open-ja"],[2,"min-elev-doors-idle-ja"],[1,"min-elev-doors-lod0-mg"],[0,"min-elev-doors-lod0-jg"]],"min-elev-track-ag":[[4,"min-elev-track-idle-ja"],[3,"min-elev-track-lod2-mg"],[2,"min-elev-track-lod1-mg"],[1,"min-elev-track-lod0-mg"],[0,"min-elev-track-lod0-jg"]],"min-elevator-ag":[[2,"min-elevator-idle-ja"],[1,"min-elevator-lod0-mg"],[0,"min-elevator-lod0-jg"]],"min-falling-elevator-ag":[[8,"min-falling-elevator-reset-ja"],[7,"min-falling-elevator-drop-ja"],[6,"min-falling-elevator-unstable-ja"],[5,"min-falling-elevator-start-unstable-ja"],[4,"min-falling-elevator-idle-ja"],[3,"min-falling-elevator-lod2-mg"],[2,"min-falling-elevator-lod1-mg"],[1,"min-falling-elevator-lod0-mg"],[0,"min-falling-elevator-lod0-jg"]],"min-falling-step-ag":[[9,"min-falling-step-unstable-ja"],[8,"min-falling-step-return-ja"],[7,"min-falling-step-hold-b-ja"],[6,"min-falling-step-falling-b-ja"],[5,"min-falling-step-hold-a-ja"],[4,"min-falling-step-falling-a-ja"],[3,"min-falling-step-idle-ja"],[2,"min-falling-step-lod1-mg"],[1,"min-falling-step-lod0-mg"],[0,"min-falling-step-lod0-jg"]],"min-folding-plat-ag":[[4,"min-folding-plat-extend-ja"],[3,"min-folding-plat-idle-ja"],[2,"min-folding-plat-lod1-mg"],[1,"min-folding-plat-lod0-mg"],[0,"min-folding-plat-lod0-jg"]],"min-moving-plat-ag":[[3,"min-moving-plat-idle-ja"],[2,"min-moving-plat-lod1-mg"],[1,"min-moving-plat-lod0-mg"],[0,"min-moving-plat-lod0-jg"]],"min-moving-step-ag":[[5,"min-moving-step-extend-ja"],[4,"min-moving-step-idle-ja"],[3,"min-moving-step-lod2-mg"],[2,"min-moving-step-lod1-mg"],[1,"min-moving-step-lod0-mg"],[0,"min-moving-step-lod0-jg"]],"min-ramp-ag":[[2,"min-ramp-idle-ja"],[1,"min-ramp-lod0-mg"],[0,"min-ramp-lod0-jg"]],"min-rat-engine-ag":[[6,"min-rat-engine-spin-ja"],[5,"min-rat-engine-lower-ja"],[4,"min-rat-engine-raise-ja"],[3,"min-rat-engine-idle-ja"],[2,"min-rat-engine-lod1-mg"],[1,"min-rat-engine-lod0-mg"],[0,"min-rat-engine-lod0-jg"]],"min-rotating-plat-ag":[[2,"min-rotating-plat-idle-ja"],[1,"min-rotating-plat-lod0-mg"],[0,"min-rotating-plat-lod0-jg"]],"min-target-sign-ag":[[5,"min-target-sign-idleb-ja"],[4,"min-target-sign-trackdown-ja"],[3,"min-target-sign-coversopen-ja"],[2,"min-target-sign-idle-ja"],[1,"min-target-sign-lod0-mg"],[0,"min-target-sign-lod0-jg"]],"minershort-ag":[[2,"minershort-minershort-idle-ja"],[1,"minershort-lod0-mg"],[0,"minershort-lod0-jg"]],"minertall-ag":[[2,"minertall-minertall-idle-ja"],[1,"minertall-lod0-mg"],[0,"minertall-lod0-jg"]],"missile-bot-ag":[[3,"missile-bot-idle-ja"],[2,"missile-bot-shadow-mg"],[1,"missile-bot-lod0-mg"],[0,"missile-bot-lod0-jg"]],"monk-ag":[[10,"monk-standing-idle-2-ja"],[9,"monk-standing-idle-1-ja"],[8,"monk-jump-ja"],[7,"monk-run-squash-ja"],[6,"monk-run-ja"],[5,"monk-jog-ja"],[4,"monk-walk-ja"],[3,"monk-idle-ja"],[2,"monk-shadow-mg"],[1,"monk-lod0-mg"],[0,"monk-lod0-jg"]],"monk-mummy-ag":[[3,"monk-mummy-idle-ja"],[2,"monk-mummy-shadow-mg"],[1,"monk-mummy-lod0-mg"],[0,"monk-mummy-lod0-jg"]],"monk-mummy-finger-explode-ag":[[2,"monk-mummy-finger-explode-idle-ja"],[1,"monk-mummy-finger-explode-lod0-mg"],[0,"monk-mummy-finger-explode-lod0-jg"]],"monster-frog-ag":[[33,"monster-frog-knocked1-land-ja"],[32,"monster-frog-knocked1-ja"],[31,"monster-frog-knocked0-land-ja"],[30,"monster-frog-knocked0-ja"],[29,"monster-frog-knocked-yellow-right-land-ja"],[12,"monster-frog-rotate-right-start-ja"],[11,"monster-frog-rotate-left-start-ja"],[10,"monster-frog-notice0-land-ja"],[9,"monster-frog-notice0-jump-ja"],[8,"monster-frog-notice0-ja"],[7,"monster-frog-submerge0-ja"],[6,"monster-frog-popup0-ja"],[5,"monster-frog-idle1-ja"],[4,"monster-frog-idle0-ja"],[3,"monster-frog-shadow-mg"],[2,"monster-frog-lod1-mg"],[1,"monster-frog-lod0-mg"],[0,"monster-frog-lod0-jg"],[13,"monster-frog-rotate-left-end-ja"],[14,"monster-frog-hop-small-start-ja"],[15,"monster-frog-hop-small-end-ja"],[16,"monster-frog-hop-slow-start-ja"],[17,"monster-frog-hop-slow-end-ja"],[18,"monster-frog-hop-fast-start-ja"],[19,"monster-frog-hop-fast-end-ja"],[20,"monster-frog-attack0-start-ja"],[21,"monster-frog-attack0-end-ja"],[22,"monster-frog-blue-hit0-ja"],[23,"monster-frog-blue-hit0-land-ja"],[24,"monster-frog-blue-hit1-ja"],[25,"monster-frog-blue-hit1-land-ja"],[26,"monster-frog-knocked-yellow-left-ja"],[27,"monster-frog-knocked-yellow-left-land-ja"],[28,"monster-frog-knocked-yellow-right-ja"]],"needle-fish-ag":[[13,"needle-fish-needle-idle-ja"],[0,"needle-fish-lod0-jg"],[1,"needle-fish-lod0-mg"],[2,"needle-fish-idle-ja"],[3,"needle-fish-swim0-ja"],[4,"needle-fish-swim-fast0-ja"],[5,"needle-fish-spikes0-ja"],[6,"needle-fish-swim-spikes0-ja"],[7,"needle-fish-turn-right0-ja"],[8,"needle-fish-turn-right0-end-ja"],[9,"needle-fish-turn-left0-ja"],[10,"needle-fish-turn-left0-end-ja"],[11,"needle-fish-needle-lod0-jg"],[12,"needle-fish-needle-lod0-mg"]],"neo-debris-ag":[[7,"neo-debris-d-lod0-mg"],[6,"neo-debris-d-lod0-jg"],[5,"neo-debris-c-lod0-mg"],[4,"neo-debris-c-lod0-jg"],[3,"neo-debris-b-lod0-mg"],[2,"neo-debris-b-lod0-jg"],[1,"neo-debris-a-lod0-mg"],[0,"neo-debris-a-lod0-jg"]],"neo-egg-a-ag":[[4,"neo-egg-a-idle-ja"],[3,"neo-egg-a-lod2-mg"],[2,"neo-egg-a-lod1-mg"],[1,"neo-egg-a-lod0-mg"],[0,"neo-egg-a-lod0-jg"]],"neo-egg-b-ag":[[4,"neo-egg-b-idle-ja"],[3,"neo-egg-b-lod2-mg"],[2,"neo-egg-b-lod1-mg"],[1,"neo-egg-b-lod0-mg"],[0,"neo-egg-b-lod0-jg"]],"neo-egg-c-ag":[[4,"neo-egg-c-idle-ja"],[3,"neo-egg-c-lod2-mg"],[2,"neo-egg-c-lod1-mg"],[1,"neo-egg-c-lod0-mg"],[0,"neo-egg-c-lod0-jg"]],"neo-grenadier-ag":[[34,"neo-grenadier-die-falling-ja"],[33,"neo-grenadier-die-ja"],[32,"neo-grenadier-knocked-land-ja"],[31,"neo-grenadier-knocked-ja"],[30,"neo-grenadier-blue-land-ja"],[29,"neo-grenadier-blue-hit2-ja"],[12,"neo-grenadier-notice1-ja"],[11,"neo-grenadier-notice-ja"],[10,"neo-grenadier-patrol1-ja"],[9,"neo-grenadier-patrol-ja"],[8,"neo-grenadier-idle-look-right-ja"],[7,"neo-grenadier-idle-look-left-ja"],[6,"neo-grenadier-idle2-ja"],[5,"neo-grenadier-idle-ja"],[4,"neo-grenadier-shadow-mg"],[3,"neo-grenadier-lod2-mg"],[2,"neo-grenadier-lod1-mg"],[1,"neo-grenadier-lod0-mg"],[0,"neo-grenadier-lod0-jg"],[13,"neo-grenadier-run-ja"],[14,"neo-grenadier-run1-ja"],[15,"neo-grenadier-run-to-throw-ja"],[16,"neo-grenadier-throw-turn-in-place-ja"],[17,"neo-grenadier-throw-stance-ja"],[18,"neo-grenadier-throw-ja"],[19,"neo-grenadier-throw1-ja"],[20,"neo-grenadier-throw-quick-ja"],[21,"neo-grenadier-spin-kick-ja"],[22,"neo-grenadier-victory-ja"],[23,"neo-grenadier-hit-ja"],[24,"neo-grenadier-hit-right-ja"],[25,"neo-grenadier-hit-left-ja"],[26,"neo-grenadier-hit-back-ja"],[27,"neo-grenadier-blue-hit0-ja"],[28,"neo-grenadier-blue-hit1-ja"]],"neo-juicer-ag":[[41,"neo-juicer-die-falling-ja"],[40,"neo-juicer-death-ja"],[39,"neo-juicer-jump-land-ja"],[38,"neo-juicer-jump-in-air-ja"],[37,"neo-juicer-jump-wind-up-ja"],[36,"neo-juicer-yellow-hit3-ja"],[35,"neo-juicer-yellow-hit2-ja"],[34,"neo-juicer-yellow-hit1-ja"],[33,"neo-juicer-yellow-hit0-ja"],[32,"neo-juicer-blue-land-ja"],[31,"neo-juicer-blue-hit5-ja"],[30,"neo-juicer-blue-hit4-ja"],[29,"neo-juicer-blue-hit3-ja"],[12,"neo-juicer-attack-turn-ja"],[11,"neo-juicer-hit-in-place-ja"],[10,"neo-juicer-turn-ja"],[9,"neo-juicer-charge0-ja"],[8,"neo-juicer-patrol0-ja"],[7,"neo-juicer-idle-right-ja"],[6,"neo-juicer-idle-left-ja"],[5,"neo-juicer-idle-ja"],[4,"neo-juicer-shadow-mg"],[3,"neo-juicer-lod2-mg"],[2,"neo-juicer-lod1-mg"],[1,"neo-juicer-lod0-mg"],[0,"neo-juicer-lod0-jg"],[13,"neo-juicer-attack0-start-ja"],[14,"neo-juicer-attack0-ja"],[15,"neo-juicer-attack-spin-ja"],[16,"neo-juicer-knocked0-ja"],[17,"neo-juicer-knocked-land0-ja"],[18,"neo-juicer-knocked1-ja"],[19,"neo-juicer-knocked-land1-ja"],[20,"neo-juicer-charge1-ja"],[21,"neo-juicer-notice0-ja"],[22,"neo-juicer-notice1-ja"],[23,"neo-juicer-patrol1-ja"],[24,"neo-juicer-celebrate0-ja"],[25,"neo-juicer-celebrate1-ja"],[26,"neo-juicer-blue-hit0-ja"],[27,"neo-juicer-blue-hit1-ja"],[28,"neo-juicer-blue-hit2-ja"]],"neo-satellite-a-ag":[[3,"neo-satellite-a-idle-ja"],[2,"neo-satellite-a-shadow-mg"],[1,"neo-satellite-a-lod0-mg"],[0,"neo-satellite-a-lod0-jg"]],"neo-satellite-ag":[[8,"neo-satellite-death-ja"],[7,"neo-satellite-stab-to-idle-ja"],[6,"neo-satellite-stab-ja"],[5,"neo-satellite-active-ja"],[4,"neo-satellite-idle-ja"],[3,"neo-satellite-shadow-mg"],[2,"neo-satellite-lod1-mg"],[1,"neo-satellite-lod0-mg"],[0,"neo-satellite-lod0-jg"]],"neo-satellite-b-ag":[[3,"neo-satellite-b-idle-ja"],[2,"neo-satellite-b-shadow-mg"],[1,"neo-satellite-b-lod0-mg"],[0,"neo-satellite-b-lod0-jg"]],"neo-satellite-break-ag":[[2,"neo-satellite-break-idle-ja"],[1,"neo-satellite-break-lod0-mg"],[0,"neo-satellite-break-lod0-jg"]],"neo-satellite-c-ag":[[3,"neo-satellite-c-idle-ja"],[2,"neo-satellite-c-shadow-mg"],[1,"neo-satellite-c-lod0-mg"],[0,"neo-satellite-c-lod0-jg"]],"neo-satellite-fma-ag":[[4,"neo-satellite-fma-active-ja"],[3,"neo-satellite-fma-idle-ja"],[2,"neo-satellite-fma-shadow-mg"],[1,"neo-satellite-fma-lod0-mg"],[0,"neo-satellite-fma-lod0-jg"]],"neo-satellite-game-ring-ag":[[3,"neo-satellite-game-ring-attack-ja"],[2,"neo-satellite-game-ring-idle-ja"],[1,"neo-satellite-game-ring-lod0-mg"],[0,"neo-satellite-game-ring-lod0-jg"]],"neo-satellite-heart-ag":[[10,"neo-satellite-heart-idle4-ja"],[9,"neo-satellite-heart-grow3-ja"],[8,"neo-satellite-heart-idle3-ja"],[7,"neo-satellite-heart-grow2-ja"],[6,"neo-satellite-heart-idle2-ja"],[5,"neo-satellite-heart-grow1-ja"],[4,"neo-satellite-heart-idle1-ja"],[3,"neo-satellite-heart-grow0-ja"],[2,"neo-satellite-heart-idle0-ja"],[1,"neo-satellite-heart-lod0-mg"],[0,"neo-satellite-heart-lod0-jg"]],"neo-satellite-ps-symbols-ag":[[2,"neo-satellite-ps-symbols-idle-ja"],[1,"neo-satellite-ps-symbols-lod0-mg"],[0,"neo-satellite-ps-symbols-lod0-jg"]],"neo-satellite-shield-ag":[[5,"neo-satellite-shield-end-ja"],[4,"neo-satellite-shield-hit-ja"],[3,"neo-satellite-shield-start-ja"],[2,"neo-satellite-shield-idle-ja"],[1,"neo-satellite-shield-lod0-mg"],[0,"neo-satellite-shield-lod0-jg"]],"neo-spawner-ag":[[15,"neo-spawner-explode-outer-idle-ja"],[14,"neo-spawner-explode-outer-lod0-mg"],[13,"neo-spawner-explode-outer-lod0-jg"],[0,"neo-spawner-lod0-jg"],[1,"neo-spawner-lod0-mg"],[2,"neo-spawner-lod1-mg"],[3,"neo-spawner-idle-ja"],[4,"neo-spawner-open-idle-ja"],[5,"neo-spawner-closed-idle-ja"],[6,"neo-spawner-open-ja"],[7,"neo-spawner-open-angry-ja"],[8,"neo-spawner-spit-start-ja"],[9,"neo-spawner-spit-end-ja"],[10,"neo-spawner-explode-inner-lod0-jg"],[11,"neo-spawner-explode-inner-lod0-mg"],[12,"neo-spawner-explode-inner-idle-ja"]],"neo-wasp-ag":[[22,"neo-wasp-explode-idle-ja"],[21,"neo-wasp-explode-lod0-mg"],[20,"neo-wasp-explode-lod0-jg"],[19,"neo-wasp-death-land-ja"],[18,"neo-wasp-death-instant-ja"],[17,"neo-wasp-death-right-fall-ja"],[16,"neo-wasp-death-right-ja"],[15,"neo-wasp-death-left-fall-ja"],[14,"neo-wasp-death-left-ja"],[13,"neo-wasp-knocked1-recover-ja"],[0,"neo-wasp-lod0-jg"],[1,"neo-wasp-lod0-mg"],[2,"neo-wasp-lod1-mg"],[3,"neo-wasp-shadow-mg"],[4,"neo-wasp-idle-ja"],[5,"neo-wasp-fly-right-ja"],[6,"neo-wasp-fly-left-ja"],[7,"neo-wasp-fly-forward-ja"],[8,"neo-wasp-fly-back-ja"],[9,"neo-wasp-shoot0-ja"],[10,"neo-wasp-knocked0-ja"],[11,"neo-wasp-knocked0-recover-ja"],[12,"neo-wasp-knocked1-ja"]],"neo-wasp-b-ag":[[13,"neo-wasp-b-knocked1-recover-ja"],[0,"neo-wasp-b-lod0-jg"],[1,"neo-wasp-b-lod0-mg"],[2,"neo-wasp-b-lod1-mg"],[3,"neo-wasp-b-shadow-mg"],[4,"neo-wasp-b-idle-ja"],[5,"neo-wasp-b-fly-right-ja"],[6,"neo-wasp-b-fly-left-ja"],[7,"neo-wasp-b-fly-forward-ja"],[8,"neo-wasp-b-fly-back-ja"],[9,"neo-wasp-b-shoot0-ja"],[10,"neo-wasp-b-knocked0-ja"],[11,"neo-wasp-b-knocked0-recover-ja"],[12,"neo-wasp-b-knocked1-ja"]],"newbike-ag":[[3,"newbike-idle-ja"],[2,"newbike-shadow-mg"],[1,"newbike-lod0-mg"],[0,"newbike-lod0-jg"]],"nst-cocoon-a-ag":[[7,"nst-cocoon-a-explode-idle-ja"],[6,"nst-cocoon-a-explode-lod0-mg"],[5,"nst-cocoon-a-explode-lod0-jg"],[4,"nst-cocoon-a-idle-ja"],[3,"nst-cocoon-a-lod2-mg"],[2,"nst-cocoon-a-lod1-mg"],[1,"nst-cocoon-a-lod0-mg"],[0,"nst-cocoon-a-lod0-jg"]],"nst-cocoon-b-ag":[[5,"nst-cocoon-b-retract-ja"],[4,"nst-cocoon-b-idle-ja"],[3,"nst-cocoon-b-lod2-mg"],[2,"nst-cocoon-b-lod1-mg"],[1,"nst-cocoon-b-lod0-mg"],[0,"nst-cocoon-b-lod0-jg"]],"nst-collapsing-stone-bridge-ag":[[11,"nst-collapsing-stone-bridge-break-c-end-ja"],[9,"nst-collapsing-stone-bridge-break-b-end-ja"],[7,"nst-collapsing-stone-bridge-break-a-end-ja"],[5,"nst-collapsing-stone-bridge-end-ja"],[4,"nst-collapsing-stone-bridge-idle-ja"],[3,"nst-collapsing-stone-bridge-lod2-mg"],[2,"nst-collapsing-stone-bridge-lod1-mg"],[1,"nst-collapsing-stone-bridge-lod0-mg"],[13,"nst-collapsing-stone-bridge-break-d-end-ja"],[0,"nst-collapsing-stone-bridge-lod0-jg"]],"nst-falling-stone-bridge-ag":[[5,"nst-falling-stone-bridge-fall-b-ja"],[4,"nst-falling-stone-bridge-fall-a-ja"],[3,"nst-falling-stone-bridge-idle-ja"],[2,"nst-falling-stone-bridge-lod1-mg"],[1,"nst-falling-stone-bridge-lod0-mg"],[0,"nst-falling-stone-bridge-lod0-jg"]],"nst-falling-stone-bridge-goo-ag":[[6,"nst-falling-stone-bridge-goo-explode-idle-ja"],[5,"nst-falling-stone-bridge-goo-explode-lod0-mg"],[4,"nst-falling-stone-bridge-goo-explode-lod0-jg"],[3,"nst-falling-stone-bridge-goo-idle-ja"],[2,"nst-falling-stone-bridge-goo-lod1-mg"],[1,"nst-falling-stone-bridge-goo-lod0-mg"],[0,"nst-falling-stone-bridge-goo-lod0-jg"]],"nst-metalhead-eggs-a-ag":[[4,"nst-metalhead-eggs-a-idle-ja"],[3,"nst-metalhead-eggs-a-lod2-mg"],[2,"nst-metalhead-eggs-a-lod1-mg"],[1,"nst-metalhead-eggs-a-lod0-mg"],[0,"nst-metalhead-eggs-a-lod0-jg"]],"nst-metalhead-eggs-b-ag":[[4,"nst-metalhead-eggs-b-idle-ja"],[3,"nst-metalhead-eggs-b-lod2-mg"],[2,"nst-metalhead-eggs-b-lod1-mg"],[1,"nst-metalhead-eggs-b-lod0-mg"],[0,"nst-metalhead-eggs-b-lod0-jg"]],"nst-metalhead-eggs-c-ag":[[4,"nst-metalhead-eggs-c-idle-ja"],[3,"nst-metalhead-eggs-c-lod2-mg"],[2,"nst-metalhead-eggs-c-lod1-mg"],[1,"nst-metalhead-eggs-c-lod0-mg"],[0,"nst-metalhead-eggs-c-lod0-jg"]],"ogreboss-ag":[[2,"ogreboss-ogreboss-idle-ja"],[1,"ogreboss-lod0-mg"],[0,"ogreboss-lod0-jg"]],"onin-highres-ag":[[6,"onin-highres-onin-idle-ja"],[5,"onin-highres-idle-wakeup-ja"],[4,"onin-highres-idle-sleep-ja"],[3,"onin-highres-idle-ja"],[2,"onin-highres-shadow-mg"],[1,"onin-highres-lod0-mg"],[0,"onin-highres-lod0-jg"]],"onin-simple-ag":[[2,"onin-simple-idle-ja"],[1,"onin-simple-lod0-mg"],[0,"onin-simple-lod0-jg"]],"ottsel-daxpants-ag":[[3,"ottsel-daxpants-idle-ja"],[2,"ottsel-daxpants-shadow-mg"],[1,"ottsel-daxpants-lod0-mg"],[0,"ottsel-daxpants-lod0-jg"],[4,"ottsel-daxpants-daxter-pants-walk-ja"]],"ottsel-dummy-ag":[[3,"ottsel-dummy-idle-ja"],[2,"ottsel-dummy-shadow-mg"],[1,"ottsel-dummy-lod0-mg"],[0,"ottsel-dummy-lod0-jg"],[4,"ottsel-dummy-dummy-idle-ja"]],"ottsel-leader-ag":[[4,"ottsel-leader-idle-ja"],[3,"ottsel-leader-leader-leaderskirt_fr-cg"],[2,"ottsel-leader-shadow-mg"],[1,"ottsel-leader-lod0-mg"],[0,"ottsel-leader-lod0-jg"],[5,"ottsel-leader-leader-idle-ja"]],"ottsel-surfer-ag":[[3,"ottsel-surfer-idle-ja"],[2,"ottsel-surfer-shadow-mg"],[1,"ottsel-surfer-lod0-mg"],[0,"ottsel-surfer-lod0-jg"],[4,"ottsel-surfer-surfer-idle-ja"]],"ottsel-tess-ag":[[3,"ottsel-tess-idle-ja"],[2,"ottsel-tess-shadow-mg"],[1,"ottsel-tess-lod0-mg"],[0,"ottsel-tess-lod0-jg"],[4,"ottsel-tess-ottess-idle-ja"]],"ottsel-veger-ag":[[3,"ottsel-veger-idle-ja"],[2,"ottsel-veger-shadow-mg"],[1,"ottsel-veger-lod0-mg"],[0,"ottsel-veger-lod0-jg"],[4,"ottsel-veger-otveger-idle-ja"]],"palmpilot-ag":[[2,"palmpilot-idle-ja"],[1,"palmpilot-lod0-mg"],[0,"palmpilot-lod0-jg"]],"palmpilot-b-ag":[[2,"palmpilot-b-idle-ja"],[1,"palmpilot-b-lod0-mg"],[0,"palmpilot-b-lod0-jg"]],"particleman-ag":[[2,"particleman-idle-ja"],[1,"particleman-lod0-mg"],[0,"particleman-lod0-jg"]],"pecker-highres-ag":[[5,"pecker-highres-pecker-fly-ja"],[3,"pecker-highres-idle-ja"],[2,"pecker-highres-shadow-mg"],[1,"pecker-highres-lod0-mg"],[0,"pecker-highres-lod0-jg"]],"pecker-ingame-ag":[[4,"pecker-ingame-fly-ja"],[3,"pecker-ingame-idle-ja"],[2,"pecker-ingame-shadow-mg"],[1,"pecker-ingame-lod0-mg"],[0,"pecker-ingame-lod0-jg"]],"plat-ag":[[4,"plat-idle-ja"],[3,"plat-lod2-mg"],[2,"plat-lod1-mg"],[1,"plat-lod0-mg"],[0,"plat-lod0-jg"]],"plat-fma-ag":[[2,"plat-fma-idle-ja"],[1,"plat-fma-lod0-mg"],[0,"plat-fma-lod0-jg"]],"pow-rings-ag":[[2,"pow-rings-idle-ja"],[1,"pow-rings-lod0-mg"],[0,"pow-rings-lod0-jg"]],"pre-artifact-a-ag":[[2,"pre-artifact-a-idle-ja"],[1,"pre-artifact-a-lod0-mg"],[0,"pre-artifact-a-lod0-jg"]],"pre-artifact-b-ag":[[2,"pre-artifact-b-idle-ja"],[1,"pre-artifact-b-lod0-mg"],[0,"pre-artifact-b-lod0-jg"]],"pre-artifact-c-ag":[[2,"pre-artifact-c-idle-ja"],[1,"pre-artifact-c-lod0-mg"],[0,"pre-artifact-c-lod0-jg"]],"pre-artifact-d-ag":[[2,"pre-artifact-d-idle-ja"],[1,"pre-artifact-d-lod0-mg"],[0,"pre-artifact-d-lod0-jg"]],"pre-mike-ag":[[2,"pre-mike-idle-ja"],[1,"pre-mike-lod0-mg"],[0,"pre-mike-lod0-jg"]],"pre-sled-ag":[[3,"pre-sled-idle-ja"],[2,"pre-sled-shadow-mg"],[1,"pre-sled-lod0-mg"],[0,"pre-sled-lod0-jg"]],"prebot-ag":[[170,"prebot-gun-gun-stow-again-ja"],[169,"prebot-gun-gun-fire-ja"],[168,"prebot-gun-gun-target-ja"],[167,"prebot-gun-gun-from-tentacle-ja"],[166,"prebot-gun-gun-stow-ja"],[165,"prebot-gun-gun-launch-ja"],[164,"prebot-gun-gun-aim-ja"],[163,"prebot-gun-gun-from-sword-R-ja"],[162,"prebot-gun-idle-ja"],[161,"prebot-gun-shadow-mg"],[160,"prebot-gun-lod0-mg"],[159,"prebot-gun-lod0-jg"],[158,"prebot-sword-r-swords-horizontal-L2R-complete-ja"],[157,"prebot-sword-r-swords-horizontal-L2R-return-ja"],[156,"prebot-sword-r-swords-horizontal-L2R-hold-ja"],[155,"prebot-sword-r-swords-horizontal-L2R-strike-ja"],[154,"prebot-sword-r-swords-horizontal-L2R-prehold-ja"],[153,"prebot-sword-r-swords-horizontal-R2L-complete-ja"],[152,"prebot-sword-r-swords-horizontal-R2L-return-ja"],[151,"prebot-sword-r-swords-horizontal-R2L-hold-ja"],[150,"prebot-sword-r-swords-horizontal-R2L-strike-ja"],[149,"prebot-sword-r-swords-horizontal-R2L-prehold-ja"],[148,"prebot-sword-r-swords-horizontal-R2L-pre-ja"],[147,"prebot-sword-r-swords-pose-ja"],[146,"prebot-sword-r-swords-strike2pose-ja"],[145,"prebot-sword-r-swords-R-vertical-strike-two-ja"],[144,"prebot-sword-r-swords-L-vertical-between-ja"],[143,"prebot-sword-r-swords-L-vertical-strike-ja"],[142,"prebot-sword-r-swords-R-vertical-between-ja"],[141,"prebot-sword-r-swords-R-vertical-strike-ja"],[140,"prebot-sword-r-swords-vertical-hold-ja"],[139,"prebot-sword-r-swords-vertical-pre-ja"],[138,"prebot-sword-l-swords-horizontal-L2R-complete-ja"],[137,"prebot-sword-l-swords-horizontal-L2R-return-ja"],[136,"prebot-sword-l-swords-horizontal-L2R-hold-ja"],[135,"prebot-sword-l-swords-horizontal-L2R-strike-ja"],[134,"prebot-sword-l-swords-horizontal-L2R-prehold-ja"],[133,"prebot-sword-l-swords-horizontal-R2L-complete-ja"],[132,"prebot-sword-l-swords-horizontal-R2L-return-ja"],[131,"prebot-sword-l-swords-horizontal-R2L-hold-ja"],[58,"prebot-swords-L-vertical-strike-ja"],[57,"prebot-swords-R-vertical-between-ja"],[56,"prebot-swords-R-vertical-strike-ja"],[55,"prebot-swords-vertical-hold-ja"],[54,"prebot-swords-vertical-pre-ja"],[53,"prebot-tentacle-stow-ja"],[52,"prebot-tentacle-launch-ja"],[51,"prebot-hatch-hover-ja"],[50,"prebot-gun-stow-again-ja"],[49,"prebot-gun-fire-ja"],[48,"prebot-gun-target-ja"],[47,"prebot-gun-from-tentacle-ja"],[46,"prebot-gun-stow-ja"],[45,"prebot-gun-launch-ja"],[44,"prebot-gun-aim-ja"],[43,"prebot-gun-from-sword-R-ja"],[42,"prebot-sword-L-horizontal-L2R-complete-ja"],[41,"prebot-sword-L-horizontal-L2R-return-ja"],[40,"prebot-sword-L-horizontal-L2R-hold-ja"],[39,"prebot-sword-L-horizontal-L2R-strike-ja"],[38,"prebot-sword-L-horizontal-L2R-prehold-ja"],[37,"prebot-sword-L-horizontal-R2L-complete-ja"],[36,"prebot-sword-L-horizontal-R2L-return-ja"],[35,"prebot-sword-L-horizontal-R2L-hold-ja"],[34,"prebot-sword-L-horizontal-R2L-strike-ja"],[33,"prebot-sword-L-horizontal-R2L-prehold-ja"],[32,"prebot-sword-L-horizontal-R2L-pre-ja"],[31,"prebot-sword-L-pose-ja"],[30,"prebot-sword-L-strike2pose-ja"],[29,"prebot-sword-L-vertical-between-ja"],[12,"prebot-sword-R-vertical-between-ja"],[11,"prebot-sword-R-vertical-strike-ja"],[10,"prebot-sword-R-vertical-hold-ja"],[9,"prebot-sword-R-vertical-pre-ja"],[8,"prebot-jump-to-hover-ja"],[7,"prebot-tentacle-launch-pre-ja"],[6,"prebot-sword-grab-AL-ja"],[5,"prebot-sword-grab-both-ja"],[4,"prebot-sword-grab-AR-ja"],[3,"prebot-idle-ja"],[130,"prebot-sword-l-swords-horizontal-R2L-strike-ja"],[2,"prebot-shadow-mg"],[129,"prebot-sword-l-swords-horizontal-R2L-prehold-ja"],[1,"prebot-lod0-mg"],[128,"prebot-sword-l-swords-horizontal-R2L-pre-ja"],[0,"prebot-lod0-jg"],[127,"prebot-sword-l-swords-pose-ja"],[13,"prebot-sword-R-strike2pose-ja"],[14,"prebot-sword-R-pose-ja"],[15,"prebot-sword-R-horizontal-L2R-pre-ja"],[16,"prebot-sword-R-horizontal-L2R-prehold-ja"],[17,"prebot-sword-R-horizontal-L2R-strike-ja"],[18,"prebot-sword-R-horizontal-L2R-hold-ja"],[19,"prebot-sword-R-horizontal-L2R-return-ja"],[20,"prebot-sword-R-horizontal-L2R-complete-ja"],[21,"prebot-sword-R-horizontal-R2L-prehold-ja"],[22,"prebot-sword-R-horizontal-R2L-strike-ja"],[23,"prebot-sword-R-horizontal-R2L-hold-ja"],[24,"prebot-sword-R-horizontal-R2L-return-ja"],[25,"prebot-sword-R-horizontal-R2L-complete-ja"],[26,"prebot-sword-L-vertical-pre-ja"],[27,"prebot-sword-L-vertical-hold-ja"],[28,"prebot-sword-L-vertical-strike-ja"],[59,"prebot-swords-L-vertical-between-ja"],[60,"prebot-swords-R-vertical-strike-two-ja"],[61,"prebot-swords-strike2pose-ja"],[62,"prebot-swords-pose-ja"],[63,"prebot-swords-horizontal-R2L-pre-ja"],[64,"prebot-swords-horizontal-R2L-prehold-ja"],[65,"prebot-swords-horizontal-R2L-strike-ja"],[66,"prebot-swords-horizontal-R2L-hold-ja"],[67,"prebot-swords-horizontal-R2L-return-ja"],[68,"prebot-swords-horizontal-R2L-complete-ja"],[69,"prebot-swords-horizontal-L2R-prehold-ja"],[70,"prebot-swords-horizontal-L2R-strike-ja"],[71,"prebot-swords-horizontal-L2R-hold-ja"],[72,"prebot-swords-horizontal-L2R-return-ja"],[73,"prebot-swords-horizontal-L2R-complete-ja"],[74,"prebot-mine-boss-train-1-ja"],[75,"prebot-mine-boss-train-2-ja"],[76,"prebot-mine-boss-train-3-ja"],[81,"prebot-sword-lod0-jg"],[82,"prebot-sword-lod0-mg"],[83,"prebot-sword-shadow-mg"],[84,"prebot-sword-idle-ja"],[85,"prebot-sword-sword-R-vertical-pre-ja"],[86,"prebot-sword-sword-R-vertical-hold-ja"],[87,"prebot-sword-sword-R-vertical-strike-ja"],[88,"prebot-sword-sword-R-vertical-between-ja"],[89,"prebot-sword-sword-R-strike2pose-ja"],[90,"prebot-sword-sword-R-pose-ja"],[91,"prebot-sword-sword-R-horizontal-L2R-pre-ja"],[92,"prebot-sword-sword-R-horizontal-L2R-prehold-ja"],[93,"prebot-sword-sword-R-horizontal-L2R-strike-ja"],[94,"prebot-sword-sword-R-horizontal-L2R-hold-ja"],[95,"prebot-sword-sword-R-horizontal-L2R-return-ja"],[96,"prebot-sword-sword-R-horizontal-L2R-complete-ja"],[97,"prebot-sword-sword-R-horizontal-R2L-prehold-ja"],[98,"prebot-sword-sword-R-horizontal-R2L-strike-ja"],[99,"prebot-sword-sword-R-horizontal-R2L-hold-ja"],[100,"prebot-sword-sword-R-horizontal-R2L-return-ja"],[101,"prebot-sword-sword-R-horizontal-R2L-complete-ja"],[102,"prebot-sword-sword-L-vertical-pre-ja"],[103,"prebot-sword-sword-L-vertical-hold-ja"],[104,"prebot-sword-sword-L-vertical-strike-ja"],[105,"prebot-sword-sword-L-vertical-between-ja"],[106,"prebot-sword-sword-L-strike2pose-ja"],[107,"prebot-sword-sword-L-pose-ja"],[108,"prebot-sword-sword-L-horizontal-R2L-pre-ja"],[109,"prebot-sword-sword-L-horizontal-R2L-prehold-ja"],[110,"prebot-sword-sword-L-horizontal-R2L-strike-ja"],[111,"prebot-sword-sword-L-horizontal-R2L-hold-ja"],[112,"prebot-sword-sword-L-horizontal-R2L-return-ja"],[113,"prebot-sword-sword-L-horizontal-R2L-complete-ja"],[114,"prebot-sword-sword-L-horizontal-L2R-prehold-ja"],[115,"prebot-sword-sword-L-horizontal-L2R-strike-ja"],[116,"prebot-sword-sword-L-horizontal-L2R-hold-ja"],[117,"prebot-sword-sword-L-horizontal-L2R-return-ja"],[118,"prebot-sword-sword-L-horizontal-L2R-complete-ja"],[119,"prebot-sword-l-swords-vertical-pre-ja"],[120,"prebot-sword-l-swords-vertical-hold-ja"],[121,"prebot-sword-l-swords-R-vertical-strike-ja"],[122,"prebot-sword-l-swords-R-vertical-between-ja"],[123,"prebot-sword-l-swords-L-vertical-strike-ja"],[124,"prebot-sword-l-swords-L-vertical-between-ja"],[125,"prebot-sword-l-swords-R-vertical-strike-two-ja"],[126,"prebot-sword-l-swords-strike2pose-ja"]],"prebot-camera-ag":[[5,"prebot-camera-mine-boss-train-3-ja"],[4,"prebot-camera-mine-boss-train-2-ja"],[3,"prebot-camera-mine-boss-train-1-ja"],[2,"prebot-camera-idle-ja"],[1,"prebot-camera-lod0-mg"],[0,"prebot-camera-lod0-jg"]],"prebot-shockwave-ag":[[2,"prebot-shockwave-shockwave-ja"],[1,"prebot-shockwave-lod0-mg"],[0,"prebot-shockwave-lod0-jg"]],"prebot-tentacle-ag":[[18,"prebot-tentacle-e-tentacle-stow-ja"],[17,"prebot-tentacle-e-tentacle-launch-ja"],[16,"prebot-tentacle-e-hatch-hover-ja"],[15,"prebot-tentacle-d-tentacle-stow-ja"],[14,"prebot-tentacle-d-tentacle-launch-ja"],[13,"prebot-tentacle-d-hatch-hover-ja"],[0,"prebot-tentacle-lod0-jg"],[1,"prebot-tentacle-lod0-mg"],[2,"prebot-tentacle-shadow-mg"],[3,"prebot-tentacle-idle-ja"],[4,"prebot-tentacle-a-hatch-hover-ja"],[5,"prebot-tentacle-a-tentacle-launch-ja"],[6,"prebot-tentacle-a-tentacle-stow-ja"],[7,"prebot-tentacle-b-hatch-hover-ja"],[8,"prebot-tentacle-b-tentacle-launch-ja"],[9,"prebot-tentacle-b-tentacle-stow-ja"],[10,"prebot-tentacle-c-hatch-hover-ja"],[11,"prebot-tentacle-c-tentacle-launch-ja"],[12,"prebot-tentacle-c-tentacle-stow-ja"]],"precur-bomb-ag":[[2,"precur-bomb-idle-ja"],[1,"precur-bomb-lod0-mg"],[0,"precur-bomb-lod0-jg"]],"precur-bomb-spawner-ag":[[3,"precur-bomb-spawner-spawn-ja"],[2,"precur-bomb-spawner-idle-ja"],[1,"precur-bomb-spawner-lod0-mg"],[0,"precur-bomb-spawner-lod0-jg"]],"precur-box-ag":[[5,"precur-box-explode-idle-ja"],[4,"precur-box-explode-lod0-mg"],[3,"precur-box-explode-lod0-jg"],[2,"precur-box-idle-ja"],[1,"precur-box-lod0-mg"],[0,"precur-box-lod0-jg"]],"precur-bridge-a-blocks-break-ag":[[2,"precur-bridge-a-blocks-break-idle-ja"],[1,"precur-bridge-a-blocks-break-lod0-mg"],[0,"precur-bridge-a-blocks-break-lod0-jg"]],"precur-bridge-a-path-break-ag":[[3,"precur-bridge-a-path-break-idle2-ja"],[2,"precur-bridge-a-path-break-idle-ja"],[1,"precur-bridge-a-path-break-lod0-mg"],[0,"precur-bridge-a-path-break-lod0-jg"]],"precur-bridge-b-blocks-break-ag":[[2,"precur-bridge-b-blocks-break-idle-ja"],[1,"precur-bridge-b-blocks-break-lod0-mg"],[0,"precur-bridge-b-blocks-break-lod0-jg"]],"precur-bridge-b-path-break-ag":[[3,"precur-bridge-b-path-break-idle2-ja"],[2,"precur-bridge-b-path-break-idle-ja"],[1,"precur-bridge-b-path-break-lod0-mg"],[0,"precur-bridge-b-path-break-lod0-jg"]],"precur-bridge-c-blocks-break-ag":[[2,"precur-bridge-c-blocks-break-idle-ja"],[1,"precur-bridge-c-blocks-break-lod0-mg"],[0,"precur-bridge-c-blocks-break-lod0-jg"]],"precur-bridge-c-path-break-ag":[[3,"precur-bridge-c-path-break-idle2-ja"],[2,"precur-bridge-c-path-break-idle-ja"],[1,"precur-bridge-c-path-break-lod0-mg"],[0,"precur-bridge-c-path-break-lod0-jg"]],"precur-bridge-d-blocks-break-ag":[[2,"precur-bridge-d-blocks-break-idle-ja"],[1,"precur-bridge-d-blocks-break-lod0-mg"],[0,"precur-bridge-d-blocks-break-lod0-jg"]],"precur-bridge-d-path-break-ag":[[3,"precur-bridge-d-path-break-idle2-ja"],[2,"precur-bridge-d-path-break-idle-ja"],[1,"precur-bridge-d-path-break-lod0-mg"],[0,"precur-bridge-d-path-break-lod0-jg"]],"precur-bridge-e-blocks-break-ag":[[2,"precur-bridge-e-blocks-break-idle-ja"],[1,"precur-bridge-e-blocks-break-lod0-mg"],[0,"precur-bridge-e-blocks-break-lod0-jg"]],"precur-bridge-e-path-break-ag":[[3,"precur-bridge-e-path-break-idle2-ja"],[2,"precur-bridge-e-path-break-idle-ja"],[1,"precur-bridge-e-path-break-lod0-mg"],[0,"precur-bridge-e-path-break-lod0-jg"]],"precur-bridge-f-blocks-break-ag":[[2,"precur-bridge-f-blocks-break-idle-ja"],[1,"precur-bridge-f-blocks-break-lod0-mg"],[0,"precur-bridge-f-blocks-break-lod0-jg"]],"precur-bridge-g-blocks-break-ag":[[2,"precur-bridge-g-blocks-break-idle-ja"],[1,"precur-bridge-g-blocks-break-lod0-mg"],[0,"precur-bridge-g-blocks-break-lod0-jg"]],"precur-bridge-h-blocks-break-ag":[[2,"precur-bridge-h-blocks-break-idle-ja"],[1,"precur-bridge-h-blocks-break-lod0-mg"],[0,"precur-bridge-h-blocks-break-lod0-jg"]],"precur-bridge-i-blocks-break-ag":[[2,"precur-bridge-i-blocks-break-idle-ja"],[1,"precur-bridge-i-blocks-break-lod0-mg"],[0,"precur-bridge-i-blocks-break-lod0-jg"]],"precur-bridge-j-blocks-break-ag":[[2,"precur-bridge-j-blocks-break-idle-ja"],[1,"precur-bridge-j-blocks-break-lod0-mg"],[0,"precur-bridge-j-blocks-break-lod0-jg"]],"precur-bridge-k-blocks-break-ag":[[2,"precur-bridge-k-blocks-break-idle-ja"],[1,"precur-bridge-k-blocks-break-lod0-mg"],[0,"precur-bridge-k-blocks-break-lod0-jg"]],"precur-bridge-l-blocks-break-ag":[[2,"precur-bridge-l-blocks-break-idle-ja"],[1,"precur-bridge-l-blocks-break-lod0-mg"],[0,"precur-bridge-l-blocks-break-lod0-jg"]],"precur-bridge-m-blocks-break-ag":[[2,"precur-bridge-m-blocks-break-idle-ja"],[1,"precur-bridge-m-blocks-break-lod0-mg"],[0,"precur-bridge-m-blocks-break-lod0-jg"]],"precur-bridge-n-blocks-break-ag":[[2,"precur-bridge-n-blocks-break-idle-ja"],[1,"precur-bridge-n-blocks-break-lod0-mg"],[0,"precur-bridge-n-blocks-break-lod0-jg"]],"precur-bridge-o-blocks-break-ag":[[2,"precur-bridge-o-blocks-break-idle-ja"],[1,"precur-bridge-o-blocks-break-lod0-mg"],[0,"precur-bridge-o-blocks-break-lod0-jg"]],"precur-bridge-p-blocks-break-ag":[[2,"precur-bridge-p-blocks-break-idle-ja"],[1,"precur-bridge-p-blocks-break-lod0-mg"],[0,"precur-bridge-p-blocks-break-lod0-jg"]],"precur-bridge-path-break-ag":[[3,"precur-bridge-path-break-idle2-ja"],[2,"precur-bridge-path-break-idle-ja"],[1,"precur-bridge-path-break-lod0-mg"],[0,"precur-bridge-path-break-lod0-jg"]],"precur-door-a-ag":[[2,"precur-door-a-idle-ja"],[1,"precur-door-a-lod0-mg"],[0,"precur-door-a-lod0-jg"]],"precur-door-b-ag":[[2,"precur-door-b-idle-ja"],[1,"precur-door-b-lod0-mg"],[0,"precur-door-b-lod0-jg"]],"precur-door-c-ag":[[5,"precur-door-c-explode-idle-ja"],[4,"precur-door-c-explode-lod0-mg"],[3,"precur-door-c-explode-lod0-jg"],[2,"precur-door-c-idle-ja"],[1,"precur-door-c-lod0-mg"],[0,"precur-door-c-lod0-jg"]],"precur-door-d-ag":[[5,"precur-door-d-explode-idle-ja"],[4,"precur-door-d-explode-lod0-mg"],[3,"precur-door-d-explode-lod0-jg"],[2,"precur-door-d-idle-ja"],[1,"precur-door-d-lod0-mg"],[0,"precur-door-d-lod0-jg"]],"precur-elevator-ag":[[2,"precur-elevator-idle-ja"],[1,"precur-elevator-lod0-mg"],[0,"precur-elevator-lod0-jg"]],"precur-generator-a-ag":[[5,"precur-generator-a-explode-idle-ja"],[4,"precur-generator-a-explode-lod0-mg"],[3,"precur-generator-a-explode-lod0-jg"],[2,"precur-generator-a-idle-ja"],[1,"precur-generator-a-lod0-mg"],[0,"precur-generator-a-lod0-jg"]],"precur-generator-b-ag":[[5,"precur-generator-b-explode-idle-ja"],[4,"precur-generator-b-explode-lod0-mg"],[3,"precur-generator-b-explode-lod0-jg"],[2,"precur-generator-b-idle-ja"],[1,"precur-generator-b-lod0-mg"],[0,"precur-generator-b-lod0-jg"]],"precur-generator-c-ag":[[5,"precur-generator-c-explode-idle-ja"],[4,"precur-generator-c-explode-lod0-mg"],[3,"precur-generator-c-explode-lod0-jg"],[2,"precur-generator-c-idle-ja"],[1,"precur-generator-c-lod0-mg"],[0,"precur-generator-c-lod0-jg"]],"precur-generator-d-ag":[[5,"precur-generator-d-explode-idle-ja"],[4,"precur-generator-d-explode-lod0-mg"],[3,"precur-generator-d-explode-lod0-jg"],[2,"precur-generator-d-idle-ja"],[1,"precur-generator-d-lod0-mg"],[0,"precur-generator-d-lod0-jg"]],"precur-generator-d-gem-ag":[[2,"precur-generator-d-gem-idle-ja"],[1,"precur-generator-d-gem-lod0-mg"],[0,"precur-generator-d-gem-lod0-jg"]],"precur-jump-plate-ag":[[3,"precur-jump-plate-move-ja"],[2,"precur-jump-plate-idle-ja"],[1,"precur-jump-plate-lod0-mg"],[0,"precur-jump-plate-lod0-jg"]],"precur-planet-ag":[[2,"precur-planet-idle-ja"],[1,"precur-planet-lod0-mg"],[0,"precur-planet-lod0-jg"]],"precur-platform-round-ag":[[3,"precur-platform-round-rotation-ja"],[2,"precur-platform-round-idle-ja"],[1,"precur-platform-round-lod0-mg"],[0,"precur-platform-round-lod0-jg"]],"precur-swingpole-pop-ag":[[2,"precur-swingpole-pop-idle-ja"],[1,"precur-swingpole-pop-lod0-mg"],[0,"precur-swingpole-pop-lod0-jg"]],"precur-wall-window-big-ag":[[3,"precur-wall-window-big-open-ja"],[2,"precur-wall-window-big-idle-ja"],[1,"precur-wall-window-big-lod0-mg"],[0,"precur-wall-window-big-lod0-jg"]],"precur-warp-effect-ag":[[2,"precur-warp-effect-idle-ja"],[1,"precur-warp-effect-lod0-mg"],[0,"precur-warp-effect-lod0-jg"]],"precursor-ag":[[2,"precursor-idle-ja"],[1,"precursor-lod0-mg"],[0,"precursor-lod0-jg"]],"precursor-controller-ag":[[2,"precursor-controller-idle-ja"],[1,"precursor-controller-lod0-mg"],[0,"precursor-controller-lod0-jg"]],"precursor-ship-ag":[[2,"precursor-ship-idle-ja"],[1,"precursor-ship-lod0-mg"],[0,"precursor-ship-lod0-jg"]],"precursor-ship-door-ag":[[2,"precursor-ship-door-idle-ja"],[1,"precursor-ship-door-lod0-mg"],[0,"precursor-ship-door-lod0-jg"]],"predator-ag":[[23,"predator-blue-hit-land-ja"],[22,"predator-blue-hit-back-ja"],[21,"predator-blue-hit-front-ja"],[20,"predator-knocked-big-death-ja"],[19,"predator-knocked-big-land-ja"],[18,"predator-knocked-big-ja"],[17,"predator-jump-attack-land-ja"],[16,"predator-jump-attack-ja"],[15,"predator-knocked-death-land-ja"],[14,"predator-knocked-death-ja"],[13,"predator-knocked-land-ja"],[0,"predator-lod0-jg"],[1,"predator-lod0-mg"],[2,"predator-lod1-mg"],[3,"predator-lod2-mg"],[4,"predator-shadow-mg"],[5,"predator-idle-ja"],[6,"predator-walk0-ja"],[7,"predator-run0-ja"],[8,"predator-close-attack-ja"],[9,"predator-close-attack-recover-ja"],[10,"predator-shoot-guns0-ja"],[11,"predator-death-standing-ja"],[12,"predator-knocked-ja"]],"purple-one-ag":[[2,"purple-one-idle-ja"],[1,"purple-one-lod0-mg"],[0,"purple-one-lod0-jg"]],"purple-three-ag":[[2,"purple-three-idle-ja"],[1,"purple-three-lod0-mg"],[0,"purple-three-lod0-jg"]],"purple-two-ag":[[2,"purple-two-idle-ja"],[1,"purple-two-lod0-mg"],[0,"purple-two-lod0-jg"]],"quantum-reflector-ag":[[3,"quantum-reflector-idle-ja"],[2,"quantum-reflector-shadow-mg"],[1,"quantum-reflector-lod0-mg"],[0,"quantum-reflector-lod0-jg"]],"rail-gun-dark-ag":[[2,"rail-gun-dark-idle-ja"],[1,"rail-gun-dark-lod0-mg"],[0,"rail-gun-dark-lod0-jg"]],"rail-oracle-door-ag":[[2,"rail-oracle-door-idle-ja"],[1,"rail-oracle-door-lod0-mg"],[0,"rail-oracle-door-lod0-jg"]],"rail-oracle-eyes-ag":[[2,"rail-oracle-eyes-idle-ja"],[1,"rail-oracle-eyes-lod0-mg"],[0,"rail-oracle-eyes-lod0-jg"]],"rail-warp-gate-ag":[[2,"rail-warp-gate-idle-ja"],[1,"rail-warp-gate-lod0-mg"],[0,"rail-warp-gate-lod0-jg"]],"rat-ag":[[28,"rat-pipe-jump0-end-ja"],[27,"rat-pipe-jump0-start-ja"],[26,"rat-ball-ja"],[25,"rat-ragdoll-pose-ja"],[24,"rat-die-ja"],[23,"rat-run-wheel0-die-ja"],[22,"rat-run-wheel0-ja"],[21,"rat-ground-to-run-ja"],[20,"rat-ground-knocked-land-ja"],[19,"rat-ground-knocked-ja"],[18,"rat-on-back-idle-ja"],[17,"rat-knocked0-land-ja"],[16,"rat-knocked0-ja"],[15,"rat-sit-to-run-ja"],[14,"rat-sit-alert-idle-ja"],[13,"rat-sit-to-alert-ja"],[0,"rat-lod0-jg"],[1,"rat-lod0-mg"],[2,"rat-shadow-mg"],[3,"rat-idle-stand-ja"],[4,"rat-stand-to-sit-ja"],[5,"rat-sit-to-stand-ja"],[6,"rat-idle-sit0-ja"],[7,"rat-idle-sit1-ja"],[8,"rat-turn-right-ja"],[9,"rat-turn-left-ja"],[10,"rat-walk0-ja"],[11,"rat-run0-ja"],[12,"rat-walk-to-sit-ja"]],"red-crimson-guard-highres-ag":[[2,"red-crimson-guard-highres-red-crimson-guard-walk-ja"],[1,"red-crimson-guard-highres-lod0-mg"],[0,"red-crimson-guard-highres-lod0-jg"]],"red-gun-mod-three-ag":[[2,"red-gun-mod-three-idle-ja"],[1,"red-gun-mod-three-lod0-mg"],[0,"red-gun-mod-three-lod0-jg"]],"red-gun-mod-two-ag":[[2,"red-gun-mod-two-idle-ja"],[1,"red-gun-mod-two-lod0-mg"],[0,"red-gun-mod-two-lod0-jg"]],"redsage-ag":[[2,"redsage-redsage-idle-ja"],[1,"redsage-lod0-mg"],[0,"redsage-lod0-jg"]],"rhino-ag":[[7,"rhino-idle-ja"],[6,"rhino-shadow-mg"],[5,"rhino-lod0-mg"],[4,"rhino-lod0-jg"],[3,"rhino-wheel-idle-ja"],[2,"rhino-wheel-shadow-mg"],[1,"rhino-wheel-lod0-mg"],[0,"rhino-wheel-lod0-jg"]],"rhino-wheel-fma-ag":[[2,"rhino-wheel-fma-idle-ja"],[1,"rhino-wheel-fma-lod0-mg"],[0,"rhino-wheel-fma-lod0-jg"]],"robo-hover-ag":[[9,"robo-hover-base-ja"],[8,"robo-hover-ragdoll-ja"],[7,"robo-hover-shoot0-ja"],[6,"robo-hover-fly-right-ja"],[5,"robo-hover-fly-left-ja"],[4,"robo-hover-fly-back-ja"],[3,"robo-hover-fly-forward-ja"],[2,"robo-hover-idle-ja"],[1,"robo-hover-lod0-mg"],[0,"robo-hover-lod0-jg"]],"roboguard-ag":[[35,"roboguard-explode-idle-ja"],[34,"roboguard-explode-lod0-mg"],[33,"roboguard-explode-lod0-jg"],[32,"roboguard-dizzy-ja"],[31,"roboguard-ball-to-dizzy-ja"],[30,"roboguard-knocked-big-land-ja"],[29,"roboguard-knocked-big-ja"],[12,"roboguard-notice-land-ja"],[11,"roboguard-notice-jump-ja"],[10,"roboguard-idle-shoot0-turn-r1-ja"],[9,"roboguard-idle-shoot0-turn-r0-ja"],[8,"roboguard-idle-shoot0-turn-l1-ja"],[7,"roboguard-idle-shoot0-turn-l0-ja"],[6,"roboguard-idle-shoot0-loop-ja"],[5,"roboguard-idle1-ja"],[4,"roboguard-idle0-ja"],[3,"roboguard-shadow-mg"],[2,"roboguard-lod1-mg"],[1,"roboguard-lod0-mg"],[0,"roboguard-lod0-jg"],[13,"roboguard-walk-ja"],[14,"roboguard-run-ja"],[15,"roboguard-idle-to-ball-ja"],[16,"roboguard-ball-ja"],[17,"roboguard-ball-to-idle-ja"],[18,"roboguard-death-standing-ja"],[19,"roboguard-punch-far-rotate-ja"],[20,"roboguard-punch-far-go-ja"],[21,"roboguard-punch-far-hold-ja"],[22,"roboguard-punch-far-end-ja"],[23,"roboguard-punch-close-rotate-ja"],[24,"roboguard-punch-close-go-ja"],[25,"roboguard-punch-close-hold-ja"],[26,"roboguard-punch-close-end-ja"],[27,"roboguard-knocked-small-ja"],[28,"roboguard-knocked-small-land-ja"]],"roboguard-city-ag":[[27,"roboguard-city-dizzy-ja"],[26,"roboguard-city-knocked-big-land-ja"],[25,"roboguard-city-knocked-big-ja"],[24,"roboguard-city-knocked-small-land-ja"],[23,"roboguard-city-knocked-small-ja"],[22,"roboguard-city-punch-close-end-ja"],[21,"roboguard-city-punch-close-hold-ja"],[20,"roboguard-city-punch-close-go-ja"],[19,"roboguard-city-punch-close-rotate-ja"],[18,"roboguard-city-punch-far-end-ja"],[17,"roboguard-city-punch-far-hold-ja"],[16,"roboguard-city-punch-far-go-ja"],[15,"roboguard-city-punch-far-rotate-ja"],[14,"roboguard-city-ball-to-idle-ja"],[13,"roboguard-city-ball-ja"],[0,"roboguard-city-lod0-jg"],[1,"roboguard-city-lod0-mg"],[2,"roboguard-city-shadow-mg"],[3,"roboguard-city-idle0-ja"],[4,"roboguard-city-idle1-ja"],[5,"roboguard-city-idle-shoot0-loop-ja"],[6,"roboguard-city-idle-shoot0-turn-l0-ja"],[7,"roboguard-city-idle-shoot0-turn-l1-ja"],[8,"roboguard-city-idle-shoot0-turn-r0-ja"],[9,"roboguard-city-idle-shoot0-turn-r1-ja"],[10,"roboguard-city-walk-ja"],[11,"roboguard-city-run-ja"],[12,"roboguard-city-idle-to-ball-ja"]],"rub-dark-jak-door-ag":[[3,"rub-dark-jak-door-break-ja"],[2,"rub-dark-jak-door-idle-ja"],[1,"rub-dark-jak-door-lod0-mg"],[0,"rub-dark-jak-door-lod0-jg"]],"rub-electric-gate-panel-a-ag":[[2,"rub-electric-gate-panel-a-idle-ja"],[1,"rub-electric-gate-panel-a-lod0-mg"],[0,"rub-electric-gate-panel-a-lod0-jg"]],"rub-electric-gate-panel-b-ag":[[2,"rub-electric-gate-panel-b-idle-ja"],[1,"rub-electric-gate-panel-b-lod0-mg"],[0,"rub-electric-gate-panel-b-lod0-jg"]],"rub-electric-gate-panel-c-ag":[[2,"rub-electric-gate-panel-c-idle-ja"],[1,"rub-electric-gate-panel-c-lod0-mg"],[0,"rub-electric-gate-panel-c-lod0-jg"]],"rub-electric-gate-panel-d-ag":[[2,"rub-electric-gate-panel-d-idle-ja"],[1,"rub-electric-gate-panel-d-lod0-mg"],[0,"rub-electric-gate-panel-d-lod0-jg"]],"rub-electric-gate-switch-ag":[[2,"rub-electric-gate-switch-idle-ja"],[1,"rub-electric-gate-switch-lod0-mg"],[0,"rub-electric-gate-switch-lod0-jg"]],"rub-falling-step-ag":[[4,"rub-falling-step-break-ja"],[3,"rub-falling-step-idle-ja"],[2,"rub-falling-step-lod1-mg"],[1,"rub-falling-step-lod0-mg"],[0,"rub-falling-step-lod0-jg"]],"rub-rhino-door-ag":[[2,"rub-rhino-door-idle-ja"],[1,"rub-rhino-door-lod0-mg"],[0,"rub-rhino-door-lod0-jg"]],"rub-tower-ag":[[4,"rub-tower-bump-ja"],[3,"rub-tower-fall-ja"],[2,"rub-tower-idle-ja"],[1,"rub-tower-lod0-mg"],[0,"rub-tower-lod0-jg"]],"saberfish-ag":[[32,"saberfish-crawl-out-of-tube-ja"],[31,"saberfish-flip-up-ja"],[30,"saberfish-flip-up-start-ja"],[29,"saberfish-swim-turn-left-ja"],[12,"saberfish-knocked-land-ja"],[11,"saberfish-knocked-ja"],[10,"saberfish-attack-end-ja"],[9,"saberfish-attack-loop-ja"],[8,"saberfish-attack-start-ja"],[7,"saberfish-turn-ja"],[6,"saberfish-walk-ja"],[5,"saberfish-run-ja"],[4,"saberfish-swim-idle-ja"],[3,"saberfish-idle-ja"],[2,"saberfish-shadow-mg"],[1,"saberfish-lod0-mg"],[0,"saberfish-lod0-jg"],[13,"saberfish-swim-burst-ja"],[14,"saberfish-swim-fast-ja"],[15,"saberfish-spin-attack-left-ja"],[16,"saberfish-spin-attack-right-ja"],[17,"saberfish-swim-attack-ja"],[18,"saberfish-jump-to-land-windup-ja"],[19,"saberfish-jump-to-land-air-ja"],[20,"saberfish-jump-to-land-land-ja"],[21,"saberfish-jump-to-water-air-ja"],[22,"saberfish-jump-to-water-land-ja"],[23,"saberfish-submerge-start-ja"],[24,"saberfish-submerge-ja"],[25,"saberfish-reemerge-start-ja"],[26,"saberfish-reemerge-ja"],[27,"saberfish-swim-180-turn-ja"],[28,"saberfish-swim-turn-right-ja"]],"samos-effect-ag":[[2,"samos-effect-idle-ja"],[1,"samos-effect-lod0-mg"],[0,"samos-effect-lod0-jg"]],"samos-highres-ag":[[5,"samos-highres-samos-walk-ja"],[4,"samos-highres-idle-stand2-ja"],[3,"samos-highres-idle-ja"],[2,"samos-highres-shadow-mg"],[1,"samos-highres-lod0-mg"],[0,"samos-highres-lod0-jg"]],"scenecamera-ag":[[2,"scenecamera-idle-ja"],[1,"scenecamera-lod0-mg"],[0,"scenecamera-lod0-jg"]],"scorpion-ag":[[11,"scorpion-idle-ja"],[10,"scorpion-shadow-mg"],[9,"scorpion-lod0-mg"],[8,"scorpion-lod0-jg"],[7,"scorpion-wheel-blur-idle-ja"],[6,"scorpion-wheel-blur-shadow-mg"],[5,"scorpion-wheel-blur-lod0-mg"],[4,"scorpion-wheel-blur-lod0-jg"],[3,"scorpion-wheel-idle-ja"],[2,"scorpion-wheel-shadow-mg"],[1,"scorpion-wheel-lod0-mg"],[0,"scorpion-wheel-lod0-jg"]],"scorpion-gun-ag":[[2,"scorpion-gun-idle-ja"],[1,"scorpion-gun-lod0-mg"],[0,"scorpion-gun-lod0-jg"]],"scorpion-wheel-fma-ag":[[3,"scorpion-wheel-fma-idle-ja"],[2,"scorpion-wheel-fma-shadow-mg"],[1,"scorpion-wheel-fma-lod0-mg"],[0,"scorpion-wheel-fma-lod0-jg"]],"scoutbot-ag":[[15,"scoutbot-red-hit0-ja"],[14,"scoutbot-shoot-loop-ja"],[13,"scoutbot-shoot-start-ja"],[0,"scoutbot-lod0-jg"],[1,"scoutbot-lod0-mg"],[2,"scoutbot-shadow-mg"],[3,"scoutbot-idle-ja"],[4,"scoutbot-walk-ja"],[5,"scoutbot-walk-turn-ja"],[6,"scoutbot-intro1-ja"],[7,"scoutbot-attack-lf-ja"],[8,"scoutbot-attack-lm-ja"],[9,"scoutbot-attack-lr-ja"],[10,"scoutbot-attack-rf-ja"],[11,"scoutbot-attack-rm-ja"],[12,"scoutbot-attack-rr-ja"]],"screen-fma-ag":[[2,"screen-fma-idle-ja"],[1,"screen-fma-lod0-mg"],[0,"screen-fma-lod0-jg"]],"sculptor-ag":[[2,"sculptor-sculptor-idle-ja"],[1,"sculptor-lod0-mg"],[0,"sculptor-lod0-jg"]],"searchlight-ag":[[2,"searchlight-idle-ja"],[1,"searchlight-lod0-mg"],[0,"searchlight-lod0-jg"]],"security-wall-ag":[[2,"security-wall-idle-ja"],[1,"security-wall-lod0-mg"],[0,"security-wall-lod0-jg"]],"seem-highres-ag":[[6,"seem-highres-seem-idle-ja"],[7,"seem-highres-idle-leaper-ja"],[5,"seem-highres-idle-satellite-ja"],[4,"seem-highres-idle-ja"],[3,"seem-highres-seem-seemskirt_fr-cg"],[2,"seem-highres-shadow-mg"],[1,"seem-highres-lod0-mg"],[0,"seem-highres-lod0-jg"]],"sew-curved-door-ag":[[2,"sew-curved-door-idle-ja"],[1,"sew-curved-door-lod0-mg"],[0,"sew-curved-door-lod0-jg"]],"sew-elevator-ag":[[3,"sew-elevator-idle-ja"],[2,"sew-elevator-lod1-mg"],[1,"sew-elevator-lod0-mg"],[0,"sew-elevator-lod0-jg"]],"sew-fan-ag":[[7,"sew-fan-explode-idle-ja"],[6,"sew-fan-explode-lod0-mg"],[5,"sew-fan-explode-lod0-jg"],[4,"sew-fan-idle-ja"],[3,"sew-fan-lod2-mg"],[2,"sew-fan-lod1-mg"],[1,"sew-fan-lod0-mg"],[0,"sew-fan-lod0-jg"]],"sew-fence-gate-ag":[[4,"sew-fence-gate-close-ja"],[3,"sew-fence-gate-idle-ja"],[2,"sew-fence-gate-lod1-mg"],[1,"sew-fence-gate-lod0-mg"],[0,"sew-fence-gate-lod0-jg"]],"sew-float-plat-ag":[[3,"sew-float-plat-idle-ja"],[2,"sew-float-plat-lod1-mg"],[1,"sew-float-plat-lod0-mg"],[0,"sew-float-plat-lod0-jg"]],"sew-floor-switch-ag":[[5,"sew-floor-switch-popup-ja"],[4,"sew-floor-switch-pushdown-ja"],[3,"sew-floor-switch-idle-ja"],[2,"sew-floor-switch-lod1-mg"],[1,"sew-floor-switch-lod0-mg"],[0,"sew-floor-switch-lod0-jg"]],"sew-gas-step-ag":[[4,"sew-gas-step-rattle-ja"],[3,"sew-gas-step-idle-ja"],[2,"sew-gas-step-lod1-mg"],[1,"sew-gas-step-lod0-mg"],[0,"sew-gas-step-lod0-jg"]],"sew-gate-ag":[[3,"sew-gate-open-ja"],[2,"sew-gate-idle-ja"],[1,"sew-gate-lod0-mg"],[0,"sew-gate-lod0-jg"]],"sew-grate-plat-ag":[[2,"sew-grate-plat-idle-ja"],[1,"sew-grate-plat-lod0-mg"],[0,"sew-grate-plat-lod0-jg"]],"sew-gunturret-ag":[[8,"sew-gunturret-explode-idle-ja"],[7,"sew-gunturret-explode-lod0-mg"],[6,"sew-gunturret-explode-lod0-jg"],[5,"sew-gunturret-shoot-ja"],[4,"sew-gunturret-idle-ja"],[3,"sew-gunturret-lod2-mg"],[2,"sew-gunturret-lod1-mg"],[1,"sew-gunturret-lod0-mg"],[0,"sew-gunturret-lod0-jg"]],"sew-jump-pad-ag":[[3,"sew-jump-pad-idle-ja"],[2,"sew-jump-pad-lod1-mg"],[1,"sew-jump-pad-lod0-mg"],[0,"sew-jump-pad-lod0-jg"]],"sew-laser-beam-ag":[[4,"sew-laser-beam-idle-ja"],[3,"sew-laser-beam-shadow-mg"],[2,"sew-laser-beam-lod1-mg"],[1,"sew-laser-beam-lod0-mg"],[0,"sew-laser-beam-lod0-jg"]],"sew-laser-guard-ag":[[4,"sew-laser-guard-shoot-ja"],[3,"sew-laser-guard-idle-ja"],[2,"sew-laser-guard-lod1-mg"],[1,"sew-laser-guard-lod0-mg"],[0,"sew-laser-guard-lod0-jg"]],"sew-laser-turret-ag":[[5,"sew-laser-turret-recoil-ja"],[4,"sew-laser-turret-arms-up-ja"],[3,"sew-laser-turret-idle-ja"],[2,"sew-laser-turret-lod1-mg"],[1,"sew-laser-turret-lod0-mg"],[0,"sew-laser-turret-lod0-jg"]],"sew-m-gate-ag":[[3,"sew-m-gate-gate-open-ja"],[2,"sew-m-gate-idle-ja"],[1,"sew-m-gate-lod0-mg"],[0,"sew-m-gate-lod0-jg"]],"sew-move-plat-ag":[[2,"sew-move-plat-idle-ja"],[1,"sew-move-plat-lod0-mg"],[0,"sew-move-plat-lod0-jg"]],"sew-move-turret-ag":[[3,"sew-move-turret-move-shoot-ja"],[2,"sew-move-turret-idle-ja"],[1,"sew-move-turret-lod0-mg"],[0,"sew-move-turret-lod0-jg"]],"sew-moving-step-a-ag":[[3,"sew-moving-step-a-idle-ja"],[2,"sew-moving-step-a-lod1-mg"],[1,"sew-moving-step-a-lod0-mg"],[0,"sew-moving-step-a-lod0-jg"]],"sew-moving-step-b-ag":[[2,"sew-moving-step-b-idle-ja"],[1,"sew-moving-step-b-lod0-mg"],[0,"sew-moving-step-b-lod0-jg"]],"sew-pipe-ag":[[3,"sew-pipe-down-ja"],[2,"sew-pipe-idle-ja"],[1,"sew-pipe-lod0-mg"],[0,"sew-pipe-lod0-jg"]],"sew-poison-switch-ag":[[4,"sew-poison-switch-open-ja"],[3,"sew-poison-switch-idle-ja"],[2,"sew-poison-switch-lod1-mg"],[1,"sew-poison-switch-lod0-mg"],[0,"sew-poison-switch-lod0-jg"]],"sew-power-switch-ag":[[3,"sew-power-switch-off-ja"],[2,"sew-power-switch-idle-ja"],[1,"sew-power-switch-lod0-mg"],[0,"sew-power-switch-lod0-jg"]],"sew-rove-plat-ag":[[2,"sew-rove-plat-idle-ja"],[1,"sew-rove-plat-lod0-mg"],[0,"sew-rove-plat-lod0-jg"]],"sew-slide-step-ag":[[2,"sew-slide-step-idle-ja"],[1,"sew-slide-step-lod0-mg"],[0,"sew-slide-step-lod0-jg"]],"sew-wall-switch-ag":[[3,"sew-wall-switch-push-ja"],[2,"sew-wall-switch-idle-ja"],[1,"sew-wall-switch-lod0-mg"],[0,"sew-wall-switch-lod0-jg"]],"sewer-frog-ag":[[17,"sewer-frog-hit0-ja"],[16,"sewer-frog-attack0-end-ja"],[15,"sewer-frog-attack0-mid-ja"],[14,"sewer-frog-attack0-start-ja"],[13,"sewer-frog-turn-right-180-ja"],[0,"sewer-frog-lod0-jg"],[1,"sewer-frog-lod0-mg"],[2,"sewer-frog-shadow-mg"],[3,"sewer-frog-idle0-ja"],[4,"sewer-frog-idle-bite-ja"],[5,"sewer-frog-hop0-start-ja"],[6,"sewer-frog-hop0-end-ja"],[7,"sewer-frog-hop-small-start-ja"],[8,"sewer-frog-hop-small-end-ja"],[9,"sewer-frog-notice-ja"],[10,"sewer-frog-turn-left-45-ja"],[11,"sewer-frog-turn-right-45-ja"],[12,"sewer-frog-turn-left-180-ja"]],"shield-sphere-ag":[[2,"shield-sphere-idle-ja"],[1,"shield-sphere-lod0-mg"],[0,"shield-sphere-lod0-jg"]],"shield-sphere-distort-ag":[[2,"shield-sphere-distort-idle-ja"],[1,"shield-sphere-distort-lod0-mg"],[0,"shield-sphere-distort-lod0-jg"]],"shield-sphere-explode-ag":[[2,"shield-sphere-explode-idle-ja"],[1,"shield-sphere-explode-lod0-mg"],[0,"shield-sphere-explode-lod0-jg"]],"shoulder-plates-ag":[[2,"shoulder-plates-idle-ja"],[1,"shoulder-plates-lod0-mg"],[0,"shoulder-plates-lod0-jg"]],"sidekick-human-ag":[[2,"sidekick-human-sidekick-human-idle-ja"],[1,"sidekick-human-lod0-mg"],[0,"sidekick-human-lod0-jg"]],"sig-highres-ag":[[5,"sig-highres-sig-walk-ja"],[4,"sig-highres-idle-wasdoors-ja"],[3,"sig-highres-idle-ja"],[2,"sig-highres-shadow-mg"],[1,"sig-highres-lod0-mg"],[0,"sig-highres-lod0-jg"]],"sig-rider-ag":[[6,"sig-rider-pilot-car-up-down-ja"],[5,"sig-rider-pilot-car-turn-back-ja"],[4,"sig-rider-pilot-car-turn-front-ja"],[3,"sig-rider-idle-ja"],[2,"sig-rider-shadow-mg"],[1,"sig-rider-lod0-mg"],[0,"sig-rider-lod0-jg"]],"snake-ag":[[11,"snake-idle-ja"],[10,"snake-shadow-mg"],[9,"snake-lod0-mg"],[8,"snake-lod0-jg"],[7,"snake-wheel-blur-idle-ja"],[6,"snake-wheel-blur-shadow-mg"],[5,"snake-wheel-blur-lod0-mg"],[4,"snake-wheel-blur-lod0-jg"],[3,"snake-wheel-idle-ja"],[2,"snake-wheel-shadow-mg"],[1,"snake-wheel-lod0-mg"],[0,"snake-wheel-lod0-jg"]],"snake-wheel-fma-ag":[[3,"snake-wheel-fma-idle-ja"],[2,"snake-wheel-fma-shadow-mg"],[1,"snake-wheel-fma-lod0-mg"],[0,"snake-wheel-fma-lod0-jg"]],"spiky-frog-ag":[[21,"spiky-frog-ragdoll-ja"],[20,"spiky-frog-ball0-end-ja"],[19,"spiky-frog-ball0-turn-ja"],[18,"spiky-frog-ball0-start-ja"],[17,"spiky-frog-attack0-end-ja"],[16,"spiky-frog-attack0-start-ja"],[15,"spiky-frog-hop-fast-end-ja"],[14,"spiky-frog-hop-fast-start-ja"],[13,"spiky-frog-hop-slow-end-ja"],[0,"spiky-frog-lod0-jg"],[1,"spiky-frog-lod0-mg"],[2,"spiky-frog-lod1-mg"],[3,"spiky-frog-shadow-mg"],[4,"spiky-frog-idle0-ja"],[5,"spiky-frog-idle1-ja"],[6,"spiky-frog-notice0-ja"],[7,"spiky-frog-notice0-jump-ja"],[8,"spiky-frog-notice0-land-ja"],[9,"spiky-frog-rotate-left-start-ja"],[10,"spiky-frog-rotate-right-start-ja"],[11,"spiky-frog-rotate-left-end-ja"],[12,"spiky-frog-hop-slow-start-ja"]],"spotlight-ag":[[2,"spotlight-idle-ja"],[1,"spotlight-lod0-mg"],[0,"spotlight-lod0-jg"]],"spyder-ag":[[23,"spyder-jump-land-ja"],[22,"spyder-jump-in-air-ja"],[21,"spyder-jump-wind-up-ja"],[20,"spyder-hit-land-ja"],[19,"spyder-blue-hit2-ja"],[18,"spyder-blue-hit1-ja"],[17,"spyder-blue-hit0-ja"],[16,"spyder-hit-hard-ja"],[15,"spyder-hit-ja"],[14,"spyder-jump-ja"],[13,"spyder-die-knocked-ja"],[0,"spyder-lod0-jg"],[1,"spyder-lod0-mg"],[2,"spyder-lod1-mg"],[3,"spyder-shadow-mg"],[4,"spyder-idle-ja"],[5,"spyder-patrol0-ja"],[6,"spyder-notice-ja"],[7,"spyder-victory-ja"],[8,"spyder-run0-ja"],[9,"spyder-shoot-low-ja"],[10,"spyder-shoot-high-ja"],[11,"spyder-falling-death-ja"],[12,"spyder-death-ja"]],"spydroid-ag":[[13,"spydroid-knocked1-land-ja"],[0,"spydroid-lod0-jg"],[1,"spydroid-lod0-mg"],[2,"spydroid-shadow-mg"],[3,"spydroid-idle-ja"],[4,"spydroid-walk-ja"],[5,"spydroid-run-ja"],[6,"spydroid-attack-jump-ja"],[7,"spydroid-attack-land-ja"],[8,"spydroid-jump-wind-up-ja"],[9,"spydroid-knocked0-ja"],[10,"spydroid-knocked0-land-ja"],[11,"spydroid-knocked1-ja"],[12,"spydroid-turn-180-ja"]],"spydroid-orig-ag":[[20,"spydroid-orig-exploding-idle-ja"],[19,"spydroid-orig-exploding-lod0-mg"],[18,"spydroid-orig-exploding-lod0-jg"],[17,"spydroid-orig-turn-left-ja"],[16,"spydroid-orig-turn-right-ja"],[15,"spydroid-orig-explode-ja"],[14,"spydroid-orig-knocked1-land-ja"],[13,"spydroid-orig-knocked1-ja"],[0,"spydroid-orig-lod0-jg"],[1,"spydroid-orig-lod0-mg"],[2,"spydroid-orig-shadow-mg"],[3,"spydroid-orig-idle-ja"],[4,"spydroid-orig-walk-ja"],[5,"spydroid-orig-run-ja"],[6,"spydroid-orig-attack-jump-ja"],[7,"spydroid-orig-attack-land-ja"],[8,"spydroid-orig-jump-wind-up-ja"],[9,"spydroid-orig-jump-ja"],[10,"spydroid-orig-jump-land-ja"],[11,"spydroid-orig-knocked0-ja"],[12,"spydroid-orig-knocked0-land-ja"]],"stadium-sails-left-ag":[[3,"stadium-sails-left-idle-ja"],[2,"stadium-sails-left-lod1-mg"],[1,"stadium-sails-left-lod0-mg"],[0,"stadium-sails-left-lod0-jg"]],"stadium-sails-right-ag":[[3,"stadium-sails-right-idle-ja"],[2,"stadium-sails-right-lod1-mg"],[1,"stadium-sails-right-lod0-mg"],[0,"stadium-sails-right-lod0-jg"]],"switcher-ag":[[4,"switcher-die-ja"],[3,"switcher-charge-ja"],[2,"switcher-idle-ja"],[1,"switcher-lod0-mg"],[0,"switcher-lod0-jg"]],"talk-box-ag":[[2,"talk-box-idle-ja"],[1,"talk-box-lod0-mg"],[0,"talk-box-lod0-jg"]],"tentacle-ag":[[3,"tentacle-tentacle-attack-ja"],[2,"tentacle-emerge-ja"],[1,"tentacle-lod0-mg"],[0,"tentacle-lod0-jg"]],"terraformer-ag":[[6,"terraformer-walk-ja"],[5,"terraformer-idle-ja"],[4,"terraformer-shadow-mg"],[3,"terraformer-lod2-mg"],[2,"terraformer-lod1-mg"],[1,"terraformer-lod0-mg"],[0,"terraformer-lod0-jg"]],"terraformer-drone-ag":[[4,"terraformer-drone-spin-ja"],[3,"terraformer-drone-spike-out-ja"],[2,"terraformer-drone-idle-ja"],[1,"terraformer-drone-lod0-mg"],[0,"terraformer-drone-lod0-jg"]],"terraformer-head-ag":[[19,"terraformer-head-horn-guns-fire-loop-ja"],[18,"terraformer-head-horn-guns-fire-ja"],[17,"terraformer-head-horn-guns-idle-ja"],[16,"terraformer-head-horn-guns-extend-ja"],[15,"terraformer-head-head-guns-fire-ja"],[14,"terraformer-head-hit-right-ja"],[13,"terraformer-head-hit-left-ja"],[0,"terraformer-head-lod0-jg"],[1,"terraformer-head-lod0-mg"],[2,"terraformer-head-shadow-mg"],[3,"terraformer-head-idle-ja"],[4,"terraformer-head-slam-middle-ja"],[5,"terraformer-head-slam-left-ja"],[6,"terraformer-head-slam-right-ja"],[7,"terraformer-head-sweep-to-left-windup-ja"],[8,"terraformer-head-sweep-to-left-ja"],[9,"terraformer-head-sweep-to-left-idle-ja"],[10,"terraformer-head-sweep-to-right-windup-ja"],[11,"terraformer-head-sweep-to-right-ja"],[12,"terraformer-head-sweep-to-right-idle-ja"]],"terraformer-laser-ag":[[3,"terraformer-laser-idle-ja"],[2,"terraformer-laser-shadow-mg"],[1,"terraformer-laser-lod0-mg"],[0,"terraformer-laser-lod0-jg"]],"terraformer-laser-end-ag":[[3,"terraformer-laser-end-idle-ja"],[2,"terraformer-laser-end-shadow-mg"],[1,"terraformer-laser-end-lod0-mg"],[0,"terraformer-laser-end-lod0-jg"]],"terraformer-leg-a-ag":[[34,"terraformer-leg-a-rm-walk-ja"],[20,"terraformer-leg-a-lr-walk-ja"],[6,"terraformer-leg-a-lf-walk-ja"],[5,"terraformer-leg-a-idle-ja"],[4,"terraformer-leg-a-shadow-mg"],[3,"terraformer-leg-a-lod2-mg"],[41,"terraformer-leg-a-rr-walk-ja"],[2,"terraformer-leg-a-lod1-mg"],[27,"terraformer-leg-a-rf-walk-ja"],[1,"terraformer-leg-a-lod0-mg"],[13,"terraformer-leg-a-lm-walk-ja"],[0,"terraformer-leg-a-lod0-jg"]],"terraformer-leg-b-ag":[[34,"terraformer-leg-b-rm-walk-ja"],[20,"terraformer-leg-b-lr-walk-ja"],[6,"terraformer-leg-b-lf-walk-ja"],[5,"terraformer-leg-b-idle-ja"],[4,"terraformer-leg-b-shadow-mg"],[3,"terraformer-leg-b-lod2-mg"],[41,"terraformer-leg-b-rr-walk-ja"],[2,"terraformer-leg-b-lod1-mg"],[27,"terraformer-leg-b-rf-walk-ja"],[1,"terraformer-leg-b-lod0-mg"],[13,"terraformer-leg-b-lm-walk-ja"],[0,"terraformer-leg-b-lod0-jg"]],"terraformer-leg-c-ag":[[34,"terraformer-leg-c-rm-walk-ja"],[20,"terraformer-leg-c-lr-walk-ja"],[6,"terraformer-leg-c-lf-walk-ja"],[5,"terraformer-leg-c-idle-ja"],[4,"terraformer-leg-c-shadow-mg"],[3,"terraformer-leg-c-lod2-mg"],[41,"terraformer-leg-c-rr-walk-ja"],[2,"terraformer-leg-c-lod1-mg"],[27,"terraformer-leg-c-rf-walk-ja"],[1,"terraformer-leg-c-lod0-mg"],[13,"terraformer-leg-c-lm-walk-ja"],[0,"terraformer-leg-c-lod0-jg"]],"terraformer-mine-ag":[[3,"terraformer-mine-spike-out-ja"],[2,"terraformer-mine-idle-ja"],[1,"terraformer-mine-lod0-mg"],[0,"terraformer-mine-lod0-jg"]],"terraformer-spike-ag":[[34,"terraformer-spike-rm-walk-ja"],[20,"terraformer-spike-lr-walk-ja"],[6,"terraformer-spike-lf-walk-ja"],[5,"terraformer-spike-idle-ja"],[4,"terraformer-spike-shadow-mg"],[3,"terraformer-spike-lod2-mg"],[41,"terraformer-spike-rr-walk-ja"],[2,"terraformer-spike-lod1-mg"],[27,"terraformer-spike-rf-walk-ja"],[1,"terraformer-spike-lod0-mg"],[13,"terraformer-spike-lm-walk-ja"],[0,"terraformer-spike-lod0-jg"]],"terraformer-target-ag":[[2,"terraformer-target-idle-ja"],[1,"terraformer-target-lod0-mg"],[0,"terraformer-target-lod0-jg"]],"tess-highres-ag":[[6,"tess-highres-idle-res-no-gun-ja"],[5,"tess-highres-idle-res-gun-ja"],[4,"tess-highres-idle-clean-gun-ja"],[3,"tess-highres-idle-ja"],[2,"tess-highres-shadow-mg"],[1,"tess-highres-lod0-mg"],[0,"tess-highres-lod0-jg"]],"time-map-ag":[[2,"time-map-idle-ja"],[1,"time-map-lod0-mg"],[0,"time-map-lod0-jg"]],"tizard-ag":[[6,"tizard-turn-right0-ja"],[5,"tizard-turn-left0-ja"],[4,"tizard-walk0-ja"],[3,"tizard-idle-ja"],[2,"tizard-shadow-mg"],[1,"tizard-lod0-mg"],[0,"tizard-lod0-jg"]],"toad-ag":[[11,"toad-idle-ja"],[10,"toad-shadow-mg"],[9,"toad-lod0-mg"],[8,"toad-lod0-jg"],[7,"toad-wheel-blur-idle-ja"],[6,"toad-wheel-blur-shadow-mg"],[5,"toad-wheel-blur-lod0-mg"],[4,"toad-wheel-blur-lod0-jg"],[3,"toad-wheel-idle-ja"],[2,"toad-wheel-shadow-mg"],[1,"toad-wheel-lod0-mg"],[0,"toad-wheel-lod0-jg"]],"tomb-baby-spider-ag":[[22,"tomb-baby-spider-hit-blue-land-ja"],[21,"tomb-baby-spider-hit-blue-back-ja"],[20,"tomb-baby-spider-hit-blue-front-ja"],[19,"tomb-baby-spider-knocked1-land-fadeout-ja"],[18,"tomb-baby-spider-knocked1-land-ja"],[17,"tomb-baby-spider-knocked1-ja"],[16,"tomb-baby-spider-knocked0-land-fadeout-ja"],[15,"tomb-baby-spider-knocked0-land-ja"],[14,"tomb-baby-spider-knocked0-ja"],[13,"tomb-baby-spider-die-ja"],[0,"tomb-baby-spider-lod0-jg"],[1,"tomb-baby-spider-lod0-mg"],[2,"tomb-baby-spider-lod1-mg"],[3,"tomb-baby-spider-shadow-mg"],[4,"tomb-baby-spider-idle-ja"],[5,"tomb-baby-spider-walk0-ja"],[6,"tomb-baby-spider-notice-spin-ja"],[7,"tomb-baby-spider-notice-land-ja"],[8,"tomb-baby-spider-run0-ja"],[9,"tomb-baby-spider-turn-right-ja"],[10,"tomb-baby-spider-turn-left-ja"],[11,"tomb-baby-spider-attack0-start-ja"],[12,"tomb-baby-spider-attack0-stop-ja"]],"torn-effect-ag":[[2,"torn-effect-idle-ja"],[1,"torn-effect-lod0-mg"],[0,"torn-effect-lod0-jg"]],"torn-highres-ag":[[7,"torn-highres-torn-walk-ja"],[6,"torn-highres-idle-bar-ja"],[5,"torn-highres-idle-booth-ja"],[4,"torn-highres-idle-table-ja"],[3,"torn-highres-idle-ja"],[2,"torn-highres-shadow-mg"],[1,"torn-highres-lod0-mg"],[0,"torn-highres-lod0-jg"]],"torn-simple-ag":[[2,"torn-simple-idle-ja"],[1,"torn-simple-lod0-mg"],[0,"torn-simple-lod0-jg"]],"tow-break-ag":[[2,"tow-break-idle-ja"],[1,"tow-break-lod0-mg"],[0,"tow-break-lod0-jg"]],"tow-break-base-ag":[[10,"tow-break-base-b-idle-ja"],[9,"tow-break-base-b-lod0-mg"],[8,"tow-break-base-b-lod0-jg"],[6,"tow-break-base-a-idle-ja"],[5,"tow-break-base-a-lod0-mg"],[4,"tow-break-base-a-lod0-jg"],[2,"tow-break-base-idle-ja"],[1,"tow-break-base-lod0-mg"],[0,"tow-break-base-lod0-jg"]],"tow-energy-bridge-ag":[[3,"tow-energy-bridge-appear-ja"],[2,"tow-energy-bridge-idle-ja"],[1,"tow-energy-bridge-lod0-mg"],[0,"tow-energy-bridge-lod0-jg"]],"tow-large-plat-ag":[[2,"tow-large-plat-idle-ja"],[1,"tow-large-plat-lod0-mg"],[0,"tow-large-plat-lod0-jg"]],"tow-spawner-ag":[[5,"tow-spawner-spawn-end-ja"],[4,"tow-spawner-spawn-middle-ja"],[3,"tow-spawner-spawn-start-ja"],[2,"tow-spawner-idle-ja"],[1,"tow-spawner-lod0-mg"],[0,"tow-spawner-lod0-jg"]],"tow-tentacle-ag":[[2,"tow-tentacle-idle-ja"],[1,"tow-tentacle-lod0-mg"],[0,"tow-tentacle-lod0-jg"]],"tow-top-ag":[[12,"tow-top-c-lod0-jg"],[10,"tow-top-b-idle-ja"],[9,"tow-top-b-lod0-mg"],[8,"tow-top-b-lod0-jg"],[6,"tow-top-a-idle-ja"],[5,"tow-top-a-lod0-mg"],[4,"tow-top-a-lod0-jg"],[2,"tow-top-idle-ja"],[14,"tow-top-c-idle-ja"],[1,"tow-top-lod0-mg"],[13,"tow-top-c-lod0-mg"],[0,"tow-top-lod0-jg"]],"tow-warp-effect-ag":[[2,"tow-warp-effect-idle-ja"],[1,"tow-warp-effect-lod0-mg"],[0,"tow-warp-effect-lod0-jg"]],"tpl-banner-ag":[[2,"tpl-banner-idle-ja"],[1,"tpl-banner-lod0-mg"],[0,"tpl-banner-lod0-jg"]],"tpl-banner-b-ag":[[2,"tpl-banner-b-idle-ja"],[1,"tpl-banner-b-lod0-mg"],[0,"tpl-banner-b-lod0-jg"]],"tpl-bouncer-ag":[[3,"tpl-bouncer-idle-ja"],[2,"tpl-bouncer-lod1-mg"],[1,"tpl-bouncer-lod0-mg"],[0,"tpl-bouncer-lod0-jg"]],"tpl-break-alcove-ag":[[2,"tpl-break-alcove-idle-ja"],[1,"tpl-break-alcove-lod0-mg"],[0,"tpl-break-alcove-lod0-jg"]],"tpl-break-bridge-ag":[[3,"tpl-break-bridge-idle-ja"],[2,"tpl-break-bridge-lod1-mg"],[1,"tpl-break-bridge-lod0-mg"],[0,"tpl-break-bridge-lod0-jg"]],"tpl-break-door-a-ag":[[2,"tpl-break-door-a-idle-ja"],[1,"tpl-break-door-a-lod0-mg"],[0,"tpl-break-door-a-lod0-jg"]],"tpl-bridge-debris-ag":[[7,"tpl-bridge-debris-d-lod0-mg"],[6,"tpl-bridge-debris-d-lod0-jg"],[5,"tpl-bridge-debris-c-lod0-mg"],[4,"tpl-bridge-debris-c-lod0-jg"],[3,"tpl-bridge-debris-b-lod0-mg"],[2,"tpl-bridge-debris-b-lod0-jg"],[1,"tpl-bridge-debris-a-lod0-mg"],[0,"tpl-bridge-debris-a-lod0-jg"]],"tpl-door-a-ag":[[2,"tpl-door-a-idle-ja"],[1,"tpl-door-a-lod0-mg"],[0,"tpl-door-a-lod0-jg"]],"tpl-door-b-ag":[[4,"tpl-door-b-idle-ja"],[3,"tpl-door-b-irrelevant-ja"],[2,"tpl-door-b-lod1-mg"],[1,"tpl-door-b-lod0-mg"],[0,"tpl-door-b-lod0-jg"]],"tpl-door-switch-ag":[[3,"tpl-door-switch-press-ja"],[2,"tpl-door-switch-idle-ja"],[1,"tpl-door-switch-lod0-mg"],[0,"tpl-door-switch-lod0-jg"]],"tpl-elec-swing-pole-ag":[[2,"tpl-elec-swing-pole-idle-ja"],[1,"tpl-elec-swing-pole-lod0-mg"],[0,"tpl-elec-swing-pole-lod0-jg"]],"tpl-elevator-ag":[[2,"tpl-elevator-idle-ja"],[1,"tpl-elevator-lod0-mg"],[0,"tpl-elevator-lod0-jg"]],"tpl-fan-three-ag":[[2,"tpl-fan-three-idle-ja"],[1,"tpl-fan-three-lod0-mg"],[0,"tpl-fan-three-lod0-jg"]],"tpl-fan-two-ag":[[2,"tpl-fan-two-idle-ja"],[1,"tpl-fan-two-lod0-mg"],[0,"tpl-fan-two-lod0-jg"]],"tpl-gate-ag":[[4,"tpl-gate-close-ja"],[3,"tpl-gate-open-ja"],[2,"tpl-gate-idle-ja"],[1,"tpl-gate-lod0-mg"],[0,"tpl-gate-lod0-jg"]],"tpl-glider-ag":[[2,"tpl-glider-idle-ja"],[1,"tpl-glider-lod0-mg"],[0,"tpl-glider-lod0-jg"]],"tpl-glider-break-ag":[[2,"tpl-glider-break-idle-ja"],[1,"tpl-glider-break-lod0-mg"],[0,"tpl-glider-break-lod0-jg"]],"tpl-glider-broken-ag":[[2,"tpl-glider-broken-idle-ja"],[1,"tpl-glider-broken-lod0-mg"],[0,"tpl-glider-broken-lod0-jg"]],"tpl-holo-eye-ag":[[5,"tpl-holo-eye-shuteye-ja"],[4,"tpl-holo-eye-openeye-ja"],[3,"tpl-holo-eye-blink-ja"],[2,"tpl-holo-eye-idle-ja"],[1,"tpl-holo-eye-lod0-mg"],[0,"tpl-holo-eye-lod0-jg"]],"tpl-inner-airlock-door-ag":[[2,"tpl-inner-airlock-door-idle-ja"],[1,"tpl-inner-airlock-door-lod0-mg"],[0,"tpl-inner-airlock-door-lod0-jg"]],"tpl-mardoor-ag":[[2,"tpl-mardoor-idle-ja"],[1,"tpl-mardoor-lod0-mg"],[0,"tpl-mardoor-lod0-jg"]],"tpl-oracle-eye-ag":[[3,"tpl-oracle-eye-open-ja"],[2,"tpl-oracle-eye-idle-ja"],[1,"tpl-oracle-eye-lod0-mg"],[0,"tpl-oracle-eye-lod0-jg"]],"tpl-outer-airlock-door-ag":[[2,"tpl-outer-airlock-door-idle-ja"],[1,"tpl-outer-airlock-door-lod0-mg"],[0,"tpl-outer-airlock-door-lod0-jg"]],"tpl-spike-trap-ag":[[4,"tpl-spike-trap-down-ja"],[3,"tpl-spike-trap-up-ja"],[2,"tpl-spike-trap-idle-ja"],[1,"tpl-spike-trap-lod0-mg"],[0,"tpl-spike-trap-lod0-jg"]],"tpl-spindle-ag":[[2,"tpl-spindle-idle-ja"],[1,"tpl-spindle-lod0-mg"],[0,"tpl-spindle-lod0-jg"]],"tpl-spinning-plat-ag":[[2,"tpl-spinning-plat-idle-ja"],[1,"tpl-spinning-plat-lod0-mg"],[0,"tpl-spinning-plat-lod0-jg"]],"tpl-stone-break-ag":[[4,"tpl-stone-break-drop-ja"],[3,"tpl-stone-break-idle-ja"],[2,"tpl-stone-break-lod1-mg"],[1,"tpl-stone-break-lod0-mg"],[0,"tpl-stone-break-lod0-jg"]],"tpl-symbol-ag":[[2,"tpl-symbol-idle-ja"],[1,"tpl-symbol-lod0-mg"],[0,"tpl-symbol-lod0-jg"]],"tpl-watcher-ag":[[6,"tpl-watcher-explode-idle-ja"],[5,"tpl-watcher-explode-lod0-mg"],[4,"tpl-watcher-explode-lod0-jg"],[3,"tpl-watcher-idle-ja"],[2,"tpl-watcher-shadow-mg"],[1,"tpl-watcher-lod0-mg"],[0,"tpl-watcher-lod0-jg"]],"transport-ag":[[6,"transport-hatch-close-ja"],[5,"transport-hatch-open-ja"],[4,"transport-idle-ja"],[3,"transport-lod2-mg"],[2,"transport-lod1-mg"],[1,"transport-lod0-mg"],[0,"transport-lod0-jg"]],"turtle-ag":[[11,"turtle-idle-ja"],[10,"turtle-shadow-mg"],[9,"turtle-lod0-mg"],[8,"turtle-lod0-jg"],[7,"turtle-wheel-blur-idle-ja"],[6,"turtle-wheel-blur-shadow-mg"],[5,"turtle-wheel-blur-lod0-mg"],[4,"turtle-wheel-blur-lod0-jg"],[3,"turtle-wheel-idle-ja"],[2,"turtle-wheel-shadow-mg"],[1,"turtle-wheel-lod0-mg"],[0,"turtle-wheel-lod0-jg"]],"turtle-wheel-fma-ag":[[3,"turtle-wheel-fma-idle-ja"],[2,"turtle-wheel-fma-shadow-mg"],[1,"turtle-wheel-fma-lod0-mg"],[0,"turtle-wheel-fma-lod0-jg"]],"urn-a-ag":[[2,"urn-a-idle-ja"],[1,"urn-a-lod0-mg"],[0,"urn-a-lod0-jg"]],"urn-b-ag":[[2,"urn-b-idle-ja"],[1,"urn-b-lod0-mg"],[0,"urn-b-lod0-jg"]],"urn-c-ag":[[2,"urn-c-idle-ja"],[1,"urn-c-lod0-mg"],[0,"urn-c-lod0-jg"]],"veger-highres-ag":[[6,"veger-highres-veger-walk-ja"],[5,"veger-highres-idle-ja"],[4,"veger-highres-veger-coatR-cg"],[3,"veger-highres-veger-coatL-cg"],[2,"veger-highres-shadow-mg"],[1,"veger-highres-lod0-mg"],[0,"veger-highres-lod0-jg"]],"vehicle-explosion-ag":[[2,"vehicle-explosion-idle-ja"],[1,"vehicle-explosion-lod0-mg"],[0,"vehicle-explosion-lod0-jg"]],"vin-ag":[[2,"vin-idle-ja"],[1,"vin-lod0-mg"],[0,"vin-lod0-jg"]],"vin-door-ctyinda-ag":[[2,"vin-door-ctyinda-idle-ja"],[1,"vin-door-ctyinda-lod0-mg"],[0,"vin-door-ctyinda-lod0-jg"]],"vin-effect-ag":[[2,"vin-effect-idle-ja"],[1,"vin-effect-lod0-mg"],[0,"vin-effect-lod0-jg"]],"vin-turbine-ag":[[2,"vin-turbine-idle-ja"],[1,"vin-turbine-lod0-mg"],[0,"vin-turbine-lod0-jg"]],"vol-balance-plat-ag":[[2,"vol-balance-plat-idle-ja"],[1,"vol-balance-plat-lod0-mg"],[0,"vol-balance-plat-lod0-jg"]],"vol-bouncer-ag":[[2,"vol-bouncer-idle-ja"],[1,"vol-bouncer-lod0-mg"],[0,"vol-bouncer-lod0-jg"]],"vol-break-ground-ag":[[4,"vol-break-ground-drop-ja"],[3,"vol-break-ground-idle-ja"],[2,"vol-break-ground-lod1-mg"],[1,"vol-break-ground-lod0-mg"],[0,"vol-break-ground-lod0-jg"]],"vol-collapsing-rock-ag":[[3,"vol-collapsing-rock-falling-ja"],[2,"vol-collapsing-rock-idle-ja"],[1,"vol-collapsing-rock-lod0-mg"],[0,"vol-collapsing-rock-lod0-jg"]],"vol-holo-eye-ag":[[5,"vol-holo-eye-shuteye-ja"],[4,"vol-holo-eye-openeye-ja"],[3,"vol-holo-eye-blink-ja"],[2,"vol-holo-eye-idle-ja"],[1,"vol-holo-eye-lod0-mg"],[0,"vol-holo-eye-lod0-jg"]],"vol-lava-ball-ag":[[2,"vol-lava-ball-idle-ja"],[1,"vol-lava-ball-lod0-mg"],[0,"vol-lava-ball-lod0-jg"]],"vol-lava-plat-ag":[[2,"vol-lava-plat-idle-ja"],[1,"vol-lava-plat-lod0-mg"],[0,"vol-lava-plat-lod0-jg"]],"vol-rising-step-a-ag":[[2,"vol-rising-step-a-idle-ja"],[1,"vol-rising-step-a-lod0-mg"],[0,"vol-rising-step-a-lod0-jg"]],"vol-rising-step-b-ag":[[2,"vol-rising-step-b-idle-ja"],[1,"vol-rising-step-b-lod0-mg"],[0,"vol-rising-step-b-lod0-jg"]],"vol-rising-step-c-ag":[[2,"vol-rising-step-c-idle-ja"],[1,"vol-rising-step-c-lod0-mg"],[0,"vol-rising-step-c-lod0-jg"]],"vol-stone-lid-ag":[[3,"vol-stone-lid-idle-ja"],[2,"vol-stone-lid-shadow-mg"],[1,"vol-stone-lid-lod0-mg"],[0,"vol-stone-lid-lod0-jg"]],"vol-unbroken-ground-ag":[[2,"vol-unbroken-ground-idle-ja"],[1,"vol-unbroken-ground-lod0-mg"],[0,"vol-unbroken-ground-lod0-jg"]],"warp-gate-ag":[[2,"warp-gate-idle-ja"],[1,"warp-gate-lod0-mg"],[0,"warp-gate-lod0-jg"]],"warp-telescope-ag":[[2,"warp-telescope-idle-ja"],[1,"warp-telescope-lod0-mg"],[0,"warp-telescope-lod0-jg"]],"warrior-ag":[[2,"warrior-warrior-idle-ja"],[1,"warrior-lod0-mg"],[0,"warrior-lod0-jg"]],"was-artifact-ag":[[2,"was-artifact-idle-ja"],[1,"was-artifact-lod0-mg"],[0,"was-artifact-lod0-jg"]],"wascity-airlock-ag":[[2,"wascity-airlock-idle-ja"],[1,"wascity-airlock-lod0-mg"],[0,"wascity-airlock-lod0-jg"]],"wascity-airlock-debris-ag":[[2,"wascity-airlock-debris-idle-ja"],[1,"wascity-airlock-debris-lod0-mg"],[0,"wascity-airlock-debris-lod0-jg"]],"wascity-airlock-small-ag":[[2,"wascity-airlock-small-idle-ja"],[1,"wascity-airlock-small-lod0-mg"],[0,"wascity-airlock-small-lod0-jg"]],"wascity-awning-a-ag":[[3,"wascity-awning-a-idle-ja"],[2,"wascity-awning-a-lod1-mg"],[1,"wascity-awning-a-lod0-mg"],[0,"wascity-awning-a-lod0-jg"]],"wascity-awning-b-ag":[[3,"wascity-awning-b-idle-ja"],[2,"wascity-awning-b-lod1-mg"],[1,"wascity-awning-b-lod0-mg"],[0,"wascity-awning-b-lod0-jg"]],"wascity-burning-bush-ag":[[2,"wascity-burning-bush-idle-ja"],[1,"wascity-burning-bush-lod0-mg"],[0,"wascity-burning-bush-lod0-jg"]],"wascity-cactus-ag":[[7,"wascity-cactus-explode-idle-ja"],[6,"wascity-cactus-explode-lod0-mg"],[5,"wascity-cactus-explode-lod0-jg"],[4,"wascity-cactus-idle-ja"],[3,"wascity-cactus-lod2-mg"],[2,"wascity-cactus-lod1-mg"],[1,"wascity-cactus-lod0-mg"],[0,"wascity-cactus-lod0-jg"]],"wascity-elevator-door-ag":[[4,"wascity-elevator-door-idle-ja"],[3,"wascity-elevator-door-lod2-mg"],[2,"wascity-elevator-door-lod1-mg"],[1,"wascity-elevator-door-lod0-mg"],[0,"wascity-elevator-door-lod0-jg"]],"wascity-flag-a-ag":[[3,"wascity-flag-a-flap-ja"],[2,"wascity-flag-a-idle-ja"],[1,"wascity-flag-a-lod0-mg"],[0,"wascity-flag-a-lod0-jg"]],"wascity-flag-b-ag":[[3,"wascity-flag-b-flap-ja"],[2,"wascity-flag-b-idle-ja"],[1,"wascity-flag-b-lod0-mg"],[0,"wascity-flag-b-lod0-jg"]],"wascity-flag-c-ag":[[3,"wascity-flag-c-flap-ja"],[2,"wascity-flag-c-idle-ja"],[1,"wascity-flag-c-lod0-mg"],[0,"wascity-flag-c-lod0-jg"]],"wascity-flag-d-ag":[[2,"wascity-flag-d-flap-ja"],[1,"wascity-flag-d-lod0-mg"],[0,"wascity-flag-d-lod0-jg"]],"wascity-skeet-ag":[[6,"wascity-skeet-explode-idle-ja"],[5,"wascity-skeet-explode-lod0-mg"],[4,"wascity-skeet-explode-lod0-jg"],[3,"wascity-skeet-idle-ja"],[2,"wascity-skeet-shadow-mg"],[1,"wascity-skeet-lod0-mg"],[0,"wascity-skeet-lod0-jg"]],"wascity-skeet-b-ag":[[6,"wascity-skeet-b-explode-idle-ja"],[5,"wascity-skeet-b-explode-lod0-mg"],[4,"wascity-skeet-b-explode-lod0-jg"],[3,"wascity-skeet-b-idle-ja"],[2,"wascity-skeet-b-shadow-mg"],[1,"wascity-skeet-b-lod0-mg"],[0,"wascity-skeet-b-lod0-jg"]],"wascity-skeet-c-ag":[[6,"wascity-skeet-c-explode-idle-ja"],[5,"wascity-skeet-c-explode-lod0-mg"],[4,"wascity-skeet-c-explode-lod0-jg"],[3,"wascity-skeet-c-idle-ja"],[2,"wascity-skeet-c-shadow-mg"],[1,"wascity-skeet-c-lod0-mg"],[0,"wascity-skeet-c-lod0-jg"]],"wascity-stad-door-ag":[[2,"wascity-stad-door-idle-ja"],[1,"wascity-stad-door-lod0-mg"],[0,"wascity-stad-door-lod0-jg"]],"wascity-turret-ag":[[7,"wascity-turret-explode-idle-ja"],[6,"wascity-turret-explode-lod0-mg"],[5,"wascity-turret-explode-lod0-jg"],[4,"wascity-turret-idle-ja"],[3,"wascity-turret-lod2-mg"],[2,"wascity-turret-lod1-mg"],[1,"wascity-turret-lod0-mg"],[0,"wascity-turret-lod0-jg"]],"wascity-water-pump-ag":[[3,"wascity-water-pump-idle-ja"],[2,"wascity-water-pump-lod1-mg"],[1,"wascity-water-pump-lod0-mg"],[0,"wascity-water-pump-lod0-jg"]],"wascity-wind-fan-ag":[[3,"wascity-wind-fan-idle-ja"],[2,"wascity-wind-fan-lod1-mg"],[1,"wascity-wind-fan-lod0-mg"],[0,"wascity-wind-fan-lod0-jg"]],"wascity-windmill-ag":[[3,"wascity-windmill-idle-ja"],[2,"wascity-windmill-lod1-mg"],[1,"wascity-windmill-lod0-mg"],[0,"wascity-windmill-lod0-jg"]],"waspala-blocker-ag":[[2,"waspala-blocker-idle-ja"],[1,"waspala-blocker-lod0-mg"],[0,"waspala-blocker-lod0-jg"]],"waspala-elevator-ag":[[2,"waspala-elevator-idle-ja"],[1,"waspala-elevator-lod0-mg"],[0,"waspala-elevator-lod0-jg"]],"waspala-paddle-wheel-a-ag":[[2,"waspala-paddle-wheel-a-idle-ja"],[1,"waspala-paddle-wheel-a-lod0-mg"],[0,"waspala-paddle-wheel-a-lod0-jg"]],"waspala-paddle-wheel-b-ag":[[2,"waspala-paddle-wheel-b-idle-ja"],[1,"waspala-paddle-wheel-b-lod0-mg"],[0,"waspala-paddle-wheel-b-lod0-jg"]],"water-anim-nst-ag":[[2,"water-anim-nst-idle-ja"],[1,"water-anim-nst-lake-lod0-mg"],[0,"water-anim-nst-lake-lod0-jg"]],"water-anim-waspala-ag":[[8,"water-anim-waspala-idle-ja"],[7,"water-anim-waspala-frontwindowwall-lod0-mg"],[6,"water-anim-waspala-frontwindowwall-lod0-jg"],[5,"water-anim-waspala-frontthrone-lod0-mg"],[4,"water-anim-waspala-frontthrone-lod0-jg"],[3,"water-anim-waspala-windowwall-lod0-mg"],[2,"water-anim-waspala-windowwall-lod0-jg"],[1,"water-anim-waspala-thronesec-lod0-mg"],[0,"water-anim-waspala-thronesec-lod0-jg"]],"wland-driver-ag":[[4,"wland-driver-pilot-car-up-down-ja"],[3,"wland-driver-pilot-car-turn-back-ja"],[2,"wland-driver-pilot-car-turn-front-ja"],[1,"wland-driver-lod0-mg"],[0,"wland-driver-lod0-jg"]],"wland-passenger-ag":[[25,"wland-passenger-vehicle-get-out-land-ja"],[24,"wland-passenger-vehicle-get-out-jump-ja"],[23,"wland-passenger-vehicle-get-out-ja"],[22,"wland-passenger-pilot-car-up-down-ja"],[21,"wland-passenger-pilot-car-turn-back-ja"],[20,"wland-passenger-pilot-car-turn-front-ja"],[19,"wland-passenger-run-for-cover-ja"],[18,"wland-passenger-idle-cover-ja"],[17,"wland-passenger-idle-wave-to-cover-ja"],[16,"wland-passenger-idle-wave-ja"],[15,"wland-passenger-vehicle-get-in-ja"],[14,"wland-passenger-vehicle-jump-to-ja"],[13,"wland-passenger-vehicle-get-in-spin-ja"],[0,"wland-passenger-lod0-jg"],[1,"wland-passenger-lod0-mg"],[2,"wland-passenger-shadow-mg"],[3,"wland-passenger-idle0-ja"],[4,"wland-passenger-walk0-ja"],[5,"wland-passenger-walk1-ja"],[6,"wland-passenger-run0-ja"],[7,"wland-passenger-getup-back-ja"],[8,"wland-passenger-getup-front-ja"],[9,"wland-passenger-knocked-back-ja"],[10,"wland-passenger-knocked-back-land-ja"],[11,"wland-passenger-knocked-forward-ja"],[12,"wland-passenger-knocked-forward-land-ja"]],"wlander-female-ag":[[27,"wlander-female-shoot-idle-ja"],[26,"wlander-female-ragdoll-ja"],[25,"wlander-female-attack-gunbutt-spin0-ja"],[24,"wlander-female-attack-kick-spin0-ja"],[23,"wlander-female-walk-gun0-ja"],[22,"wlander-female-gun-away0-ja"],[21,"wlander-female-shoot-turn1-end-ja"],[20,"wlander-female-shoot-turn1-ja"],[19,"wlander-female-shoot-turn1-start-ja"],[18,"wlander-female-shoot-turn0-ja"],[17,"wlander-female-getup-forward-ja"],[16,"wlander-female-knocked-forward-land-ja"],[15,"wlander-female-knocked-forward-ja"],[14,"wlander-female-knocked-back-2-gun-out-ja"],[13,"wlander-female-knocked-back-land-ja"],[0,"wlander-female-lod0-jg"],[1,"wlander-female-lod0-mg"],[2,"wlander-female-lod2-mg"],[3,"wlander-female-shadow-mg"],[4,"wlander-female-idle0-ja"],[5,"wlander-female-walk0-ja"],[6,"wlander-female-run0-ja"],[7,"wlander-female-gun-takeout-ja"],[8,"wlander-female-gun-out-ja"],[9,"wlander-female-gun-out-idle-ja"],[10,"wlander-female-run-2-gun-out-ja"],[11,"wlander-female-shoot0-ja"],[12,"wlander-female-knocked-back-ja"]],"wlander-male-ag":[[23,"wlander-male-ragdoll-ja"],[22,"wlander-male-shoot-turn1-end-ja"],[21,"wlander-male-shoot-turn1-ja"],[20,"wlander-male-shoot-turn1-start-ja"],[19,"wlander-male-shoot-turn0-ja"],[18,"wlander-male-knocked-forward-land-ja"],[17,"wlander-male-knocked-forward-ja"],[16,"wlander-male-knocked-back-land-ja"],[15,"wlander-male-knocked-back-ja"],[14,"wlander-male-getup-front-ja"],[13,"wlander-male-getup-back-ja"],[0,"wlander-male-lod0-jg"],[1,"wlander-male-lod0-mg"],[2,"wlander-male-lod2-mg"],[3,"wlander-male-shadow-mg"],[4,"wlander-male-idle0-ja"],[5,"wlander-male-walk0-ja"],[6,"wlander-male-walk1-ja"],[7,"wlander-male-run0-ja"],[8,"wlander-male-idle-to-shoot-ja"],[9,"wlander-male-shoot-idle-ja"],[10,"wlander-male-shoot0-ja"],[11,"wlander-male-shoot-to-idle-ja"],[12,"wlander-male-attack-rifle-butt-ja"]],"wstd-arena-plat-ag":[[2,"wstd-arena-plat-idle-ja"],[1,"wstd-arena-plat-lod0-mg"],[0,"wstd-arena-plat-lod0-jg"]],"wstd-blocker-ag":[[2,"wstd-blocker-idle-ja"],[1,"wstd-blocker-lod0-mg"],[0,"wstd-blocker-lod0-jg"]],"wstd-door-ag":[[2,"wstd-door-idle-ja"],[1,"wstd-door-lod0-mg"],[0,"wstd-door-lod0-jg"]],"wstd-fight-house-a-ag":[[3,"wstd-fight-house-a-open-ja"],[2,"wstd-fight-house-a-idle-ja"],[1,"wstd-fight-house-a-lod0-mg"],[0,"wstd-fight-house-a-lod0-jg"]],"wstd-fight-house-b-ag":[[3,"wstd-fight-house-b-open-ja"],[2,"wstd-fight-house-b-idle-ja"],[1,"wstd-fight-house-b-lod0-mg"],[0,"wstd-fight-house-b-lod0-jg"]],"wstd-fight-plat-ag":[[2,"wstd-fight-plat-idle-ja"],[1,"wstd-fight-plat-lod0-mg"],[0,"wstd-fight-plat-lod0-jg"]],"wstd-fight-plat-box-ag":[[2,"wstd-fight-plat-box-idle-ja"],[1,"wstd-fight-plat-box-lod0-mg"],[0,"wstd-fight-plat-box-lod0-jg"]],"wstd-fight-plat-large-ag":[[2,"wstd-fight-plat-large-idle-ja"],[1,"wstd-fight-plat-large-lod0-mg"],[0,"wstd-fight-plat-large-lod0-jg"]],"wstd-fight-plat-smlplat-ag":[[2,"wstd-fight-plat-smlplat-idle-ja"],[1,"wstd-fight-plat-smlplat-lod0-mg"],[0,"wstd-fight-plat-smlplat-lod0-jg"]],"wstd-flag-a-ag":[[2,"wstd-flag-a-idle-ja"],[1,"wstd-flag-a-lod0-mg"],[0,"wstd-flag-a-lod0-jg"]],"wstd-flag-ag":[[2,"wstd-flag-idle-ja"],[1,"wstd-flag-lod0-mg"],[0,"wstd-flag-lod0-jg"]],"wstd-gate-pass-ag":[[2,"wstd-gate-pass-idle-ja"],[1,"wstd-gate-pass-lod0-mg"],[0,"wstd-gate-pass-lod0-jg"]],"wstd-square-plat-a-ag":[[2,"wstd-square-plat-a-idle-ja"],[1,"wstd-square-plat-a-lod0-mg"],[0,"wstd-square-plat-a-lod0-jg"]],"wstd-square-plat-b-ag":[[2,"wstd-square-plat-b-idle-ja"],[1,"wstd-square-plat-b-lod0-mg"],[0,"wstd-square-plat-b-lod0-jg"]],"wstd-square-plat-c-ag":[[2,"wstd-square-plat-c-idle-ja"],[1,"wstd-square-plat-c-lod0-mg"],[0,"wstd-square-plat-c-lod0-jg"]],"wstd-training-dummy-ag":[[5,"wstd-training-dummy-explode-idle-ja"],[4,"wstd-training-dummy-explode-lod0-mg"],[3,"wstd-training-dummy-explode-lod0-jg"],[2,"wstd-training-dummy-idle-ja"],[1,"wstd-training-dummy-lod0-mg"],[0,"wstd-training-dummy-lod0-jg"]],"wstd-trapdoor-ag":[[5,"wstd-trapdoor-explode-idle-ja"],[4,"wstd-trapdoor-explode-lod0-mg"],[3,"wstd-trapdoor-explode-lod0-jg"],[2,"wstd-trapdoor-idle-ja"],[1,"wstd-trapdoor-lod0-mg"],[0,"wstd-trapdoor-lod0-jg"]],"yakow-ag":[[10,"yakow-kicked-in-place-ja"],[9,"yakow-walk-left-ja"],[8,"yakow-walk-right-ja"],[7,"yakow-kicked-ja"],[6,"yakow-run-ja"],[5,"yakow-walk-ja"],[4,"yakow-graze-ja"],[3,"yakow-idle-ja"],[2,"yakow-shadow-mg"],[1,"yakow-lod0-mg"],[0,"yakow-lod0-jg"]],"yellow-barrel-ag":[[2,"yellow-barrel-idle-ja"],[1,"yellow-barrel-lod0-mg"],[0,"yellow-barrel-lod0-jg"]],"yellowsage-ag":[[2,"yellowsage-yellowsage-idle-ja"],[1,"yellowsage-lod0-mg"],[0,"yellowsage-lod0-jg"]],"youngsamos-highres-ag":[[2,"youngsamos-highres-youngsamos-idle-ja"],[1,"youngsamos-highres-lod0-mg"],[0,"youngsamos-highres-lod0-jg"]]} +{"air-train-ag":[[3,"air-train-idle-ja"],[2,"air-train-shadow-mg"],[1,"air-train-lod0-mg"],[0,"air-train-lod0-jg"]],"air-train-fma-ag":[[3,"air-train-fma-idle-ja"],[2,"air-train-fma-shadow-mg"],[1,"air-train-fma-lod0-mg"],[0,"air-train-fma-lod0-jg"]],"arena-token-ag":[[3,"arena-token-idle-ja"],[2,"arena-token-shadow-mg"],[1,"arena-token-lod0-mg"],[0,"arena-token-lod0-jg"]],"ashelin-ag":[[41,"ashelin-tumble-right-land-ja"],[40,"ashelin-tumble-right-loop-ja"],[39,"ashelin-tumble-right-start-ja"],[38,"ashelin-cartwheel-left-land-ja"],[37,"ashelin-cartwheel-left-loop-ja"],[36,"ashelin-cartwheel-left-start-ja"],[35,"ashelin-back-spring-land-ja"],[34,"ashelin-back-spring-loop-ja"],[33,"ashelin-back-spring-start-ja"],[32,"ashelin-standing-turn-right-ja"],[31,"ashelin-standing-turn-left-ja"],[30,"ashelin-standing-to-waiting-ja"],[29,"ashelin-standing-idle-ja"],[12,"ashelin-knocked-right-die0-ja"],[11,"ashelin-knocked-right-land0-ja"],[10,"ashelin-knocked-right0-ja"],[9,"ashelin-knocked-back-die0-ja"],[8,"ashelin-knocked-back-land0-ja"],[7,"ashelin-knocked-back0-ja"],[6,"ashelin-run0-ja"],[5,"ashelin-jog0-ja"],[4,"ashelin-walk0-ja"],[3,"ashelin-idle0-ja"],[2,"ashelin-shadow-mg"],[1,"ashelin-lod0-mg"],[0,"ashelin-lod0-jg"],[13,"ashelin-blue-hit-front0-ja"],[14,"ashelin-blue-hit-front1-ja"],[15,"ashelin-blue-hit-front2-ja"],[16,"ashelin-blue-hit-front-land0-ja"],[17,"ashelin-blue-hit-front-land1-ja"],[18,"ashelin-blue-hit-front-land2-ja"],[19,"ashelin-blue-hit-back0-ja"],[20,"ashelin-blue-hit-back1-ja"],[21,"ashelin-blue-hit-back2-ja"],[22,"ashelin-blue-hit-back-land0-ja"],[23,"ashelin-blue-hit-back-land1-ja"],[24,"ashelin-blue-hit-back-land2-ja"],[25,"ashelin-blue-hit-recover-ja"],[26,"ashelin-die-in-place0-ja"],[27,"ashelin-waiting-to-standing-ja"],[28,"ashelin-standing-fire-ja"]],"ashelin-effect-ag":[[2,"ashelin-effect-idle-ja"],[1,"ashelin-effect-lod0-mg"],[0,"ashelin-effect-lod0-jg"]],"ashelin-highres-ag":[[5,"ashelin-highres-ashelin-walk-ja"],[4,"ashelin-highres-idle-stand-ja"],[3,"ashelin-highres-idle-ja"],[2,"ashelin-highres-shadow-mg"],[1,"ashelin-highres-lod0-mg"],[0,"ashelin-highres-lod0-jg"]],"babak-ag":[[2,"babak-babak-idle-ja"],[1,"babak-lod0-mg"],[0,"babak-lod0-jg"]],"barge-ag":[[2,"barge-idle-ja"],[1,"barge-lod0-mg"],[0,"barge-lod0-jg"]],"baron-highres-ag":[[3,"baron-highres-baron-idle-ja"],[2,"baron-highres-idle-ja"],[1,"baron-highres-lod0-mg"],[0,"baron-highres-lod0-jg"]],"battle-amulet-ag":[[2,"battle-amulet-idle-ja"],[1,"battle-amulet-lod0-mg"],[0,"battle-amulet-lod0-jg"]],"beacon-ag":[[2,"beacon-idle-ja"],[1,"beacon-lod0-mg"],[0,"beacon-lod0-jg"]],"beam-generator-ag":[[3,"beam-generator-idle-ja"],[2,"beam-generator-shadow-mg"],[1,"beam-generator-lod0-mg"],[0,"beam-generator-lod0-jg"]],"beast-rider-ag":[[14,"beast-rider-death0-ja"],[13,"beast-rider-run-limp0-ja"],[0,"beast-rider-lod0-jg"],[1,"beast-rider-lod0-mg"],[2,"beast-rider-shadow-mg"],[3,"beast-rider-idle-ja"],[4,"beast-rider-run1-ja"],[5,"beast-rider-run-attack-ja"],[6,"beast-rider-turn180-ja"],[7,"beast-rider-fall-forward-ja"],[8,"beast-rider-down-idle1-ja"],[9,"beast-rider-down-idle2-ja"],[10,"beast-rider-get-up-ja"],[11,"beast-rider-down-hits0-ja"],[12,"beast-rider-down-hits0-jitter-ja"]],"bikea-ag":[[5,"bikea-idle-ja"],[4,"bikea-shadow-mg"],[3,"bikea-lod2-mg"],[2,"bikea-lod1-mg"],[1,"bikea-lod0-mg"],[0,"bikea-lod0-jg"]],"bikeb-ag":[[5,"bikeb-idle-ja"],[4,"bikeb-shadow-mg"],[3,"bikeb-lod2-mg"],[2,"bikeb-lod1-mg"],[1,"bikeb-lod0-mg"],[0,"bikeb-lod0-jg"]],"bikec-ag":[[5,"bikec-idle-ja"],[4,"bikec-shadow-mg"],[3,"bikec-lod2-mg"],[2,"bikec-lod1-mg"],[1,"bikec-lod0-mg"],[0,"bikec-lod0-jg"]],"billy-ag":[[2,"billy-billy-idle-ja"],[1,"billy-lod0-mg"],[0,"billy-lod0-jg"]],"bird-lady-ag":[[2,"bird-lady-bird-lady-idle-ja"],[1,"bird-lady-lod0-mg"],[0,"bird-lady-lod0-jg"]],"blocking-plane-ag":[[2,"blocking-plane-idle-ja"],[1,"blocking-plane-lod0-mg"],[0,"blocking-plane-lod0-jg"]],"blue-gun-mod-one-ag":[[2,"blue-gun-mod-one-idle-ja"],[1,"blue-gun-mod-one-lod0-mg"],[0,"blue-gun-mod-one-lod0-jg"]],"blue-gun-mod-three-ag":[[2,"blue-gun-mod-three-idle-ja"],[1,"blue-gun-mod-three-lod0-mg"],[0,"blue-gun-mod-three-lod0-jg"]],"blue-two-upgrade-ag":[[2,"blue-two-upgrade-idle-ja"],[1,"blue-two-upgrade-lod0-mg"],[0,"blue-two-upgrade-lod0-jg"]],"bluesage-ag":[[2,"bluesage-bluesage-idle-ja"],[1,"bluesage-lod0-mg"],[0,"bluesage-lod0-jg"]],"board-ag":[[5,"board-board-idle-ja"],[4,"board-close-ja"],[3,"board-open-ja"],[2,"board-shadow-mg"],[1,"board-lod0-mg"],[0,"board-lod0-jg"]],"bomb-bot-movie-ag":[[2,"bomb-bot-movie-idle-ja"],[1,"bomb-bot-movie-lod0-mg"],[0,"bomb-bot-movie-lod0-jg"]],"bombbot-ag":[[3,"bombbot-idle-ja"],[2,"bombbot-shadow-mg"],[1,"bombbot-lod0-mg"],[0,"bombbot-lod0-jg"]],"bombbot-bomb-ag":[[5,"bombbot-bomb-idle-ja"],[4,"bombbot-bomb-shadow-mg"],[3,"bombbot-bomb-lod2-mg"],[2,"bombbot-bomb-lod1-mg"],[1,"bombbot-bomb-lod0-mg"],[0,"bombbot-bomb-lod0-jg"]],"breastplate-ag":[[2,"breastplate-idle-ja"],[1,"breastplate-lod0-mg"],[0,"breastplate-lod0-jg"]],"broken-mdaxter-ag":[[2,"broken-mdaxter-idle-ja"],[1,"broken-mdaxter-lod0-mg"],[0,"broken-mdaxter-lod0-jg"]],"brutter-highres-ag":[[2,"brutter-highres-brutter-idle-ja"],[1,"brutter-highres-lod0-mg"],[0,"brutter-highres-lod0-jg"]],"bt-grunt-ag":[[18,"bt-grunt-closeup-idle-ja"],[17,"bt-grunt-close-attack1-ja"],[16,"bt-grunt-close-attack0-ja"],[15,"bt-grunt-mech-double-pound-ja"],[14,"bt-grunt-mech-punch-left-ja"],[13,"bt-grunt-mech-head-butt-ja"],[0,"bt-grunt-lod0-jg"],[1,"bt-grunt-lod0-mg"],[2,"bt-grunt-shadow-mg"],[3,"bt-grunt-idle-ja"],[4,"bt-grunt-idle2-ja"],[5,"bt-grunt-notice-ja"],[6,"bt-grunt-jump-wind-up-ja"],[7,"bt-grunt-jump-in-air-ja"],[8,"bt-grunt-jump-land-ja"],[9,"bt-grunt-ragdoll-ja"],[10,"bt-grunt-mech-lunge-ja"],[11,"bt-grunt-mech-grab-ja"],[12,"bt-grunt-mech-idle0-ja"]],"bt-jinx-ag":[[4,"bt-jinx-ride-ja"],[3,"bt-jinx-idle-ja"],[2,"bt-jinx-shadow-mg"],[1,"bt-jinx-lod0-mg"],[0,"bt-jinx-lod0-jg"]],"bt-roboguard-ag":[[14,"bt-roboguard-knocked-big-land-ja"],[13,"bt-roboguard-knocked-big-ja"],[0,"bt-roboguard-lod0-jg"],[1,"bt-roboguard-lod0-mg"],[2,"bt-roboguard-shadow-mg"],[3,"bt-roboguard-idle0-ja"],[4,"bt-roboguard-idle1-ja"],[5,"bt-roboguard-idle-shoot0-loop-ja"],[6,"bt-roboguard-idle-shoot0-turn-l0-ja"],[7,"bt-roboguard-idle-shoot0-turn-l1-ja"],[8,"bt-roboguard-idle-shoot0-turn-r0-ja"],[9,"bt-roboguard-idle-shoot0-turn-r1-ja"],[10,"bt-roboguard-walk-ja"],[11,"bt-roboguard-knocked-small-ja"],[12,"bt-roboguard-knocked-small-land-ja"]],"bt-sig-ag":[[7,"bt-sig-ride-ja"],[6,"bt-sig-pilot-car-up-down-ja"],[5,"bt-sig-pilot-car-turn-back-ja"],[4,"bt-sig-pilot-car-turn-front-ja"],[3,"bt-sig-idle-ja"],[2,"bt-sig-shadow-mg"],[1,"bt-sig-lod0-mg"],[0,"bt-sig-lod0-jg"]],"bt-torn-ag":[[3,"bt-torn-ride-ja"],[2,"bt-torn-idle-ja"],[1,"bt-torn-lod0-mg"],[0,"bt-torn-lod0-jg"]],"bt-wasp-ag":[[10,"bt-wasp-knocked0-recover-ja"],[9,"bt-wasp-knocked0-ja"],[8,"bt-wasp-shoot0-ja"],[7,"bt-wasp-fly-back-ja"],[6,"bt-wasp-fly-forward-ja"],[5,"bt-wasp-fly-left-ja"],[4,"bt-wasp-fly-right-ja"],[3,"bt-wasp-idle-ja"],[2,"bt-wasp-shadow-mg"],[1,"bt-wasp-lod0-mg"],[0,"bt-wasp-lod0-jg"]],"burning-bush-ag":[[2,"burning-bush-idle-ja"],[1,"burning-bush-lod0-mg"],[0,"burning-bush-lod0-jg"]],"cara-ag":[[5,"cara-idle-ja"],[4,"cara-shadow-mg"],[3,"cara-lod2-mg"],[2,"cara-lod1-mg"],[1,"cara-lod0-mg"],[0,"cara-lod0-jg"]],"carb-ag":[[5,"carb-idle-ja"],[4,"carb-shadow-mg"],[3,"carb-lod2-mg"],[2,"carb-lod1-mg"],[1,"carb-lod0-mg"],[0,"carb-lod0-jg"]],"carc-ag":[[5,"carc-idle-ja"],[4,"carc-shadow-mg"],[3,"carc-lod2-mg"],[2,"carc-lod1-mg"],[1,"carc-lod0-mg"],[0,"carc-lod0-jg"]],"catapult-ag":[[37,"catapult-debris-rearpanel-d-lod0-mg"],[36,"catapult-debris-rearpanel-d-lod0-jg"],[35,"catapult-debris-rearpanel-c-lod0-mg"],[34,"catapult-debris-rearpanel-c-lod0-jg"],[33,"catapult-debris-rearpanel-b-lod0-mg"],[32,"catapult-debris-rearpanel-b-lod0-jg"],[31,"catapult-debris-rearpanel-a-lod0-mg"],[30,"catapult-debris-rearpanel-a-lod0-jg"],[29,"catapult-debris-midpanel-d-lod0-mg"],[12,"catapult-debris-bumper-lod0-jg"],[11,"catapult-debris-bar-lod0-mg"],[10,"catapult-debris-bar-lod0-jg"],[9,"catapult-debris-smlspike-lod0-mg"],[8,"catapult-debris-smlspike-lod0-jg"],[7,"catapult-debris-longspike-lod0-mg"],[6,"catapult-debris-longspike-lod0-jg"],[5,"catapult-debris-panel-lod0-mg"],[4,"catapult-debris-panel-lod0-jg"],[3,"catapult-wheel-idle-ja"],[2,"catapult-wheel-shadow-mg"],[1,"catapult-wheel-lod0-mg"],[0,"catapult-wheel-lod0-jg"],[13,"catapult-debris-bumper-lod0-mg"],[14,"catapult-debris-frontpanel-a-lod0-jg"],[15,"catapult-debris-frontpanel-a-lod0-mg"],[16,"catapult-debris-frontpanel-b-lod0-jg"],[17,"catapult-debris-frontpanel-b-lod0-mg"],[18,"catapult-debris-frontpanel-c-lod0-jg"],[19,"catapult-debris-frontpanel-c-lod0-mg"],[20,"catapult-debris-frontpanel-d-lod0-jg"],[21,"catapult-debris-frontpanel-d-lod0-mg"],[22,"catapult-debris-midpanel-a-lod0-jg"],[23,"catapult-debris-midpanel-a-lod0-mg"],[24,"catapult-debris-midpanel-b-lod0-jg"],[25,"catapult-debris-midpanel-b-lod0-mg"],[26,"catapult-debris-midpanel-c-lod0-jg"],[27,"catapult-debris-midpanel-c-lod0-mg"],[28,"catapult-debris-midpanel-d-lod0-jg"]],"catapult-target-ag":[[3,"catapult-target-idle-ja"],[2,"catapult-target-shadow-mg"],[1,"catapult-target-lod0-mg"],[0,"catapult-target-lod0-jg"]],"cav-airlock-door-ag":[[2,"cav-airlock-door-idle-ja"],[1,"cav-airlock-door-lod0-mg"],[0,"cav-airlock-door-lod0-jg"]],"cav-break-bridge-ag":[[2,"cav-break-bridge-idle-ja"],[1,"cav-break-bridge-lod0-mg"],[0,"cav-break-bridge-lod0-jg"]],"cav-eco-lg-ag":[[20,"cav-eco-lg-sml-walk-alt-ja"],[19,"cav-eco-lg-sml-walk-ja"],[18,"cav-eco-lg-sml-attack-ja"],[17,"cav-eco-lg-sml-turn-right-ja"],[16,"cav-eco-lg-sml-turn-left-ja"],[15,"cav-eco-lg-med-walk-ja"],[14,"cav-eco-lg-med-attack-ja"],[13,"cav-eco-lg-ball-to-idle-ja"],[0,"cav-eco-lg-lod0-jg"],[1,"cav-eco-lg-lod0-mg"],[2,"cav-eco-lg-idle-ja"],[3,"cav-eco-lg-walk-ja"],[4,"cav-eco-lg-split-top-ja"],[5,"cav-eco-lg-split-bottom-ja"],[6,"cav-eco-lg-turn-left-ja"],[7,"cav-eco-lg-turn-right-ja"],[8,"cav-eco-lg-attack-ja"],[9,"cav-eco-lg-attack-alt-ja"],[10,"cav-eco-lg-victory-ja"],[11,"cav-eco-lg-victory-alt-ja"],[12,"cav-eco-lg-ball-ja"]],"cav-exit-door-ag":[[4,"cav-exit-door-open-ja"],[3,"cav-exit-door-idle-ja"],[2,"cav-exit-door-lod1-mg"],[1,"cav-exit-door-lod0-mg"],[0,"cav-exit-door-lod0-jg"]],"cav-minecar-ag":[[2,"cav-minecar-idle-ja"],[1,"cav-minecar-lod0-mg"],[0,"cav-minecar-lod0-jg"]],"cav-pillar-ag":[[23,"cav-pillar-debris-d-idle-ja"],[22,"cav-pillar-debris-d-lod0-mg"],[21,"cav-pillar-debris-d-lod0-jg"],[20,"cav-pillar-debris-c-idle-ja"],[19,"cav-pillar-debris-c-lod0-mg"],[18,"cav-pillar-debris-c-lod0-jg"],[17,"cav-pillar-debris-b-idle-ja"],[16,"cav-pillar-debris-b-lod0-mg"],[15,"cav-pillar-debris-b-lod0-jg"],[14,"cav-pillar-debris-a-idle-ja"],[13,"cav-pillar-debris-a-lod0-mg"],[0,"cav-pillar-lod0-jg"],[1,"cav-pillar-lod0-mg"],[2,"cav-pillar-idle-ja"],[3,"cav-pillar-b-lod0-jg"],[4,"cav-pillar-b-lod0-mg"],[5,"cav-pillar-b-idle-ja"],[6,"cav-pillar-c-lod0-jg"],[7,"cav-pillar-c-lod0-mg"],[8,"cav-pillar-c-idle-ja"],[9,"cav-pillar-d-lod0-jg"],[10,"cav-pillar-d-lod0-mg"],[11,"cav-pillar-d-idle-ja"],[12,"cav-pillar-debris-a-lod0-jg"]],"cav-prebot-break-ag":[[6,"cav-prebot-break-a-idle-ja"],[5,"cav-prebot-break-a-lod0-mg"],[4,"cav-prebot-break-a-lod0-jg"],[2,"cav-prebot-break-idle-ja"],[1,"cav-prebot-break-lod0-mg"],[0,"cav-prebot-break-lod0-jg"]],"cav-railblocker-ag":[[5,"cav-railblocker-explode-idle-ja"],[4,"cav-railblocker-explode-lod0-mg"],[3,"cav-railblocker-explode-lod0-jg"],[2,"cav-railblocker-idle-ja"],[1,"cav-railblocker-lod0-mg"],[0,"cav-railblocker-lod0-jg"]],"cipher-ag":[[2,"cipher-idle-ja"],[1,"cipher-lod0-mg"],[0,"cipher-lod0-jg"]],"citizen-chick-ag":[[27,"citizen-chick-riding-stance-ja"],[26,"citizen-chick-shuffle-ja"],[25,"citizen-chick-get-up-from-back-ja"],[24,"citizen-chick-get-up-from-front-ja"],[23,"citizen-chick-knocked-back-land-ja"],[22,"citizen-chick-knocked-back-ja"],[21,"citizen-chick-knocked-front-land-ja"],[20,"citizen-chick-knocked-front-ja"],[19,"citizen-chick-blue-hit-back-ja"],[18,"citizen-chick-blue-hit-front-ja"],[17,"citizen-chick-dive-forward-ja"],[16,"citizen-chick-cover-head-end-ja"],[15,"citizen-chick-cover-head-loop-ja"],[14,"citizen-chick-cover-head-start-ja"],[13,"citizen-chick-hit-the-deck-ja"],[0,"citizen-chick-lod0-jg"],[1,"citizen-chick-lod0-mg"],[2,"citizen-chick-lod2-mg"],[3,"citizen-chick-shadow-mg"],[4,"citizen-chick-walk-ja"],[5,"citizen-chick-walk2-ja"],[6,"citizen-chick-walk3-ja"],[7,"citizen-chick-run-ja"],[8,"citizen-chick-run2-ja"],[9,"citizen-chick-run3-ja"],[10,"citizen-chick-idle-ja"],[11,"citizen-chick-panic-run-ja"],[12,"citizen-chick-tread-water-ja"]],"citizen-fat-ag":[[32,"citizen-fat-tread-water-ja"],[31,"citizen-fat-riding-stance-ja"],[30,"citizen-fat-cover-head-end-ja"],[29,"citizen-fat-cover-head-loop-ja"],[12,"citizen-fat-shuffle-ja"],[11,"citizen-fat-walk-ja"],[10,"citizen-fat-out-of-breath-ja"],[9,"citizen-fat-idle-to-out-of-breath-ja"],[8,"citizen-fat-arms-crossed-ja"],[7,"citizen-fat-idle-to-arms-crossed-ja"],[6,"citizen-fat-arms-hips-ja"],[5,"citizen-fat-idle-to-arms-hips-ja"],[4,"citizen-fat-idle-ja"],[3,"citizen-fat-shadow-mg"],[2,"citizen-fat-lod2-mg"],[1,"citizen-fat-lod0-mg"],[0,"citizen-fat-lod0-jg"],[13,"citizen-fat-walk2-ja"],[14,"citizen-fat-walk3-ja"],[15,"citizen-fat-run-ja"],[16,"citizen-fat-run2-ja"],[17,"citizen-fat-panic-run-ja"],[18,"citizen-fat-dive-forward-ja"],[19,"citizen-fat-hit-the-deck-ja"],[20,"citizen-fat-knocked-front-ja"],[21,"citizen-fat-knocked-front-land-ja"],[22,"citizen-fat-knocked-back-ja"],[23,"citizen-fat-knocked-back-land-ja"],[24,"citizen-fat-get-up-from-front-ja"],[25,"citizen-fat-get-up-from-back-ja"],[26,"citizen-fat-blue-hit-front-ja"],[27,"citizen-fat-blue-hit-back-ja"],[28,"citizen-fat-cover-head-start-ja"]],"citizen-norm-ag":[[34,"citizen-norm-knocked-from-bike-ja"],[33,"citizen-norm-knocked-from-car-ja"],[32,"citizen-norm-get-in-car-ja"],[31,"citizen-norm-car-stance-ja"],[30,"citizen-norm-bike-stance-ja"],[29,"citizen-norm-tread-water-ja"],[12,"citizen-norm-walk-ja"],[11,"citizen-norm-shuffle-ja"],[10,"citizen-norm-out-of-breath-ja"],[9,"citizen-norm-idle-to-out-of-breath-ja"],[8,"citizen-norm-arms-crossed-ja"],[7,"citizen-norm-idle-to-arms-crossed-ja"],[6,"citizen-norm-arms-hips-ja"],[5,"citizen-norm-idle-to-arms-hips-ja"],[4,"citizen-norm-idle-ja"],[3,"citizen-norm-shadow-mg"],[2,"citizen-norm-lod2-mg"],[1,"citizen-norm-lod0-mg"],[0,"citizen-norm-lod0-jg"],[13,"citizen-norm-walk2-ja"],[14,"citizen-norm-run-ja"],[15,"citizen-norm-panic-run-ja"],[16,"citizen-norm-dive-forward-ja"],[17,"citizen-norm-hit-the-deck-ja"],[18,"citizen-norm-knocked-front-ja"],[19,"citizen-norm-knocked-front-land-ja"],[20,"citizen-norm-knocked-back-ja"],[21,"citizen-norm-knocked-back-land-ja"],[22,"citizen-norm-get-up-from-front-ja"],[23,"citizen-norm-get-up-from-back-ja"],[24,"citizen-norm-blue-hit-ja"],[25,"citizen-norm-blue-hit-land-death-ja"],[26,"citizen-norm-cover-head-start-ja"],[27,"citizen-norm-cover-head-loop-ja"],[28,"citizen-norm-cover-head-end-ja"]],"citizen-norm-rider-ag":[[5,"citizen-norm-rider-car-stance-ja"],[4,"citizen-norm-rider-bike-stance-ja"],[3,"citizen-norm-rider-idle-ja"],[2,"citizen-norm-rider-lod2-mg"],[1,"citizen-norm-rider-lod0-mg"],[0,"citizen-norm-rider-lod0-jg"]],"city-flitter-ag":[[17,"city-flitter-blue-hit0-ja"],[16,"city-flitter-knocked-land-upright-ja"],[15,"city-flitter-knocked-land0-ja"],[14,"city-flitter-knocked0-ja"],[13,"city-flitter-die-in-place-ja"],[0,"city-flitter-lod0-jg"],[1,"city-flitter-lod0-mg"],[2,"city-flitter-lod1-mg"],[3,"city-flitter-shadow-mg"],[4,"city-flitter-idle-ja"],[5,"city-flitter-ambush-jump-ja"],[6,"city-flitter-ambush-land-ja"],[7,"city-flitter-walk-ja"],[8,"city-flitter-move-ja"],[9,"city-flitter-turn-ja"],[10,"city-flitter-attack-ja"],[11,"city-flitter-attack-high-ja"],[12,"city-flitter-die-falling-ja"]],"city-grunt-ag":[[15,"city-grunt-ragdoll-ja"],[14,"city-grunt-getup-back-ja"],[13,"city-grunt-getup-front-ja"],[0,"city-grunt-lod0-jg"],[1,"city-grunt-lod0-mg"],[2,"city-grunt-lod1-mg"],[3,"city-grunt-shadow-mg"],[4,"city-grunt-idle-ja"],[5,"city-grunt-patrol1-ja"],[6,"city-grunt-notice-ja"],[7,"city-grunt-charge0-ja"],[8,"city-grunt-attack0-ja"],[9,"city-grunt-bite-ja"],[10,"city-grunt-jump-wind-up-ja"],[11,"city-grunt-jump-in-air-ja"],[12,"city-grunt-jump-land-ja"]],"collectables-ag":[[27,"collectables-warp-time-end-ja"],[26,"collectables-warp-time-idle-ja"],[25,"collectables-warp-time-lod0-mg"],[24,"collectables-warp-time-lod0-jg"],[23,"collectables-skill-idle-ja"],[22,"collectables-skill-shadow-mg"],[21,"collectables-skill-lod2-mg"],[20,"collectables-skill-lod1-mg"],[19,"collectables-skill-lod0-mg"],[18,"collectables-skill-lod0-jg"],[17,"collectables-generic-ripples-cycle-ja"],[16,"collectables-generic-ripples-idle-ja"],[15,"collectables-generic-ripples-lod0-mg"],[14,"collectables-generic-ripples-lod0-jg"],[13,"collectables-generic-blast-fade-ja"],[0,"collectables-bomb-blast-lod0-jg"],[1,"collectables-bomb-blast-lod0-mg"],[2,"collectables-bomb-blast-idle-ja"],[3,"collectables-health-lod0-jg"],[4,"collectables-health-lod0-mg"],[5,"collectables-health-idle-ja"],[6,"collectables-gem-lod0-jg"],[7,"collectables-gem-lod0-mg"],[8,"collectables-gem-lod1-mg"],[9,"collectables-gem-idle-ja"],[10,"collectables-generic-blast-lod0-jg"],[11,"collectables-generic-blast-lod0-mg"],[12,"collectables-generic-blast-idle-ja"]],"com-airlock-inner-ag":[[2,"com-airlock-inner-idle-ja"],[1,"com-airlock-inner-lod0-mg"],[0,"com-airlock-inner-lod0-jg"]],"com-airlock-outer-ag":[[2,"com-airlock-outer-idle-ja"],[1,"com-airlock-outer-lod0-mg"],[0,"com-airlock-outer-lod0-jg"]],"com-airlock-outer-mhcity-ag":[[2,"com-airlock-outer-mhcity-idle-ja"],[1,"com-airlock-outer-mhcity-lod0-mg"],[0,"com-airlock-outer-mhcity-lod0-jg"]],"com-power-box-ag":[[10,"com-power-box-debris-tubes-lod0-mg"],[9,"com-power-box-debris-tubes-lod0-jg"],[8,"com-power-box-debris-paneltop-lod0-mg"],[7,"com-power-box-debris-paneltop-lod0-jg"],[6,"com-power-box-debris-panelwires-lod0-mg"],[5,"com-power-box-debris-panelwires-lod0-jg"],[4,"com-power-box-debris-piece-lod0-mg"],[3,"com-power-box-debris-piece-lod0-jg"],[2,"com-power-box-idle-ja"],[1,"com-power-box-lod0-mg"],[0,"com-power-box-lod0-jg"]],"com-rod-of-god-ag":[[2,"com-rod-of-god-idle-ja"],[1,"com-rod-of-god-lod0-mg"],[0,"com-rod-of-god-lod0-jg"]],"comb-energy-ring-ag":[[3,"comb-energy-ring-idle-ja"],[2,"comb-energy-ring-lod1-mg"],[1,"comb-energy-ring-lod0-mg"],[0,"comb-energy-ring-lod0-jg"]],"comb-obstacle-ag":[[6,"comb-obstacle-explode-idle-ja"],[5,"comb-obstacle-explode-lod0-mg"],[4,"comb-obstacle-explode-lod0-jg"],[3,"comb-obstacle-idle-ja"],[2,"comb-obstacle-lod1-mg"],[1,"comb-obstacle-lod0-mg"],[0,"comb-obstacle-lod0-jg"]],"comb-pillar-ag":[[7,"comb-pillar-explode-idle-ja"],[6,"comb-pillar-explode-lod0-mg"],[5,"comb-pillar-explode-lod0-jg"],[4,"comb-pillar-idle-ja"],[3,"comb-pillar-lod2-mg"],[2,"comb-pillar-lod1-mg"],[1,"comb-pillar-lod0-mg"],[0,"comb-pillar-lod0-jg"]],"comb-rail-rider-ag":[[3,"comb-rail-rider-idle-ja"],[2,"comb-rail-rider-shadow-mg"],[1,"comb-rail-rider-lod0-mg"],[0,"comb-rail-rider-lod0-jg"]],"comb-sentinel-ag":[[5,"comb-sentinel-explode-idle-ja"],[4,"comb-sentinel-explode-lod0-mg"],[3,"comb-sentinel-explode-lod0-jg"],[2,"comb-sentinel-idle-ja"],[1,"comb-sentinel-lod0-mg"],[0,"comb-sentinel-lod0-jg"]],"crate-ag":[[3,"crate-idle-ja"],[2,"crate-krimson-lod1-mg"],[1,"crate-krimson-lod0-mg"],[0,"crate-krimson-lod0-jg"]],"crimson-guard-ag":[[55,"crimson-guard-shield-sidle-ja"],[54,"crimson-guard-shield-advance-ja"],[53,"crimson-guard-shield-flinch-ja"],[52,"crimson-guard-shield-hit-knock-ja"],[51,"crimson-guard-shield-shuffle-ja"],[50,"crimson-guard-shield-walk-ja"],[49,"crimson-guard-shield-fire-loop-ja"],[48,"crimson-guard-shield-fire-ja"],[47,"crimson-guard-shield-idle-ja"],[46,"crimson-guard-shield-pull-out-ja"],[45,"crimson-guard-cock-gun-ja"],[44,"crimson-guard-grenade-reload-ja"],[43,"crimson-guard-knocked-from-bike-ja"],[42,"crimson-guard-knocked-from-car-ja"],[41,"crimson-guard-jump-left-ja"],[40,"crimson-guard-jump-right-ja"],[39,"crimson-guard-die-falling-ja"],[38,"crimson-guard-jump-high-ja"],[37,"crimson-guard-grenade-attack-ja"],[36,"crimson-guard-car-stance-ja"],[35,"crimson-guard-bike-stance-ja"],[34,"crimson-guard-get-up-back-ja"],[33,"crimson-guard-get-up-front-ja"],[32,"crimson-guard-knocked-back-land-ja"],[31,"crimson-guard-knocked-back-ja"],[30,"crimson-guard-attack-shoot-knee-end-ja"],[29,"crimson-guard-attack-shoot-knee-ja"],[12,"crimson-guard-blue-hit-land-death-ja"],[11,"crimson-guard-blue-hit-land-ja"],[10,"crimson-guard-blue-hit-ja"],[9,"crimson-guard-knocked-land-ja"],[8,"crimson-guard-knocked-ja"],[7,"crimson-guard-notice-ja"],[6,"crimson-guard-run-ja"],[5,"crimson-guard-walk-ja"],[4,"crimson-guard-idle-ja"],[3,"crimson-guard-shadow-mg"],[2,"crimson-guard-lod2-mg"],[1,"crimson-guard-lod0-mg"],[0,"crimson-guard-lod0-jg"],[13,"crimson-guard-yellow-hit0-ja"],[14,"crimson-guard-yellow-hit0-land-ja"],[15,"crimson-guard-yellow-hit1-ja"],[16,"crimson-guard-yellow-hit1-land-ja"],[17,"crimson-guard-die-ja"],[18,"crimson-guard-rifle-butt-ja"],[19,"crimson-guard-idle-to-stab-idle-ja"],[20,"crimson-guard-stab-idle-loop-ja"],[21,"crimson-guard-stab-idle-to-attack-ja"],[22,"crimson-guard-stab-attack-ja"],[23,"crimson-guard-stab-attack-to-stab-idle-ja"],[24,"crimson-guard-stab-idle-to-idle-ja"],[25,"crimson-guard-stab-shuffle-ja"],[26,"crimson-guard-gun-attack-ja"],[27,"crimson-guard-attack-shoot-knee-start-ja"],[28,"crimson-guard-attack-shoot-knee-loop-ja"]],"crimson-guard-highres-ag":[[3,"crimson-guard-highres-idle-ja"],[2,"crimson-guard-highres-shadow-mg"],[1,"crimson-guard-highres-lod0-mg"],[0,"crimson-guard-highres-lod0-jg"]],"crocadog-highres-ag":[[2,"crocadog-highres-idle-ja"],[1,"crocadog-highres-lod0-mg"],[0,"crocadog-highres-lod0-jg"]],"cty-dax-missile-ag":[[3,"cty-dax-missile-idle-ja"],[2,"cty-dax-missile-lod1-mg"],[1,"cty-dax-missile-lod0-mg"],[0,"cty-dax-missile-lod0-jg"]],"cty-dax-missile-launcher-ag":[[4,"cty-dax-missile-launcher-rise-ja"],[3,"cty-dax-missile-launcher-idle-ja"],[2,"cty-dax-missile-launcher-lod1-mg"],[1,"cty-dax-missile-launcher-lod0-mg"],[0,"cty-dax-missile-launcher-lod0-jg"]],"cty-decoy-ag":[[7,"cty-decoy-explode-idle-ja"],[6,"cty-decoy-explode-lod0-mg"],[5,"cty-decoy-explode-lod0-jg"],[4,"cty-decoy-open-idle-ja"],[3,"cty-decoy-open-ja"],[2,"cty-decoy-idle-ja"],[1,"cty-decoy-lod0-mg"],[0,"cty-decoy-lod0-jg"]],"cty-door-ag":[[3,"cty-door-idle-ja"],[2,"cty-door-lod1-mg"],[1,"cty-door-lod0-mg"],[0,"cty-door-lod0-jg"]],"cty-elevator-ag":[[2,"cty-elevator-idle-ja"],[1,"cty-elevator-lod0-mg"],[0,"cty-elevator-lod0-jg"]],"cty-explode-barrel-ag":[[2,"cty-explode-barrel-idle-ja"],[1,"cty-explode-barrel-lod0-mg"],[0,"cty-explode-barrel-lod0-jg"]],"cty-fruit-stand-ag":[[2,"cty-fruit-stand-idle-ja"],[1,"cty-fruit-stand-lod0-mg"],[0,"cty-fruit-stand-lod0-jg"]],"cty-homing-missile-ag":[[2,"cty-homing-missile-idle-ja"],[1,"cty-homing-missile-lod0-mg"],[0,"cty-homing-missile-lod0-jg"]],"cty-missile-launcher-ag":[[4,"cty-missile-launcher-recoil-ja"],[3,"cty-missile-launcher-idle-ja"],[2,"cty-missile-launcher-lod1-mg"],[1,"cty-missile-launcher-lod0-mg"],[0,"cty-missile-launcher-lod0-jg"]],"cty-port-mine-ag":[[6,"cty-port-mine-explode-idle-ja"],[5,"cty-port-mine-explode-lod0-mg"],[4,"cty-port-mine-explode-lod0-jg"],[3,"cty-port-mine-idle-ja"],[2,"cty-port-mine-lod1-mg"],[1,"cty-port-mine-lod0-mg"],[0,"cty-port-mine-lod0-jg"]],"cty-remote-ag":[[2,"cty-remote-idle-ja"],[1,"cty-remote-lod0-mg"],[0,"cty-remote-lod0-jg"]],"cty-sniper-battery-ag":[[5,"cty-sniper-battery-explode-idle-ja"],[4,"cty-sniper-battery-explode-lod0-mg"],[3,"cty-sniper-battery-explode-lod0-jg"],[2,"cty-sniper-battery-idle-ja"],[1,"cty-sniper-battery-lod0-mg"],[0,"cty-sniper-battery-lod0-jg"]],"cty-sniper-button-ag":[[5,"cty-sniper-button-popup-ja"],[4,"cty-sniper-button-pushdown-ja"],[3,"cty-sniper-button-idle-ja"],[2,"cty-sniper-button-lod1-mg"],[1,"cty-sniper-button-lod0-mg"],[0,"cty-sniper-button-lod0-jg"]],"cty-sniper-button-top-ag":[[5,"cty-sniper-button-top-popup-ja"],[4,"cty-sniper-button-top-pushdown-ja"],[3,"cty-sniper-button-top-idle-ja"],[2,"cty-sniper-button-top-lod1-mg"],[1,"cty-sniper-button-top-lod0-mg"],[0,"cty-sniper-button-top-lod0-jg"]],"cty-sniper-core-ag":[[7,"cty-sniper-core-explode-idle-ja"],[6,"cty-sniper-core-explode-lod0-mg"],[5,"cty-sniper-core-explode-lod0-jg"],[4,"cty-sniper-core-retract-ja"],[3,"cty-sniper-core-open-ja"],[2,"cty-sniper-core-idle-ja"],[1,"cty-sniper-core-lod0-mg"],[0,"cty-sniper-core-lod0-jg"]],"cty-sniper-turret-ag":[[10,"cty-sniper-turret-explode-idle-ja"],[9,"cty-sniper-turret-explode-lod0-mg"],[8,"cty-sniper-turret-explode-lod0-jg"],[7,"cty-sniper-turret-collapse-ja"],[6,"cty-sniper-turret-deactivate-ja"],[5,"cty-sniper-turret-activate-ja"],[4,"cty-sniper-turret-barrelfire-ja"],[3,"cty-sniper-turret-idle-ja"],[2,"cty-sniper-turret-lod1-mg"],[1,"cty-sniper-turret-lod0-mg"],[0,"cty-sniper-turret-lod0-jg"]],"cty-sniper-turret-reticle-ag":[[4,"cty-sniper-turret-reticle-locked-ja"],[3,"cty-sniper-turret-reticle-idle-ja"],[2,"cty-sniper-turret-reticle-shadow-mg"],[1,"cty-sniper-turret-reticle-lod0-mg"],[0,"cty-sniper-turret-reticle-lod0-jg"]],"ctycrate-ag":[[6,"ctycrate-idle-ja"],[5,"ctycrate-metal-lod1-mg"],[4,"ctycrate-metal-lod0-mg"],[3,"ctycrate-metal-lod0-jg"],[2,"ctycrate-blue-lod1-mg"],[1,"ctycrate-blue-lod0-mg"],[0,"ctycrate-blue-lod0-jg"]],"ctyinda-evil-streetlamp-ag":[[2,"ctyinda-evil-streetlamp-idle-ja"],[1,"ctyinda-evil-streetlamp-lod0-mg"],[0,"ctyinda-evil-streetlamp-lod0-jg"]],"ctypal-base-break-ag":[[2,"ctypal-base-break-idle-ja"],[1,"ctypal-base-break-lod0-mg"],[0,"ctypal-base-break-lod0-jg"]],"ctypal-cable-break-ag":[[2,"ctypal-cable-break-idle-ja"],[1,"ctypal-cable-break-lod0-mg"],[0,"ctypal-cable-break-lod0-jg"]],"ctypal-ctyfarma-ag":[[2,"ctypal-ctyfarma-idle-ja"],[1,"ctypal-ctyfarma-lod0-mg"],[0,"ctypal-ctyfarma-lod0-jg"]],"ctypal-palace-break-ag":[[22,"ctypal-palace-break-e-idle-ja"],[21,"ctypal-palace-break-e-lod0-mg"],[20,"ctypal-palace-break-e-lod0-jg"],[18,"ctypal-palace-break-d-idle-ja"],[17,"ctypal-palace-break-d-lod0-mg"],[0,"ctypal-palace-break-lod0-jg"],[13,"ctypal-palace-break-c-lod0-mg"],[1,"ctypal-palace-break-lod0-mg"],[14,"ctypal-palace-break-c-idle-ja"],[2,"ctypal-palace-break-idle-ja"],[4,"ctypal-palace-break-a-lod0-jg"],[5,"ctypal-palace-break-a-lod0-mg"],[6,"ctypal-palace-break-a-idle-ja"],[8,"ctypal-palace-break-b-lod0-jg"],[9,"ctypal-palace-break-b-lod0-mg"],[10,"ctypal-palace-break-b-idle-ja"],[12,"ctypal-palace-break-c-lod0-jg"],[16,"ctypal-palace-break-d-lod0-jg"]],"ctypal-rail-ag":[[2,"ctypal-rail-idle-ja"],[1,"ctypal-rail-lod0-mg"],[0,"ctypal-rail-lod0-jg"]],"ctypal-support-break-ag":[[2,"ctypal-support-break-idle-ja"],[1,"ctypal-support-break-lod0-mg"],[0,"ctypal-support-break-lod0-jg"]],"ctyport-mine-ag":[[2,"ctyport-mine-idle-ja"],[1,"ctyport-mine-lod0-mg"],[0,"ctyport-mine-lod0-jg"]],"ctyslumc-flag-ag":[[2,"ctyslumc-flag-idle-ja"],[1,"ctyslumc-flag-lod0-mg"],[0,"ctyslumc-flag-lod0-jg"]],"ctywide-arrow-ag":[[2,"ctywide-arrow-idle-ja"],[1,"ctywide-arrow-lod0-mg"],[0,"ctywide-arrow-lod0-jg"]],"dark-eco-vent-ag":[[4,"dark-eco-vent-close-open-ja"],[3,"dark-eco-vent-lod2-mg"],[2,"dark-eco-vent-lod1-mg"],[1,"dark-eco-vent-lod0-mg"],[0,"dark-eco-vent-lod0-jg"]],"dark-maker-idol-ag":[[2,"dark-maker-idol-idle-ja"],[1,"dark-maker-idol-lod0-mg"],[0,"dark-maker-idol-lod0-jg"]],"dark-maker-idol-break-ag":[[2,"dark-maker-idol-break-idle-ja"],[1,"dark-maker-idol-break-lod0-mg"],[0,"dark-maker-idol-break-lod0-jg"]],"dark-maker-idol-fma-ag":[[2,"dark-maker-idol-fma-idle-ja"],[1,"dark-maker-idol-fma-lod0-mg"],[0,"dark-maker-idol-fma-lod0-jg"]],"darkjak-highres-ag":[[5,"darkjak-highres-idle-ja"],[4,"darkjak-highres-jakcfma0-scarf-cg"],[3,"darkjak-highres-jakcfma0-sash-cg"],[2,"darkjak-highres-jakcfma0-skirt-cg"],[1,"darkjak-highres-lod0-mg"],[0,"darkjak-highres-lod0-jg"]],"daxter-ag":[[349,"daxter-turret-for-fire-ja"],[348,"daxter-turret-for-stance-right-ja"],[347,"daxter-turret-for-stance-left-ja"],[346,"daxter-turret-for-get-on-ja"],[345,"daxter-turret-for-get-off-ja"],[344,"daxter-turret-for-stance-ja"],[343,"daxter-turret-get-on-ja"],[342,"daxter-turret-get-off-ja"],[341,"daxter-turret-stance-ja"],[119,"daxter-tube-jump-land-ja"],[118,"daxter-tube-turn-ja"],[91,"daxter-tentacle-attack-ja"],[146,"daxter-racer-death-explode-ja"],[145,"daxter-racer-get-on-ja"],[144,"daxter-racer-get-off-ja"],[143,"daxter-racer-smack-ja"],[142,"daxter-racer-jump-high-land-ja"],[141,"daxter-racer-jump-high-loop-ja"],[140,"daxter-racer-stance-ja"],[139,"daxter-racer-jump-small-land-ja"],[138,"daxter-racer-jump-small-loop-ja"],[137,"daxter-racer-jump-small-ja"],[136,"daxter-racer-jump-land-ja"],[135,"daxter-racer-jump-loop-ja"],[134,"daxter-racer-jump-ja"],[133,"daxter-racer-dig2-ja"],[132,"daxter-racer-dig-ja"],[131,"daxter-racer-turn2-ja"],[130,"daxter-racer-turn-ja"],[129,"daxter-racer-idle-ja"],[114,"daxter-pole-jump-loop-ja"],[113,"daxter-pole-flip-forward-ja"],[112,"daxter-pole-flip-up-ja"],[111,"daxter-pole-cycle2-ja"],[110,"daxter-pole-cycle-ja"],[328,"daxter-pilot-wcar-turn-back-ja"],[327,"daxter-pilot-wcar-turn-front-ja"],[324,"daxter-pilot-bike-smack-right-ja"],[323,"daxter-pilot-bike-smack-left-ja"],[306,"daxter-pilot-bike-get-off-ja"],[305,"daxter-pilot-bike-smack-shock-ja"],[304,"daxter-pilot-bike-up-down-ja"],[302,"daxter-pilot-bike-smack-back-ja"],[301,"daxter-pilot-bike-smack-front-ja"],[300,"daxter-pilot-bike-turn-back-ja"],[299,"daxter-pilot-bike-turn-front-ja"],[293,"daxter-pilot-car-turn-back-ja"],[292,"daxter-pilot-car-turn-front-ja"],[291,"daxter-pilot-bike-get-on-ja"],[322,"daxter-pilot-gun-dark-takeout-ja"],[321,"daxter-pilot-gun-blue-takeout-ja"],[320,"daxter-pilot-gun-yellow-takeout-ja"],[319,"daxter-pilot-gun-blue-blue-ja"],[318,"daxter-pilot-gun-yellow-blue-ja"],[317,"daxter-pilot-gun-red-blue-ja"],[316,"daxter-pilot-gun-red-yellow-ja"],[315,"daxter-pilot-gun-red-dark-ja"],[314,"daxter-pilot-gun-dark-fire-ja"],[313,"daxter-pilot-gun-yellow-fire-ja"],[312,"daxter-pilot-gun-red-fire-ja"],[311,"daxter-pilot-gun-blue-idle-ja"],[310,"daxter-pilot-gun-yellow-idle-ja"],[309,"daxter-pilot-gun-dark-idle-ja"],[308,"daxter-pilot-gun-red-idle-ja"],[297,"daxter-pilot-gun-blue-fire-single-ja"],[296,"daxter-pilot-gun-blue-fire-ja"],[288,"daxter-pilot-gun-red-takeout-ja"],[330,"daxter-pilot-glider-turn-back-ja"],[329,"daxter-pilot-glider-turn-front-ja"],[326,"daxter-pilot-car-smack-right-ja"],[325,"daxter-pilot-car-smack-left-ja"],[307,"daxter-pilot-eject-loop-ja"],[303,"daxter-pilot-car-up-down-ja"],[298,"daxter-pilot-car-smack-shock-ja"],[295,"daxter-pilot-car-smack-back-ja"],[294,"daxter-pilot-car-smack-front-ja"],[290,"daxter-pilot-car-get-on-ja"],[289,"daxter-pilot-car-get-off-ja"],[540,"daxter-pidax-car-crash-right-ja"],[539,"daxter-pidax-car-crash-left-ja"],[538,"daxter-pidax-car-crash-back-ja"],[537,"daxter-pidax-car-crash-front-ja"],[536,"daxter-pidax-car-up-down-ja"],[535,"daxter-pidax-car-turn-back-ja"],[534,"daxter-pidax-car-turn-front-ja"],[191,"daxter-board-attack-pegasus-ja"],[374,"daxter-flut-kanga-catch-ja"],[533,"daxter-indax-hang-dummy9-ja"],[532,"daxter-indax-hang-dummy8-ja"],[531,"daxter-indax-hang-dummy7-ja"],[530,"daxter-indax-hang-dummy6-ja"],[529,"daxter-indax-hang-dummy5-ja"],[528,"daxter-indax-hang-get-on-ja"],[527,"daxter-indax-hang-walk-to-stance-ja"],[526,"daxter-indax-hang-attack-ja"],[525,"daxter-indax-hang-dodge-off-ja"],[524,"daxter-indax-hang-dodge-loop-ja"],[523,"daxter-indax-hang-dodge-on-ja"],[522,"daxter-indax-hang-turn-around-ja"],[521,"daxter-indax-hang-walk-start-ja"],[520,"daxter-indax-hang-walk-ja"],[519,"daxter-indax-hang-stance-ja"],[518,"daxter-indax-dummy7-ja"],[517,"daxter-indax-dummy6-ja"],[516,"daxter-indax-dummy5-ja"],[515,"daxter-indax-dummy4-ja"],[514,"daxter-indax-dummy3-ja"],[513,"daxter-indax-dummy2-ja"],[512,"daxter-indax-dummy1-ja"],[511,"daxter-indax-dummy0-ja"],[510,"daxter-indax-run-right-ja"],[509,"daxter-indax-run-left-ja"],[508,"daxter-indax-run-down-ja"],[507,"daxter-indax-run-up-ja"],[506,"daxter-indax-tube-jump-land-ja"],[505,"daxter-indax-tube-turn-ja"],[504,"daxter-indax-death-shock-ja"],[503,"daxter-indax-death-freeze-ja"],[502,"daxter-indax-trip-land-ja"],[501,"daxter-indax-trip-ja"],[500,"daxter-indax-running-attack-end-ja"],[499,"daxter-indax-run-squash-hands-ja"],[498,"daxter-indax-jump-forward-hands-land-ja"],[497,"daxter-indax-jump-forward-hands-loop-ja"],[496,"daxter-indax-jump-forward-hands-ja"],[495,"daxter-indax-running-attack-ja"],[494,"daxter-indax-death-eaten-ja"],[493,"daxter-indax-death-kill-ja"],[492,"daxter-indax-death-fall-ja"],[491,"daxter-indax-death-squashed-ja"],[490,"daxter-indax-hit-roll-ja"],[489,"daxter-indax-hit-back-ja"],[488,"daxter-indax-hit-front-ja"],[487,"daxter-indax-run-to-stance-ja"],[486,"daxter-indax-attack-spin-air-ja"],[485,"daxter-indax-run-squash-ja"],[484,"daxter-indax-jump-forward-land-ja"],[483,"daxter-indax-jump-forward-loop-ja"],[482,"daxter-indax-jump-forward-ja"],[481,"daxter-indax-run-look-back-ja"],[480,"daxter-indax-attack-spin-end-ja"],[479,"daxter-indax-attack-spin-ja"],[478,"daxter-indax-jump-land-ja"],[477,"daxter-indax-jump-loop-ja"],[476,"daxter-indax-jump-ja"],[475,"daxter-indax-run-ja"],[474,"daxter-indax-walk-ja"],[473,"daxter-indax-stance-ja"],[117,"daxter-ice-stance-ja"],[116,"daxter-ice-slide-ja"],[115,"daxter-ice-skate-ja"],[376,"daxter-flut-death-drown-ja"],[375,"daxter-flut-deathb-ja"],[373,"daxter-flut-run-squash-ja"],[372,"daxter-flut-deatha-ja"],[371,"daxter-flut-smack-surface-end-ja"],[370,"daxter-flut-smack-surface-ja"],[369,"daxter-flut-hit-back-end-ja"],[368,"daxter-flut-hit-back-ja"],[367,"daxter-flut-get-off-ja"],[366,"daxter-flut-get-on-ja"],[365,"daxter-flut-air-attack-land-ja"],[364,"daxter-flut-air-attack-loop-ja"],[363,"daxter-flut-air-attack-ja"],[362,"daxter-flut-running-attack-end-ja"],[361,"daxter-flut-running-attack-ja"],[360,"daxter-flut-double-jump-ja"],[359,"daxter-flut-jump-forward-land-ja"],[358,"daxter-flut-jump-forward-loop-ja"],[357,"daxter-flut-jump-forward-ja"],[356,"daxter-flut-jump-land-ja"],[355,"daxter-flut-jump-loop-ja"],[354,"daxter-flut-jump-ja"],[353,"daxter-flut-run-ja"],[352,"daxter-flut-jog-ja"],[351,"daxter-flut-walk-ja"],[398,"daxter-fldax-death-cactus-ja"],[397,"daxter-fldax-finish-ja"],[396,"daxter-fldax-run-squash-ja"],[395,"daxter-fldax-walk-ja"],[394,"daxter-fldax-wild-run-right-ja"],[393,"daxter-fldax-wild-run-left-ja"],[392,"daxter-fldax-get-off-ja"],[391,"daxter-fldax-idle-ja"],[390,"daxter-fldax-get-on-ja"],[389,"daxter-fldax-jump-forward-loop-ja"],[388,"daxter-fldax-jump-forward-ja"],[387,"daxter-fldax-deatha-ja"],[386,"daxter-fldax-smack-surface-end-ja"],[385,"daxter-fldax-smack-surface-ja"],[384,"daxter-fldax-wild-run-ja"],[334,"daxter-pilot-wcar-snake-jump-ja"],[333,"daxter-pilot-wcar-snake-out-ja"],[332,"daxter-pilot-wcar-snake-loop-ja"],[331,"daxter-pilot-wcar-snake-in-ja"],[285,"daxter-gun-side-to-side-hop-2-ja"],[272,"daxter-gun-duck-walk-ja"],[266,"daxter-gun-yellow-fire-twirl-ja"],[265,"daxter-gun-red-from-sideways-ja"],[264,"daxter-gun-stance-red-sideways-ja"],[263,"daxter-gun-dark-fire-twirl-ja"],[262,"daxter-gun-red-fire-from-sideways-ja"],[261,"daxter-gun-red-fire-to-sideways-ja"],[90,"daxter-death-lava-ja"],[89,"daxter-invisible-to-stance-ja"],[88,"daxter-invisible-loop-ja"],[87,"daxter-stance-to-invisible-ja"],[86,"daxter-blast-recover-end-ja"],[85,"daxter-blast-recover-loop-ja"],[84,"daxter-blast-recover-ja"],[83,"daxter-wall-hide-body-ja"],[82,"daxter-wall-hide-head-right-ja"],[81,"daxter-wall-hide-head-left-ja"],[80,"daxter-wall-hide-head-ja"],[79,"daxter-wall-hide-scared-return-ja"],[78,"daxter-wall-hide-scared-loop-ja"],[77,"daxter-wall-hide-scared-ja"],[76,"daxter-wall-hide-ja"],[73,"daxter-powerup-ja"],[47,"daxter-attack-punch-alt-end-ja"],[41,"daxter-attack-from-stance-run-alt-end-ja"],[39,"daxter-attack-from-stance-alt-end-ja"],[15,"daxter-stance-to-duck-ja"],[467,"daxter-lightjak-shield-end-ja"],[466,"daxter-lightjak-heal-end-ja"],[465,"daxter-lightjak-heal-loop-ja"],[464,"daxter-lightjak-heal-ja"],[462,"daxter-lightjak-freeze-land-ja"],[461,"daxter-lightjak-freeze-ja"],[460,"daxter-lightjak-shield-ja"],[459,"daxter-lightjak-swoop-land-ja"],[458,"daxter-lightjak-swoop-fall-loop-ja"],[457,"daxter-lightjak-swoop-fall-ja"],[456,"daxter-lightjak-swoop2-ja"],[455,"daxter-lightjak-swoop1-ja"],[454,"daxter-lightjak-stance-ja"],[448,"daxter-lightjak-stance-to-stance-ja"],[447,"daxter-lightjak-get-on-out-ja"],[445,"daxter-lightjak-get-on-land-ja"],[213,"daxter-board-spin-ccw-ja"],[212,"daxter-board-spin-cw-ja"],[204,"daxter-board-kickspin-c-ja"],[203,"daxter-board-kickspin-b-ja"],[202,"daxter-board-airwalk-end-ja"],[201,"daxter-board-airwalk-loop-ja"],[200,"daxter-board-airwalk-ja"],[199,"daxter-board-backgrab-end-ja"],[198,"daxter-board-backgrab-loop-ja"],[197,"daxter-board-backgrab-ja"],[196,"daxter-board-method-cross-end-ja"],[195,"daxter-board-method-cross-loop-ja"],[194,"daxter-board-method-cross-ja"],[193,"daxter-board-kickspin-a-ja"],[192,"daxter-board-jump-high-ja"],[189,"daxter-board-kickflip-c-ja"],[188,"daxter-board-kickflip-b-ja"],[184,"daxter-board-jump-kickoff-ja"],[183,"daxter-board-noseflip-ja"],[287,"daxter-gun-attack-butt-end-alt1-ja"],[571,"daxter-ladder-jump-ja"],[30,"daxter-edge-grab-stance1-ja"],[154,"daxter-board-hit-ja"],[281,"daxter-gun-yellow-fire-3-ja"],[280,"daxter-gun-red-fire-2-ja"],[564,"daxter-ladder-stance-ja"],[23,"daxter-jump-loop-ja"],[271,"daxter-gun-front-jump-land-ja"],[14,"daxter-run-squash-weak-ja"],[270,"daxter-gun-front-jump-ja"],[13,"daxter-run-squash-ja"],[269,"daxter-gun-front-run-ja"],[253,"daxter-gun-duck-roll-end-ja"],[252,"daxter-gun-duck-roll-ja"],[251,"daxter-gun-edge-grab-to-jump-ja"],[250,"daxter-gun-edge-grab-off-ja"],[249,"daxter-gun-attack-upperbutt-blue-ja"],[248,"daxter-gun-jump-land-side-ja"],[247,"daxter-gun-jump-land-ja"],[246,"daxter-gun-attack-butt-blue-end-ja"],[245,"daxter-gun-attack-butt-blue-ja"],[244,"daxter-gun-attack-butt-end-ja"],[243,"daxter-gun-attack-butt-ja"],[242,"daxter-gun-blue-to-front-hop-ja"],[241,"daxter-gun-front-to-blue-hop-ja"],[240,"daxter-gun-front-to-side-hop-ja"],[239,"daxter-gun-transformation-twirl-ja"],[238,"daxter-gun-side-to-front-hop-ja"],[237,"daxter-gun-attack-upperbutt-ja"],[236,"daxter-gun-blue-takeout-ja"],[235,"daxter-gun-yellow-takeout-ja"],[234,"daxter-gun-dark-takeout-ja"],[233,"daxter-gun-red-takeout-ja"],[232,"daxter-gun-run-blue-ja"],[231,"daxter-gun-walk-side-ja"],[230,"daxter-gun-yellow-fire-ja"],[229,"daxter-gun-dark-fire-ja"],[228,"daxter-gun-blue-fire-single-ja"],[227,"daxter-gun-blue-fire-ja"],[226,"daxter-gun-red-fire-ja"],[225,"daxter-gun-stance-blue-ja"],[224,"daxter-gun-stance-yellow-ja"],[222,"daxter-gun-blue-to-yellow-ja"],[221,"daxter-gun-attack-from-stance-blue-end-ja"],[220,"daxter-gun-attack-from-stance-blue-ja"],[219,"daxter-gun-attack-from-stance-end-ja"],[218,"daxter-gun-attack-from-stance-ja"],[217,"daxter-gun-yellow-highlow-ja"],[216,"daxter-gun-yellow-fire-low-ja"],[215,"daxter-gun-stance-yellow-low-ja"],[472,"daxter-lightjak-dummy25-ja"],[282,"daxter-gun-blue-fire-2-ja"],[566,"daxter-ladder-down-ja"],[25,"daxter-jump-forward-ja"],[569,"daxter-ladder-slide-loop-ja"],[28,"daxter-launch-jump-loop-ja"],[152,"daxter-board-jump-loop-ja"],[409,"daxter-darkjak-hit-ja"],[279,"daxter-gun-red-fire-fast-ja"],[151,"daxter-board-jump-ja"],[149,"daxter-board-turn-ja"],[148,"daxter-board-duck-turn-ja"],[275,"daxter-gun-side-jump-land-ja"],[562,"daxter-ladder-up-ja"],[21,"daxter-painful-land-ja"],[278,"daxter-gun-red-reload-ja"],[147,"daxter-board-stance-ja"],[274,"daxter-gun-side-jump-ja"],[277,"daxter-gun-wall-hide-loop-ja"],[273,"daxter-gun-walk-blue-ja"],[560,"daxter-ladder-get-on-ja"],[19,"daxter-jump-ja"],[276,"daxter-gun-wall-hide-ja"],[268,"daxter-gun-front-walk-ja"],[267,"daxter-gun-hit-elec-ja"],[283,"daxter-gun-blue-stance-2-ja"],[570,"daxter-ladder-slide-stop-ja"],[29,"daxter-edge-grab-stance0-ja"],[286,"daxter-gun-attack-from-stance-end-alt1-ja"],[254,"daxter-gun-roll-flip-ja"],[541,"daxter-pidax-missile-turn-front-ja"],[0,"daxter-lod0-jg"],[257,"daxter-gun-flop-down-loop-ja"],[59,"daxter-roll-flip-land-ja"],[284,"daxter-gun-side-to-side-hop-1-ja"],[568,"daxter-ladder-slide-start-ja"],[27,"daxter-launch-jump-ja"],[255,"daxter-gun-roll-flip-land-ja"],[542,"daxter-pidax-missile-turn-back-ja"],[1,"daxter-lod0-mg"],[258,"daxter-gun-flop-down-land-ja"],[60,"daxter-trip-ja"],[256,"daxter-gun-flop-down-ja"],[543,"daxter-pidax-missile-jump-ja"],[2,"daxter-shadow-mg"],[259,"daxter-gun-hit-from-front-ja"],[61,"daxter-hit-elec-ja"],[573,"daxter-ladder-jump-on-ja"],[32,"daxter-falling-to-edge-grab-ja"],[544,"daxter-pidax-missile-jump-loop-ja"],[3,"daxter-run-to-stance-ja"],[260,"daxter-gun-hit-from-back-ja"],[62,"daxter-hit-from-front-ja"],[545,"daxter-pidax-missile-get-off-prep-ja"],[4,"daxter-run-to-stance-loop-ja"],[63,"daxter-hit-from-back-ja"],[546,"daxter-pidax-missile-up-down-ja"],[5,"daxter-stance-loop-ja"],[64,"daxter-hit-up-ja"],[35,"daxter-edge-grab-to-jump-ja"],[547,"daxter-pidax-missile-crash-left-ja"],[6,"daxter-run-to-stance-fast-ja"],[65,"daxter-deatha-ja"],[36,"daxter-edge-grab-off-ja"],[548,"daxter-pidax-missile-crash-right-ja"],[7,"daxter-run-ja"],[66,"daxter-death-painful-land-ja"],[37,"daxter-attack-from-stance-ja"],[10,"daxter-walk-ja"],[551,"daxter-jak-death-3-ja"],[214,"daxter-gun-stance-ja"],[471,"daxter-lightjak-dummy24-ja"],[549,"daxter-jak-death-1-ja"],[8,"daxter-run-up-ja"],[67,"daxter-smack-surface-ja"],[550,"daxter-jak-death-2-ja"],[9,"daxter-run-down-ja"],[68,"daxter-smack-surface-end-ja"],[69,"daxter-shocked-ja"],[38,"daxter-attack-from-stance-end-ja"],[11,"daxter-walk-up-ja"],[552,"daxter-jak-death-4-ja"],[40,"daxter-attack-from-stance-run-end-ja"],[42,"daxter-attack-from-jump-ja"],[43,"daxter-attack-from-jump-loop-ja"],[16,"daxter-duck-stance-ja"],[557,"daxter-dummy-57-ja"],[44,"daxter-attack-from-jump-end-ja"],[17,"daxter-duck-walk-ja"],[558,"daxter-dummy-58-ja"],[45,"daxter-attack-punch-ja"],[18,"daxter-turn-around-ja"],[559,"daxter-dummy-59-ja"],[46,"daxter-attack-punch-end-ja"],[48,"daxter-attack-uppercut-ja"],[49,"daxter-flop-down-ja"],[22,"daxter-painful-land-end-ja"],[563,"daxter-ladder-up-to-stance-ja"],[50,"daxter-flop-down-loop-ja"],[51,"daxter-flop-down-land-ja"],[24,"daxter-jump-short-land-ja"],[565,"daxter-ladder-stance-to-down-ja"],[52,"daxter-moving-flop-down-ja"],[53,"daxter-moving-flop-down-loop-ja"],[26,"daxter-duck-high-jump-ja"],[567,"daxter-ladder-get-off-ja"],[55,"daxter-flop-jump-ja"],[223,"daxter-gun-stance-dark-ja"],[350,"daxter-flut-idle-ja"],[93,"daxter-dummy56-ja"],[56,"daxter-duck-roll-ja"],[57,"daxter-duck-roll-end-ja"],[58,"daxter-roll-flip-ja"],[157,"daxter-board-turn-left-ja"],[158,"daxter-board-turn-right-ja"],[159,"daxter-board-turn-up-ja"],[160,"daxter-board-turn-down-ja"],[161,"daxter-board-hit-forward-ja"],[418,"daxter-darkjak-attack-combo3-ja"],[166,"daxter-board-get-on-ja"],[167,"daxter-board-get-off-ja"],[424,"daxter-darkjak-get-on-fast-ja"],[173,"daxter-board-air-turn-ja"],[185,"daxter-board-hit-elec-ja"],[442,"daxter-powerjak-get-on-loop-ja"],[186,"daxter-board-get-on-land-ja"],[443,"daxter-lightjak-get-on-ja"],[187,"daxter-board-get-off-pre-ja"],[444,"daxter-lightjak-get-off-ja"],[190,"daxter-board-hit-get-off-ja"],[420,"daxter-darkjak-get-off-ja"],[163,"daxter-board-ride-turn-front-ja"],[427,"daxter-darkjak-get-off-end-ja"],[170,"daxter-board-method-ja"],[434,"daxter-darkjak-get-on-fast-loop-ja"],[177,"daxter-board-flip-forward-loop-ja"],[441,"daxter-powerjak-get-on-ja"],[446,"daxter-lightjak-get-on-loop-ja"],[97,"daxter-wade-shallow-walk-ja"],[98,"daxter-wade-deep-walk-ja"],[99,"daxter-swim-stance-ja"],[100,"daxter-swim-walk-ja"],[101,"daxter-swim-walk-to-down-ja"],[102,"daxter-swim-down-ja"],[103,"daxter-swim-down-to-up-ja"],[104,"daxter-swim-up-ja"],[105,"daxter-swim-up-to-stance-ja"],[106,"daxter-swim-jump-ja"],[107,"daxter-death-swim-ja"],[108,"daxter-death-swim-loop-ja"],[109,"daxter-death-swim-end-ja"],[402,"daxter-darkjak-get-on-ja"],[12,"daxter-walk-down-ja"],[553,"daxter-jak-death-5-ja"],[572,"daxter-ladder-fall-ja"],[31,"daxter-edge-grab-stance1-alt-ja"],[574,"daxter-ladder-switch-ja"],[33,"daxter-edge-grab-swing-left-ja"],[34,"daxter-edge-grab-swing-right-ja"],[54,"daxter-moving-flop-down-land-ja"],[70,"daxter-yellow-running-blast-ja"],[71,"daxter-yellow-running-blast-end-ja"],[72,"daxter-yellow-jumping-blast-ja"],[74,"daxter-slide-right-ja"],[75,"daxter-slide-left-ja"],[92,"daxter-dummy55-ja"],[94,"daxter-dummy57-ja"],[95,"daxter-dummy58-ja"],[96,"daxter-dummy59-ja"],[120,"daxter-tube-dummy2-ja"],[377,"daxter-flut-dummy2-ja"],[121,"daxter-tube-dummy3-ja"],[378,"daxter-flut-dummy3-ja"],[122,"daxter-tube-dummy4-ja"],[379,"daxter-flut-dummy4-ja"],[123,"daxter-tube-dummy5-ja"],[380,"daxter-flut-dummy5-ja"],[124,"daxter-tube-dummy6-ja"],[381,"daxter-flut-dummy6-ja"],[156,"daxter-board-flip-forward-land-ja"],[175,"daxter-board-flip-backward-land-ja"],[176,"daxter-board-kickflip-land-ja"],[205,"daxter-board-dummy3-ja"],[206,"daxter-board-dummy4-ja"],[463,"daxter-lightjak-dummy26-ja"],[207,"daxter-board-dummy5-ja"],[208,"daxter-board-dummy6-ja"],[209,"daxter-board-dummy7-ja"],[210,"daxter-board-dummy8-ja"],[211,"daxter-board-dummy9-ja"],[468,"daxter-lightjak-dummy21-ja"],[335,"daxter-pilot-gun-dummy0-ja"],[336,"daxter-pilot-gun-dummy1-ja"],[337,"daxter-pilot-gun-dummy2-ja"],[338,"daxter-pilot-gun-dummy3-ja"],[339,"daxter-pilot-gun-dummy4-ja"],[340,"daxter-pilot-gun-dummy5-ja"],[382,"daxter-flut-dummy7-ja"],[383,"daxter-flut-dummy8-ja"],[399,"daxter-fldax-dummy6-ja"],[400,"daxter-fldax-dummy7-ja"],[401,"daxter-fldax-dummy8-ja"],[410,"daxter-darkjak-hit-land-ja"],[153,"daxter-board-turn-around-ja"],[419,"daxter-darkjak-attack-combo3-end-ja"],[162,"daxter-board-ride-turn-back-ja"],[449,"daxter-lightjak-dummy10-ja"],[450,"daxter-lightjak-dummy11-ja"],[451,"daxter-lightjak-dummy12-ja"],[452,"daxter-lightjak-dummy13-ja"],[453,"daxter-lightjak-dummy14-ja"],[469,"daxter-lightjak-dummy22-ja"],[470,"daxter-lightjak-dummy23-ja"],[20,"daxter-jump-land-ja"],[561,"daxter-ladder-stance-to-up-ja"],[150,"daxter-board-jump-kick-ja"],[155,"daxter-board-flip-forward-ja"],[164,"daxter-board-ride-turn-right-ja"],[165,"daxter-board-ride-turn-left-ja"],[168,"daxter-board-grenade-ja"],[169,"daxter-board-nosegrab-ja"],[171,"daxter-board-kickflip-a-ja"],[172,"daxter-board-spin-ja"],[174,"daxter-board-flip-backward-ja"],[178,"daxter-board-flip-backward-loop-ja"],[179,"daxter-board-method-loop-ja"],[180,"daxter-board-method-end-ja"],[181,"daxter-board-nosegrab-loop-ja"],[182,"daxter-board-nosegrab-end-ja"]],"daxter-highres-ag":[[3,"daxter-highres-daxter-walk-ja"],[2,"daxter-highres-shadow-mg"],[1,"daxter-highres-lod0-mg"],[0,"daxter-highres-lod0-jg"]],"daxter-pac-man-ag":[[9,"daxter-pac-man-eat-ja"],[8,"daxter-pac-man-zip-up-ja"],[7,"daxter-pac-man-zip-down-ja"],[6,"daxter-pac-man-death-2-ja"],[5,"daxter-pac-man-death-1-ja"],[4,"daxter-pac-man-victory-ja"],[3,"daxter-pac-man-idle-fast-ja"],[2,"daxter-pac-man-idle-ja"],[1,"daxter-pac-man-lod0-mg"],[0,"daxter-pac-man-lod0-jg"]],"des-beast-ag":[[16,"des-beast-death1-ja"],[15,"des-beast-death0-ja"],[14,"des-beast-run-limp0-ja"],[13,"des-beast-down-hits0-jitter-ja"],[0,"des-beast-lod0-jg"],[1,"des-beast-lod0-mg"],[2,"des-beast-shadow-mg"],[3,"des-beast-idle-ja"],[4,"des-beast-jog0-ja"],[5,"des-beast-run1-ja"],[6,"des-beast-run-attack-ja"],[7,"des-beast-turn180-ja"],[8,"des-beast-fall-forward-ja"],[9,"des-beast-down-idle1-ja"],[10,"des-beast-down-idle2-ja"],[11,"des-beast-get-up-ja"],[12,"des-beast-down-hits0-ja"]],"des-burning-bush-ag":[[2,"des-burning-bush-idle-ja"],[1,"des-burning-bush-lod0-mg"],[0,"des-burning-bush-lod0-jg"]],"des-cactus-a-ag":[[8,"des-cactus-a-explode-idle-ja"],[7,"des-cactus-a-explode-lod0-mg"],[6,"des-cactus-a-explode-lod0-jg"],[5,"des-cactus-a-idle-ja"],[4,"des-cactus-a-lod3-mg"],[3,"des-cactus-a-lod2-mg"],[2,"des-cactus-a-lod1-mg"],[1,"des-cactus-a-lod0-mg"],[0,"des-cactus-a-lod0-jg"]],"des-cactus-b-ag":[[8,"des-cactus-b-explode-idle-ja"],[7,"des-cactus-b-explode-lod0-mg"],[6,"des-cactus-b-explode-lod0-jg"],[5,"des-cactus-b-idle-ja"],[4,"des-cactus-b-lod3-mg"],[3,"des-cactus-b-lod2-mg"],[2,"des-cactus-b-lod1-mg"],[1,"des-cactus-b-lod0-mg"],[0,"des-cactus-b-lod0-jg"]],"des-cactus-obstacle-ag":[[2,"des-cactus-obstacle-idle-ja"],[1,"des-cactus-obstacle-lod0-mg"],[0,"des-cactus-obstacle-lod0-jg"]],"des-draw-bridge-ag":[[4,"des-draw-bridge-down-ja"],[3,"des-draw-bridge-idle-ja"],[2,"des-draw-bridge-shadow-mg"],[1,"des-draw-bridge-lod0-mg"],[0,"des-draw-bridge-lod0-jg"]],"des-garage-door-ag":[[3,"des-garage-door-open-ja"],[2,"des-garage-door-idle-ja"],[1,"des-garage-door-lod0-mg"],[0,"des-garage-door-lod0-jg"]],"des-glider-ring-ag":[[3,"des-glider-ring-expand-ja"],[2,"des-glider-ring-idle-ja"],[1,"des-glider-ring-lod0-mg"],[0,"des-glider-ring-lod0-jg"]],"des-jump-bridge-ag":[[4,"des-jump-bridge-80meterup-ja"],[3,"des-jump-bridge-60meterup-ja"],[2,"des-jump-bridge-idle-ja"],[1,"des-jump-bridge-lod0-mg"],[0,"des-jump-bridge-lod0-jg"]],"des-rally-bollard-ag":[[3,"des-rally-bollard-idle-ja"],[2,"des-rally-bollard-lod1-mg"],[1,"des-rally-bollard-lod0-mg"],[0,"des-rally-bollard-lod0-jg"]],"des-terraformer-break-ag":[[6,"des-terraformer-break-a-idle-ja"],[5,"des-terraformer-break-a-lod0-mg"],[4,"des-terraformer-break-a-lod0-jg"],[2,"des-terraformer-break-idle-ja"],[1,"des-terraformer-break-lod0-mg"],[0,"des-terraformer-break-lod0-jg"]],"des-train-barrier-ag":[[2,"des-train-barrier-idle-ja"],[1,"des-train-barrier-lod0-mg"],[0,"des-train-barrier-lod0-jg"]],"des-train-bollard-ag":[[2,"des-train-bollard-idle-ja"],[1,"des-train-bollard-lod0-mg"],[0,"des-train-bollard-lod0-jg"]],"des-train-stones-ag":[[2,"des-train-stones-idle-ja"],[1,"des-train-stones-lod0-mg"],[0,"des-train-stones-lod0-jg"]],"desert-eggwall-ag":[[2,"desert-eggwall-idle-ja"],[1,"desert-eggwall-lod0-mg"],[0,"desert-eggwall-lod0-jg"]],"desert-eggwall-break-ag":[[6,"desert-eggwall-break-a-idle-ja"],[5,"desert-eggwall-break-a-lod0-mg"],[4,"desert-eggwall-break-a-lod0-jg"],[2,"desert-eggwall-break-idle-ja"],[1,"desert-eggwall-break-lod0-mg"],[0,"desert-eggwall-break-lod0-jg"]],"desert-transport-ag":[[5,"desert-transport-close-ja"],[4,"desert-transport-open-ja"],[3,"desert-transport-idle-ja"],[2,"desert-transport-shadow-mg"],[1,"desert-transport-lod0-mg"],[0,"desert-transport-lod0-jg"]],"desw-eco-tank-ag":[[5,"desw-eco-tank-debris-idle-ja"],[4,"desw-eco-tank-debris-lod0-mg"],[3,"desw-eco-tank-debris-lod0-jg"],[2,"desw-eco-tank-idle-ja"],[1,"desw-eco-tank-lod0-mg"],[0,"desw-eco-tank-lod0-jg"]],"desw-snake-stump-ag":[[2,"desw-snake-stump-idle-ja"],[1,"desw-snake-stump-lod0-mg"],[0,"desw-snake-stump-lod0-jg"]],"dm-debris-ag":[[7,"dm-debris-d-lod0-mg"],[6,"dm-debris-d-lod0-jg"],[5,"dm-debris-c-lod0-mg"],[4,"dm-debris-c-lod0-jg"],[3,"dm-debris-b-lod0-mg"],[2,"dm-debris-b-lod0-jg"],[1,"dm-debris-a-lod0-mg"],[0,"dm-debris-a-lod0-jg"]],"dm-mine-spider-ag":[[10,"dm-mine-spider-knocked-explode-ja"],[9,"dm-mine-spider-anticipate-explode-ja"],[8,"dm-mine-spider-run-stop-ja"],[7,"dm-mine-spider-run-ja"],[6,"dm-mine-spider-idle-ja"],[5,"dm-mine-spider-climb-end-ja"],[4,"dm-mine-spider-climb-ja"],[3,"dm-mine-spider-climb-start-ja"],[2,"dm-mine-spider-shadow-mg"],[1,"dm-mine-spider-lod0-mg"],[0,"dm-mine-spider-lod0-jg"]],"dm-mine-spider-spawner-ag":[[2,"dm-mine-spider-spawner-idle-ja"],[1,"dm-mine-spider-spawner-lod0-mg"],[0,"dm-mine-spider-spawner-lod0-jg"]],"dm-missile-ag":[[2,"dm-missile-idle-ja"],[1,"dm-missile-lod0-mg"],[0,"dm-missile-lod0-jg"]],"dm-missile-target-ag":[[3,"dm-missile-target-idle-ja"],[2,"dm-missile-target-shadow-mg"],[1,"dm-missile-target-lod0-mg"],[0,"dm-missile-target-lod0-jg"]],"dm-robot-ag":[[9,"dm-robot-knock3-ja"],[8,"dm-robot-knock2-ja"],[7,"dm-robot-knock1-ja"],[6,"dm-robot-standup-ja"],[5,"dm-robot-walk-ja"],[4,"dm-robot-ball-ja"],[3,"dm-robot-idle-ja"],[2,"dm-robot-shadow-mg"],[1,"dm-robot-lod0-mg"],[0,"dm-robot-lod0-jg"]],"dm-ship-ag":[[2,"dm-ship-idle-ja"],[1,"dm-ship-lod0-mg"],[0,"dm-ship-lod0-jg"]],"dm-ship-break-ag":[[2,"dm-ship-break-idle-ja"],[1,"dm-ship-break-lod0-mg"],[0,"dm-ship-break-lod0-jg"]],"dm-ship-tent-brk-ag":[[2,"dm-ship-tent-brk-idle-ja"],[1,"dm-ship-tent-brk-lod0-mg"],[0,"dm-ship-tent-brk-lod0-jg"]],"dm-spines-ag":[[2,"dm-spines-idle-ja"],[1,"dm-spines-lod0-mg"],[0,"dm-spines-lod0-jg"]],"dm-tentacle-ag":[[11,"dm-tentacle-explode-idle-ja"],[10,"dm-tentacle-explode-lod0-mg"],[9,"dm-tentacle-explode-lod0-jg"],[8,"dm-tentacle-spit-ja"],[7,"dm-tentacle-whip-ja"],[6,"dm-tentacle-sweep-ja"],[5,"dm-tentacle-strike-ja"],[4,"dm-tentacle-idle2-ja"],[3,"dm-tentacle-idle-ja"],[2,"dm-tentacle-shadow-mg"],[1,"dm-tentacle-lod0-mg"],[0,"dm-tentacle-lod0-jg"]],"dm-urchin-ag":[[7,"dm-urchin-explode-idle-ja"],[6,"dm-urchin-explode-lod0-mg"],[5,"dm-urchin-explode-lod0-jg"],[4,"dm-urchin-shudder-ja"],[3,"dm-urchin-pulse-ja"],[2,"dm-urchin-idle-ja"],[1,"dm-urchin-lod0-mg"],[0,"dm-urchin-lod0-jg"]],"dogat-ag":[[9,"dogat-knocked-forward-land-ja"],[8,"dogat-knocked-forward-ja"],[7,"dogat-run0-ja"],[6,"dogat-idle-eat-ja"],[5,"dogat-idle-situp-ja"],[4,"dogat-idle-sit-ja"],[3,"dogat-idle-ja"],[2,"dogat-shadow-mg"],[1,"dogat-lod0-mg"],[0,"dogat-lod0-jg"]],"dp-bipedal-ag":[[41,"dp-bipedal-turret-jump-off-end-ja"],[40,"dp-bipedal-turret-jump-off-jump-ja"],[39,"dp-bipedal-turret-jump-off-start-ja"],[38,"dp-bipedal-turret-jump-on-end-ja"],[37,"dp-bipedal-turret-jump-on-start-ja"],[36,"dp-bipedal-turret-knocked-right0-ja"],[35,"dp-bipedal-turret-knocked-left0-ja"],[34,"dp-bipedal-turret-shoot0-ja"],[33,"dp-bipedal-turret-idle-right-ja"],[32,"dp-bipedal-turret-idle-left-ja"],[31,"dp-bipedal-turret-idle-down-ja"],[30,"dp-bipedal-turret-idle-up-ja"],[29,"dp-bipedal-turret-idle-middle-ja"],[12,"dp-bipedal-shield-out-ja"],[11,"dp-bipedal-attack-throw0-end-ja"],[10,"dp-bipedal-attack-throw0-middle-ja"],[9,"dp-bipedal-attack-throw0-start-ja"],[8,"dp-bipedal-attack-close0-end-ja"],[7,"dp-bipedal-attack-close0-middle-ja"],[6,"dp-bipedal-attack-close0-start-ja"],[5,"dp-bipedal-walk0-ja"],[4,"dp-bipedal-run0-ja"],[3,"dp-bipedal-idle0-ja"],[2,"dp-bipedal-shadow-mg"],[1,"dp-bipedal-lod0-mg"],[0,"dp-bipedal-lod0-jg"],[13,"dp-bipedal-shield-out-idle-ja"],[14,"dp-bipedal-shield-in-ja"],[15,"dp-bipedal-shield-up-recoil0-ja"],[16,"dp-bipedal-getup0-start-ja"],[17,"dp-bipedal-getup0-end-ja"],[18,"dp-bipedal-warp-in0-ja"],[19,"dp-bipedal-warp-in1-ja"],[20,"dp-bipedal-jump0-start-ja"],[21,"dp-bipedal-jump0-fall-ja"],[22,"dp-bipedal-jump0-land-ja"],[23,"dp-bipedal-knocked-yellow-right-ja"],[24,"dp-bipedal-knocked-yellow-right-land-ja"],[25,"dp-bipedal-knocked-yellow-left-ja"],[26,"dp-bipedal-knocked-yellow-left-land-ja"],[27,"dp-bipedal-knocked-blue0-ja"],[28,"dp-bipedal-ragdoll-ja"]],"dummy1-ag":[[1,"dummy1-lod0-mg"],[0,"dummy1-lod0-jg"]],"dummy2-ag":[[1,"dummy2-lod0-mg"],[0,"dummy2-lod0-jg"]],"dummy3-ag":[[1,"dummy3-lod0-mg"],[0,"dummy3-lod0-jg"]],"dummy4-ag":[[1,"dummy4-lod0-mg"],[0,"dummy4-lod0-jg"]],"eco-canister-ag":[[2,"eco-canister-dark-idle-ja"],[1,"eco-canister-dark-lod0-mg"],[0,"eco-canister-dark-lod0-jg"]],"eco-crystal-dark-ag":[[2,"eco-crystal-dark-idle-ja"],[1,"eco-crystal-dark-lod0-mg"],[0,"eco-crystal-dark-lod0-jg"]],"eco-crystal-light-ag":[[2,"eco-crystal-light-idle-ja"],[1,"eco-crystal-light-lod0-mg"],[0,"eco-crystal-light-lod0-jg"]],"eco-crystal-sphere-ag":[[2,"eco-crystal-sphere-idle-ja"],[1,"eco-crystal-sphere-lod0-mg"],[0,"eco-crystal-sphere-lod0-jg"]],"eco-crystal-sphere-simple-ag":[[2,"eco-crystal-sphere-simple-idle-ja"],[1,"eco-crystal-sphere-simple-lod0-mg"],[0,"eco-crystal-sphere-simple-lod0-jg"]],"egg-spider-ag":[[13,"egg-spider-knocked-red-land-ja"],[0,"egg-spider-lod0-jg"],[1,"egg-spider-lod0-mg"],[2,"egg-spider-lod1-mg"],[3,"egg-spider-lod2-mg"],[4,"egg-spider-shadow-mg"],[5,"egg-spider-idle-ja"],[6,"egg-spider-walk-ja"],[7,"egg-spider-crawl-from-ground-ja"],[8,"egg-spider-jump-car-ja"],[9,"egg-spider-land-car-ja"],[10,"egg-spider-bite-car-ja"],[11,"egg-spider-attack-jump-ja"],[12,"egg-spider-knocked-red-ja"]],"errol-ag":[[3,"errol-errol-idle-ja"],[2,"errol-idle-ja"],[1,"errol-lod0-mg"],[0,"errol-lod0-jg"]],"errol-effect-ag":[[2,"errol-effect-idle-ja"],[1,"errol-effect-lod0-mg"],[0,"errol-effect-lod0-jg"]],"errol-highres-ag":[[3,"errol-highres-errol-walk-ja"],[2,"errol-highres-shadow-mg"],[1,"errol-highres-lod0-mg"],[0,"errol-highres-lod0-jg"]],"errol-lowres-ag":[[15,"errol-lowres-run-to-idle-ja"],[14,"errol-lowres-run-ccw-ja"],[13,"errol-lowres-run-cw-ja"],[0,"errol-lowres-lod0-jg"],[1,"errol-lowres-lod0-mg"],[2,"errol-lowres-lod1-mg"],[3,"errol-lowres-idle30-ja"],[4,"errol-lowres-idle60-ja"],[5,"errol-lowres-idle-hit-console-ja"],[6,"errol-lowres-idle-hit-console-2-ja"],[7,"errol-lowres-idle-throw-ja"],[8,"errol-lowres-idle-yell-ja"],[9,"errol-lowres-idle-yell-1-ja"],[10,"errol-lowres-idle-knocked-ja"],[11,"errol-lowres-idle-to-run-cw-ja"],[12,"errol-lowres-idle-to-run-ccw-ja"]],"evilbro-ag":[[3,"evilbro-evilbro-idle-ja"],[2,"evilbro-shadow-mg"],[1,"evilbro-lod0-mg"],[0,"evilbro-lod0-jg"]],"evilsis-ag":[[3,"evilsis-evilsis-idle-ja"],[2,"evilsis-shadow-mg"],[1,"evilsis-lod0-mg"],[0,"evilsis-lod0-jg"]],"explorer-ag":[[3,"explorer-explorer-idle-ja"],[2,"explorer-shadow-mg"],[1,"explorer-lod0-mg"],[0,"explorer-lod0-jg"]],"fac-break-fence-a-ag":[[6,"fac-break-fence-a-explode-idle-ja"],[5,"fac-break-fence-a-explode-lod0-mg"],[4,"fac-break-fence-a-explode-lod0-jg"],[3,"fac-break-fence-a-idle-ja"],[2,"fac-break-fence-a-lod1-mg"],[1,"fac-break-fence-a-lod0-mg"],[0,"fac-break-fence-a-lod0-jg"]],"fac-break-fence-b-ag":[[6,"fac-break-fence-b-explode-idle-ja"],[5,"fac-break-fence-b-explode-lod0-mg"],[4,"fac-break-fence-b-explode-lod0-jg"],[3,"fac-break-fence-b-idle-ja"],[2,"fac-break-fence-b-lod1-mg"],[1,"fac-break-fence-b-lod0-mg"],[0,"fac-break-fence-b-lod0-jg"]],"fac-break-fence-c-ag":[[6,"fac-break-fence-c-explode-idle-ja"],[5,"fac-break-fence-c-explode-lod0-mg"],[4,"fac-break-fence-c-explode-lod0-jg"],[3,"fac-break-fence-c-idle-ja"],[2,"fac-break-fence-c-lod1-mg"],[1,"fac-break-fence-c-lod0-mg"],[0,"fac-break-fence-c-lod0-jg"]],"fac-break-floor-ag":[[6,"fac-break-floor-explode-idle-ja"],[5,"fac-break-floor-explode-lod0-mg"],[4,"fac-break-floor-explode-lod0-jg"],[3,"fac-break-floor-idle-ja"],[2,"fac-break-floor-lod1-mg"],[1,"fac-break-floor-lod0-mg"],[0,"fac-break-floor-lod0-jg"]],"fac-drop-plat-ag":[[2,"fac-drop-plat-idle-ja"],[1,"fac-drop-plat-lod0-mg"],[0,"fac-drop-plat-lod0-jg"]],"fac-elevator-a-ag":[[5,"fac-elevator-a-gate_down-ja"],[4,"fac-elevator-a-gate_up-ja"],[3,"fac-elevator-a-idle-ja"],[2,"fac-elevator-a-lod1-mg"],[1,"fac-elevator-a-lod0-mg"],[0,"fac-elevator-a-lod0-jg"]],"fac-fire-torch-ag":[[2,"fac-fire-torch-idle-ja"],[1,"fac-fire-torch-lod0-mg"],[0,"fac-fire-torch-lod0-jg"]],"fac-fma-breaking-bits-ag":[[2,"fac-fma-breaking-bits-idle-ja"],[1,"fac-fma-breaking-bits-lod0-mg"],[0,"fac-fma-breaking-bits-lod0-jg"]],"fac-gun-tower-ag":[[7,"fac-gun-tower-break-idle-ja"],[6,"fac-gun-tower-break-lod0-mg"],[5,"fac-gun-tower-break-lod0-jg"],[4,"fac-gun-tower-dooropen-ja"],[3,"fac-gun-tower-idle-ja"],[2,"fac-gun-tower-lod1-mg"],[1,"fac-gun-tower-lod0-mg"],[0,"fac-gun-tower-lod0-jg"]],"fac-gun-tower-base-ag":[[14,"fac-gun-tower-base-broken-west-idle-ja"],[13,"fac-gun-tower-base-broken-west-lod0-mg"],[0,"fac-gun-tower-base-lod0-jg"],[1,"fac-gun-tower-base-lod0-mg"],[2,"fac-gun-tower-base-idle-ja"],[3,"fac-gun-tower-base-broken-north-lod0-jg"],[4,"fac-gun-tower-base-broken-north-lod0-mg"],[5,"fac-gun-tower-base-broken-north-idle-ja"],[6,"fac-gun-tower-base-broken-south-lod0-jg"],[7,"fac-gun-tower-base-broken-south-lod0-mg"],[8,"fac-gun-tower-base-broken-south-idle-ja"],[9,"fac-gun-tower-base-broken-east-lod0-jg"],[10,"fac-gun-tower-base-broken-east-lod0-mg"],[11,"fac-gun-tower-base-broken-east-idle-ja"],[12,"fac-gun-tower-base-broken-west-lod0-jg"]],"fac-gun-tower-turret-ag":[[9,"fac-gun-tower-turret-explode-idle-ja"],[8,"fac-gun-tower-turret-explode-lod0-mg"],[7,"fac-gun-tower-turret-explode-lod0-jg"],[6,"fac-gun-tower-turret-updown-ja"],[5,"fac-gun-tower-turret-shoot-ja"],[4,"fac-gun-tower-turret-idle-ja"],[3,"fac-gun-tower-turret-lod2-mg"],[2,"fac-gun-tower-turret-lod1-mg"],[1,"fac-gun-tower-turret-lod0-mg"],[0,"fac-gun-tower-turret-lod0-jg"]],"fac-lorez-ag":[[2,"fac-lorez-idle-ja"],[1,"fac-lorez-lod0-mg"],[0,"fac-lorez-lod0-jg"]],"fac-move-plat-a-ag":[[2,"fac-move-plat-a-idle-ja"],[1,"fac-move-plat-a-lod0-mg"],[0,"fac-move-plat-a-lod0-jg"]],"fac-move-plat-b-ag":[[2,"fac-move-plat-b-idle-ja"],[1,"fac-move-plat-b-lod0-mg"],[0,"fac-move-plat-b-lod0-jg"]],"fac-punch-wall-ag":[[4,"fac-punch-wall-drop-ja"],[3,"fac-punch-wall-idle-ja"],[2,"fac-punch-wall-lod1-mg"],[1,"fac-punch-wall-lod0-mg"],[0,"fac-punch-wall-lod0-jg"]],"fac-robopod-ag":[[8,"fac-robopod-explode-idle-ja"],[7,"fac-robopod-explode-lod0-mg"],[6,"fac-robopod-explode-lod0-jg"],[5,"fac-robopod-close-ja"],[4,"fac-robopod-open-ja"],[3,"fac-robopod-idle-ja"],[2,"fac-robopod-lod1-mg"],[1,"fac-robopod-lod0-mg"],[0,"fac-robopod-lod0-jg"]],"fac-robotank-ag":[[9,"fac-robotank-explode-idle-ja"],[8,"fac-robotank-explode-lod0-mg"],[7,"fac-robotank-explode-lod0-jg"],[6,"fac-robotank-fire-end-ja"],[5,"fac-robotank-fire-start-ja"],[4,"fac-robotank-idle-ja"],[3,"fac-robotank-lod2-mg"],[2,"fac-robotank-lod1-mg"],[1,"fac-robotank-lod0-mg"],[0,"fac-robotank-lod0-jg"]],"fac-robotank-top-ag":[[9,"fac-robotank-top-explode-idle-ja"],[8,"fac-robotank-top-explode-lod0-mg"],[7,"fac-robotank-top-explode-lod0-jg"],[6,"fac-robotank-top-fire-end-ja"],[5,"fac-robotank-top-fire-start-ja"],[4,"fac-robotank-top-idle-ja"],[3,"fac-robotank-top-lod2-mg"],[2,"fac-robotank-top-lod1-mg"],[1,"fac-robotank-top-lod0-mg"],[0,"fac-robotank-top-lod0-jg"]],"fac-rotfan-ag":[[4,"fac-rotfan-spin-ja"],[3,"fac-rotfan-idle-ja"],[2,"fac-rotfan-lod1-mg"],[1,"fac-rotfan-lod0-mg"],[0,"fac-rotfan-lod0-jg"]],"fac-switch-ag":[[2,"fac-switch-idle-ja"],[1,"fac-switch-lod0-mg"],[0,"fac-switch-lod0-jg"]],"fac-target-ag":[[9,"fac-target-explode-idle-ja"],[8,"fac-target-explode-lod0-mg"],[7,"fac-target-explode-lod0-jg"],[6,"fac-target-desend-ja"],[5,"fac-target-rotate-ja"],[4,"fac-target-idle-ja"],[3,"fac-target-lod2-mg"],[2,"fac-target-lod1-mg"],[1,"fac-target-lod0-mg"],[0,"fac-target-lod0-jg"]],"fac-warp-effect-ag":[[2,"fac-warp-effect-idle-ja"],[1,"fac-warp-effect-lod0-mg"],[0,"fac-warp-effect-lod0-jg"]],"faccar-ag":[[11,"faccar-idle-ja"],[10,"faccar-shadow-mg"],[9,"faccar-lod0-mg"],[8,"faccar-lod0-jg"],[7,"faccar-wheel-blur-idle-ja"],[6,"faccar-wheel-blur-shadow-mg"],[5,"faccar-wheel-blur-lod0-mg"],[4,"faccar-wheel-blur-lod0-jg"],[3,"faccar-wheel-idle-ja"],[2,"faccar-wheel-shadow-mg"],[1,"faccar-wheel-lod0-mg"],[0,"faccar-wheel-lod0-jg"]],"farm-beetree-ag":[[5,"farm-beetree-explode-idle-ja"],[4,"farm-beetree-explode-lod0-mg"],[3,"farm-beetree-explode-lod0-jg"],[2,"farm-beetree-idle-ja"],[1,"farm-beetree-lod0-mg"],[0,"farm-beetree-lod0-jg"]],"farm-cabbage-ag":[[5,"farm-cabbage-explode-idle-ja"],[4,"farm-cabbage-explode-lod0-mg"],[3,"farm-cabbage-explode-lod0-jg"],[2,"farm-cabbage-idle-ja"],[1,"farm-cabbage-lod0-mg"],[0,"farm-cabbage-lod0-jg"]],"farm-chilirots-ag":[[5,"farm-chilirots-explode-idle-ja"],[4,"farm-chilirots-explode-lod0-mg"],[3,"farm-chilirots-explode-lod0-jg"],[2,"farm-chilirots-idle-ja"],[1,"farm-chilirots-lod0-mg"],[0,"farm-chilirots-lod0-jg"]],"farm-marrow-ag":[[5,"farm-marrow-explode-idle-ja"],[4,"farm-marrow-explode-lod0-mg"],[3,"farm-marrow-explode-lod0-jg"],[2,"farm-marrow-idle-ja"],[1,"farm-marrow-lod0-mg"],[0,"farm-marrow-lod0-jg"]],"farm-small-cabbage-ag":[[5,"farm-small-cabbage-explode-idle-ja"],[4,"farm-small-cabbage-explode-lod0-mg"],[3,"farm-small-cabbage-explode-lod0-jg"],[2,"farm-small-cabbage-idle-ja"],[1,"farm-small-cabbage-lod0-mg"],[0,"farm-small-cabbage-lod0-jg"]],"farm-sprinkler-barrels-ag":[[2,"farm-sprinkler-barrels-idle-ja"],[1,"farm-sprinkler-barrels-lod0-mg"],[0,"farm-sprinkler-barrels-lod0-jg"]],"farmer-ag":[[2,"farmer-farmer-idle-ja"],[1,"farmer-lod0-mg"],[0,"farmer-lod0-jg"]],"fisher-ag":[[2,"fisher-fisher-idle-ja"],[1,"fisher-lod0-mg"],[0,"fisher-lod0-jg"]],"flamer-lava-ag":[[23,"flamer-lava-explode-idle-ja"],[22,"flamer-lava-explode-lod0-mg"],[21,"flamer-lava-explode-lod0-jg"],[20,"flamer-lava-blue-hit2-ja"],[19,"flamer-lava-blue-hit1-ja"],[18,"flamer-lava-blue-hit0-ja"],[17,"flamer-lava-die-in-place-ja"],[16,"flamer-lava-knock-back-land-ja"],[15,"flamer-lava-die-ja"],[14,"flamer-lava-knock-back-fall-ja"],[13,"flamer-lava-knock-back-ja"],[0,"flamer-lava-lod0-jg"],[1,"flamer-lava-lod0-mg"],[2,"flamer-lava-lod1-mg"],[3,"flamer-lava-lod2-mg"],[4,"flamer-lava-shadow-mg"],[5,"flamer-lava-idle-ja"],[6,"flamer-lava-fly-right-ja"],[7,"flamer-lava-fly-left-ja"],[8,"flamer-lava-fly-forward-ja"],[9,"flamer-lava-fly-back-ja"],[10,"flamer-lava-fly-straight-ja"],[11,"flamer-lava-shoot-ja"],[12,"flamer-lava-shoot1-ja"]],"flitter-ag":[[23,"flitter-blue-hit0-ja"],[22,"flitter-knocked-land-upright-ja"],[21,"flitter-knocked-land0-ja"],[20,"flitter-knocked0-ja"],[19,"flitter-die-in-place-ja"],[18,"flitter-die-falling-ja"],[17,"flitter-attack-high-ja"],[16,"flitter-attack-ja"],[15,"flitter-turn-ja"],[14,"flitter-move-ja"],[13,"flitter-walk-ja"],[0,"flitter-lod0-jg"],[1,"flitter-lod0-mg"],[2,"flitter-lod1-mg"],[3,"flitter-lod2-mg"],[4,"flitter-shadow-mg"],[5,"flitter-idle-ja"],[6,"flitter-idle-look-left-ja"],[7,"flitter-idle-look-left-hold-ja"],[8,"flitter-idle-look-right-ja"],[9,"flitter-idle-look-right-hold-ja"],[10,"flitter-ambush-jump-ja"],[11,"flitter-ambush-land-ja"],[12,"flitter-notice-ja"]],"flut-saddle-ag":[[3,"flut-saddle-flut-idle-ja"],[2,"flut-saddle-shadow-mg"],[1,"flut-saddle-lod0-mg"],[0,"flut-saddle-lod0-jg"],[27,"flut-saddle-flut-kanga-catch-ja"],[29,"flut-saddle-flut-death-drown-ja"],[28,"flut-saddle-flut-deathb-ja"],[26,"flut-saddle-flut-run-squash-ja"],[25,"flut-saddle-flut-deatha-ja"],[24,"flut-saddle-flut-smack-surface-end-ja"],[23,"flut-saddle-flut-smack-surface-ja"],[22,"flut-saddle-flut-hit-back-end-ja"],[21,"flut-saddle-flut-hit-back-ja"],[20,"flut-saddle-flut-get-off-ja"],[19,"flut-saddle-flut-get-on-ja"],[18,"flut-saddle-flut-air-attack-land-ja"],[17,"flut-saddle-flut-air-attack-loop-ja"],[16,"flut-saddle-flut-air-attack-ja"],[15,"flut-saddle-flut-running-attack-end-ja"],[14,"flut-saddle-flut-running-attack-ja"],[13,"flut-saddle-flut-double-jump-ja"],[12,"flut-saddle-flut-jump-forward-land-ja"],[11,"flut-saddle-flut-jump-forward-loop-ja"],[10,"flut-saddle-flut-jump-forward-ja"],[9,"flut-saddle-flut-jump-land-ja"],[8,"flut-saddle-flut-jump-loop-ja"],[38,"flut-saddle-fldax-smack-surface-ja"],[37,"flut-saddle-fldax-wild-run-ja"],[54,"flut-saddle-fldax-dummy8-ja"],[53,"flut-saddle-fldax-dummy7-ja"],[39,"flut-saddle-fldax-smack-surface-end-ja"],[52,"flut-saddle-fldax-dummy6-ja"],[36,"flut-saddle-flut-dummy8-ja"],[7,"flut-saddle-flut-jump-ja"],[35,"flut-saddle-flut-dummy7-ja"],[6,"flut-saddle-flut-run-ja"],[34,"flut-saddle-flut-dummy6-ja"],[5,"flut-saddle-flut-jog-ja"],[33,"flut-saddle-flut-dummy5-ja"],[4,"flut-saddle-flut-walk-ja"],[32,"flut-saddle-flut-dummy4-ja"],[31,"flut-saddle-flut-dummy3-ja"],[30,"flut-saddle-flut-dummy2-ja"],[40,"flut-saddle-fldax-deatha-ja"],[41,"flut-saddle-fldax-jump-forward-ja"],[42,"flut-saddle-fldax-jump-forward-loop-ja"],[43,"flut-saddle-fldax-get-on-ja"],[44,"flut-saddle-fldax-idle-ja"],[45,"flut-saddle-fldax-get-off-ja"],[46,"flut-saddle-fldax-wild-run-left-ja"],[47,"flut-saddle-fldax-wild-run-right-ja"],[48,"flut-saddle-fldax-walk-ja"],[49,"flut-saddle-fldax-run-squash-ja"],[50,"flut-saddle-fldax-finish-ja"],[51,"flut-saddle-fldax-death-cactus-ja"]],"flut-wild-ag":[[12,"flut-wild-idle-leaper-ja"],[11,"flut-wild-ragdoll-ja"],[10,"flut-wild-jump-land-ja"],[9,"flut-wild-jump-loop-ja"],[8,"flut-wild-jump-ja"],[7,"flut-wild-run-squash-ja"],[6,"flut-wild-run-ja"],[5,"flut-wild-jog-ja"],[4,"flut-wild-walk-ja"],[3,"flut-wild-idle-ja"],[2,"flut-wild-shadow-mg"],[1,"flut-wild-lod0-mg"],[0,"flut-wild-lod0-jg"]],"flutflut-ag":[[2,"flutflut-flutflut-walk-ja"],[1,"flutflut-lod0-mg"],[0,"flutflut-lod0-jg"]],"flyingsaw-ag":[[2,"flyingsaw-idle-ja"],[1,"flyingsaw-lod0-mg"],[0,"flyingsaw-lod0-jg"]],"fma-gun-ag":[[3,"fma-gun-idle-ja"],[2,"fma-gun-shadow-mg"],[1,"fma-gun-lod0-mg"],[0,"fma-gun-lod0-jg"]],"for-break-bridge-ag":[[14,"for-break-bridge-board-explode-idle-ja"],[13,"for-break-bridge-board-explode-lod0-mg"],[0,"for-break-bridge-board-a-lod0-jg"],[1,"for-break-bridge-board-a-lod0-mg"],[2,"for-break-bridge-board-a-idle-ja"],[3,"for-break-bridge-board-b-lod0-jg"],[4,"for-break-bridge-board-b-lod0-mg"],[5,"for-break-bridge-board-b-idle-ja"],[6,"for-break-bridge-board-c-lod0-jg"],[7,"for-break-bridge-board-c-lod0-mg"],[8,"for-break-bridge-board-c-idle-ja"],[9,"for-break-bridge-board-d-lod0-jg"],[10,"for-break-bridge-board-d-lod0-mg"],[11,"for-break-bridge-board-d-idle-ja"],[12,"for-break-bridge-board-explode-lod0-jg"]],"for-pillar-ag":[[2,"for-pillar-idle-ja"],[1,"for-pillar-lod0-mg"],[0,"for-pillar-lod0-jg"]],"for-statue-ag":[[10,"for-statue-debris-eye-lod0-mg"],[9,"for-statue-debris-eye-lod0-jg"],[8,"for-statue-debris-chunk-lod0-mg"],[7,"for-statue-debris-chunk-lod0-jg"],[6,"for-statue-debris-arrow-lod0-mg"],[5,"for-statue-debris-arrow-lod0-jg"],[4,"for-statue-open-eyes-ja"],[3,"for-statue-rise-ja"],[2,"for-statue-idle-ja"],[1,"for-statue-lod0-mg"],[0,"for-statue-lod0-jg"]],"for-t-fma-ag":[[2,"for-t-fma-idle-ja"],[1,"for-t-fma-lod0-mg"],[0,"for-t-fma-lod0-jg"]],"for-telescope-ag":[[2,"for-telescope-idle-ja"],[1,"for-telescope-lod0-mg"],[0,"for-telescope-lod0-jg"]],"for-telescope-fma-ag":[[2,"for-telescope-fma-idle-ja"],[1,"for-telescope-fma-lod0-mg"],[0,"for-telescope-fma-lod0-jg"]],"for-tower-ag":[[2,"for-tower-idle-ja"],[1,"for-tower-lod0-mg"],[0,"for-tower-lod0-jg"]],"for-tower-fma-ag":[[2,"for-tower-fma-idle-ja"],[1,"for-tower-fma-lod0-mg"],[0,"for-tower-fma-lod0-jg"]],"for-turret-ag":[[8,"for-turret-explode-idle-ja"],[7,"for-turret-explode-lod0-mg"],[6,"for-turret-explode-lod0-jg"],[5,"for-turret-shoot-ja"],[4,"for-turret-idle-ja"],[3,"for-turret-lod2-mg"],[2,"for-turret-lod1-mg"],[1,"for-turret-lod0-mg"],[0,"for-turret-lod0-jg"]],"fort-entry-gate-ag":[[2,"fort-entry-gate-idle-ja"],[1,"fort-entry-gate-lod0-mg"],[0,"fort-entry-gate-lod0-jg"]],"fox-ag":[[11,"fox-idle-ja"],[10,"fox-shadow-mg"],[9,"fox-lod0-mg"],[8,"fox-lod0-jg"],[7,"fox-wheel-blur-idle-ja"],[6,"fox-wheel-blur-shadow-mg"],[5,"fox-wheel-blur-lod0-mg"],[4,"fox-wheel-blur-lod0-jg"],[3,"fox-wheel-idle-ja"],[2,"fox-wheel-shadow-mg"],[1,"fox-wheel-lod0-mg"],[0,"fox-wheel-lod0-jg"]],"freehq-sml-door-ag":[[2,"freehq-sml-door-idle-ja"],[1,"freehq-sml-door-lod0-mg"],[0,"freehq-sml-door-lod0-jg"]],"gambler-ag":[[2,"gambler-gambler-idle-ja"],[1,"gambler-lod0-mg"],[0,"gambler-lod0-jg"]],"gauntlets-ag":[[2,"gauntlets-idle-ja"],[1,"gauntlets-lod0-mg"],[0,"gauntlets-lod0-jg"]],"gekko-ag":[[36,"gekko-ragdoll-pose-ja"],[35,"gekko-jump0-land-ja"],[34,"gekko-jump0-in-air-ja"],[33,"gekko-jump0-start-ja"],[32,"gekko-death-standing0-ja"],[31,"gekko-knocked-death0-ja"],[30,"gekko-knocked-red0-land-ja"],[29,"gekko-knocked-red0-ja"],[12,"gekko-turn-left0-ja"],[11,"gekko-wall-shoot0-ja"],[10,"gekko-wall-turn-idle0-ja"],[9,"gekko-wall-turn-right0-ja"],[8,"gekko-wall-turn-left0-ja"],[7,"gekko-wall-run0-b-ja"],[6,"gekko-wall-run0-a-ja"],[5,"gekko-wall-idle1-ja"],[4,"gekko-wall-idle0-ja"],[3,"gekko-idle-ja"],[2,"gekko-shadow-mg"],[1,"gekko-lod0-mg"],[0,"gekko-lod0-jg"],[13,"gekko-turn-right0-ja"],[14,"gekko-run0-a-ja"],[15,"gekko-run0-b-ja"],[16,"gekko-jump-to-ground-start-ja"],[17,"gekko-jump-to-ground-in-air-ja"],[18,"gekko-jump-to-ground-end-ja"],[19,"gekko-wall-knocked0-ja"],[20,"gekko-wall-knocked1-ja"],[21,"gekko-turn-hop0-ja"],[22,"gekko-turn-hop0-land-ja"],[23,"gekko-wall-knocked-to-ground0-ja"],[24,"gekko-idle0-ja"],[25,"gekko-idle1-ja"],[26,"gekko-attack0-start-ja"],[27,"gekko-attack0-mid-ja"],[28,"gekko-attack0-land-ja"]],"geologist-ag":[[2,"geologist-geologist-idle-ja"],[1,"geologist-lod0-mg"],[0,"geologist-lod0-jg"]],"grunt-ag":[[27,"grunt-ragdoll-ja"],[26,"grunt-getup-back-ja"],[25,"grunt-getup-front-ja"],[24,"grunt-jump-land-ja"],[23,"grunt-jump-in-air-ja"],[22,"grunt-jump-wind-up-ja"],[21,"grunt-celebrate-finish-ja"],[20,"grunt-celebrate-start-ja"],[19,"grunt-taunt-ja"],[18,"grunt-attack1-ja"],[17,"grunt-attack0-ja"],[16,"grunt-charge2-ja"],[15,"grunt-charge1-ja"],[14,"grunt-charge0-ja"],[13,"grunt-notice-ja"],[0,"grunt-lod0-jg"],[1,"grunt-lod0-mg"],[2,"grunt-lod1-mg"],[3,"grunt-lod2-mg"],[4,"grunt-shadow-mg"],[5,"grunt-idle-ja"],[6,"grunt-idle1-look-right-ja"],[7,"grunt-idle1-look-right-hold-ja"],[8,"grunt-idle1-look-left-ja"],[9,"grunt-idle1-look-left-hold-ja"],[10,"grunt-idle1-left-to-idle-ja"],[11,"grunt-patrol0-ja"],[12,"grunt-patrol1-ja"]],"grunt-head-ag":[[2,"grunt-head-idle-ja"],[1,"grunt-head-lod0-mg"],[0,"grunt-head-lod0-jg"]],"gun-ag":[[54,"gun-gun-gun-dummy4-ja"],[53,"gun-gun-gun-dummy3-ja"],[52,"gun-gun-dark-fire-3-ja"],[51,"gun-gun-dark-fire-2-ja"],[50,"gun-gun-dark2-dark3-ja"],[49,"gun-gun-dark1-dark2-ja"],[48,"gun-gun-blue1-blue2-ja"],[47,"gun-gun-yellow2-yellow3-ja"],[46,"gun-gun-red-fire-3-ja"],[45,"gun-gun-blue-fire-3-single-ja"],[44,"gun-gun-red1-red2-ja"],[43,"gun-gun-blue-red-ja"],[42,"gun-gun-yellow-fire-2-ja"],[41,"gun-gun-blue-fire-3-ja"],[40,"gun-gun-blue-dark-ja"],[39,"gun-gun-yellow-red-ja"],[38,"gun-gun-yellow-blue-ja"],[37,"gun-gun-dark-yellow-ja"],[36,"gun-gun-red-blue-ja"],[35,"gun-gun-red-yellow-ja"],[34,"gun-gun-red-dark-ja"],[33,"gun-gun-blue-fire-2-ja"],[32,"gun-gun-yellow-fire-3-ja"],[31,"gun-gun-red-fire-2-ja"],[30,"gun-gun-yellow-fire-ja"],[29,"gun-gun-dark-fire-ja"],[28,"gun-gun-blue-fire-single-ja"],[27,"gun-gun-blue-fire-ja"],[24,"gun-idle-blue3-ja"],[83,"gun-nuke-lod0-jg"],[23,"gun-idle-blue2-ja"],[82,"gun-nuke-sphere-fade-ja"],[22,"gun-idle-blue-ja"],[81,"gun-nuke-sphere-idle-ja"],[21,"gun-idle-yellow3-ja"],[80,"gun-nuke-sphere-lod0-mg"],[20,"gun-idle-yellow2-ja"],[79,"gun-nuke-sphere-lod0-jg"],[19,"gun-idle-yellow-ja"],[78,"gun-red-sphere-fade-ja"],[18,"gun-idle-dark3-ja"],[77,"gun-red-sphere-burst-ja"],[17,"gun-idle-dark2-ja"],[76,"gun-red-sphere-idle-ja"],[16,"gun-idle-dark-ja"],[75,"gun-red-sphere-lod0-mg"],[15,"gun-idle-red3-ja"],[74,"gun-red-sphere-lod0-jg"],[14,"gun-idle-red2-ja"],[73,"gun-grenade-idle-ja"],[13,"gun-idle-red-ja"],[72,"gun-grenade-lod1-mg"],[0,"gun-ammo-yellow-lod0-jg"],[1,"gun-ammo-yellow-lod0-mg"],[2,"gun-ammo-red-lod0-jg"],[61,"gun-red-cone-lod0-jg"],[3,"gun-ammo-red-lod0-mg"],[62,"gun-red-cone-lod0-mg"],[4,"gun-ammo-blue-lod0-jg"],[63,"gun-red-cone-idle-ja"],[5,"gun-ammo-blue-lod0-mg"],[64,"gun-red-burst-lod0-jg"],[6,"gun-ammo-dark-lod0-jg"],[65,"gun-red-burst-lod0-mg"],[7,"gun-ammo-dark-lod0-mg"],[66,"gun-red-burst-idle-ja"],[8,"gun-ammo-idle-ja"],[67,"gun-saucer-lod0-jg"],[9,"gun-lod0-jg"],[68,"gun-saucer-lod0-mg"],[10,"gun-lod0-mg"],[69,"gun-saucer-idle-ja"],[11,"gun-shadow-mg"],[70,"gun-grenade-lod0-jg"],[12,"gun-idle-ja"],[71,"gun-grenade-lod0-mg"],[84,"gun-nuke-lod0-mg"],[25,"gun-gun-yellow-fire-low-ja"],[85,"gun-nuke-idle-ja"],[26,"gun-gun-red-fire-ja"],[86,"gun-suck-lod0-jg"],[87,"gun-suck-lod0-mg"],[88,"gun-suck-idle-ja"],[89,"gun-dark-2-ring-lod0-jg"],[90,"gun-dark-2-ring-lod0-mg"],[91,"gun-dark-2-ring-shadow-mg"],[92,"gun-dark-2-ring-idle-ja"]],"gun-cit-a-ag":[[5,"gun-cit-a-explode-idle-ja"],[4,"gun-cit-a-explode-lod0-mg"],[3,"gun-cit-a-explode-lod0-jg"],[2,"gun-cit-a-idle-ja"],[1,"gun-cit-a-lod0-mg"],[0,"gun-cit-a-lod0-jg"]],"gun-cit-b-ag":[[5,"gun-cit-b-explode-idle-ja"],[4,"gun-cit-b-explode-lod0-mg"],[3,"gun-cit-b-explode-lod0-jg"],[2,"gun-cit-b-idle-ja"],[1,"gun-cit-b-lod0-mg"],[0,"gun-cit-b-lod0-jg"]],"gun-cit-c-ag":[[5,"gun-cit-c-explode-idle-ja"],[4,"gun-cit-c-explode-lod0-mg"],[3,"gun-cit-c-explode-lod0-jg"],[2,"gun-cit-c-idle-ja"],[1,"gun-cit-c-lod0-mg"],[0,"gun-cit-c-lod0-jg"]],"gun-cit-d-ag":[[5,"gun-cit-d-explode-idle-ja"],[4,"gun-cit-d-explode-lod0-mg"],[3,"gun-cit-d-explode-lod0-jg"],[2,"gun-cit-d-idle-ja"],[1,"gun-cit-d-lod0-mg"],[0,"gun-cit-d-lod0-jg"]],"gun-clank-ag":[[5,"gun-clank-explode-idle-ja"],[4,"gun-clank-explode-lod0-mg"],[3,"gun-clank-explode-lod0-jg"],[2,"gun-clank-idle-ja"],[1,"gun-clank-lod0-mg"],[0,"gun-clank-lod0-jg"]],"gun-kg-bomb-ag":[[5,"gun-kg-bomb-explode-idle-ja"],[4,"gun-kg-bomb-explode-lod0-mg"],[3,"gun-kg-bomb-explode-lod0-jg"],[2,"gun-kg-bomb-idle-ja"],[1,"gun-kg-bomb-lod0-mg"],[0,"gun-kg-bomb-lod0-jg"]],"gun-kg-target-ag":[[6,"gun-kg-target-explode-idle-ja"],[5,"gun-kg-target-explode-lod0-mg"],[4,"gun-kg-target-explode-lod0-jg"],[3,"gun-kg-target-recoil-ja"],[2,"gun-kg-target-idle-ja"],[1,"gun-kg-target-lod0-mg"],[0,"gun-kg-target-lod0-jg"]],"gun-kg-target-b-ag":[[5,"gun-kg-target-b-explode-idle-ja"],[4,"gun-kg-target-b-explode-lod0-mg"],[3,"gun-kg-target-b-explode-lod0-jg"],[2,"gun-kg-target-b-idle-ja"],[1,"gun-kg-target-b-lod0-mg"],[0,"gun-kg-target-b-lod0-jg"]],"gun-kg-target-bonus-ag":[[5,"gun-kg-target-bonus-explode-idle-ja"],[4,"gun-kg-target-bonus-explode-lod0-mg"],[3,"gun-kg-target-bonus-explode-lod0-jg"],[2,"gun-kg-target-bonus-idle-ja"],[1,"gun-kg-target-bonus-lod0-mg"],[0,"gun-kg-target-bonus-lod0-jg"]],"gun-kg-target-c-ag":[[5,"gun-kg-target-c-explode-idle-ja"],[4,"gun-kg-target-c-explode-lod0-mg"],[3,"gun-kg-target-c-explode-lod0-jg"],[2,"gun-kg-target-c-idle-ja"],[1,"gun-kg-target-c-lod0-mg"],[0,"gun-kg-target-c-lod0-jg"]],"gun-kg-target-d-ag":[[5,"gun-kg-target-d-explode-idle-ja"],[4,"gun-kg-target-d-explode-lod0-mg"],[3,"gun-kg-target-d-explode-lod0-jg"],[2,"gun-kg-target-d-idle-ja"],[1,"gun-kg-target-d-lod0-mg"],[0,"gun-kg-target-d-lod0-jg"]],"gun-npc-ag":[[4,"gun-npc-idle-res-gun-ja"],[3,"gun-npc-idle-clean-gun-ja"],[2,"gun-npc-shadow-mg"],[1,"gun-npc-lod0-mg"],[0,"gun-npc-lod0-jg"]],"gun-rachet-ag":[[5,"gun-rachet-explode-idle-ja"],[4,"gun-rachet-explode-lod0-mg"],[3,"gun-rachet-explode-lod0-jg"],[2,"gun-rachet-idle-ja"],[1,"gun-rachet-lod0-mg"],[0,"gun-rachet-lod0-jg"]],"gun-rc-four-eyes-ag":[[5,"gun-rc-four-eyes-explode-idle-ja"],[4,"gun-rc-four-eyes-explode-lod0-mg"],[3,"gun-rc-four-eyes-explode-lod0-jg"],[2,"gun-rc-four-eyes-idle-ja"],[1,"gun-rc-four-eyes-lod0-mg"],[0,"gun-rc-four-eyes-lod0-jg"]],"gun-rc-one-eye-ag":[[5,"gun-rc-one-eye-explode-idle-ja"],[4,"gun-rc-one-eye-explode-lod0-mg"],[3,"gun-rc-one-eye-explode-lod0-jg"],[2,"gun-rc-one-eye-idle-ja"],[1,"gun-rc-one-eye-lod0-mg"],[0,"gun-rc-one-eye-lod0-jg"]],"gun-rc-three-eyes-ag":[[5,"gun-rc-three-eyes-explode-idle-ja"],[4,"gun-rc-three-eyes-explode-lod0-mg"],[3,"gun-rc-three-eyes-explode-lod0-jg"],[2,"gun-rc-three-eyes-idle-ja"],[1,"gun-rc-three-eyes-lod0-mg"],[0,"gun-rc-three-eyes-lod0-jg"]],"gun-rc-three-eyes-bonus-ag":[[5,"gun-rc-three-eyes-bonus-explode-idle-ja"],[4,"gun-rc-three-eyes-bonus-explode-lod0-mg"],[3,"gun-rc-three-eyes-bonus-explode-lod0-jg"],[2,"gun-rc-three-eyes-bonus-idle-ja"],[1,"gun-rc-three-eyes-bonus-lod0-mg"],[0,"gun-rc-three-eyes-bonus-lod0-jg"]],"gun-rc-two-eyes-ag":[[5,"gun-rc-two-eyes-explode-idle-ja"],[4,"gun-rc-two-eyes-explode-lod0-mg"],[3,"gun-rc-two-eyes-explode-lod0-jg"],[2,"gun-rc-two-eyes-idle-ja"],[1,"gun-rc-two-eyes-lod0-mg"],[0,"gun-rc-two-eyes-lod0-jg"]],"handcuffs-ag":[[2,"handcuffs-idle-ja"],[1,"handcuffs-lod0-mg"],[0,"handcuffs-lod0-jg"]],"hellcat-ag":[[5,"hellcat-idle-ja"],[4,"hellcat-shadow-mg"],[3,"hellcat-lod2-mg"],[2,"hellcat-lod1-mg"],[1,"hellcat-lod0-mg"],[0,"hellcat-lod0-jg"]],"hellcat-lowres-fma-ag":[[2,"hellcat-lowres-fma-idle-ja"],[1,"hellcat-lowres-fma-lod0-mg"],[0,"hellcat-lowres-fma-lod0-jg"]],"hellcat-tower-ag":[[2,"hellcat-tower-idle-ja"],[1,"hellcat-tower-lod0-mg"],[0,"hellcat-tower-lod0-jg"]],"hemisplosion-ag":[[2,"hemisplosion-idle-ja"],[1,"hemisplosion-lod0-mg"],[0,"hemisplosion-lod0-jg"]],"hip-door-a-ag":[[2,"hip-door-a-idle-ja"],[1,"hip-door-a-lod0-mg"],[0,"hip-door-a-lod0-jg"]],"hud-ring-ag":[[5,"hud-ring-part-idle-ja"],[4,"hud-ring-part-lod0-mg"],[3,"hud-ring-part-lod0-jg"],[2,"hud-ring-idle-ja"],[1,"hud-ring-lod0-mg"],[0,"hud-ring-lod0-jg"]],"interceptor-ag":[[19,"interceptor-idle-ja"],[18,"interceptor-shadow-mg"],[17,"interceptor-lod0-mg"],[16,"interceptor-lod0-jg"],[15,"interceptor-debris-panel-lod0-mg"],[14,"interceptor-debris-panel-lod0-jg"],[13,"interceptor-debris-rod-lod0-mg"],[0,"interceptor-wheel-lod0-jg"],[1,"interceptor-wheel-lod0-mg"],[2,"interceptor-wheel-shadow-mg"],[3,"interceptor-wheel-idle-ja"],[4,"interceptor-wheel-blur-lod0-jg"],[5,"interceptor-wheel-blur-lod0-mg"],[6,"interceptor-wheel-blur-shadow-mg"],[7,"interceptor-wheel-blur-idle-ja"],[8,"interceptor-debris-ring-lod0-jg"],[9,"interceptor-debris-ring-lod0-mg"],[10,"interceptor-debris-nut-lod0-jg"],[11,"interceptor-debris-nut-lod0-mg"],[12,"interceptor-debris-rod-lod0-jg"]],"interceptor-b-ag":[[11,"interceptor-b-idle-ja"],[10,"interceptor-b-shadow-mg"],[9,"interceptor-b-lod0-mg"],[8,"interceptor-b-lod0-jg"],[7,"interceptor-b-wheel-blur-idle-ja"],[6,"interceptor-b-wheel-blur-shadow-mg"],[5,"interceptor-b-wheel-blur-lod0-mg"],[4,"interceptor-b-wheel-blur-lod0-jg"],[3,"interceptor-b-wheel-idle-ja"],[2,"interceptor-b-wheel-shadow-mg"],[1,"interceptor-b-wheel-lod0-mg"],[0,"interceptor-b-wheel-lod0-jg"]],"interceptor-wheel-fma-ag":[[3,"interceptor-wheel-fma-idle-ja"],[2,"interceptor-wheel-fma-shadow-mg"],[1,"interceptor-wheel-fma-lod0-mg"],[0,"interceptor-wheel-fma-lod0-jg"]],"jak-highres-ag":[[4,"jak-highres-jakb-walk-ja"],[3,"jak-highres-idle-ja"],[2,"jak-highres-shadow-mg"],[1,"jak-highres-lod0-mg"],[0,"jak-highres-lod0-jg"]],"jak-one-ag":[[2,"jak-one-idle-ja"],[1,"jak-one-lod0-mg"],[0,"jak-one-lod0-jg"]],"jakb-ag":[[405,"jakb-turret-for-fire-ja"],[404,"jakb-turret-for-stance-right-ja"],[403,"jakb-turret-for-stance-left-ja"],[402,"jakb-turret-for-get-on-ja"],[401,"jakb-turret-for-get-off-ja"],[400,"jakb-turret-for-stance-ja"],[399,"jakb-turret-get-on-ja"],[398,"jakb-turret-get-off-ja"],[397,"jakb-turret-stance-ja"],[136,"jakb-tube-jump-land-ja"],[135,"jakb-tube-turn-ja"],[109,"jakb-tentacle-attack-ja"],[163,"jakb-racer-death-explode-ja"],[162,"jakb-racer-get-on-ja"],[161,"jakb-racer-get-off-ja"],[160,"jakb-racer-smack-ja"],[159,"jakb-racer-jump-high-land-ja"],[158,"jakb-racer-jump-high-loop-ja"],[157,"jakb-racer-stance-ja"],[156,"jakb-racer-jump-small-land-ja"],[155,"jakb-racer-jump-small-loop-ja"],[154,"jakb-racer-jump-small-ja"],[153,"jakb-racer-jump-land-ja"],[152,"jakb-racer-jump-loop-ja"],[151,"jakb-racer-jump-ja"],[150,"jakb-racer-dig2-ja"],[149,"jakb-racer-dig-ja"],[148,"jakb-racer-turn2-ja"],[147,"jakb-racer-turn-ja"],[146,"jakb-racer-idle-ja"],[131,"jakb-pole-jump-loop-ja"],[130,"jakb-pole-flip-forward-ja"],[129,"jakb-pole-flip-up-ja"],[128,"jakb-pole-cycle-ja"],[269,"jakb-pilot-wcar-turn-back-ja"],[268,"jakb-pilot-wcar-turn-front-ja"],[265,"jakb-pilot-bike-smack-right-ja"],[264,"jakb-pilot-bike-smack-left-ja"],[247,"jakb-pilot-bike-get-off-ja"],[246,"jakb-pilot-bike-smack-shock-ja"],[245,"jakb-pilot-bike-up-down-ja"],[243,"jakb-pilot-bike-smack-back-ja"],[242,"jakb-pilot-bike-smack-front-ja"],[241,"jakb-pilot-bike-turn-back-ja"],[240,"jakb-pilot-bike-turn-front-ja"],[234,"jakb-pilot-car-turn-back-ja"],[233,"jakb-pilot-car-turn-front-ja"],[232,"jakb-pilot-bike-get-on-ja"],[263,"jakb-pilot-gun-dark-takeout-ja"],[262,"jakb-pilot-gun-blue-takeout-ja"],[261,"jakb-pilot-gun-yellow-takeout-ja"],[260,"jakb-pilot-gun-blue-blue-ja"],[259,"jakb-pilot-gun-yellow-blue-ja"],[258,"jakb-pilot-gun-red-blue-ja"],[257,"jakb-pilot-gun-red-yellow-ja"],[256,"jakb-pilot-gun-red-dark-ja"],[255,"jakb-pilot-gun-dark-fire-ja"],[254,"jakb-pilot-gun-yellow-fire-ja"],[253,"jakb-pilot-gun-red-fire-ja"],[252,"jakb-pilot-gun-blue-idle-ja"],[251,"jakb-pilot-gun-yellow-idle-ja"],[250,"jakb-pilot-gun-dark-idle-ja"],[249,"jakb-pilot-gun-red-idle-ja"],[238,"jakb-pilot-gun-blue-fire-single-ja"],[237,"jakb-pilot-gun-blue-fire-ja"],[229,"jakb-pilot-gun-red-takeout-ja"],[271,"jakb-pilot-glider-turn-back-ja"],[270,"jakb-pilot-glider-turn-front-ja"],[267,"jakb-pilot-car-smack-right-ja"],[266,"jakb-pilot-car-smack-left-ja"],[248,"jakb-pilot-eject-loop-ja"],[244,"jakb-pilot-car-up-down-ja"],[239,"jakb-pilot-car-smack-shock-ja"],[236,"jakb-pilot-car-smack-back-ja"],[235,"jakb-pilot-car-smack-front-ja"],[231,"jakb-pilot-car-get-on-ja"],[230,"jakb-pilot-car-get-off-ja"],[208,"jakb-board-attack-pegasus-ja"],[391,"jakb-mech-punch-u-ja"],[390,"jakb-mech-death-b-ja"],[389,"jakb-mech-death-a-ja"],[388,"jakb-mech-get-on-ja"],[387,"jakb-mech-get-off-ja"],[386,"jakb-mech-hit-front-ja"],[385,"jakb-mech-drag-pickup-ja"],[384,"jakb-mech-pull-ja"],[383,"jakb-mech-push-ja"],[382,"jakb-mech-carry-turn45-ja"],[381,"jakb-mech-carry-throw-ja"],[380,"jakb-mech-carry-jump-land-ja"],[379,"jakb-mech-carry-jump-loop-ja"],[378,"jakb-mech-carry-jump-ja"],[377,"jakb-mech-carry-walk-ja"],[376,"jakb-mech-carry-stance-ja"],[375,"jakb-mech-carry-pickup-high-ja"],[374,"jakb-mech-carry-pickup-low-ja"],[373,"jakb-mech-punch-b-ja"],[372,"jakb-mech-punch-r-ja"],[371,"jakb-mech-punch-l-ja"],[370,"jakb-mech-turn20-ja"],[369,"jakb-mech-jump-land-ja"],[368,"jakb-mech-jump-loop-ja"],[367,"jakb-mech-jump-thrust-ja"],[366,"jakb-mech-jump-ja"],[365,"jakb-mech-turn90-ja"],[364,"jakb-mech-walk-ja"],[363,"jakb-mech-run-ja"],[362,"jakb-mech-stance-ja"],[536,"jakb-ladder-switch-ja"],[535,"jakb-ladder-jump-on-ja"],[534,"jakb-ladder-fall-ja"],[533,"jakb-ladder-jump-ja"],[532,"jakb-ladder-slide-stop-ja"],[531,"jakb-ladder-slide-loop-ja"],[530,"jakb-ladder-slide-start-ja"],[528,"jakb-ladder-down-ja"],[526,"jakb-ladder-stance-ja"],[524,"jakb-ladder-up-ja"],[522,"jakb-ladder-get-on-ja"],[430,"jakb-flut-kanga-catch-ja"],[134,"jakb-ice-stance-ja"],[133,"jakb-ice-slide-ja"],[132,"jakb-ice-skate-ja"],[432,"jakb-flut-death-drown-ja"],[431,"jakb-flut-deathb-ja"],[429,"jakb-flut-run-squash-ja"],[428,"jakb-flut-deatha-ja"],[427,"jakb-flut-smack-surface-end-ja"],[426,"jakb-flut-smack-surface-ja"],[425,"jakb-flut-hit-back-end-ja"],[424,"jakb-flut-hit-back-ja"],[423,"jakb-flut-get-off-ja"],[422,"jakb-flut-get-on-ja"],[421,"jakb-flut-air-attack-land-ja"],[420,"jakb-flut-air-attack-loop-ja"],[419,"jakb-flut-air-attack-ja"],[418,"jakb-flut-running-attack-end-ja"],[417,"jakb-flut-running-attack-ja"],[416,"jakb-flut-double-jump-ja"],[415,"jakb-flut-jump-forward-land-ja"],[414,"jakb-flut-jump-forward-loop-ja"],[413,"jakb-flut-jump-forward-ja"],[412,"jakb-flut-jump-land-ja"],[411,"jakb-flut-jump-loop-ja"],[410,"jakb-flut-jump-ja"],[409,"jakb-flut-run-ja"],[408,"jakb-flut-jog-ja"],[407,"jakb-flut-walk-ja"],[275,"jakb-pilot-wcar-snake-jump-ja"],[274,"jakb-pilot-wcar-snake-out-ja"],[273,"jakb-pilot-wcar-snake-loop-ja"],[272,"jakb-pilot-wcar-snake-in-ja"],[353,"jakb-gun-side-to-side-hop-2-ja"],[340,"jakb-gun-duck-walk-ja"],[334,"jakb-gun-yellow-fire-twirl-ja"],[333,"jakb-gun-red-from-sideways-ja"],[332,"jakb-gun-stance-red-sideways-ja"],[331,"jakb-gun-dark-fire-twirl-ja"],[330,"jakb-gun-red-fire-from-sideways-ja"],[329,"jakb-gun-red-fire-to-sideways-ja"],[108,"jakb-death-lava-ja"],[107,"jakb-invisible-to-stance-ja"],[106,"jakb-invisible-loop-ja"],[105,"jakb-stance-to-invisible-ja"],[104,"jakb-blast-recover-end-ja"],[103,"jakb-blast-recover-loop-ja"],[102,"jakb-blast-recover-ja"],[101,"jakb-wall-hide-body-ja"],[100,"jakb-wall-hide-head-right-ja"],[99,"jakb-wall-hide-head-left-ja"],[98,"jakb-wall-hide-head-ja"],[97,"jakb-wall-hide-scared-return-ja"],[96,"jakb-wall-hide-scared-loop-ja"],[95,"jakb-wall-hide-scared-ja"],[94,"jakb-wall-hide-ja"],[91,"jakb-powerup-ja"],[63,"jakb-attack-punch-alt-end-ja"],[57,"jakb-attack-from-stance-run-alt-end-ja"],[55,"jakb-attack-from-stance-alt-end-ja"],[43,"jakb-duck-high-jump-ja"],[35,"jakb-turn-around-ja"],[34,"jakb-duck-walk-ja"],[33,"jakb-duck-stance-ja"],[32,"jakb-stance-to-duck-ja"],[552,"jakb-shield-hit-ja"],[551,"jakb-shield-idle-ja"],[505,"jakb-lightjak-shield-end-ja"],[504,"jakb-lightjak-heal-end-ja"],[503,"jakb-lightjak-heal-loop-ja"],[502,"jakb-lightjak-heal-ja"],[500,"jakb-lightjak-freeze-land-ja"],[499,"jakb-lightjak-freeze-ja"],[498,"jakb-lightjak-shield-ja"],[497,"jakb-lightjak-swoop-land-ja"],[496,"jakb-lightjak-swoop-fall-loop-ja"],[495,"jakb-lightjak-swoop-fall-ja"],[494,"jakb-lightjak-swoop2-ja"],[493,"jakb-lightjak-swoop1-ja"],[492,"jakb-lightjak-stance-ja"],[486,"jakb-lightjak-stance-to-stance-ja"],[485,"jakb-lightjak-get-on-out-ja"],[483,"jakb-lightjak-get-on-land-ja"],[539,"jakb-wings-wings-shadow-mg"],[538,"jakb-wings-wings-lod0-mg"],[537,"jakb-wings-wings-lod0-jg"],[547,"jakb-wings-lightjak-swoop-land-ja"],[6,"jakb-old-lod0-mg"],[543,"jakb-wings-lightjak-swoop1-ja"],[2,"jakb-normal-lod0-jg"],[546,"jakb-wings-lightjak-swoop-fall-loop-ja"],[5,"jak-ext-geo-c+0-jakclod0-scarf-cg"],[545,"jakb-wings-lightjak-swoop-fall-ja"],[4,"jak-ext-geo-c+0-jakclod0-sash-cg"],[544,"jakb-wings-lightjak-swoop2-ja"],[3,"jak-ext-geo-c+0-jakclod0-skirt-cg"],[550,"jakb-shield-start-ja"],[9,"jakb-c-shadow-mg"],[549,"jakb-shield-shield-lod0-mg"],[8,"jakb-c-lod0-mg"],[548,"jakb-shield-shield-lod0-jg"],[7,"jakb-c-lod0-jg"],[221,"jakb-board-kickspin-c-ja"],[220,"jakb-board-kickspin-b-ja"],[219,"jakb-board-airwalk-end-ja"],[218,"jakb-board-airwalk-loop-ja"],[217,"jakb-board-airwalk-ja"],[216,"jakb-board-backgrab-end-ja"],[215,"jakb-board-backgrab-loop-ja"],[214,"jakb-board-backgrab-ja"],[213,"jakb-board-method-cross-end-ja"],[212,"jakb-board-method-cross-loop-ja"],[211,"jakb-board-method-cross-ja"],[210,"jakb-board-kickspin-a-ja"],[209,"jakb-board-jump-high-ja"],[206,"jakb-board-kickflip-c-ja"],[205,"jakb-board-kickflip-b-ja"],[201,"jakb-board-jump-kickoff-ja"],[200,"jakb-board-noseflip-ja"],[199,"jakb-board-nosegrab-end-ja"],[198,"jakb-board-nosegrab-loop-ja"],[197,"jakb-board-method-end-ja"],[196,"jakb-board-method-loop-ja"],[195,"jakb-board-flip-backward-loop-ja"],[194,"jakb-board-flip-forward-loop-ja"],[191,"jakb-board-flip-backward-ja"],[189,"jakb-board-spin-ja"],[188,"jakb-board-kickflip-a-ja"],[187,"jakb-board-method-ja"],[186,"jakb-board-nosegrab-ja"],[185,"jakb-board-grenade-ja"],[182,"jakb-board-ride-turn-left-ja"],[181,"jakb-board-ride-turn-right-ja"],[180,"jakb-board-ride-turn-front-ja"],[179,"jakb-board-ride-turn-back-ja"],[352,"jakb-gun-side-to-side-hop-1-ja"],[351,"jakb-gun-blue-stance-2-ja"],[350,"jakb-gun-blue-fire-2-ja"],[93,"jakb-slide-left-ja"],[349,"jakb-gun-yellow-fire-3-ja"],[92,"jakb-slide-right-ja"],[348,"jakb-gun-red-fire-2-ja"],[347,"jakb-gun-red-fire-fast-ja"],[90,"jakb-yellow-jumping-blast-ja"],[343,"jakb-gun-side-jump-land-ja"],[86,"jakb-shocked-ja"],[342,"jakb-gun-side-jump-ja"],[85,"jakb-smack-surface-end-ja"],[341,"jakb-gun-walk-blue-ja"],[84,"jakb-smack-surface-ja"],[324,"jakb-gun-flop-down-ja"],[67,"jakb-flop-down-land-ja"],[317,"jakb-gun-attack-upperbutt-blue-ja"],[60,"jakb-attack-from-jump-end-ja"],[311,"jakb-gun-attack-butt-ja"],[54,"jakb-attack-from-stance-end-ja"],[309,"jakb-gun-front-to-blue-hop-ja"],[52,"jakb-edge-grab-off-ja"],[304,"jakb-gun-blue-takeout-ja"],[47,"jakb-edge-grab-stance1-ja"],[303,"jakb-gun-yellow-takeout-ja"],[46,"jakb-edge-grab-stance0-ja"],[298,"jakb-gun-yellow-fire-ja"],[41,"jakb-jump-short-land-ja"],[297,"jakb-gun-dark-fire-ja"],[40,"jakb-jump-loop-ja"],[289,"jakb-gun-attack-from-stance-blue-end-ja"],[288,"jakb-gun-attack-from-stance-blue-ja"],[31,"jakb-run-squash-weak-ja"],[287,"jakb-gun-attack-from-stance-end-ja"],[30,"jakb-run-squash-ja"],[286,"jakb-gun-attack-from-stance-ja"],[29,"jakb-walk-left-ja"],[339,"jakb-gun-front-jump-land-ja"],[82,"jakb-deatha-ja"],[338,"jakb-gun-front-jump-ja"],[81,"jakb-hit-up-ja"],[337,"jakb-gun-front-run-ja"],[80,"jakb-hit-from-back-ja"],[83,"jakb-death-painful-land-ja"],[336,"jakb-gun-front-walk-ja"],[79,"jakb-hit-from-front-ja"],[295,"jakb-gun-blue-fire-ja"],[38,"jakb-painful-land-ja"],[294,"jakb-gun-red-fire-ja"],[37,"jakb-jump-land-ja"],[293,"jakb-gun-stance-blue-ja"],[36,"jakb-jump-ja"],[39,"jakb-painful-land-end-ja"],[296,"jakb-gun-blue-fire-single-ja"],[292,"jakb-gun-stance-yellow-ja"],[164,"jakb-board-stance-ja"],[291,"jakb-gun-stance-dark-ja"],[290,"jakb-gun-blue-to-yellow-ja"],[285,"jakb-gun-yellow-highlow-ja"],[28,"jakb-walk-right-ja"],[282,"jakb-gun-stance-ja"],[25,"jakb-walk-ja"],[27,"jakb-walk-down-ja"],[284,"jakb-gun-yellow-fire-low-ja"],[26,"jakb-walk-up-ja"],[283,"jakb-gun-stance-yellow-low-ja"],[540,"jakb-wings-lightjak-get-off-ja"],[406,"jakb-flut-idle-ja"],[24,"jakb-run-left-ja"],[281,"jakb-pilot-gun-dummy5-ja"],[541,"jakb-wings-lightjak-get-on-land-ja"],[0,"jakb-lod0-jg"],[514,"jakb-jak-death-4-ja"],[313,"jakb-gun-attack-butt-blue-ja"],[56,"jakb-attack-from-stance-run-end-ja"],[59,"jakb-attack-from-jump-loop-ja"],[316,"jakb-gun-jump-land-side-ja"],[42,"jakb-jump-forward-ja"],[299,"jakb-gun-walk-side-ja"],[13,"jakb-dummy107-ja"],[527,"jakb-ladder-stance-to-down-ja"],[326,"jakb-gun-flop-down-land-ja"],[69,"jakb-moving-flop-down-loop-ja"],[72,"jakb-duck-roll-ja"],[542,"jakb-wings-lightjak-stance-ja"],[1,"jakb-lod0-mg"],[515,"jakb-jak-death-5-ja"],[314,"jakb-gun-attack-butt-blue-end-ja"],[14,"jakb-dummy108-ja"],[327,"jakb-gun-hit-from-front-ja"],[70,"jakb-moving-flop-down-land-ja"],[73,"jakb-duck-roll-end-ja"],[15,"jakb-dummy109-ja"],[529,"jakb-ladder-get-off-ja"],[328,"jakb-gun-hit-from-back-ja"],[71,"jakb-flop-jump-ja"],[74,"jakb-roll-flip-ja"],[45,"jakb-launch-jump-loop-ja"],[302,"jakb-gun-dark-takeout-ja"],[16,"jakb-run-to-stance-ja"],[75,"jakb-roll-flip-land-ja"],[17,"jakb-run-to-stance-loop-ja"],[76,"jakb-trip-ja"],[18,"jakb-stance-loop-ja"],[77,"jakb-hit-elec-ja"],[19,"jakb-run-to-stance-fast-ja"],[276,"jakb-pilot-gun-dummy0-ja"],[78,"jakb-hit-from-front-alt1-ja"],[335,"jakb-gun-hit-elec-ja"],[20,"jakb-run-ja"],[277,"jakb-pilot-gun-dummy1-ja"],[21,"jakb-run-up-ja"],[278,"jakb-pilot-gun-dummy2-ja"],[22,"jakb-run-down-ja"],[279,"jakb-pilot-gun-dummy3-ja"],[23,"jakb-run-right-ja"],[280,"jakb-pilot-gun-dummy4-ja"],[300,"jakb-gun-run-blue-ja"],[301,"jakb-gun-red-takeout-ja"],[44,"jakb-launch-jump-ja"],[48,"jakb-falling-to-edge-grab-ja"],[305,"jakb-gun-attack-upperbutt-ja"],[51,"jakb-edge-grab-to-jump-ja"],[308,"jakb-gun-front-to-side-hop-ja"],[306,"jakb-gun-side-to-front-hop-ja"],[49,"jakb-edge-grab-swing-left-ja"],[307,"jakb-gun-transformation-twirl-ja"],[50,"jakb-edge-grab-swing-right-ja"],[53,"jakb-attack-from-stance-ja"],[310,"jakb-gun-blue-to-front-hop-ja"],[312,"jakb-gun-attack-butt-end-ja"],[58,"jakb-attack-from-jump-ja"],[315,"jakb-gun-jump-land-ja"],[61,"jakb-attack-punch-ja"],[318,"jakb-gun-edge-grab-off-ja"],[62,"jakb-attack-punch-end-ja"],[319,"jakb-gun-edge-grab-to-jump-ja"],[64,"jakb-attack-uppercut-ja"],[321,"jakb-gun-duck-roll-end-ja"],[65,"jakb-flop-down-ja"],[322,"jakb-gun-roll-flip-ja"],[320,"jakb-gun-duck-roll-ja"],[66,"jakb-flop-down-loop-ja"],[323,"jakb-gun-roll-flip-land-ja"],[68,"jakb-moving-flop-down-ja"],[325,"jakb-gun-flop-down-loop-ja"],[165,"jakb-board-duck-turn-ja"],[166,"jakb-board-turn-ja"],[168,"jakb-board-jump-ja"],[169,"jakb-board-jump-loop-ja"],[171,"jakb-board-hit-ja"],[174,"jakb-board-turn-left-ja"],[175,"jakb-board-turn-right-ja"],[176,"jakb-board-turn-up-ja"],[433,"jakb-flut-dummy2-ja"],[177,"jakb-board-turn-down-ja"],[434,"jakb-flut-dummy3-ja"],[178,"jakb-board-hit-forward-ja"],[435,"jakb-flut-dummy4-ja"],[183,"jakb-board-get-on-ja"],[440,"jakb-darkjak-get-on-ja"],[184,"jakb-board-get-off-ja"],[190,"jakb-board-air-turn-ja"],[447,"jakb-darkjak-hit-ja"],[202,"jakb-board-hit-elec-ja"],[203,"jakb-board-get-on-land-ja"],[204,"jakb-board-get-off-pre-ja"],[207,"jakb-board-hit-get-off-ja"],[458,"jakb-darkjak-get-off-ja"],[462,"jakb-darkjak-get-on-fast-ja"],[465,"jakb-darkjak-get-off-end-ja"],[472,"jakb-darkjak-get-on-fast-loop-ja"],[479,"jakb-powerjak-get-on-ja"],[222,"jakb-board-dummy3-ja"],[480,"jakb-powerjak-get-on-loop-ja"],[223,"jakb-board-dummy4-ja"],[481,"jakb-lightjak-get-on-ja"],[224,"jakb-board-dummy5-ja"],[482,"jakb-lightjak-get-off-ja"],[225,"jakb-board-dummy6-ja"],[484,"jakb-lightjak-get-on-loop-ja"],[227,"jakb-board-dummy8-ja"],[115,"jakb-wade-shallow-walk-ja"],[116,"jakb-wade-deep-walk-ja"],[117,"jakb-swim-stance-ja"],[118,"jakb-swim-walk-ja"],[119,"jakb-swim-walk-to-down-ja"],[120,"jakb-swim-down-ja"],[121,"jakb-swim-down-to-up-ja"],[122,"jakb-swim-up-ja"],[123,"jakb-swim-up-to-stance-ja"],[124,"jakb-swim-jump-ja"],[125,"jakb-death-swim-ja"],[126,"jakb-death-swim-loop-ja"],[127,"jakb-death-swim-end-ja"],[354,"jakb-carry-stance-ja"],[355,"jakb-carry-walk-ja"],[356,"jakb-carry-pickup-low-ja"],[357,"jakb-carry-pickup-high-ja"],[358,"jakb-carry-throw-ja"],[359,"jakb-carry-jump-ja"],[360,"jakb-carry-jump-loop-ja"],[361,"jakb-carry-jump-land-ja"],[511,"jakb-jak-death-1-ja"],[512,"jakb-jak-death-2-ja"],[513,"jakb-jak-death-3-ja"],[87,"jakb-periscope-grab-ja"],[344,"jakb-gun-wall-hide-ja"],[88,"jakb-yellow-running-blast-ja"],[345,"jakb-gun-wall-hide-loop-ja"],[89,"jakb-yellow-running-blast-end-ja"],[346,"jakb-gun-red-reload-ja"],[110,"jakb-dummy55-ja"],[111,"jakb-dummy56-ja"],[112,"jakb-dummy57-ja"],[113,"jakb-dummy58-ja"],[114,"jakb-dummy59-ja"],[137,"jakb-tube-dummy2-ja"],[394,"jakb-mech-dummy5-ja"],[138,"jakb-tube-dummy3-ja"],[395,"jakb-mech-dummy6-ja"],[139,"jakb-tube-dummy4-ja"],[396,"jakb-mech-dummy7-ja"],[140,"jakb-tube-dummy5-ja"],[141,"jakb-tube-dummy6-ja"],[173,"jakb-board-flip-forward-land-ja"],[192,"jakb-board-flip-backward-land-ja"],[193,"jakb-board-kickflip-land-ja"],[226,"jakb-board-dummy7-ja"],[228,"jakb-board-dummy9-ja"],[392,"jakb-mech-dummy3-ja"],[393,"jakb-mech-dummy4-ja"],[436,"jakb-flut-dummy5-ja"],[437,"jakb-flut-dummy6-ja"],[438,"jakb-flut-dummy7-ja"],[439,"jakb-flut-dummy8-ja"],[448,"jakb-darkjak-hit-land-ja"],[456,"jakb-darkjak-attack-combo3-ja"],[457,"jakb-darkjak-attack-combo3-end-ja"],[487,"jakb-lightjak-dummy10-ja"],[488,"jakb-lightjak-dummy11-ja"],[489,"jakb-lightjak-dummy12-ja"],[490,"jakb-lightjak-dummy13-ja"],[491,"jakb-lightjak-dummy14-ja"],[501,"jakb-lightjak-dummy26-ja"],[506,"jakb-lightjak-dummy21-ja"],[507,"jakb-lightjak-dummy22-ja"],[508,"jakb-lightjak-dummy23-ja"],[509,"jakb-lightjak-dummy24-ja"],[510,"jakb-lightjak-dummy25-ja"],[519,"jakb-dummy-57-ja"],[520,"jakb-dummy-58-ja"],[521,"jakb-dummy-59-ja"],[523,"jakb-ladder-stance-to-up-ja"],[525,"jakb-ladder-up-to-stance-ja"],[167,"jakb-board-jump-kick-ja"],[170,"jakb-board-turn-around-ja"],[172,"jakb-board-flip-forward-ja"]],"jakc-feet-ag":[[6,"jakc-feet-idle-ja"],[5,"jakc-feet-jakcfma0-scarf-cg"],[4,"jakc-feet-jakcfma0-sash-cg"],[3,"jakc-feet-jakcfma0-skirt-cg"],[2,"jakc-feet-shadow-mg"],[1,"jakc-feet-lod0-mg"],[0,"jakc-feet-lod0-jg"]],"jakc-highres-ag":[[7,"jakc-highres-jakc-walk-ja"],[6,"jakc-highres-idle-ja"],[5,"jakc-highres-jakcfma0-scarf-cg"],[4,"jakc-highres-jakcfma0-sash-cg"],[3,"jakc-highres-jakcfma0-skirt-cg"],[2,"jakc-highres-shadow-mg"],[1,"jakc-highres-lod0-mg"],[0,"jakc-highres-lod0-jg"]],"jakc-scarf-ag":[[2,"jakc-scarf-idle-ja"],[1,"jakc-scarf-lod0-mg"],[0,"jakc-scarf-lod0-jg"]],"jakc-wings-ag":[[2,"jakc-wings-idle-ja"],[1,"jakc-wings-lod0-mg"],[0,"jakc-wings-lod0-jg"]],"jakthreelogo-ag":[[2,"jakthreelogo-idle-ja"],[1,"jakthreelogo-lod0-mg"],[0,"jakthreelogo-lod0-jg"]],"jinx-ag":[[35,"jinx-kneel-knocked-right-ja"],[34,"jinx-kneel-knocked-left-ja"],[33,"jinx-kneel-up-ja"],[32,"jinx-kneel-loop1-ja"],[31,"jinx-kneel-loop0-ja"],[30,"jinx-kneel-fix-ja"],[29,"jinx-kneel-down-ja"],[12,"jinx-turn-left50-end0-ja"],[11,"jinx-turn-left-start0-ja"],[10,"jinx-run0-ja"],[9,"jinx-walk0-ja"],[8,"jinx-die-in-place0-ja"],[7,"jinx-knocked-land0-ja"],[6,"jinx-knocked0-ja"],[5,"jinx-blue-hit-front0-ja"],[4,"jinx-idle1-ja"],[3,"jinx-idle0-ja"],[2,"jinx-shadow-mg"],[1,"jinx-lod0-mg"],[0,"jinx-lod0-jg"],[13,"jinx-turn-left100-end0-ja"],[14,"jinx-turn-left150-end0-ja"],[15,"jinx-kick0-ja"],[16,"jinx-kick1-ja"],[17,"jinx-in-car-back-ja"],[18,"jinx-in-car-front-ja"],[19,"jinx-get-in-car-start-ja"],[20,"jinx-get-in-car-jump-ja"],[21,"jinx-get-in-car-land-ja"],[22,"jinx-get-in-car-sit-ja"],[23,"jinx-get-in-car-sit-end-ja"],[24,"jinx-get-out-car-start-ja"],[25,"jinx-get-out-car-getup-ja"],[26,"jinx-get-out-car-start-jump-ja"],[27,"jinx-get-out-car-jump-ja"],[28,"jinx-get-out-car-land-ja"]],"jinx-highres-ag":[[4,"jinx-highres-jinx-walk-ja"],[3,"jinx-highres-idle-hiphog-ja"],[2,"jinx-highres-idle-ja"],[1,"jinx-highres-lod0-mg"],[0,"jinx-highres-lod0-jg"]],"kanga-lizard-ag":[[10,"kanga-lizard-run-squash-ja"],[9,"kanga-lizard-jump-land-ja"],[8,"kanga-lizard-jump-ja"],[7,"kanga-lizard-notice-ja"],[6,"kanga-lizard-run-ja"],[5,"kanga-lizard-jog-ja"],[4,"kanga-lizard-ambient-ja"],[3,"kanga-lizard-idle-ja"],[2,"kanga-lizard-shadow-mg"],[1,"kanga-lizard-lod0-mg"],[0,"kanga-lizard-lod0-jg"],[11,"kanga-lizard-flut-kanga-catch-ja"]],"keira-highres-ag":[[4,"keira-highres-keira-idle-ja"],[3,"keira-highres-idle-ja"],[2,"keira-highres-shadow-mg"],[1,"keira-highres-lod0-mg"],[0,"keira-highres-lod0-jg"]],"keira-simple-ag":[[2,"keira-simple-idle-ja"],[1,"keira-simple-lod0-mg"],[0,"keira-simple-lod0-jg"]],"kg-debris-ag":[[7,"kg-debris-d-lod0-mg"],[6,"kg-debris-d-lod0-jg"],[5,"kg-debris-c-lod0-mg"],[4,"kg-debris-c-lod0-jg"],[3,"kg-debris-b-lod0-mg"],[2,"kg-debris-b-lod0-jg"],[1,"kg-debris-a-lod0-mg"],[0,"kg-debris-a-lod0-jg"]],"kg-fighter-ag":[[7,"kg-fighter-explode-idle-ja"],[6,"kg-fighter-explode-lod0-mg"],[5,"kg-fighter-explode-lod0-jg"],[4,"kg-fighter-idle-ja"],[3,"kg-fighter-lod2-mg"],[2,"kg-fighter-lod1-mg"],[1,"kg-fighter-lod0-mg"],[0,"kg-fighter-lod0-jg"]],"kg-flying-turret-ag":[[4,"kg-flying-turret-fire-ja"],[3,"kg-flying-turret-hover-ja"],[2,"kg-flying-turret-idle-ja"],[1,"kg-flying-turret-lod0-mg"],[0,"kg-flying-turret-lod0-jg"]],"kg-grunt-ag":[[47,"kg-grunt-jump-land-ja"],[46,"kg-grunt-jump-in-air-ja"],[45,"kg-grunt-jump-wind-up-ja"],[44,"kg-grunt-blue-land-ja"],[43,"kg-grunt-blue-hit5-ja"],[42,"kg-grunt-blue-hit4-ja"],[41,"kg-grunt-blue-hit3-ja"],[40,"kg-grunt-blue-hit2-ja"],[39,"kg-grunt-blue-hit1-ja"],[38,"kg-grunt-blue-hit0-ja"],[37,"kg-grunt-yellow-hit3-ja"],[36,"kg-grunt-yellow-hit2-ja"],[35,"kg-grunt-yellow-hit1-ja"],[34,"kg-grunt-yellow-hit0-ja"],[33,"kg-grunt-bite-ja"],[32,"kg-grunt-die-falling-ja"],[31,"kg-grunt-celebrate-finish-ja"],[30,"kg-grunt-celebrate-start-ja"],[29,"kg-grunt-explode-land0-ja"],[12,"kg-grunt-patrol1-ja"],[11,"kg-grunt-patrol0-ja"],[10,"kg-grunt-idle1-left-to-idle-ja"],[9,"kg-grunt-idle1-look-left-hold-ja"],[8,"kg-grunt-idle1-look-left-ja"],[7,"kg-grunt-idle1-look-right-hold-ja"],[6,"kg-grunt-idle1-look-right-ja"],[5,"kg-grunt-idle-ja"],[4,"kg-grunt-shadow-mg"],[3,"kg-grunt-lod2-mg"],[2,"kg-grunt-lod1-mg"],[1,"kg-grunt-lod0-mg"],[0,"kg-grunt-lod0-jg"],[13,"kg-grunt-notice-ja"],[14,"kg-grunt-charge0-ja"],[15,"kg-grunt-charge1-ja"],[16,"kg-grunt-charge2-ja"],[17,"kg-grunt-attack0-ja"],[18,"kg-grunt-attack1-ja"],[19,"kg-grunt-death-in-place-ja"],[20,"kg-grunt-taunt-ja"],[21,"kg-grunt-turn-ja"],[22,"kg-grunt-knocked0-ja"],[23,"kg-grunt-knocked-land0-ja"],[24,"kg-grunt-knocked1-ja"],[25,"kg-grunt-knocked-land1-ja"],[26,"kg-grunt-knocked2-ja"],[27,"kg-grunt-knocked-land2-ja"],[28,"kg-grunt-explode0-ja"]],"kg-hopper-ag":[[36,"kg-hopper-hop-attack-land-ja"],[35,"kg-hopper-hop-attack-air-ja"],[34,"kg-hopper-hop-attack-start-ja"],[33,"kg-hopper-hop-land-ja"],[32,"kg-hopper-hop-air-ja"],[31,"kg-hopper-hop-start-ja"],[30,"kg-hopper-knocked2-land-ja"],[29,"kg-hopper-knocked2-ja"],[12,"kg-hopper-jump-start-right-ja"],[11,"kg-hopper-jump-start-left-ja"],[10,"kg-hopper-jump-start-ja"],[9,"kg-hopper-turn-ja"],[8,"kg-hopper-notice-alt-ja"],[7,"kg-hopper-notice-ja"],[6,"kg-hopper-idle-look-right-ja"],[5,"kg-hopper-idle-look-left-ja"],[4,"kg-hopper-idle-ja"],[3,"kg-hopper-shadow-mg"],[2,"kg-hopper-lod1-mg"],[1,"kg-hopper-lod0-mg"],[0,"kg-hopper-lod0-jg"],[13,"kg-hopper-jump-ja"],[14,"kg-hopper-jump-land-ja"],[15,"kg-hopper-jump-attack-ja"],[16,"kg-hopper-jump-attack-land-ja"],[17,"kg-hopper-jump-attack2-ja"],[18,"kg-hopper-jump-attack2-land-ja"],[19,"kg-hopper-die-ja"],[20,"kg-hopper-die-falling-ja"],[21,"kg-hopper-blue-hit0-ja"],[22,"kg-hopper-blue-hit1-ja"],[23,"kg-hopper-blue-hit2-ja"],[24,"kg-hopper-blue-hit-land-ja"],[25,"kg-hopper-knocked0-ja"],[26,"kg-hopper-knocked0-land-ja"],[27,"kg-hopper-knocked1-ja"],[28,"kg-hopper-knocked1-land-ja"]],"kg-pickup-ag":[[3,"kg-pickup-idle-ja"],[2,"kg-pickup-shadow-mg"],[1,"kg-pickup-lod0-mg"],[0,"kg-pickup-lod0-jg"]],"kg-robot-transport-ag":[[3,"kg-robot-transport-idle-ja"],[2,"kg-robot-transport-shadow-mg"],[1,"kg-robot-transport-lod0-mg"],[0,"kg-robot-transport-lod0-jg"]],"kg-robot-transport-bomb-ag":[[2,"kg-robot-transport-bomb-idle-ja"],[1,"kg-robot-transport-bomb-lod0-mg"],[0,"kg-robot-transport-bomb-lod0-jg"]],"kg-robot-transport-break-ag":[[3,"kg-robot-transport-break-break-ja"],[2,"kg-robot-transport-break-idle-ja"],[1,"kg-robot-transport-break-lod0-mg"],[0,"kg-robot-transport-break-lod0-jg"]],"kid-ag":[[3,"kid-idle-ja"],[2,"kid-shadow-mg"],[1,"kid-lod0-mg"],[0,"kid-lod0-jg"]],"kid-highres-ag":[[2,"kid-highres-kid-walk-ja"],[1,"kid-highres-lod0-mg"],[0,"kid-highres-lod0-jg"]],"kidmedallion-ag":[[2,"kidmedallion-idle-ja"],[1,"kidmedallion-lod0-mg"],[0,"kidmedallion-lod0-jg"]],"king-highres-ag":[[10,"king-highres-damus-walk-ja"],[9,"king-highres-idle-wasdoors-ja"],[8,"king-highres-idle-breathe-forward-ja"],[7,"king-highres-idle-lean-forward-ja"],[6,"king-highres-idle-breathe-back-ja"],[5,"king-highres-idle-lean-back-ja"],[4,"king-highres-idle-ja"],[3,"king-highres-king-kingskirt-cg"],[2,"king-highres-shadow-mg"],[1,"king-highres-lod0-mg"],[0,"king-highres-lod0-jg"]],"king-rider-ag":[[5,"king-rider-pilot-car-up-down-ja"],[4,"king-rider-pilot-car-turn-back-ja"],[3,"king-rider-pilot-car-turn-front-ja"],[2,"king-rider-idle-ja"],[1,"king-rider-lod0-mg"],[0,"king-rider-lod0-jg"]],"kleever-highres-ag":[[14,"kleever-highres-kleever-walk-ja"],[13,"kleever-highres-idle-shift-b-ja"],[0,"kleever-highres-lod0-jg"],[1,"kleever-highres-lod0-mg"],[2,"kleever-highres-shadow-mg"],[3,"kleever-highres-kleever-R1-cg"],[4,"kleever-highres-kleever-L1-cg"],[5,"kleever-highres-kleever-Center-cg"],[6,"kleever-highres-kleever-R2-cg"],[7,"kleever-highres-kleever-L2-cg"],[8,"kleever-highres-idle-ja"],[9,"kleever-highres-idle-city-chase-ja"],[10,"kleever-highres-idle-breathing-a-ja"],[11,"kleever-highres-idle-shift-a-ja"],[12,"kleever-highres-idle-breathing-b-ja"]],"kleever-rider-ag":[[5,"kleever-rider-pilot-car-up-down-ja"],[4,"kleever-rider-pilot-car-turn-back-ja"],[3,"kleever-rider-pilot-car-turn-front-ja"],[2,"kleever-rider-idle-ja"],[1,"kleever-rider-lod0-mg"],[0,"kleever-rider-lod0-jg"]],"kor-highres-ag":[[3,"kor-highres-kor-idle-ja"],[2,"kor-highres-idle-ja"],[1,"kor-highres-lod0-mg"],[0,"kor-highres-lod0-jg"]],"krew-ag":[[2,"krew-idle-ja"],[1,"krew-lod0-mg"],[0,"krew-lod0-jg"]],"krimson-wall-ag":[[4,"krimson-wall-idle-ja"],[3,"krimson-wall-lod2-mg"],[2,"krimson-wall-lod1-mg"],[1,"krimson-wall-lod0-mg"],[0,"krimson-wall-lod0-jg"]],"krimson-wall-break-ag":[[28,"krimson-wall-break-b-idle-3-ja"],[26,"krimson-wall-break-b-end-2-ja"],[25,"krimson-wall-break-b-idle-2-ja"],[23,"krimson-wall-break-b-end-ja"],[22,"krimson-wall-break-b-idle-ja"],[19,"krimson-wall-break-a-end-3-ja"],[29,"krimson-wall-break-b-end-3-ja"],[0,"krimson-wall-break-lod0-jg"],[13,"krimson-wall-break-a-end-ja"],[1,"krimson-wall-break-lod0-mg"],[2,"krimson-wall-break-idle-ja"],[15,"krimson-wall-break-a-idle-2-ja"],[3,"krimson-wall-break-end-ja"],[16,"krimson-wall-break-a-end-2-ja"],[5,"krimson-wall-break-idle-2-ja"],[18,"krimson-wall-break-a-idle-3-ja"],[6,"krimson-wall-break-end-2-ja"],[8,"krimson-wall-break-idle-3-ja"],[9,"krimson-wall-break-end-3-ja"],[12,"krimson-wall-break-a-idle-ja"]],"ladder-ag":[[2,"ladder-idle-ja"],[1,"ladder-lod0-mg"],[0,"ladder-lod0-jg"]],"leggings-ag":[[2,"leggings-idle-ja"],[1,"leggings-lod0-mg"],[0,"leggings-lod0-jg"]],"leggings-fma-ag":[[2,"leggings-fma-idle-ja"],[1,"leggings-fma-lod0-mg"],[0,"leggings-fma-lod0-jg"]],"lfac-hanger-door-ag":[[2,"lfac-hanger-door-idle-ja"],[1,"lfac-hanger-door-lod0-mg"],[0,"lfac-hanger-door-lod0-jg"]],"light-eco-vent-ag":[[4,"light-eco-vent-close-open-ja"],[3,"light-eco-vent-lod2-mg"],[2,"light-eco-vent-lod1-mg"],[1,"light-eco-vent-lod0-mg"],[0,"light-eco-vent-lod0-jg"]],"manta-ag":[[22,"manta-glide-end-ja"],[21,"manta-attack-end-ja"],[20,"manta-attack-start-ja"],[19,"manta-falling-death-land-phase-out-ja"],[18,"manta-falling-death-land-ja"],[17,"manta-falling-death-fade-ja"],[16,"manta-falling-death-ja"],[15,"manta-knocked-blue-recover-ja"],[14,"manta-knocked-blue-ja"],[13,"manta-knocked0-ja"],[0,"manta-lod0-jg"],[1,"manta-lod0-mg"],[2,"manta-shadow-mg"],[3,"manta-idle0-ja"],[4,"manta-idle1-ja"],[5,"manta-go-alert-ja"],[6,"manta-alert-idle-ja"],[7,"manta-alert-to-fly-ja"],[8,"manta-flap-ja"],[9,"manta-flap1-ja"],[10,"manta-flap-fast-ja"],[11,"manta-flap-back-ja"],[12,"manta-land-ja"]],"mantis-ag":[[35,"mantis-ragdoll-ja"],[34,"mantis-hop-left-land-ja"],[33,"mantis-hop-left-ja"],[32,"mantis-roll-left-ja"],[31,"mantis-roll-right-land-ja"],[30,"mantis-roll-right-ja"],[29,"mantis-attack1-land-ja"],[12,"mantis-hop-backward-wind-up-ja"],[11,"mantis-hop-forward-go-ja"],[10,"mantis-hop-forward-wind-up-ja"],[9,"mantis-run0-ja"],[8,"mantis-idle1-to-idle0-ja"],[7,"mantis-idle0-to-idle1-ja"],[6,"mantis-idle1-ja"],[5,"mantis-idle0-ja"],[4,"mantis-shadow-mg"],[3,"mantis-lod2-mg"],[2,"mantis-lod1-mg"],[1,"mantis-lod0-mg"],[0,"mantis-lod0-jg"],[13,"mantis-hop-backward-go-ja"],[14,"mantis-hop-backward-land-ja"],[15,"mantis-flip-forward-wind-up-ja"],[16,"mantis-flip-forward-go-ja"],[17,"mantis-flip-forward-land-ja"],[18,"mantis-flip-backward-wind-up-ja"],[19,"mantis-flip-backward-go-ja"],[20,"mantis-flip-backward-land-ja"],[21,"mantis-ground-jump-out-ja"],[22,"mantis-ground-jump-out-land-ja"],[23,"mantis-ground-crawl-out-ja"],[24,"mantis-death0-ja"],[25,"mantis-attack0-ja"],[26,"mantis-attack0-land-ja"],[27,"mantis-attack1-wind-up-ja"],[28,"mantis-attack1-go-ja"]],"marauder-male-ag":[[34,"marauder-male-die-ja"],[33,"marauder-male-turn-ja"],[32,"marauder-male-attack-shoot0-end-ja"],[31,"marauder-male-attack-shoot0-shoot-ja"],[30,"marauder-male-attack-shoot0-start-ja"],[29,"marauder-male-run2-ja"],[12,"marauder-male-jump-out-car-land-ja"],[11,"marauder-male-jump-out-car-ja"],[10,"marauder-male-jump-land-ja"],[9,"marauder-male-jump-ja"],[8,"marauder-male-jump-start-ja"],[7,"marauder-male-run1-ja"],[6,"marauder-male-run0-ja"],[5,"marauder-male-walk0-ja"],[4,"marauder-male-idle1-ja"],[3,"marauder-male-idle0-ja"],[2,"marauder-male-shadow-mg"],[1,"marauder-male-lod0-mg"],[0,"marauder-male-lod0-jg"],[13,"marauder-male-attack-run0-start-ja"],[14,"marauder-male-attack-run0-ja"],[15,"marauder-male-attack-jump0-start-ja"],[16,"marauder-male-attack-jump0-ja"],[17,"marauder-male-attack-jump0-land-ja"],[18,"marauder-male-celebrate0-ja"],[19,"marauder-male-ragdoll-ja"],[20,"marauder-male-knocked-back0-ja"],[21,"marauder-male-knocked-back0-land-ja"],[22,"marauder-male-knocked-death-ja"],[23,"marauder-male-knocked-death-land-ja"],[24,"marauder-male-knocked-forward0-ja"],[25,"marauder-male-knocked-forward0-land-ja"],[26,"marauder-male-knocked-forward-death-ja"],[27,"marauder-male-knocked-forward-death-land-ja"],[28,"marauder-male-drown-lava-ja"]],"market-basket-a-ag":[[2,"market-basket-a-idle-ja"],[1,"market-basket-a-lod0-mg"],[0,"market-basket-a-lod0-jg"]],"market-basket-b-ag":[[2,"market-basket-b-idle-ja"],[1,"market-basket-b-lod0-mg"],[0,"market-basket-b-lod0-jg"]],"market-crate-ag":[[2,"market-crate-idle-ja"],[1,"market-crate-lod0-mg"],[0,"market-crate-lod0-jg"]],"market-sack-a-ag":[[2,"market-sack-a-idle-ja"],[1,"market-sack-a-lod0-mg"],[0,"market-sack-a-lod0-jg"]],"market-sack-b-ag":[[2,"market-sack-b-idle-ja"],[1,"market-sack-b-lod0-mg"],[0,"market-sack-b-lod0-jg"]],"mayor-ag":[[2,"mayor-mayor-pace-ja"],[1,"mayor-lod0-mg"],[0,"mayor-lod0-jg"]],"mech-ag":[[44,"mech-target-idle-ja"],[43,"mech-target-lod0-mg"],[42,"mech-target-lod0-jg"],[41,"mech-explode-idle-ja"],[40,"mech-explode-lod0-mg"],[39,"mech-explode-lod0-jg"],[3,"mech-mech-idle-ja"],[2,"mech-shadow-mg"],[1,"mech-lod0-mg"],[0,"mech-lod0-jg"],[33,"mech-mech-punch-u-ja"],[32,"mech-mech-death-b-ja"],[31,"mech-mech-death-a-ja"],[30,"mech-mech-get-on-ja"],[29,"mech-mech-get-off-ja"],[28,"mech-mech-hit-front-ja"],[7,"mech-mech-turn90-ja"],[36,"mech-mech-dummy5-ja"],[6,"mech-mech-walk-ja"],[35,"mech-mech-dummy4-ja"],[5,"mech-mech-run-ja"],[34,"mech-mech-dummy3-ja"],[4,"mech-mech-stance-ja"],[38,"mech-mech-dummy7-ja"],[9,"mech-mech-jump-thrust-ja"],[11,"mech-mech-jump-land-ja"],[37,"mech-mech-dummy6-ja"],[8,"mech-mech-jump-ja"],[10,"mech-mech-jump-loop-ja"],[12,"mech-mech-turn20-ja"],[13,"mech-mech-punch-l-ja"],[14,"mech-mech-punch-r-ja"],[15,"mech-mech-punch-b-ja"],[16,"mech-mech-carry-pickup-low-ja"],[17,"mech-mech-carry-pickup-high-ja"],[18,"mech-mech-carry-stance-ja"],[19,"mech-mech-carry-walk-ja"],[20,"mech-mech-carry-jump-ja"],[21,"mech-mech-carry-jump-loop-ja"],[22,"mech-mech-carry-jump-land-ja"],[23,"mech-mech-carry-throw-ja"],[24,"mech-mech-carry-turn45-ja"],[25,"mech-mech-push-ja"],[26,"mech-mech-pull-ja"],[27,"mech-mech-drag-pickup-ja"]],"mecha-daxter-ag":[[2,"mecha-daxter-idle-ja"],[1,"mecha-daxter-lod0-mg"],[0,"mecha-daxter-lod0-jg"]],"mh-bat-ag":[[7,"mh-bat-attack0-ja"],[6,"mh-bat-attack0-windup-ja"],[5,"mh-bat-fly-glide0-ja"],[4,"mh-bat-fly-fast0-ja"],[3,"mh-bat-ragdoll-ja"],[2,"mh-bat-shadow-mg"],[1,"mh-bat-lod0-mg"],[0,"mh-bat-lod0-jg"]],"mh-centipede-ag":[[10,"mh-centipede-explode-idle-ja"],[9,"mh-centipede-explode-lod0-mg"],[8,"mh-centipede-explode-lod0-jg"],[7,"mh-centipede-shoot-ja"],[6,"mh-centipede-breach-2-ja"],[5,"mh-centipede-breach-1-ja"],[4,"mh-centipede-breach-ja"],[3,"mh-centipede-idle-ja"],[2,"mh-centipede-shadow-mg"],[1,"mh-centipede-lod0-mg"],[0,"mh-centipede-lod0-jg"]],"mh-communicator-ag":[[3,"mh-communicator-activate-ja"],[2,"mh-communicator-idle-ja"],[1,"mh-communicator-lod0-mg"],[0,"mh-communicator-lod0-jg"]],"mh-flyer-ag":[[10,"mh-flyer-ragdoll-ja"],[9,"mh-flyer-fly-fast0-jitter-ja"],[8,"mh-flyer-glide0-jitter-ja"],[7,"mh-flyer-fly0-jitter-ja"],[6,"mh-flyer-fly-fast0-ja"],[5,"mh-flyer-glide0-ja"],[4,"mh-flyer-fly0-ja"],[3,"mh-flyer-shadow-mg"],[2,"mh-flyer-lod1-mg"],[1,"mh-flyer-lod0-mg"],[0,"mh-flyer-lod0-jg"]],"mh-flyer-missile-ag":[[2,"mh-flyer-missile-idle-ja"],[1,"mh-flyer-missile-lod0-mg"],[0,"mh-flyer-missile-lod0-jg"]],"mh-plant-ag":[[7,"mh-plant-burrow-ja"],[6,"mh-plant-pop-up-ja"],[5,"mh-plant-swell-ja"],[4,"mh-plant-throb-ja"],[3,"mh-plant-idle-ja"],[2,"mh-plant-lod1-mg"],[1,"mh-plant-lod0-mg"],[0,"mh-plant-lod0-jg"]],"mh-spawner-ag":[[2,"mh-spawner-idle-ja"],[1,"mh-spawner-lod0-mg"],[0,"mh-spawner-lod0-jg"]],"mhcity-claw-finger-small-ag":[[3,"mhcity-claw-finger-small-open-ja"],[2,"mhcity-claw-finger-small-idle-ja"],[1,"mhcity-claw-finger-small-lod0-mg"],[0,"mhcity-claw-finger-small-lod0-jg"]],"mhcity-dark-eco-door-ag":[[2,"mhcity-dark-eco-door-idle-ja"],[1,"mhcity-dark-eco-door-lod0-mg"],[0,"mhcity-dark-eco-door-lod0-jg"]],"mhcity-dark-eco-door-break-ag":[[4,"mhcity-dark-eco-door-break-explode-ja"],[3,"mhcity-dark-eco-door-break-crack-ja"],[2,"mhcity-dark-eco-door-break-idle-ja"],[1,"mhcity-dark-eco-door-break-lod0-mg"],[0,"mhcity-dark-eco-door-break-lod0-jg"]],"mhcity-dark-eco-nodule-ag":[[2,"mhcity-dark-eco-nodule-idle-ja"],[1,"mhcity-dark-eco-nodule-lod0-mg"],[0,"mhcity-dark-eco-nodule-lod0-jg"]],"mhcity-de-tower-egg-ag":[[3,"mhcity-de-tower-egg-hit-ja"],[2,"mhcity-de-tower-egg-idle-ja"],[1,"mhcity-de-tower-egg-lod0-mg"],[0,"mhcity-de-tower-egg-lod0-jg"]],"mhcity-eco-dark-tower-ag":[[7,"mhcity-eco-dark-tower-straight-ja"],[6,"mhcity-eco-dark-tower-spit-loop-b-ja"],[5,"mhcity-eco-dark-tower-spit-loop-a-ja"],[4,"mhcity-eco-dark-tower-spit-b-ja"],[3,"mhcity-eco-dark-tower-spit-a-ja"],[2,"mhcity-eco-dark-tower-idle-ja"],[1,"mhcity-eco-dark-tower-lod0-mg"],[0,"mhcity-eco-dark-tower-lod0-jg"]],"mhcity-grunt-egg-b-ag":[[4,"mhcity-grunt-egg-b-idle2-ja"],[3,"mhcity-grunt-egg-b-idle-ja"],[2,"mhcity-grunt-egg-b-lod1-mg"],[1,"mhcity-grunt-egg-b-lod0-mg"],[0,"mhcity-grunt-egg-b-lod0-jg"]],"mhcity-grunt-egg-c-ag":[[4,"mhcity-grunt-egg-c-idle2-ja"],[3,"mhcity-grunt-egg-c-idle-ja"],[2,"mhcity-grunt-egg-c-lod1-mg"],[1,"mhcity-grunt-egg-c-lod0-mg"],[0,"mhcity-grunt-egg-c-lod0-jg"]],"mhcity-puffer-ag":[[4,"mhcity-puffer-spit-loop-ja"],[3,"mhcity-puffer-spit-ja"],[2,"mhcity-puffer-idle-ja"],[1,"mhcity-puffer-lod0-mg"],[0,"mhcity-puffer-lod0-jg"]],"mhcity-puffer-large-ag":[[4,"mhcity-puffer-large-spit-loop-ja"],[3,"mhcity-puffer-large-spit-ja"],[2,"mhcity-puffer-large-idle-ja"],[1,"mhcity-puffer-large-lod0-mg"],[0,"mhcity-puffer-large-lod0-jg"]],"mhcity-tower-door-ag":[[2,"mhcity-tower-door-idle-ja"],[1,"mhcity-tower-door-lod0-mg"],[0,"mhcity-tower-door-lod0-jg"]],"mhcity-tower-door-break-ag":[[2,"mhcity-tower-door-break-idle-ja"],[1,"mhcity-tower-door-break-lod0-mg"],[0,"mhcity-tower-door-break-lod0-jg"]],"mhcity-twitch-blade-ag":[[2,"mhcity-twitch-blade-idle-ja"],[1,"mhcity-twitch-blade-lod0-mg"],[0,"mhcity-twitch-blade-lod0-jg"]],"mhcity-vein-writhing-large-ag":[[2,"mhcity-vein-writhing-large-idle-ja"],[1,"mhcity-vein-writhing-large-lod0-mg"],[0,"mhcity-vein-writhing-large-lod0-jg"]],"mhcity-vein-writhing-small-ag":[[2,"mhcity-vein-writhing-small-idle-ja"],[1,"mhcity-vein-writhing-small-lod0-mg"],[0,"mhcity-vein-writhing-small-lod0-jg"]],"mhcity-vine-wriggler-ag":[[2,"mhcity-vine-wriggler-idle-ja"],[1,"mhcity-vine-wriggler-lod0-mg"],[0,"mhcity-vine-wriggler-lod0-jg"]],"mhcity-vine-wriggler-big-ag":[[2,"mhcity-vine-wriggler-big-idle-ja"],[1,"mhcity-vine-wriggler-big-lod0-mg"],[0,"mhcity-vine-wriggler-big-lod0-jg"]],"min-airlock-door-ag":[[2,"min-airlock-door-idle-ja"],[1,"min-airlock-door-lod0-mg"],[0,"min-airlock-door-lod0-jg"]],"min-bomb-elevator-ag":[[2,"min-bomb-elevator-idle-ja"],[1,"min-bomb-elevator-lod0-mg"],[0,"min-bomb-elevator-lod0-jg"]],"min-bomb-train-ag":[[6,"min-bomb-train-mine-boss-train-3-ja"],[5,"min-bomb-train-mine-boss-train-2-ja"],[4,"min-bomb-train-mine-boss-train-1-ja"],[3,"min-bomb-train-idle-ja"],[2,"min-bomb-train-shadow-mg"],[1,"min-bomb-train-lod0-mg"],[0,"min-bomb-train-lod0-jg"]],"min-bomb-train-debris-ag":[[7,"min-bomb-train-debris-d-lod0-mg"],[6,"min-bomb-train-debris-d-lod0-jg"],[5,"min-bomb-train-debris-c-lod0-mg"],[4,"min-bomb-train-debris-c-lod0-jg"],[3,"min-bomb-train-debris-b-lod0-mg"],[2,"min-bomb-train-debris-b-lod0-jg"],[1,"min-bomb-train-debris-a-lod0-mg"],[0,"min-bomb-train-debris-a-lod0-jg"]],"min-boss-elev-ag":[[2,"min-boss-elev-idle-ja"],[1,"min-boss-elev-lod0-mg"],[0,"min-boss-elev-lod0-jg"]],"min-bridge-ag":[[3,"min-bridge-move-ja"],[2,"min-bridge-idle-ja"],[1,"min-bridge-lod0-mg"],[0,"min-bridge-lod0-jg"]],"min-crane-ag":[[2,"min-crane-idle-ja"],[1,"min-crane-lod0-mg"],[0,"min-crane-lod0-jg"]],"min-crane-switch-ag":[[2,"min-crane-switch-idle-ja"],[1,"min-crane-switch-lod0-mg"],[0,"min-crane-switch-lod0-jg"]],"min-door-ag":[[2,"min-door-idle-ja"],[1,"min-door-lod0-mg"],[0,"min-door-lod0-jg"]],"min-door-break-ag":[[2,"min-door-break-idle-ja"],[1,"min-door-break-lod0-mg"],[0,"min-door-break-lod0-jg"]],"min-elev-doors-ag":[[3,"min-elev-doors-open-ja"],[2,"min-elev-doors-idle-ja"],[1,"min-elev-doors-lod0-mg"],[0,"min-elev-doors-lod0-jg"]],"min-elev-track-ag":[[4,"min-elev-track-idle-ja"],[3,"min-elev-track-lod2-mg"],[2,"min-elev-track-lod1-mg"],[1,"min-elev-track-lod0-mg"],[0,"min-elev-track-lod0-jg"]],"min-elevator-ag":[[2,"min-elevator-idle-ja"],[1,"min-elevator-lod0-mg"],[0,"min-elevator-lod0-jg"]],"min-falling-elevator-ag":[[8,"min-falling-elevator-reset-ja"],[7,"min-falling-elevator-drop-ja"],[6,"min-falling-elevator-unstable-ja"],[5,"min-falling-elevator-start-unstable-ja"],[4,"min-falling-elevator-idle-ja"],[3,"min-falling-elevator-lod2-mg"],[2,"min-falling-elevator-lod1-mg"],[1,"min-falling-elevator-lod0-mg"],[0,"min-falling-elevator-lod0-jg"]],"min-falling-step-ag":[[9,"min-falling-step-unstable-ja"],[8,"min-falling-step-return-ja"],[7,"min-falling-step-hold-b-ja"],[6,"min-falling-step-falling-b-ja"],[5,"min-falling-step-hold-a-ja"],[4,"min-falling-step-falling-a-ja"],[3,"min-falling-step-idle-ja"],[2,"min-falling-step-lod1-mg"],[1,"min-falling-step-lod0-mg"],[0,"min-falling-step-lod0-jg"]],"min-folding-plat-ag":[[4,"min-folding-plat-extend-ja"],[3,"min-folding-plat-idle-ja"],[2,"min-folding-plat-lod1-mg"],[1,"min-folding-plat-lod0-mg"],[0,"min-folding-plat-lod0-jg"]],"min-moving-plat-ag":[[3,"min-moving-plat-idle-ja"],[2,"min-moving-plat-lod1-mg"],[1,"min-moving-plat-lod0-mg"],[0,"min-moving-plat-lod0-jg"]],"min-moving-step-ag":[[5,"min-moving-step-extend-ja"],[4,"min-moving-step-idle-ja"],[3,"min-moving-step-lod2-mg"],[2,"min-moving-step-lod1-mg"],[1,"min-moving-step-lod0-mg"],[0,"min-moving-step-lod0-jg"]],"min-ramp-ag":[[2,"min-ramp-idle-ja"],[1,"min-ramp-lod0-mg"],[0,"min-ramp-lod0-jg"]],"min-rat-engine-ag":[[6,"min-rat-engine-spin-ja"],[5,"min-rat-engine-lower-ja"],[4,"min-rat-engine-raise-ja"],[3,"min-rat-engine-idle-ja"],[2,"min-rat-engine-lod1-mg"],[1,"min-rat-engine-lod0-mg"],[0,"min-rat-engine-lod0-jg"]],"min-rotating-plat-ag":[[2,"min-rotating-plat-idle-ja"],[1,"min-rotating-plat-lod0-mg"],[0,"min-rotating-plat-lod0-jg"]],"min-target-sign-ag":[[5,"min-target-sign-idleb-ja"],[4,"min-target-sign-trackdown-ja"],[3,"min-target-sign-coversopen-ja"],[2,"min-target-sign-idle-ja"],[1,"min-target-sign-lod0-mg"],[0,"min-target-sign-lod0-jg"]],"minershort-ag":[[2,"minershort-minershort-idle-ja"],[1,"minershort-lod0-mg"],[0,"minershort-lod0-jg"]],"minertall-ag":[[2,"minertall-minertall-idle-ja"],[1,"minertall-lod0-mg"],[0,"minertall-lod0-jg"]],"missile-bot-ag":[[3,"missile-bot-idle-ja"],[2,"missile-bot-shadow-mg"],[1,"missile-bot-lod0-mg"],[0,"missile-bot-lod0-jg"]],"monk-ag":[[10,"monk-standing-idle-2-ja"],[9,"monk-standing-idle-1-ja"],[8,"monk-jump-ja"],[7,"monk-run-squash-ja"],[6,"monk-run-ja"],[5,"monk-jog-ja"],[4,"monk-walk-ja"],[3,"monk-idle-ja"],[2,"monk-shadow-mg"],[1,"monk-lod0-mg"],[0,"monk-lod0-jg"]],"monk-mummy-ag":[[3,"monk-mummy-idle-ja"],[2,"monk-mummy-shadow-mg"],[1,"monk-mummy-lod0-mg"],[0,"monk-mummy-lod0-jg"]],"monk-mummy-finger-explode-ag":[[2,"monk-mummy-finger-explode-idle-ja"],[1,"monk-mummy-finger-explode-lod0-mg"],[0,"monk-mummy-finger-explode-lod0-jg"]],"monster-frog-ag":[[33,"monster-frog-knocked1-land-ja"],[32,"monster-frog-knocked1-ja"],[31,"monster-frog-knocked0-land-ja"],[30,"monster-frog-knocked0-ja"],[29,"monster-frog-knocked-yellow-right-land-ja"],[12,"monster-frog-rotate-right-start-ja"],[11,"monster-frog-rotate-left-start-ja"],[10,"monster-frog-notice0-land-ja"],[9,"monster-frog-notice0-jump-ja"],[8,"monster-frog-notice0-ja"],[7,"monster-frog-submerge0-ja"],[6,"monster-frog-popup0-ja"],[5,"monster-frog-idle1-ja"],[4,"monster-frog-idle0-ja"],[3,"monster-frog-shadow-mg"],[2,"monster-frog-lod1-mg"],[1,"monster-frog-lod0-mg"],[0,"monster-frog-lod0-jg"],[13,"monster-frog-rotate-left-end-ja"],[14,"monster-frog-hop-small-start-ja"],[15,"monster-frog-hop-small-end-ja"],[16,"monster-frog-hop-slow-start-ja"],[17,"monster-frog-hop-slow-end-ja"],[18,"monster-frog-hop-fast-start-ja"],[19,"monster-frog-hop-fast-end-ja"],[20,"monster-frog-attack0-start-ja"],[21,"monster-frog-attack0-end-ja"],[22,"monster-frog-blue-hit0-ja"],[23,"monster-frog-blue-hit0-land-ja"],[24,"monster-frog-blue-hit1-ja"],[25,"monster-frog-blue-hit1-land-ja"],[26,"monster-frog-knocked-yellow-left-ja"],[27,"monster-frog-knocked-yellow-left-land-ja"],[28,"monster-frog-knocked-yellow-right-ja"]],"needle-fish-ag":[[13,"needle-fish-needle-idle-ja"],[0,"needle-fish-lod0-jg"],[1,"needle-fish-lod0-mg"],[2,"needle-fish-idle-ja"],[3,"needle-fish-swim0-ja"],[4,"needle-fish-swim-fast0-ja"],[5,"needle-fish-spikes0-ja"],[6,"needle-fish-swim-spikes0-ja"],[7,"needle-fish-turn-right0-ja"],[8,"needle-fish-turn-right0-end-ja"],[9,"needle-fish-turn-left0-ja"],[10,"needle-fish-turn-left0-end-ja"],[11,"needle-fish-needle-lod0-jg"],[12,"needle-fish-needle-lod0-mg"]],"neo-debris-ag":[[7,"neo-debris-d-lod0-mg"],[6,"neo-debris-d-lod0-jg"],[5,"neo-debris-c-lod0-mg"],[4,"neo-debris-c-lod0-jg"],[3,"neo-debris-b-lod0-mg"],[2,"neo-debris-b-lod0-jg"],[1,"neo-debris-a-lod0-mg"],[0,"neo-debris-a-lod0-jg"]],"neo-egg-a-ag":[[4,"neo-egg-a-idle-ja"],[3,"neo-egg-a-lod2-mg"],[2,"neo-egg-a-lod1-mg"],[1,"neo-egg-a-lod0-mg"],[0,"neo-egg-a-lod0-jg"]],"neo-egg-b-ag":[[4,"neo-egg-b-idle-ja"],[3,"neo-egg-b-lod2-mg"],[2,"neo-egg-b-lod1-mg"],[1,"neo-egg-b-lod0-mg"],[0,"neo-egg-b-lod0-jg"]],"neo-egg-c-ag":[[4,"neo-egg-c-idle-ja"],[3,"neo-egg-c-lod2-mg"],[2,"neo-egg-c-lod1-mg"],[1,"neo-egg-c-lod0-mg"],[0,"neo-egg-c-lod0-jg"]],"neo-grenadier-ag":[[34,"neo-grenadier-die-falling-ja"],[33,"neo-grenadier-die-ja"],[32,"neo-grenadier-knocked-land-ja"],[31,"neo-grenadier-knocked-ja"],[30,"neo-grenadier-blue-land-ja"],[29,"neo-grenadier-blue-hit2-ja"],[12,"neo-grenadier-notice1-ja"],[11,"neo-grenadier-notice-ja"],[10,"neo-grenadier-patrol1-ja"],[9,"neo-grenadier-patrol-ja"],[8,"neo-grenadier-idle-look-right-ja"],[7,"neo-grenadier-idle-look-left-ja"],[6,"neo-grenadier-idle2-ja"],[5,"neo-grenadier-idle-ja"],[4,"neo-grenadier-shadow-mg"],[3,"neo-grenadier-lod2-mg"],[2,"neo-grenadier-lod1-mg"],[1,"neo-grenadier-lod0-mg"],[0,"neo-grenadier-lod0-jg"],[13,"neo-grenadier-run-ja"],[14,"neo-grenadier-run1-ja"],[15,"neo-grenadier-run-to-throw-ja"],[16,"neo-grenadier-throw-turn-in-place-ja"],[17,"neo-grenadier-throw-stance-ja"],[18,"neo-grenadier-throw-ja"],[19,"neo-grenadier-throw1-ja"],[20,"neo-grenadier-throw-quick-ja"],[21,"neo-grenadier-spin-kick-ja"],[22,"neo-grenadier-victory-ja"],[23,"neo-grenadier-hit-ja"],[24,"neo-grenadier-hit-right-ja"],[25,"neo-grenadier-hit-left-ja"],[26,"neo-grenadier-hit-back-ja"],[27,"neo-grenadier-blue-hit0-ja"],[28,"neo-grenadier-blue-hit1-ja"]],"neo-juicer-ag":[[41,"neo-juicer-die-falling-ja"],[40,"neo-juicer-death-ja"],[39,"neo-juicer-jump-land-ja"],[38,"neo-juicer-jump-in-air-ja"],[37,"neo-juicer-jump-wind-up-ja"],[36,"neo-juicer-yellow-hit3-ja"],[35,"neo-juicer-yellow-hit2-ja"],[34,"neo-juicer-yellow-hit1-ja"],[33,"neo-juicer-yellow-hit0-ja"],[32,"neo-juicer-blue-land-ja"],[31,"neo-juicer-blue-hit5-ja"],[30,"neo-juicer-blue-hit4-ja"],[29,"neo-juicer-blue-hit3-ja"],[12,"neo-juicer-attack-turn-ja"],[11,"neo-juicer-hit-in-place-ja"],[10,"neo-juicer-turn-ja"],[9,"neo-juicer-charge0-ja"],[8,"neo-juicer-patrol0-ja"],[7,"neo-juicer-idle-right-ja"],[6,"neo-juicer-idle-left-ja"],[5,"neo-juicer-idle-ja"],[4,"neo-juicer-shadow-mg"],[3,"neo-juicer-lod2-mg"],[2,"neo-juicer-lod1-mg"],[1,"neo-juicer-lod0-mg"],[0,"neo-juicer-lod0-jg"],[13,"neo-juicer-attack0-start-ja"],[14,"neo-juicer-attack0-ja"],[15,"neo-juicer-attack-spin-ja"],[16,"neo-juicer-knocked0-ja"],[17,"neo-juicer-knocked-land0-ja"],[18,"neo-juicer-knocked1-ja"],[19,"neo-juicer-knocked-land1-ja"],[20,"neo-juicer-charge1-ja"],[21,"neo-juicer-notice0-ja"],[22,"neo-juicer-notice1-ja"],[23,"neo-juicer-patrol1-ja"],[24,"neo-juicer-celebrate0-ja"],[25,"neo-juicer-celebrate1-ja"],[26,"neo-juicer-blue-hit0-ja"],[27,"neo-juicer-blue-hit1-ja"],[28,"neo-juicer-blue-hit2-ja"]],"neo-satellite-a-ag":[[3,"neo-satellite-a-idle-ja"],[2,"neo-satellite-a-shadow-mg"],[1,"neo-satellite-a-lod0-mg"],[0,"neo-satellite-a-lod0-jg"]],"neo-satellite-ag":[[8,"neo-satellite-death-ja"],[7,"neo-satellite-stab-to-idle-ja"],[6,"neo-satellite-stab-ja"],[5,"neo-satellite-active-ja"],[4,"neo-satellite-idle-ja"],[3,"neo-satellite-shadow-mg"],[2,"neo-satellite-lod1-mg"],[1,"neo-satellite-lod0-mg"],[0,"neo-satellite-lod0-jg"]],"neo-satellite-b-ag":[[3,"neo-satellite-b-idle-ja"],[2,"neo-satellite-b-shadow-mg"],[1,"neo-satellite-b-lod0-mg"],[0,"neo-satellite-b-lod0-jg"]],"neo-satellite-break-ag":[[2,"neo-satellite-break-idle-ja"],[1,"neo-satellite-break-lod0-mg"],[0,"neo-satellite-break-lod0-jg"]],"neo-satellite-c-ag":[[3,"neo-satellite-c-idle-ja"],[2,"neo-satellite-c-shadow-mg"],[1,"neo-satellite-c-lod0-mg"],[0,"neo-satellite-c-lod0-jg"]],"neo-satellite-fma-ag":[[4,"neo-satellite-fma-active-ja"],[3,"neo-satellite-fma-idle-ja"],[2,"neo-satellite-fma-shadow-mg"],[1,"neo-satellite-fma-lod0-mg"],[0,"neo-satellite-fma-lod0-jg"]],"neo-satellite-game-ring-ag":[[3,"neo-satellite-game-ring-attack-ja"],[2,"neo-satellite-game-ring-idle-ja"],[1,"neo-satellite-game-ring-lod0-mg"],[0,"neo-satellite-game-ring-lod0-jg"]],"neo-satellite-heart-ag":[[10,"neo-satellite-heart-idle4-ja"],[9,"neo-satellite-heart-grow3-ja"],[8,"neo-satellite-heart-idle3-ja"],[7,"neo-satellite-heart-grow2-ja"],[6,"neo-satellite-heart-idle2-ja"],[5,"neo-satellite-heart-grow1-ja"],[4,"neo-satellite-heart-idle1-ja"],[3,"neo-satellite-heart-grow0-ja"],[2,"neo-satellite-heart-idle0-ja"],[1,"neo-satellite-heart-lod0-mg"],[0,"neo-satellite-heart-lod0-jg"]],"neo-satellite-ps-symbols-ag":[[2,"neo-satellite-ps-symbols-idle-ja"],[1,"neo-satellite-ps-symbols-lod0-mg"],[0,"neo-satellite-ps-symbols-lod0-jg"]],"neo-satellite-shield-ag":[[5,"neo-satellite-shield-end-ja"],[4,"neo-satellite-shield-hit-ja"],[3,"neo-satellite-shield-start-ja"],[2,"neo-satellite-shield-idle-ja"],[1,"neo-satellite-shield-lod0-mg"],[0,"neo-satellite-shield-lod0-jg"]],"neo-spawner-ag":[[15,"neo-spawner-explode-outer-idle-ja"],[14,"neo-spawner-explode-outer-lod0-mg"],[13,"neo-spawner-explode-outer-lod0-jg"],[0,"neo-spawner-lod0-jg"],[1,"neo-spawner-lod0-mg"],[2,"neo-spawner-lod1-mg"],[3,"neo-spawner-idle-ja"],[4,"neo-spawner-open-idle-ja"],[5,"neo-spawner-closed-idle-ja"],[6,"neo-spawner-open-ja"],[7,"neo-spawner-open-angry-ja"],[8,"neo-spawner-spit-start-ja"],[9,"neo-spawner-spit-end-ja"],[10,"neo-spawner-explode-inner-lod0-jg"],[11,"neo-spawner-explode-inner-lod0-mg"],[12,"neo-spawner-explode-inner-idle-ja"]],"neo-wasp-ag":[[22,"neo-wasp-explode-idle-ja"],[21,"neo-wasp-explode-lod0-mg"],[20,"neo-wasp-explode-lod0-jg"],[19,"neo-wasp-death-land-ja"],[18,"neo-wasp-death-instant-ja"],[17,"neo-wasp-death-right-fall-ja"],[16,"neo-wasp-death-right-ja"],[15,"neo-wasp-death-left-fall-ja"],[14,"neo-wasp-death-left-ja"],[13,"neo-wasp-knocked1-recover-ja"],[0,"neo-wasp-lod0-jg"],[1,"neo-wasp-lod0-mg"],[2,"neo-wasp-lod1-mg"],[3,"neo-wasp-shadow-mg"],[4,"neo-wasp-idle-ja"],[5,"neo-wasp-fly-right-ja"],[6,"neo-wasp-fly-left-ja"],[7,"neo-wasp-fly-forward-ja"],[8,"neo-wasp-fly-back-ja"],[9,"neo-wasp-shoot0-ja"],[10,"neo-wasp-knocked0-ja"],[11,"neo-wasp-knocked0-recover-ja"],[12,"neo-wasp-knocked1-ja"]],"neo-wasp-b-ag":[[13,"neo-wasp-b-knocked1-recover-ja"],[0,"neo-wasp-b-lod0-jg"],[1,"neo-wasp-b-lod0-mg"],[2,"neo-wasp-b-lod1-mg"],[3,"neo-wasp-b-shadow-mg"],[4,"neo-wasp-b-idle-ja"],[5,"neo-wasp-b-fly-right-ja"],[6,"neo-wasp-b-fly-left-ja"],[7,"neo-wasp-b-fly-forward-ja"],[8,"neo-wasp-b-fly-back-ja"],[9,"neo-wasp-b-shoot0-ja"],[10,"neo-wasp-b-knocked0-ja"],[11,"neo-wasp-b-knocked0-recover-ja"],[12,"neo-wasp-b-knocked1-ja"]],"newbike-ag":[[3,"newbike-idle-ja"],[2,"newbike-shadow-mg"],[1,"newbike-lod0-mg"],[0,"newbike-lod0-jg"]],"nst-cocoon-a-ag":[[7,"nst-cocoon-a-explode-idle-ja"],[6,"nst-cocoon-a-explode-lod0-mg"],[5,"nst-cocoon-a-explode-lod0-jg"],[4,"nst-cocoon-a-idle-ja"],[3,"nst-cocoon-a-lod2-mg"],[2,"nst-cocoon-a-lod1-mg"],[1,"nst-cocoon-a-lod0-mg"],[0,"nst-cocoon-a-lod0-jg"]],"nst-cocoon-b-ag":[[5,"nst-cocoon-b-retract-ja"],[4,"nst-cocoon-b-idle-ja"],[3,"nst-cocoon-b-lod2-mg"],[2,"nst-cocoon-b-lod1-mg"],[1,"nst-cocoon-b-lod0-mg"],[0,"nst-cocoon-b-lod0-jg"]],"nst-collapsing-stone-bridge-ag":[[11,"nst-collapsing-stone-bridge-break-c-end-ja"],[9,"nst-collapsing-stone-bridge-break-b-end-ja"],[7,"nst-collapsing-stone-bridge-break-a-end-ja"],[5,"nst-collapsing-stone-bridge-end-ja"],[4,"nst-collapsing-stone-bridge-idle-ja"],[3,"nst-collapsing-stone-bridge-lod2-mg"],[2,"nst-collapsing-stone-bridge-lod1-mg"],[1,"nst-collapsing-stone-bridge-lod0-mg"],[13,"nst-collapsing-stone-bridge-break-d-end-ja"],[0,"nst-collapsing-stone-bridge-lod0-jg"]],"nst-falling-stone-bridge-ag":[[5,"nst-falling-stone-bridge-fall-b-ja"],[4,"nst-falling-stone-bridge-fall-a-ja"],[3,"nst-falling-stone-bridge-idle-ja"],[2,"nst-falling-stone-bridge-lod1-mg"],[1,"nst-falling-stone-bridge-lod0-mg"],[0,"nst-falling-stone-bridge-lod0-jg"]],"nst-falling-stone-bridge-goo-ag":[[6,"nst-falling-stone-bridge-goo-explode-idle-ja"],[5,"nst-falling-stone-bridge-goo-explode-lod0-mg"],[4,"nst-falling-stone-bridge-goo-explode-lod0-jg"],[3,"nst-falling-stone-bridge-goo-idle-ja"],[2,"nst-falling-stone-bridge-goo-lod1-mg"],[1,"nst-falling-stone-bridge-goo-lod0-mg"],[0,"nst-falling-stone-bridge-goo-lod0-jg"]],"nst-metalhead-eggs-a-ag":[[4,"nst-metalhead-eggs-a-idle-ja"],[3,"nst-metalhead-eggs-a-lod2-mg"],[2,"nst-metalhead-eggs-a-lod1-mg"],[1,"nst-metalhead-eggs-a-lod0-mg"],[0,"nst-metalhead-eggs-a-lod0-jg"]],"nst-metalhead-eggs-b-ag":[[4,"nst-metalhead-eggs-b-idle-ja"],[3,"nst-metalhead-eggs-b-lod2-mg"],[2,"nst-metalhead-eggs-b-lod1-mg"],[1,"nst-metalhead-eggs-b-lod0-mg"],[0,"nst-metalhead-eggs-b-lod0-jg"]],"nst-metalhead-eggs-c-ag":[[4,"nst-metalhead-eggs-c-idle-ja"],[3,"nst-metalhead-eggs-c-lod2-mg"],[2,"nst-metalhead-eggs-c-lod1-mg"],[1,"nst-metalhead-eggs-c-lod0-mg"],[0,"nst-metalhead-eggs-c-lod0-jg"]],"ogreboss-ag":[[2,"ogreboss-ogreboss-idle-ja"],[1,"ogreboss-lod0-mg"],[0,"ogreboss-lod0-jg"]],"onin-highres-ag":[[6,"onin-highres-onin-idle-ja"],[5,"onin-highres-idle-wakeup-ja"],[4,"onin-highres-idle-sleep-ja"],[3,"onin-highres-idle-ja"],[2,"onin-highres-shadow-mg"],[1,"onin-highres-lod0-mg"],[0,"onin-highres-lod0-jg"]],"onin-simple-ag":[[2,"onin-simple-idle-ja"],[1,"onin-simple-lod0-mg"],[0,"onin-simple-lod0-jg"]],"ottsel-daxpants-ag":[[3,"ottsel-daxpants-idle-ja"],[2,"ottsel-daxpants-shadow-mg"],[1,"ottsel-daxpants-lod0-mg"],[0,"ottsel-daxpants-lod0-jg"],[4,"ottsel-daxpants-daxter-pants-walk-ja"]],"ottsel-dummy-ag":[[3,"ottsel-dummy-idle-ja"],[2,"ottsel-dummy-shadow-mg"],[1,"ottsel-dummy-lod0-mg"],[0,"ottsel-dummy-lod0-jg"],[4,"ottsel-dummy-dummy-idle-ja"]],"ottsel-leader-ag":[[4,"ottsel-leader-idle-ja"],[3,"ottsel-leader-leader-leaderskirt_fr-cg"],[2,"ottsel-leader-shadow-mg"],[1,"ottsel-leader-lod0-mg"],[0,"ottsel-leader-lod0-jg"],[5,"ottsel-leader-leader-idle-ja"]],"ottsel-surfer-ag":[[3,"ottsel-surfer-idle-ja"],[2,"ottsel-surfer-shadow-mg"],[1,"ottsel-surfer-lod0-mg"],[0,"ottsel-surfer-lod0-jg"],[4,"ottsel-surfer-surfer-idle-ja"]],"ottsel-tess-ag":[[3,"ottsel-tess-idle-ja"],[2,"ottsel-tess-shadow-mg"],[1,"ottsel-tess-lod0-mg"],[0,"ottsel-tess-lod0-jg"],[4,"ottsel-tess-ottess-idle-ja"]],"ottsel-veger-ag":[[3,"ottsel-veger-idle-ja"],[2,"ottsel-veger-shadow-mg"],[1,"ottsel-veger-lod0-mg"],[0,"ottsel-veger-lod0-jg"],[4,"ottsel-veger-otveger-idle-ja"]],"palmpilot-ag":[[2,"palmpilot-idle-ja"],[1,"palmpilot-lod0-mg"],[0,"palmpilot-lod0-jg"]],"palmpilot-b-ag":[[2,"palmpilot-b-idle-ja"],[1,"palmpilot-b-lod0-mg"],[0,"palmpilot-b-lod0-jg"]],"particleman-ag":[[2,"particleman-idle-ja"],[1,"particleman-lod0-mg"],[0,"particleman-lod0-jg"]],"pecker-highres-ag":[[5,"pecker-highres-pecker-fly-ja"],[3,"pecker-highres-idle-ja"],[2,"pecker-highres-shadow-mg"],[1,"pecker-highres-lod0-mg"],[0,"pecker-highres-lod0-jg"]],"pecker-ingame-ag":[[4,"pecker-ingame-fly-ja"],[3,"pecker-ingame-idle-ja"],[2,"pecker-ingame-shadow-mg"],[1,"pecker-ingame-lod0-mg"],[0,"pecker-ingame-lod0-jg"]],"plat-ag":[[4,"plat-idle-ja"],[3,"plat-lod2-mg"],[2,"plat-lod1-mg"],[1,"plat-lod0-mg"],[0,"plat-lod0-jg"]],"plat-fma-ag":[[2,"plat-fma-idle-ja"],[1,"plat-fma-lod0-mg"],[0,"plat-fma-lod0-jg"]],"pow-rings-ag":[[2,"pow-rings-idle-ja"],[1,"pow-rings-lod0-mg"],[0,"pow-rings-lod0-jg"]],"pre-artifact-a-ag":[[2,"pre-artifact-a-idle-ja"],[1,"pre-artifact-a-lod0-mg"],[0,"pre-artifact-a-lod0-jg"]],"pre-artifact-b-ag":[[2,"pre-artifact-b-idle-ja"],[1,"pre-artifact-b-lod0-mg"],[0,"pre-artifact-b-lod0-jg"]],"pre-artifact-c-ag":[[2,"pre-artifact-c-idle-ja"],[1,"pre-artifact-c-lod0-mg"],[0,"pre-artifact-c-lod0-jg"]],"pre-artifact-d-ag":[[2,"pre-artifact-d-idle-ja"],[1,"pre-artifact-d-lod0-mg"],[0,"pre-artifact-d-lod0-jg"]],"pre-mike-ag":[[2,"pre-mike-idle-ja"],[1,"pre-mike-lod0-mg"],[0,"pre-mike-lod0-jg"]],"pre-sled-ag":[[3,"pre-sled-idle-ja"],[2,"pre-sled-shadow-mg"],[1,"pre-sled-lod0-mg"],[0,"pre-sled-lod0-jg"]],"prebot-ag":[[170,"prebot-gun-gun-stow-again-ja"],[169,"prebot-gun-gun-fire-ja"],[168,"prebot-gun-gun-target-ja"],[167,"prebot-gun-gun-from-tentacle-ja"],[166,"prebot-gun-gun-stow-ja"],[165,"prebot-gun-gun-launch-ja"],[164,"prebot-gun-gun-aim-ja"],[163,"prebot-gun-gun-from-sword-R-ja"],[162,"prebot-gun-idle-ja"],[161,"prebot-gun-shadow-mg"],[160,"prebot-gun-lod0-mg"],[159,"prebot-gun-lod0-jg"],[158,"prebot-sword-r-swords-horizontal-L2R-complete-ja"],[157,"prebot-sword-r-swords-horizontal-L2R-return-ja"],[156,"prebot-sword-r-swords-horizontal-L2R-hold-ja"],[155,"prebot-sword-r-swords-horizontal-L2R-strike-ja"],[154,"prebot-sword-r-swords-horizontal-L2R-prehold-ja"],[153,"prebot-sword-r-swords-horizontal-R2L-complete-ja"],[152,"prebot-sword-r-swords-horizontal-R2L-return-ja"],[151,"prebot-sword-r-swords-horizontal-R2L-hold-ja"],[150,"prebot-sword-r-swords-horizontal-R2L-strike-ja"],[149,"prebot-sword-r-swords-horizontal-R2L-prehold-ja"],[148,"prebot-sword-r-swords-horizontal-R2L-pre-ja"],[147,"prebot-sword-r-swords-pose-ja"],[146,"prebot-sword-r-swords-strike2pose-ja"],[145,"prebot-sword-r-swords-R-vertical-strike-two-ja"],[144,"prebot-sword-r-swords-L-vertical-between-ja"],[143,"prebot-sword-r-swords-L-vertical-strike-ja"],[142,"prebot-sword-r-swords-R-vertical-between-ja"],[141,"prebot-sword-r-swords-R-vertical-strike-ja"],[140,"prebot-sword-r-swords-vertical-hold-ja"],[139,"prebot-sword-r-swords-vertical-pre-ja"],[138,"prebot-sword-l-swords-horizontal-L2R-complete-ja"],[137,"prebot-sword-l-swords-horizontal-L2R-return-ja"],[136,"prebot-sword-l-swords-horizontal-L2R-hold-ja"],[135,"prebot-sword-l-swords-horizontal-L2R-strike-ja"],[134,"prebot-sword-l-swords-horizontal-L2R-prehold-ja"],[133,"prebot-sword-l-swords-horizontal-R2L-complete-ja"],[132,"prebot-sword-l-swords-horizontal-R2L-return-ja"],[131,"prebot-sword-l-swords-horizontal-R2L-hold-ja"],[58,"prebot-swords-L-vertical-strike-ja"],[57,"prebot-swords-R-vertical-between-ja"],[56,"prebot-swords-R-vertical-strike-ja"],[55,"prebot-swords-vertical-hold-ja"],[54,"prebot-swords-vertical-pre-ja"],[53,"prebot-tentacle-stow-ja"],[52,"prebot-tentacle-launch-ja"],[51,"prebot-hatch-hover-ja"],[50,"prebot-gun-stow-again-ja"],[49,"prebot-gun-fire-ja"],[48,"prebot-gun-target-ja"],[47,"prebot-gun-from-tentacle-ja"],[46,"prebot-gun-stow-ja"],[45,"prebot-gun-launch-ja"],[44,"prebot-gun-aim-ja"],[43,"prebot-gun-from-sword-R-ja"],[42,"prebot-sword-L-horizontal-L2R-complete-ja"],[41,"prebot-sword-L-horizontal-L2R-return-ja"],[40,"prebot-sword-L-horizontal-L2R-hold-ja"],[39,"prebot-sword-L-horizontal-L2R-strike-ja"],[38,"prebot-sword-L-horizontal-L2R-prehold-ja"],[37,"prebot-sword-L-horizontal-R2L-complete-ja"],[36,"prebot-sword-L-horizontal-R2L-return-ja"],[35,"prebot-sword-L-horizontal-R2L-hold-ja"],[34,"prebot-sword-L-horizontal-R2L-strike-ja"],[33,"prebot-sword-L-horizontal-R2L-prehold-ja"],[32,"prebot-sword-L-horizontal-R2L-pre-ja"],[31,"prebot-sword-L-pose-ja"],[30,"prebot-sword-L-strike2pose-ja"],[29,"prebot-sword-L-vertical-between-ja"],[12,"prebot-sword-R-vertical-between-ja"],[11,"prebot-sword-R-vertical-strike-ja"],[10,"prebot-sword-R-vertical-hold-ja"],[9,"prebot-sword-R-vertical-pre-ja"],[8,"prebot-jump-to-hover-ja"],[7,"prebot-tentacle-launch-pre-ja"],[6,"prebot-sword-grab-AL-ja"],[5,"prebot-sword-grab-both-ja"],[4,"prebot-sword-grab-AR-ja"],[3,"prebot-idle-ja"],[130,"prebot-sword-l-swords-horizontal-R2L-strike-ja"],[2,"prebot-shadow-mg"],[129,"prebot-sword-l-swords-horizontal-R2L-prehold-ja"],[1,"prebot-lod0-mg"],[128,"prebot-sword-l-swords-horizontal-R2L-pre-ja"],[0,"prebot-lod0-jg"],[127,"prebot-sword-l-swords-pose-ja"],[13,"prebot-sword-R-strike2pose-ja"],[14,"prebot-sword-R-pose-ja"],[15,"prebot-sword-R-horizontal-L2R-pre-ja"],[16,"prebot-sword-R-horizontal-L2R-prehold-ja"],[17,"prebot-sword-R-horizontal-L2R-strike-ja"],[18,"prebot-sword-R-horizontal-L2R-hold-ja"],[19,"prebot-sword-R-horizontal-L2R-return-ja"],[20,"prebot-sword-R-horizontal-L2R-complete-ja"],[21,"prebot-sword-R-horizontal-R2L-prehold-ja"],[22,"prebot-sword-R-horizontal-R2L-strike-ja"],[23,"prebot-sword-R-horizontal-R2L-hold-ja"],[24,"prebot-sword-R-horizontal-R2L-return-ja"],[25,"prebot-sword-R-horizontal-R2L-complete-ja"],[26,"prebot-sword-L-vertical-pre-ja"],[27,"prebot-sword-L-vertical-hold-ja"],[28,"prebot-sword-L-vertical-strike-ja"],[59,"prebot-swords-L-vertical-between-ja"],[60,"prebot-swords-R-vertical-strike-two-ja"],[61,"prebot-swords-strike2pose-ja"],[62,"prebot-swords-pose-ja"],[63,"prebot-swords-horizontal-R2L-pre-ja"],[64,"prebot-swords-horizontal-R2L-prehold-ja"],[65,"prebot-swords-horizontal-R2L-strike-ja"],[66,"prebot-swords-horizontal-R2L-hold-ja"],[67,"prebot-swords-horizontal-R2L-return-ja"],[68,"prebot-swords-horizontal-R2L-complete-ja"],[69,"prebot-swords-horizontal-L2R-prehold-ja"],[70,"prebot-swords-horizontal-L2R-strike-ja"],[71,"prebot-swords-horizontal-L2R-hold-ja"],[72,"prebot-swords-horizontal-L2R-return-ja"],[73,"prebot-swords-horizontal-L2R-complete-ja"],[74,"prebot-mine-boss-train-1-ja"],[75,"prebot-mine-boss-train-2-ja"],[76,"prebot-mine-boss-train-3-ja"],[81,"prebot-sword-lod0-jg"],[82,"prebot-sword-lod0-mg"],[83,"prebot-sword-shadow-mg"],[84,"prebot-sword-idle-ja"],[85,"prebot-sword-sword-R-vertical-pre-ja"],[86,"prebot-sword-sword-R-vertical-hold-ja"],[87,"prebot-sword-sword-R-vertical-strike-ja"],[88,"prebot-sword-sword-R-vertical-between-ja"],[89,"prebot-sword-sword-R-strike2pose-ja"],[90,"prebot-sword-sword-R-pose-ja"],[91,"prebot-sword-sword-R-horizontal-L2R-pre-ja"],[92,"prebot-sword-sword-R-horizontal-L2R-prehold-ja"],[93,"prebot-sword-sword-R-horizontal-L2R-strike-ja"],[94,"prebot-sword-sword-R-horizontal-L2R-hold-ja"],[95,"prebot-sword-sword-R-horizontal-L2R-return-ja"],[96,"prebot-sword-sword-R-horizontal-L2R-complete-ja"],[97,"prebot-sword-sword-R-horizontal-R2L-prehold-ja"],[98,"prebot-sword-sword-R-horizontal-R2L-strike-ja"],[99,"prebot-sword-sword-R-horizontal-R2L-hold-ja"],[100,"prebot-sword-sword-R-horizontal-R2L-return-ja"],[101,"prebot-sword-sword-R-horizontal-R2L-complete-ja"],[102,"prebot-sword-sword-L-vertical-pre-ja"],[103,"prebot-sword-sword-L-vertical-hold-ja"],[104,"prebot-sword-sword-L-vertical-strike-ja"],[105,"prebot-sword-sword-L-vertical-between-ja"],[106,"prebot-sword-sword-L-strike2pose-ja"],[107,"prebot-sword-sword-L-pose-ja"],[108,"prebot-sword-sword-L-horizontal-R2L-pre-ja"],[109,"prebot-sword-sword-L-horizontal-R2L-prehold-ja"],[110,"prebot-sword-sword-L-horizontal-R2L-strike-ja"],[111,"prebot-sword-sword-L-horizontal-R2L-hold-ja"],[112,"prebot-sword-sword-L-horizontal-R2L-return-ja"],[113,"prebot-sword-sword-L-horizontal-R2L-complete-ja"],[114,"prebot-sword-sword-L-horizontal-L2R-prehold-ja"],[115,"prebot-sword-sword-L-horizontal-L2R-strike-ja"],[116,"prebot-sword-sword-L-horizontal-L2R-hold-ja"],[117,"prebot-sword-sword-L-horizontal-L2R-return-ja"],[118,"prebot-sword-sword-L-horizontal-L2R-complete-ja"],[119,"prebot-sword-l-swords-vertical-pre-ja"],[120,"prebot-sword-l-swords-vertical-hold-ja"],[121,"prebot-sword-l-swords-R-vertical-strike-ja"],[122,"prebot-sword-l-swords-R-vertical-between-ja"],[123,"prebot-sword-l-swords-L-vertical-strike-ja"],[124,"prebot-sword-l-swords-L-vertical-between-ja"],[125,"prebot-sword-l-swords-R-vertical-strike-two-ja"],[126,"prebot-sword-l-swords-strike2pose-ja"]],"prebot-camera-ag":[[5,"prebot-camera-mine-boss-train-3-ja"],[4,"prebot-camera-mine-boss-train-2-ja"],[3,"prebot-camera-mine-boss-train-1-ja"],[2,"prebot-camera-idle-ja"],[1,"prebot-camera-lod0-mg"],[0,"prebot-camera-lod0-jg"]],"prebot-shockwave-ag":[[2,"prebot-shockwave-shockwave-ja"],[1,"prebot-shockwave-lod0-mg"],[0,"prebot-shockwave-lod0-jg"]],"prebot-tentacle-ag":[[18,"prebot-tentacle-e-tentacle-stow-ja"],[17,"prebot-tentacle-e-tentacle-launch-ja"],[16,"prebot-tentacle-e-hatch-hover-ja"],[15,"prebot-tentacle-d-tentacle-stow-ja"],[14,"prebot-tentacle-d-tentacle-launch-ja"],[13,"prebot-tentacle-d-hatch-hover-ja"],[0,"prebot-tentacle-lod0-jg"],[1,"prebot-tentacle-lod0-mg"],[2,"prebot-tentacle-shadow-mg"],[3,"prebot-tentacle-idle-ja"],[4,"prebot-tentacle-a-hatch-hover-ja"],[5,"prebot-tentacle-a-tentacle-launch-ja"],[6,"prebot-tentacle-a-tentacle-stow-ja"],[7,"prebot-tentacle-b-hatch-hover-ja"],[8,"prebot-tentacle-b-tentacle-launch-ja"],[9,"prebot-tentacle-b-tentacle-stow-ja"],[10,"prebot-tentacle-c-hatch-hover-ja"],[11,"prebot-tentacle-c-tentacle-launch-ja"],[12,"prebot-tentacle-c-tentacle-stow-ja"]],"precur-bomb-ag":[[2,"precur-bomb-idle-ja"],[1,"precur-bomb-lod0-mg"],[0,"precur-bomb-lod0-jg"]],"precur-bomb-spawner-ag":[[3,"precur-bomb-spawner-spawn-ja"],[2,"precur-bomb-spawner-idle-ja"],[1,"precur-bomb-spawner-lod0-mg"],[0,"precur-bomb-spawner-lod0-jg"]],"precur-box-ag":[[5,"precur-box-explode-idle-ja"],[4,"precur-box-explode-lod0-mg"],[3,"precur-box-explode-lod0-jg"],[2,"precur-box-idle-ja"],[1,"precur-box-lod0-mg"],[0,"precur-box-lod0-jg"]],"precur-bridge-a-blocks-break-ag":[[2,"precur-bridge-a-blocks-break-idle-ja"],[1,"precur-bridge-a-blocks-break-lod0-mg"],[0,"precur-bridge-a-blocks-break-lod0-jg"]],"precur-bridge-a-path-break-ag":[[3,"precur-bridge-a-path-break-idle2-ja"],[2,"precur-bridge-a-path-break-idle-ja"],[1,"precur-bridge-a-path-break-lod0-mg"],[0,"precur-bridge-a-path-break-lod0-jg"]],"precur-bridge-b-blocks-break-ag":[[2,"precur-bridge-b-blocks-break-idle-ja"],[1,"precur-bridge-b-blocks-break-lod0-mg"],[0,"precur-bridge-b-blocks-break-lod0-jg"]],"precur-bridge-b-path-break-ag":[[3,"precur-bridge-b-path-break-idle2-ja"],[2,"precur-bridge-b-path-break-idle-ja"],[1,"precur-bridge-b-path-break-lod0-mg"],[0,"precur-bridge-b-path-break-lod0-jg"]],"precur-bridge-c-blocks-break-ag":[[2,"precur-bridge-c-blocks-break-idle-ja"],[1,"precur-bridge-c-blocks-break-lod0-mg"],[0,"precur-bridge-c-blocks-break-lod0-jg"]],"precur-bridge-c-path-break-ag":[[3,"precur-bridge-c-path-break-idle2-ja"],[2,"precur-bridge-c-path-break-idle-ja"],[1,"precur-bridge-c-path-break-lod0-mg"],[0,"precur-bridge-c-path-break-lod0-jg"]],"precur-bridge-d-blocks-break-ag":[[2,"precur-bridge-d-blocks-break-idle-ja"],[1,"precur-bridge-d-blocks-break-lod0-mg"],[0,"precur-bridge-d-blocks-break-lod0-jg"]],"precur-bridge-d-path-break-ag":[[3,"precur-bridge-d-path-break-idle2-ja"],[2,"precur-bridge-d-path-break-idle-ja"],[1,"precur-bridge-d-path-break-lod0-mg"],[0,"precur-bridge-d-path-break-lod0-jg"]],"precur-bridge-e-blocks-break-ag":[[2,"precur-bridge-e-blocks-break-idle-ja"],[1,"precur-bridge-e-blocks-break-lod0-mg"],[0,"precur-bridge-e-blocks-break-lod0-jg"]],"precur-bridge-e-path-break-ag":[[3,"precur-bridge-e-path-break-idle2-ja"],[2,"precur-bridge-e-path-break-idle-ja"],[1,"precur-bridge-e-path-break-lod0-mg"],[0,"precur-bridge-e-path-break-lod0-jg"]],"precur-bridge-f-blocks-break-ag":[[2,"precur-bridge-f-blocks-break-idle-ja"],[1,"precur-bridge-f-blocks-break-lod0-mg"],[0,"precur-bridge-f-blocks-break-lod0-jg"]],"precur-bridge-g-blocks-break-ag":[[2,"precur-bridge-g-blocks-break-idle-ja"],[1,"precur-bridge-g-blocks-break-lod0-mg"],[0,"precur-bridge-g-blocks-break-lod0-jg"]],"precur-bridge-h-blocks-break-ag":[[2,"precur-bridge-h-blocks-break-idle-ja"],[1,"precur-bridge-h-blocks-break-lod0-mg"],[0,"precur-bridge-h-blocks-break-lod0-jg"]],"precur-bridge-i-blocks-break-ag":[[2,"precur-bridge-i-blocks-break-idle-ja"],[1,"precur-bridge-i-blocks-break-lod0-mg"],[0,"precur-bridge-i-blocks-break-lod0-jg"]],"precur-bridge-j-blocks-break-ag":[[2,"precur-bridge-j-blocks-break-idle-ja"],[1,"precur-bridge-j-blocks-break-lod0-mg"],[0,"precur-bridge-j-blocks-break-lod0-jg"]],"precur-bridge-k-blocks-break-ag":[[2,"precur-bridge-k-blocks-break-idle-ja"],[1,"precur-bridge-k-blocks-break-lod0-mg"],[0,"precur-bridge-k-blocks-break-lod0-jg"]],"precur-bridge-l-blocks-break-ag":[[2,"precur-bridge-l-blocks-break-idle-ja"],[1,"precur-bridge-l-blocks-break-lod0-mg"],[0,"precur-bridge-l-blocks-break-lod0-jg"]],"precur-bridge-m-blocks-break-ag":[[2,"precur-bridge-m-blocks-break-idle-ja"],[1,"precur-bridge-m-blocks-break-lod0-mg"],[0,"precur-bridge-m-blocks-break-lod0-jg"]],"precur-bridge-n-blocks-break-ag":[[2,"precur-bridge-n-blocks-break-idle-ja"],[1,"precur-bridge-n-blocks-break-lod0-mg"],[0,"precur-bridge-n-blocks-break-lod0-jg"]],"precur-bridge-o-blocks-break-ag":[[2,"precur-bridge-o-blocks-break-idle-ja"],[1,"precur-bridge-o-blocks-break-lod0-mg"],[0,"precur-bridge-o-blocks-break-lod0-jg"]],"precur-bridge-p-blocks-break-ag":[[2,"precur-bridge-p-blocks-break-idle-ja"],[1,"precur-bridge-p-blocks-break-lod0-mg"],[0,"precur-bridge-p-blocks-break-lod0-jg"]],"precur-bridge-path-break-ag":[[3,"precur-bridge-path-break-idle2-ja"],[2,"precur-bridge-path-break-idle-ja"],[1,"precur-bridge-path-break-lod0-mg"],[0,"precur-bridge-path-break-lod0-jg"]],"precur-door-a-ag":[[2,"precur-door-a-idle-ja"],[1,"precur-door-a-lod0-mg"],[0,"precur-door-a-lod0-jg"]],"precur-door-b-ag":[[2,"precur-door-b-idle-ja"],[1,"precur-door-b-lod0-mg"],[0,"precur-door-b-lod0-jg"]],"precur-door-c-ag":[[5,"precur-door-c-explode-idle-ja"],[4,"precur-door-c-explode-lod0-mg"],[3,"precur-door-c-explode-lod0-jg"],[2,"precur-door-c-idle-ja"],[1,"precur-door-c-lod0-mg"],[0,"precur-door-c-lod0-jg"]],"precur-door-d-ag":[[5,"precur-door-d-explode-idle-ja"],[4,"precur-door-d-explode-lod0-mg"],[3,"precur-door-d-explode-lod0-jg"],[2,"precur-door-d-idle-ja"],[1,"precur-door-d-lod0-mg"],[0,"precur-door-d-lod0-jg"]],"precur-elevator-ag":[[2,"precur-elevator-idle-ja"],[1,"precur-elevator-lod0-mg"],[0,"precur-elevator-lod0-jg"]],"precur-generator-a-ag":[[5,"precur-generator-a-explode-idle-ja"],[4,"precur-generator-a-explode-lod0-mg"],[3,"precur-generator-a-explode-lod0-jg"],[2,"precur-generator-a-idle-ja"],[1,"precur-generator-a-lod0-mg"],[0,"precur-generator-a-lod0-jg"]],"precur-generator-b-ag":[[5,"precur-generator-b-explode-idle-ja"],[4,"precur-generator-b-explode-lod0-mg"],[3,"precur-generator-b-explode-lod0-jg"],[2,"precur-generator-b-idle-ja"],[1,"precur-generator-b-lod0-mg"],[0,"precur-generator-b-lod0-jg"]],"precur-generator-c-ag":[[5,"precur-generator-c-explode-idle-ja"],[4,"precur-generator-c-explode-lod0-mg"],[3,"precur-generator-c-explode-lod0-jg"],[2,"precur-generator-c-idle-ja"],[1,"precur-generator-c-lod0-mg"],[0,"precur-generator-c-lod0-jg"]],"precur-generator-d-ag":[[5,"precur-generator-d-explode-idle-ja"],[4,"precur-generator-d-explode-lod0-mg"],[3,"precur-generator-d-explode-lod0-jg"],[2,"precur-generator-d-idle-ja"],[1,"precur-generator-d-lod0-mg"],[0,"precur-generator-d-lod0-jg"]],"precur-generator-d-gem-ag":[[2,"precur-generator-d-gem-idle-ja"],[1,"precur-generator-d-gem-lod0-mg"],[0,"precur-generator-d-gem-lod0-jg"]],"precur-jump-plate-ag":[[3,"precur-jump-plate-move-ja"],[2,"precur-jump-plate-idle-ja"],[1,"precur-jump-plate-lod0-mg"],[0,"precur-jump-plate-lod0-jg"]],"precur-planet-ag":[[2,"precur-planet-idle-ja"],[1,"precur-planet-lod0-mg"],[0,"precur-planet-lod0-jg"]],"precur-platform-round-ag":[[3,"precur-platform-round-rotation-ja"],[2,"precur-platform-round-idle-ja"],[1,"precur-platform-round-lod0-mg"],[0,"precur-platform-round-lod0-jg"]],"precur-swingpole-pop-ag":[[2,"precur-swingpole-pop-idle-ja"],[1,"precur-swingpole-pop-lod0-mg"],[0,"precur-swingpole-pop-lod0-jg"]],"precur-wall-window-big-ag":[[3,"precur-wall-window-big-open-ja"],[2,"precur-wall-window-big-idle-ja"],[1,"precur-wall-window-big-lod0-mg"],[0,"precur-wall-window-big-lod0-jg"]],"precur-warp-effect-ag":[[2,"precur-warp-effect-idle-ja"],[1,"precur-warp-effect-lod0-mg"],[0,"precur-warp-effect-lod0-jg"]],"precursor-ag":[[2,"precursor-idle-ja"],[1,"precursor-lod0-mg"],[0,"precursor-lod0-jg"]],"precursor-controller-ag":[[2,"precursor-controller-idle-ja"],[1,"precursor-controller-lod0-mg"],[0,"precursor-controller-lod0-jg"]],"precursor-ship-ag":[[2,"precursor-ship-idle-ja"],[1,"precursor-ship-lod0-mg"],[0,"precursor-ship-lod0-jg"]],"precursor-ship-door-ag":[[2,"precursor-ship-door-idle-ja"],[1,"precursor-ship-door-lod0-mg"],[0,"precursor-ship-door-lod0-jg"]],"predator-ag":[[23,"predator-blue-hit-land-ja"],[22,"predator-blue-hit-back-ja"],[21,"predator-blue-hit-front-ja"],[20,"predator-knocked-big-death-ja"],[19,"predator-knocked-big-land-ja"],[18,"predator-knocked-big-ja"],[17,"predator-jump-attack-land-ja"],[16,"predator-jump-attack-ja"],[15,"predator-knocked-death-land-ja"],[14,"predator-knocked-death-ja"],[13,"predator-knocked-land-ja"],[0,"predator-lod0-jg"],[1,"predator-lod0-mg"],[2,"predator-lod1-mg"],[3,"predator-lod2-mg"],[4,"predator-shadow-mg"],[5,"predator-idle-ja"],[6,"predator-walk0-ja"],[7,"predator-run0-ja"],[8,"predator-close-attack-ja"],[9,"predator-close-attack-recover-ja"],[10,"predator-shoot-guns0-ja"],[11,"predator-death-standing-ja"],[12,"predator-knocked-ja"]],"purple-one-ag":[[2,"purple-one-idle-ja"],[1,"purple-one-lod0-mg"],[0,"purple-one-lod0-jg"]],"purple-three-ag":[[2,"purple-three-idle-ja"],[1,"purple-three-lod0-mg"],[0,"purple-three-lod0-jg"]],"purple-two-ag":[[2,"purple-two-idle-ja"],[1,"purple-two-lod0-mg"],[0,"purple-two-lod0-jg"]],"quantum-reflector-ag":[[3,"quantum-reflector-idle-ja"],[2,"quantum-reflector-shadow-mg"],[1,"quantum-reflector-lod0-mg"],[0,"quantum-reflector-lod0-jg"]],"rail-gun-dark-ag":[[2,"rail-gun-dark-idle-ja"],[1,"rail-gun-dark-lod0-mg"],[0,"rail-gun-dark-lod0-jg"]],"rail-oracle-door-ag":[[2,"rail-oracle-door-idle-ja"],[1,"rail-oracle-door-lod0-mg"],[0,"rail-oracle-door-lod0-jg"]],"rail-oracle-eyes-ag":[[2,"rail-oracle-eyes-idle-ja"],[1,"rail-oracle-eyes-lod0-mg"],[0,"rail-oracle-eyes-lod0-jg"]],"rail-warp-gate-ag":[[2,"rail-warp-gate-idle-ja"],[1,"rail-warp-gate-lod0-mg"],[0,"rail-warp-gate-lod0-jg"]],"rat-ag":[[28,"rat-pipe-jump0-end-ja"],[27,"rat-pipe-jump0-start-ja"],[26,"rat-ball-ja"],[25,"rat-ragdoll-pose-ja"],[24,"rat-die-ja"],[23,"rat-run-wheel0-die-ja"],[22,"rat-run-wheel0-ja"],[21,"rat-ground-to-run-ja"],[20,"rat-ground-knocked-land-ja"],[19,"rat-ground-knocked-ja"],[18,"rat-on-back-idle-ja"],[17,"rat-knocked0-land-ja"],[16,"rat-knocked0-ja"],[15,"rat-sit-to-run-ja"],[14,"rat-sit-alert-idle-ja"],[13,"rat-sit-to-alert-ja"],[0,"rat-lod0-jg"],[1,"rat-lod0-mg"],[2,"rat-shadow-mg"],[3,"rat-idle-stand-ja"],[4,"rat-stand-to-sit-ja"],[5,"rat-sit-to-stand-ja"],[6,"rat-idle-sit0-ja"],[7,"rat-idle-sit1-ja"],[8,"rat-turn-right-ja"],[9,"rat-turn-left-ja"],[10,"rat-walk0-ja"],[11,"rat-run0-ja"],[12,"rat-walk-to-sit-ja"]],"red-crimson-guard-highres-ag":[[2,"red-crimson-guard-highres-red-crimson-guard-walk-ja"],[1,"red-crimson-guard-highres-lod0-mg"],[0,"red-crimson-guard-highres-lod0-jg"]],"red-gun-mod-three-ag":[[2,"red-gun-mod-three-idle-ja"],[1,"red-gun-mod-three-lod0-mg"],[0,"red-gun-mod-three-lod0-jg"]],"red-gun-mod-two-ag":[[2,"red-gun-mod-two-idle-ja"],[1,"red-gun-mod-two-lod0-mg"],[0,"red-gun-mod-two-lod0-jg"]],"redsage-ag":[[2,"redsage-redsage-idle-ja"],[1,"redsage-lod0-mg"],[0,"redsage-lod0-jg"]],"rhino-ag":[[7,"rhino-idle-ja"],[6,"rhino-shadow-mg"],[5,"rhino-lod0-mg"],[4,"rhino-lod0-jg"],[3,"rhino-wheel-idle-ja"],[2,"rhino-wheel-shadow-mg"],[1,"rhino-wheel-lod0-mg"],[0,"rhino-wheel-lod0-jg"]],"rhino-wheel-fma-ag":[[2,"rhino-wheel-fma-idle-ja"],[1,"rhino-wheel-fma-lod0-mg"],[0,"rhino-wheel-fma-lod0-jg"]],"robo-hover-ag":[[9,"robo-hover-base-ja"],[8,"robo-hover-ragdoll-ja"],[7,"robo-hover-shoot0-ja"],[6,"robo-hover-fly-right-ja"],[5,"robo-hover-fly-left-ja"],[4,"robo-hover-fly-back-ja"],[3,"robo-hover-fly-forward-ja"],[2,"robo-hover-idle-ja"],[1,"robo-hover-lod0-mg"],[0,"robo-hover-lod0-jg"]],"roboguard-ag":[[35,"roboguard-explode-idle-ja"],[34,"roboguard-explode-lod0-mg"],[33,"roboguard-explode-lod0-jg"],[32,"roboguard-dizzy-ja"],[31,"roboguard-ball-to-dizzy-ja"],[30,"roboguard-knocked-big-land-ja"],[29,"roboguard-knocked-big-ja"],[12,"roboguard-notice-land-ja"],[11,"roboguard-notice-jump-ja"],[10,"roboguard-idle-shoot0-turn-r1-ja"],[9,"roboguard-idle-shoot0-turn-r0-ja"],[8,"roboguard-idle-shoot0-turn-l1-ja"],[7,"roboguard-idle-shoot0-turn-l0-ja"],[6,"roboguard-idle-shoot0-loop-ja"],[5,"roboguard-idle1-ja"],[4,"roboguard-idle0-ja"],[3,"roboguard-shadow-mg"],[2,"roboguard-lod1-mg"],[1,"roboguard-lod0-mg"],[0,"roboguard-lod0-jg"],[13,"roboguard-walk-ja"],[14,"roboguard-run-ja"],[15,"roboguard-idle-to-ball-ja"],[16,"roboguard-ball-ja"],[17,"roboguard-ball-to-idle-ja"],[18,"roboguard-death-standing-ja"],[19,"roboguard-punch-far-rotate-ja"],[20,"roboguard-punch-far-go-ja"],[21,"roboguard-punch-far-hold-ja"],[22,"roboguard-punch-far-end-ja"],[23,"roboguard-punch-close-rotate-ja"],[24,"roboguard-punch-close-go-ja"],[25,"roboguard-punch-close-hold-ja"],[26,"roboguard-punch-close-end-ja"],[27,"roboguard-knocked-small-ja"],[28,"roboguard-knocked-small-land-ja"]],"roboguard-city-ag":[[27,"roboguard-city-dizzy-ja"],[26,"roboguard-city-knocked-big-land-ja"],[25,"roboguard-city-knocked-big-ja"],[24,"roboguard-city-knocked-small-land-ja"],[23,"roboguard-city-knocked-small-ja"],[22,"roboguard-city-punch-close-end-ja"],[21,"roboguard-city-punch-close-hold-ja"],[20,"roboguard-city-punch-close-go-ja"],[19,"roboguard-city-punch-close-rotate-ja"],[18,"roboguard-city-punch-far-end-ja"],[17,"roboguard-city-punch-far-hold-ja"],[16,"roboguard-city-punch-far-go-ja"],[15,"roboguard-city-punch-far-rotate-ja"],[14,"roboguard-city-ball-to-idle-ja"],[13,"roboguard-city-ball-ja"],[0,"roboguard-city-lod0-jg"],[1,"roboguard-city-lod0-mg"],[2,"roboguard-city-shadow-mg"],[3,"roboguard-city-idle0-ja"],[4,"roboguard-city-idle1-ja"],[5,"roboguard-city-idle-shoot0-loop-ja"],[6,"roboguard-city-idle-shoot0-turn-l0-ja"],[7,"roboguard-city-idle-shoot0-turn-l1-ja"],[8,"roboguard-city-idle-shoot0-turn-r0-ja"],[9,"roboguard-city-idle-shoot0-turn-r1-ja"],[10,"roboguard-city-walk-ja"],[11,"roboguard-city-run-ja"],[12,"roboguard-city-idle-to-ball-ja"]],"rub-dark-jak-door-ag":[[3,"rub-dark-jak-door-break-ja"],[2,"rub-dark-jak-door-idle-ja"],[1,"rub-dark-jak-door-lod0-mg"],[0,"rub-dark-jak-door-lod0-jg"]],"rub-electric-gate-panel-a-ag":[[2,"rub-electric-gate-panel-a-idle-ja"],[1,"rub-electric-gate-panel-a-lod0-mg"],[0,"rub-electric-gate-panel-a-lod0-jg"]],"rub-electric-gate-panel-b-ag":[[2,"rub-electric-gate-panel-b-idle-ja"],[1,"rub-electric-gate-panel-b-lod0-mg"],[0,"rub-electric-gate-panel-b-lod0-jg"]],"rub-electric-gate-panel-c-ag":[[2,"rub-electric-gate-panel-c-idle-ja"],[1,"rub-electric-gate-panel-c-lod0-mg"],[0,"rub-electric-gate-panel-c-lod0-jg"]],"rub-electric-gate-panel-d-ag":[[2,"rub-electric-gate-panel-d-idle-ja"],[1,"rub-electric-gate-panel-d-lod0-mg"],[0,"rub-electric-gate-panel-d-lod0-jg"]],"rub-electric-gate-switch-ag":[[2,"rub-electric-gate-switch-idle-ja"],[1,"rub-electric-gate-switch-lod0-mg"],[0,"rub-electric-gate-switch-lod0-jg"]],"rub-falling-step-ag":[[4,"rub-falling-step-break-ja"],[3,"rub-falling-step-idle-ja"],[2,"rub-falling-step-lod1-mg"],[1,"rub-falling-step-lod0-mg"],[0,"rub-falling-step-lod0-jg"]],"rub-rhino-door-ag":[[2,"rub-rhino-door-idle-ja"],[1,"rub-rhino-door-lod0-mg"],[0,"rub-rhino-door-lod0-jg"]],"rub-tower-ag":[[4,"rub-tower-bump-ja"],[3,"rub-tower-fall-ja"],[2,"rub-tower-idle-ja"],[1,"rub-tower-lod0-mg"],[0,"rub-tower-lod0-jg"]],"saberfish-ag":[[32,"saberfish-crawl-out-of-tube-ja"],[31,"saberfish-flip-up-ja"],[30,"saberfish-flip-up-start-ja"],[29,"saberfish-swim-turn-left-ja"],[12,"saberfish-knocked-land-ja"],[11,"saberfish-knocked-ja"],[10,"saberfish-attack-end-ja"],[9,"saberfish-attack-loop-ja"],[8,"saberfish-attack-start-ja"],[7,"saberfish-turn-ja"],[6,"saberfish-walk-ja"],[5,"saberfish-run-ja"],[4,"saberfish-swim-idle-ja"],[3,"saberfish-idle-ja"],[2,"saberfish-shadow-mg"],[1,"saberfish-lod0-mg"],[0,"saberfish-lod0-jg"],[13,"saberfish-swim-burst-ja"],[14,"saberfish-swim-fast-ja"],[15,"saberfish-spin-attack-left-ja"],[16,"saberfish-spin-attack-right-ja"],[17,"saberfish-swim-attack-ja"],[18,"saberfish-jump-to-land-windup-ja"],[19,"saberfish-jump-to-land-air-ja"],[20,"saberfish-jump-to-land-land-ja"],[21,"saberfish-jump-to-water-air-ja"],[22,"saberfish-jump-to-water-land-ja"],[23,"saberfish-submerge-start-ja"],[24,"saberfish-submerge-ja"],[25,"saberfish-reemerge-start-ja"],[26,"saberfish-reemerge-ja"],[27,"saberfish-swim-180-turn-ja"],[28,"saberfish-swim-turn-right-ja"]],"samos-effect-ag":[[2,"samos-effect-idle-ja"],[1,"samos-effect-lod0-mg"],[0,"samos-effect-lod0-jg"]],"samos-highres-ag":[[5,"samos-highres-samos-walk-ja"],[4,"samos-highres-idle-stand2-ja"],[3,"samos-highres-idle-ja"],[2,"samos-highres-shadow-mg"],[1,"samos-highres-lod0-mg"],[0,"samos-highres-lod0-jg"]],"scenecamera-ag":[[2,"scenecamera-idle-ja"],[1,"scenecamera-lod0-mg"],[0,"scenecamera-lod0-jg"]],"scorpion-ag":[[11,"scorpion-idle-ja"],[10,"scorpion-shadow-mg"],[9,"scorpion-lod0-mg"],[8,"scorpion-lod0-jg"],[7,"scorpion-wheel-blur-idle-ja"],[6,"scorpion-wheel-blur-shadow-mg"],[5,"scorpion-wheel-blur-lod0-mg"],[4,"scorpion-wheel-blur-lod0-jg"],[3,"scorpion-wheel-idle-ja"],[2,"scorpion-wheel-shadow-mg"],[1,"scorpion-wheel-lod0-mg"],[0,"scorpion-wheel-lod0-jg"]],"scorpion-gun-ag":[[2,"scorpion-gun-idle-ja"],[1,"scorpion-gun-lod0-mg"],[0,"scorpion-gun-lod0-jg"]],"scorpion-wheel-fma-ag":[[3,"scorpion-wheel-fma-idle-ja"],[2,"scorpion-wheel-fma-shadow-mg"],[1,"scorpion-wheel-fma-lod0-mg"],[0,"scorpion-wheel-fma-lod0-jg"]],"scoutbot-ag":[[15,"scoutbot-red-hit0-ja"],[14,"scoutbot-shoot-loop-ja"],[13,"scoutbot-shoot-start-ja"],[0,"scoutbot-lod0-jg"],[1,"scoutbot-lod0-mg"],[2,"scoutbot-shadow-mg"],[3,"scoutbot-idle-ja"],[4,"scoutbot-walk-ja"],[5,"scoutbot-walk-turn-ja"],[6,"scoutbot-intro1-ja"],[7,"scoutbot-attack-lf-ja"],[8,"scoutbot-attack-lm-ja"],[9,"scoutbot-attack-lr-ja"],[10,"scoutbot-attack-rf-ja"],[11,"scoutbot-attack-rm-ja"],[12,"scoutbot-attack-rr-ja"]],"screen-fma-ag":[[2,"screen-fma-idle-ja"],[1,"screen-fma-lod0-mg"],[0,"screen-fma-lod0-jg"]],"sculptor-ag":[[2,"sculptor-sculptor-idle-ja"],[1,"sculptor-lod0-mg"],[0,"sculptor-lod0-jg"]],"searchlight-ag":[[2,"searchlight-idle-ja"],[1,"searchlight-lod0-mg"],[0,"searchlight-lod0-jg"]],"security-wall-ag":[[2,"security-wall-idle-ja"],[1,"security-wall-lod0-mg"],[0,"security-wall-lod0-jg"]],"seem-highres-ag":[[6,"seem-highres-seem-idle-ja"],[7,"seem-highres-idle-leaper-ja"],[5,"seem-highres-idle-satellite-ja"],[4,"seem-highres-idle-ja"],[3,"seem-highres-seem-seemskirt_fr-cg"],[2,"seem-highres-shadow-mg"],[1,"seem-highres-lod0-mg"],[0,"seem-highres-lod0-jg"]],"sew-curved-door-ag":[[2,"sew-curved-door-idle-ja"],[1,"sew-curved-door-lod0-mg"],[0,"sew-curved-door-lod0-jg"]],"sew-elevator-ag":[[3,"sew-elevator-idle-ja"],[2,"sew-elevator-lod1-mg"],[1,"sew-elevator-lod0-mg"],[0,"sew-elevator-lod0-jg"]],"sew-fan-ag":[[7,"sew-fan-explode-idle-ja"],[6,"sew-fan-explode-lod0-mg"],[5,"sew-fan-explode-lod0-jg"],[4,"sew-fan-idle-ja"],[3,"sew-fan-lod2-mg"],[2,"sew-fan-lod1-mg"],[1,"sew-fan-lod0-mg"],[0,"sew-fan-lod0-jg"]],"sew-fence-gate-ag":[[4,"sew-fence-gate-close-ja"],[3,"sew-fence-gate-idle-ja"],[2,"sew-fence-gate-lod1-mg"],[1,"sew-fence-gate-lod0-mg"],[0,"sew-fence-gate-lod0-jg"]],"sew-float-plat-ag":[[3,"sew-float-plat-idle-ja"],[2,"sew-float-plat-lod1-mg"],[1,"sew-float-plat-lod0-mg"],[0,"sew-float-plat-lod0-jg"]],"sew-floor-switch-ag":[[5,"sew-floor-switch-popup-ja"],[4,"sew-floor-switch-pushdown-ja"],[3,"sew-floor-switch-idle-ja"],[2,"sew-floor-switch-lod1-mg"],[1,"sew-floor-switch-lod0-mg"],[0,"sew-floor-switch-lod0-jg"]],"sew-gas-step-ag":[[4,"sew-gas-step-rattle-ja"],[3,"sew-gas-step-idle-ja"],[2,"sew-gas-step-lod1-mg"],[1,"sew-gas-step-lod0-mg"],[0,"sew-gas-step-lod0-jg"]],"sew-gate-ag":[[3,"sew-gate-open-ja"],[2,"sew-gate-idle-ja"],[1,"sew-gate-lod0-mg"],[0,"sew-gate-lod0-jg"]],"sew-grate-plat-ag":[[2,"sew-grate-plat-idle-ja"],[1,"sew-grate-plat-lod0-mg"],[0,"sew-grate-plat-lod0-jg"]],"sew-gunturret-ag":[[8,"sew-gunturret-explode-idle-ja"],[7,"sew-gunturret-explode-lod0-mg"],[6,"sew-gunturret-explode-lod0-jg"],[5,"sew-gunturret-shoot-ja"],[4,"sew-gunturret-idle-ja"],[3,"sew-gunturret-lod2-mg"],[2,"sew-gunturret-lod1-mg"],[1,"sew-gunturret-lod0-mg"],[0,"sew-gunturret-lod0-jg"]],"sew-jump-pad-ag":[[3,"sew-jump-pad-idle-ja"],[2,"sew-jump-pad-lod1-mg"],[1,"sew-jump-pad-lod0-mg"],[0,"sew-jump-pad-lod0-jg"]],"sew-laser-beam-ag":[[4,"sew-laser-beam-idle-ja"],[3,"sew-laser-beam-shadow-mg"],[2,"sew-laser-beam-lod1-mg"],[1,"sew-laser-beam-lod0-mg"],[0,"sew-laser-beam-lod0-jg"]],"sew-laser-guard-ag":[[4,"sew-laser-guard-shoot-ja"],[3,"sew-laser-guard-idle-ja"],[2,"sew-laser-guard-lod1-mg"],[1,"sew-laser-guard-lod0-mg"],[0,"sew-laser-guard-lod0-jg"]],"sew-laser-turret-ag":[[5,"sew-laser-turret-recoil-ja"],[4,"sew-laser-turret-arms-up-ja"],[3,"sew-laser-turret-idle-ja"],[2,"sew-laser-turret-lod1-mg"],[1,"sew-laser-turret-lod0-mg"],[0,"sew-laser-turret-lod0-jg"]],"sew-m-gate-ag":[[3,"sew-m-gate-gate-open-ja"],[2,"sew-m-gate-idle-ja"],[1,"sew-m-gate-lod0-mg"],[0,"sew-m-gate-lod0-jg"]],"sew-move-plat-ag":[[2,"sew-move-plat-idle-ja"],[1,"sew-move-plat-lod0-mg"],[0,"sew-move-plat-lod0-jg"]],"sew-move-turret-ag":[[3,"sew-move-turret-move-shoot-ja"],[2,"sew-move-turret-idle-ja"],[1,"sew-move-turret-lod0-mg"],[0,"sew-move-turret-lod0-jg"]],"sew-moving-step-a-ag":[[3,"sew-moving-step-a-idle-ja"],[2,"sew-moving-step-a-lod1-mg"],[1,"sew-moving-step-a-lod0-mg"],[0,"sew-moving-step-a-lod0-jg"]],"sew-moving-step-b-ag":[[2,"sew-moving-step-b-idle-ja"],[1,"sew-moving-step-b-lod0-mg"],[0,"sew-moving-step-b-lod0-jg"]],"sew-pipe-ag":[[3,"sew-pipe-down-ja"],[2,"sew-pipe-idle-ja"],[1,"sew-pipe-lod0-mg"],[0,"sew-pipe-lod0-jg"]],"sew-poison-switch-ag":[[4,"sew-poison-switch-open-ja"],[3,"sew-poison-switch-idle-ja"],[2,"sew-poison-switch-lod1-mg"],[1,"sew-poison-switch-lod0-mg"],[0,"sew-poison-switch-lod0-jg"]],"sew-power-switch-ag":[[3,"sew-power-switch-off-ja"],[2,"sew-power-switch-idle-ja"],[1,"sew-power-switch-lod0-mg"],[0,"sew-power-switch-lod0-jg"]],"sew-rove-plat-ag":[[2,"sew-rove-plat-idle-ja"],[1,"sew-rove-plat-lod0-mg"],[0,"sew-rove-plat-lod0-jg"]],"sew-slide-step-ag":[[2,"sew-slide-step-idle-ja"],[1,"sew-slide-step-lod0-mg"],[0,"sew-slide-step-lod0-jg"]],"sew-wall-switch-ag":[[3,"sew-wall-switch-push-ja"],[2,"sew-wall-switch-idle-ja"],[1,"sew-wall-switch-lod0-mg"],[0,"sew-wall-switch-lod0-jg"]],"sewer-frog-ag":[[17,"sewer-frog-hit0-ja"],[16,"sewer-frog-attack0-end-ja"],[15,"sewer-frog-attack0-mid-ja"],[14,"sewer-frog-attack0-start-ja"],[13,"sewer-frog-turn-right-180-ja"],[0,"sewer-frog-lod0-jg"],[1,"sewer-frog-lod0-mg"],[2,"sewer-frog-shadow-mg"],[3,"sewer-frog-idle0-ja"],[4,"sewer-frog-idle-bite-ja"],[5,"sewer-frog-hop0-start-ja"],[6,"sewer-frog-hop0-end-ja"],[7,"sewer-frog-hop-small-start-ja"],[8,"sewer-frog-hop-small-end-ja"],[9,"sewer-frog-notice-ja"],[10,"sewer-frog-turn-left-45-ja"],[11,"sewer-frog-turn-right-45-ja"],[12,"sewer-frog-turn-left-180-ja"]],"shield-sphere-ag":[[2,"shield-sphere-idle-ja"],[1,"shield-sphere-lod0-mg"],[0,"shield-sphere-lod0-jg"]],"shield-sphere-distort-ag":[[2,"shield-sphere-distort-idle-ja"],[1,"shield-sphere-distort-lod0-mg"],[0,"shield-sphere-distort-lod0-jg"]],"shield-sphere-explode-ag":[[2,"shield-sphere-explode-idle-ja"],[1,"shield-sphere-explode-lod0-mg"],[0,"shield-sphere-explode-lod0-jg"]],"shoulder-plates-ag":[[2,"shoulder-plates-idle-ja"],[1,"shoulder-plates-lod0-mg"],[0,"shoulder-plates-lod0-jg"]],"sidekick-human-ag":[[2,"sidekick-human-sidekick-human-idle-ja"],[1,"sidekick-human-lod0-mg"],[0,"sidekick-human-lod0-jg"]],"sig-highres-ag":[[5,"sig-highres-sig-walk-ja"],[4,"sig-highres-idle-wasdoors-ja"],[3,"sig-highres-idle-ja"],[2,"sig-highres-shadow-mg"],[1,"sig-highres-lod0-mg"],[0,"sig-highres-lod0-jg"]],"sig-rider-ag":[[6,"sig-rider-pilot-car-up-down-ja"],[5,"sig-rider-pilot-car-turn-back-ja"],[4,"sig-rider-pilot-car-turn-front-ja"],[3,"sig-rider-idle-ja"],[2,"sig-rider-shadow-mg"],[1,"sig-rider-lod0-mg"],[0,"sig-rider-lod0-jg"]],"snake-ag":[[11,"snake-idle-ja"],[10,"snake-shadow-mg"],[9,"snake-lod0-mg"],[8,"snake-lod0-jg"],[7,"snake-wheel-blur-idle-ja"],[6,"snake-wheel-blur-shadow-mg"],[5,"snake-wheel-blur-lod0-mg"],[4,"snake-wheel-blur-lod0-jg"],[3,"snake-wheel-idle-ja"],[2,"snake-wheel-shadow-mg"],[1,"snake-wheel-lod0-mg"],[0,"snake-wheel-lod0-jg"]],"snake-wheel-fma-ag":[[3,"snake-wheel-fma-idle-ja"],[2,"snake-wheel-fma-shadow-mg"],[1,"snake-wheel-fma-lod0-mg"],[0,"snake-wheel-fma-lod0-jg"]],"spiky-frog-ag":[[21,"spiky-frog-ragdoll-ja"],[20,"spiky-frog-ball0-end-ja"],[19,"spiky-frog-ball0-turn-ja"],[18,"spiky-frog-ball0-start-ja"],[17,"spiky-frog-attack0-end-ja"],[16,"spiky-frog-attack0-start-ja"],[15,"spiky-frog-hop-fast-end-ja"],[14,"spiky-frog-hop-fast-start-ja"],[13,"spiky-frog-hop-slow-end-ja"],[0,"spiky-frog-lod0-jg"],[1,"spiky-frog-lod0-mg"],[2,"spiky-frog-lod1-mg"],[3,"spiky-frog-shadow-mg"],[4,"spiky-frog-idle0-ja"],[5,"spiky-frog-idle1-ja"],[6,"spiky-frog-notice0-ja"],[7,"spiky-frog-notice0-jump-ja"],[8,"spiky-frog-notice0-land-ja"],[9,"spiky-frog-rotate-left-start-ja"],[10,"spiky-frog-rotate-right-start-ja"],[11,"spiky-frog-rotate-left-end-ja"],[12,"spiky-frog-hop-slow-start-ja"]],"spotlight-ag":[[2,"spotlight-idle-ja"],[1,"spotlight-lod0-mg"],[0,"spotlight-lod0-jg"]],"spyder-ag":[[23,"spyder-jump-land-ja"],[22,"spyder-jump-in-air-ja"],[21,"spyder-jump-wind-up-ja"],[20,"spyder-hit-land-ja"],[19,"spyder-blue-hit2-ja"],[18,"spyder-blue-hit1-ja"],[17,"spyder-blue-hit0-ja"],[16,"spyder-hit-hard-ja"],[15,"spyder-hit-ja"],[14,"spyder-jump-ja"],[13,"spyder-die-knocked-ja"],[0,"spyder-lod0-jg"],[1,"spyder-lod0-mg"],[2,"spyder-lod1-mg"],[3,"spyder-shadow-mg"],[4,"spyder-idle-ja"],[5,"spyder-patrol0-ja"],[6,"spyder-notice-ja"],[7,"spyder-victory-ja"],[8,"spyder-run0-ja"],[9,"spyder-shoot-low-ja"],[10,"spyder-shoot-high-ja"],[11,"spyder-falling-death-ja"],[12,"spyder-death-ja"]],"spydroid-ag":[[13,"spydroid-knocked1-land-ja"],[0,"spydroid-lod0-jg"],[1,"spydroid-lod0-mg"],[2,"spydroid-shadow-mg"],[3,"spydroid-idle-ja"],[4,"spydroid-walk-ja"],[5,"spydroid-run-ja"],[6,"spydroid-attack-jump-ja"],[7,"spydroid-attack-land-ja"],[8,"spydroid-jump-wind-up-ja"],[9,"spydroid-knocked0-ja"],[10,"spydroid-knocked0-land-ja"],[11,"spydroid-knocked1-ja"],[12,"spydroid-turn-180-ja"]],"spydroid-orig-ag":[[20,"spydroid-orig-exploding-idle-ja"],[19,"spydroid-orig-exploding-lod0-mg"],[18,"spydroid-orig-exploding-lod0-jg"],[17,"spydroid-orig-turn-left-ja"],[16,"spydroid-orig-turn-right-ja"],[15,"spydroid-orig-explode-ja"],[14,"spydroid-orig-knocked1-land-ja"],[13,"spydroid-orig-knocked1-ja"],[0,"spydroid-orig-lod0-jg"],[1,"spydroid-orig-lod0-mg"],[2,"spydroid-orig-shadow-mg"],[3,"spydroid-orig-idle-ja"],[4,"spydroid-orig-walk-ja"],[5,"spydroid-orig-run-ja"],[6,"spydroid-orig-attack-jump-ja"],[7,"spydroid-orig-attack-land-ja"],[8,"spydroid-orig-jump-wind-up-ja"],[9,"spydroid-orig-jump-ja"],[10,"spydroid-orig-jump-land-ja"],[11,"spydroid-orig-knocked0-ja"],[12,"spydroid-orig-knocked0-land-ja"]],"stadium-sails-left-ag":[[3,"stadium-sails-left-idle-ja"],[2,"stadium-sails-left-lod1-mg"],[1,"stadium-sails-left-lod0-mg"],[0,"stadium-sails-left-lod0-jg"]],"stadium-sails-right-ag":[[3,"stadium-sails-right-idle-ja"],[2,"stadium-sails-right-lod1-mg"],[1,"stadium-sails-right-lod0-mg"],[0,"stadium-sails-right-lod0-jg"]],"switcher-ag":[[4,"switcher-die-ja"],[3,"switcher-charge-ja"],[2,"switcher-idle-ja"],[1,"switcher-lod0-mg"],[0,"switcher-lod0-jg"]],"talk-box-ag":[[2,"talk-box-idle-ja"],[1,"talk-box-lod0-mg"],[0,"talk-box-lod0-jg"]],"tentacle-ag":[[3,"tentacle-tentacle-attack-ja"],[2,"tentacle-emerge-ja"],[1,"tentacle-lod0-mg"],[0,"tentacle-lod0-jg"]],"terraformer-ag":[[6,"terraformer-walk-ja"],[5,"terraformer-idle-ja"],[4,"terraformer-shadow-mg"],[3,"terraformer-lod2-mg"],[2,"terraformer-lod1-mg"],[1,"terraformer-lod0-mg"],[0,"terraformer-lod0-jg"]],"terraformer-drone-ag":[[4,"terraformer-drone-spin-ja"],[3,"terraformer-drone-spike-out-ja"],[2,"terraformer-drone-idle-ja"],[1,"terraformer-drone-lod0-mg"],[0,"terraformer-drone-lod0-jg"]],"terraformer-head-ag":[[19,"terraformer-head-horn-guns-fire-loop-ja"],[18,"terraformer-head-horn-guns-fire-ja"],[17,"terraformer-head-horn-guns-idle-ja"],[16,"terraformer-head-horn-guns-extend-ja"],[15,"terraformer-head-head-guns-fire-ja"],[14,"terraformer-head-hit-right-ja"],[13,"terraformer-head-hit-left-ja"],[0,"terraformer-head-lod0-jg"],[1,"terraformer-head-lod0-mg"],[2,"terraformer-head-shadow-mg"],[3,"terraformer-head-idle-ja"],[4,"terraformer-head-slam-middle-ja"],[5,"terraformer-head-slam-left-ja"],[6,"terraformer-head-slam-right-ja"],[7,"terraformer-head-sweep-to-left-windup-ja"],[8,"terraformer-head-sweep-to-left-ja"],[9,"terraformer-head-sweep-to-left-idle-ja"],[10,"terraformer-head-sweep-to-right-windup-ja"],[11,"terraformer-head-sweep-to-right-ja"],[12,"terraformer-head-sweep-to-right-idle-ja"]],"terraformer-laser-ag":[[3,"terraformer-laser-idle-ja"],[2,"terraformer-laser-shadow-mg"],[1,"terraformer-laser-lod0-mg"],[0,"terraformer-laser-lod0-jg"]],"terraformer-laser-end-ag":[[3,"terraformer-laser-end-idle-ja"],[2,"terraformer-laser-end-shadow-mg"],[1,"terraformer-laser-end-lod0-mg"],[0,"terraformer-laser-end-lod0-jg"]],"terraformer-leg-a-ag":[[34,"terraformer-leg-a-rm-walk-ja"],[20,"terraformer-leg-a-lr-walk-ja"],[6,"terraformer-leg-a-lf-walk-ja"],[5,"terraformer-leg-a-idle-ja"],[4,"terraformer-leg-a-shadow-mg"],[3,"terraformer-leg-a-lod2-mg"],[41,"terraformer-leg-a-rr-walk-ja"],[2,"terraformer-leg-a-lod1-mg"],[27,"terraformer-leg-a-rf-walk-ja"],[1,"terraformer-leg-a-lod0-mg"],[13,"terraformer-leg-a-lm-walk-ja"],[0,"terraformer-leg-a-lod0-jg"]],"terraformer-leg-b-ag":[[34,"terraformer-leg-b-rm-walk-ja"],[20,"terraformer-leg-b-lr-walk-ja"],[6,"terraformer-leg-b-lf-walk-ja"],[5,"terraformer-leg-b-idle-ja"],[4,"terraformer-leg-b-shadow-mg"],[3,"terraformer-leg-b-lod2-mg"],[41,"terraformer-leg-b-rr-walk-ja"],[2,"terraformer-leg-b-lod1-mg"],[27,"terraformer-leg-b-rf-walk-ja"],[1,"terraformer-leg-b-lod0-mg"],[13,"terraformer-leg-b-lm-walk-ja"],[0,"terraformer-leg-b-lod0-jg"]],"terraformer-leg-c-ag":[[34,"terraformer-leg-c-rm-walk-ja"],[20,"terraformer-leg-c-lr-walk-ja"],[6,"terraformer-leg-c-lf-walk-ja"],[5,"terraformer-leg-c-idle-ja"],[4,"terraformer-leg-c-shadow-mg"],[3,"terraformer-leg-c-lod2-mg"],[41,"terraformer-leg-c-rr-walk-ja"],[2,"terraformer-leg-c-lod1-mg"],[27,"terraformer-leg-c-rf-walk-ja"],[1,"terraformer-leg-c-lod0-mg"],[13,"terraformer-leg-c-lm-walk-ja"],[0,"terraformer-leg-c-lod0-jg"]],"terraformer-mine-ag":[[3,"terraformer-mine-spike-out-ja"],[2,"terraformer-mine-idle-ja"],[1,"terraformer-mine-lod0-mg"],[0,"terraformer-mine-lod0-jg"]],"terraformer-spike-ag":[[34,"terraformer-spike-rm-walk-ja"],[20,"terraformer-spike-lr-walk-ja"],[6,"terraformer-spike-lf-walk-ja"],[5,"terraformer-spike-idle-ja"],[4,"terraformer-spike-shadow-mg"],[3,"terraformer-spike-lod2-mg"],[41,"terraformer-spike-rr-walk-ja"],[2,"terraformer-spike-lod1-mg"],[27,"terraformer-spike-rf-walk-ja"],[1,"terraformer-spike-lod0-mg"],[13,"terraformer-spike-lm-walk-ja"],[0,"terraformer-spike-lod0-jg"]],"terraformer-target-ag":[[2,"terraformer-target-idle-ja"],[1,"terraformer-target-lod0-mg"],[0,"terraformer-target-lod0-jg"]],"tess-highres-ag":[[6,"tess-highres-idle-res-no-gun-ja"],[5,"tess-highres-idle-res-gun-ja"],[4,"tess-highres-idle-clean-gun-ja"],[3,"tess-highres-idle-ja"],[2,"tess-highres-shadow-mg"],[1,"tess-highres-lod0-mg"],[0,"tess-highres-lod0-jg"]],"time-map-ag":[[2,"time-map-idle-ja"],[1,"time-map-lod0-mg"],[0,"time-map-lod0-jg"]],"tizard-ag":[[6,"tizard-turn-right0-ja"],[5,"tizard-turn-left0-ja"],[4,"tizard-walk0-ja"],[3,"tizard-idle-ja"],[2,"tizard-shadow-mg"],[1,"tizard-lod0-mg"],[0,"tizard-lod0-jg"]],"toad-ag":[[11,"toad-idle-ja"],[10,"toad-shadow-mg"],[9,"toad-lod0-mg"],[8,"toad-lod0-jg"],[7,"toad-wheel-blur-idle-ja"],[6,"toad-wheel-blur-shadow-mg"],[5,"toad-wheel-blur-lod0-mg"],[4,"toad-wheel-blur-lod0-jg"],[3,"toad-wheel-idle-ja"],[2,"toad-wheel-shadow-mg"],[1,"toad-wheel-lod0-mg"],[0,"toad-wheel-lod0-jg"]],"tomb-baby-spider-ag":[[22,"tomb-baby-spider-hit-blue-land-ja"],[21,"tomb-baby-spider-hit-blue-back-ja"],[20,"tomb-baby-spider-hit-blue-front-ja"],[19,"tomb-baby-spider-knocked1-land-fadeout-ja"],[18,"tomb-baby-spider-knocked1-land-ja"],[17,"tomb-baby-spider-knocked1-ja"],[16,"tomb-baby-spider-knocked0-land-fadeout-ja"],[15,"tomb-baby-spider-knocked0-land-ja"],[14,"tomb-baby-spider-knocked0-ja"],[13,"tomb-baby-spider-die-ja"],[0,"tomb-baby-spider-lod0-jg"],[1,"tomb-baby-spider-lod0-mg"],[2,"tomb-baby-spider-lod1-mg"],[3,"tomb-baby-spider-shadow-mg"],[4,"tomb-baby-spider-idle-ja"],[5,"tomb-baby-spider-walk0-ja"],[6,"tomb-baby-spider-notice-spin-ja"],[7,"tomb-baby-spider-notice-land-ja"],[8,"tomb-baby-spider-run0-ja"],[9,"tomb-baby-spider-turn-right-ja"],[10,"tomb-baby-spider-turn-left-ja"],[11,"tomb-baby-spider-attack0-start-ja"],[12,"tomb-baby-spider-attack0-stop-ja"]],"torn-effect-ag":[[2,"torn-effect-idle-ja"],[1,"torn-effect-lod0-mg"],[0,"torn-effect-lod0-jg"]],"torn-highres-ag":[[7,"torn-highres-torn-walk-ja"],[6,"torn-highres-idle-bar-ja"],[5,"torn-highres-idle-booth-ja"],[4,"torn-highres-idle-table-ja"],[3,"torn-highres-idle-ja"],[2,"torn-highres-shadow-mg"],[1,"torn-highres-lod0-mg"],[0,"torn-highres-lod0-jg"]],"torn-simple-ag":[[2,"torn-simple-idle-ja"],[1,"torn-simple-lod0-mg"],[0,"torn-simple-lod0-jg"]],"tow-break-ag":[[2,"tow-break-idle-ja"],[1,"tow-break-lod0-mg"],[0,"tow-break-lod0-jg"]],"tow-break-base-ag":[[10,"tow-break-base-b-idle-ja"],[9,"tow-break-base-b-lod0-mg"],[8,"tow-break-base-b-lod0-jg"],[6,"tow-break-base-a-idle-ja"],[5,"tow-break-base-a-lod0-mg"],[4,"tow-break-base-a-lod0-jg"],[2,"tow-break-base-idle-ja"],[1,"tow-break-base-lod0-mg"],[0,"tow-break-base-lod0-jg"]],"tow-energy-bridge-ag":[[3,"tow-energy-bridge-appear-ja"],[2,"tow-energy-bridge-idle-ja"],[1,"tow-energy-bridge-lod0-mg"],[0,"tow-energy-bridge-lod0-jg"]],"tow-large-plat-ag":[[2,"tow-large-plat-idle-ja"],[1,"tow-large-plat-lod0-mg"],[0,"tow-large-plat-lod0-jg"]],"tow-spawner-ag":[[5,"tow-spawner-spawn-end-ja"],[4,"tow-spawner-spawn-middle-ja"],[3,"tow-spawner-spawn-start-ja"],[2,"tow-spawner-idle-ja"],[1,"tow-spawner-lod0-mg"],[0,"tow-spawner-lod0-jg"]],"tow-tentacle-ag":[[2,"tow-tentacle-idle-ja"],[1,"tow-tentacle-lod0-mg"],[0,"tow-tentacle-lod0-jg"]],"tow-top-ag":[[12,"tow-top-c-lod0-jg"],[10,"tow-top-b-idle-ja"],[9,"tow-top-b-lod0-mg"],[8,"tow-top-b-lod0-jg"],[6,"tow-top-a-idle-ja"],[5,"tow-top-a-lod0-mg"],[4,"tow-top-a-lod0-jg"],[2,"tow-top-idle-ja"],[14,"tow-top-c-idle-ja"],[1,"tow-top-lod0-mg"],[13,"tow-top-c-lod0-mg"],[0,"tow-top-lod0-jg"]],"tow-warp-effect-ag":[[2,"tow-warp-effect-idle-ja"],[1,"tow-warp-effect-lod0-mg"],[0,"tow-warp-effect-lod0-jg"]],"tpl-banner-ag":[[2,"tpl-banner-idle-ja"],[1,"tpl-banner-lod0-mg"],[0,"tpl-banner-lod0-jg"]],"tpl-banner-b-ag":[[2,"tpl-banner-b-idle-ja"],[1,"tpl-banner-b-lod0-mg"],[0,"tpl-banner-b-lod0-jg"]],"tpl-bouncer-ag":[[3,"tpl-bouncer-idle-ja"],[2,"tpl-bouncer-lod1-mg"],[1,"tpl-bouncer-lod0-mg"],[0,"tpl-bouncer-lod0-jg"]],"tpl-break-alcove-ag":[[2,"tpl-break-alcove-idle-ja"],[1,"tpl-break-alcove-lod0-mg"],[0,"tpl-break-alcove-lod0-jg"]],"tpl-break-bridge-ag":[[3,"tpl-break-bridge-idle-ja"],[2,"tpl-break-bridge-lod1-mg"],[1,"tpl-break-bridge-lod0-mg"],[0,"tpl-break-bridge-lod0-jg"]],"tpl-break-door-a-ag":[[2,"tpl-break-door-a-idle-ja"],[1,"tpl-break-door-a-lod0-mg"],[0,"tpl-break-door-a-lod0-jg"]],"tpl-bridge-debris-ag":[[7,"tpl-bridge-debris-d-lod0-mg"],[6,"tpl-bridge-debris-d-lod0-jg"],[5,"tpl-bridge-debris-c-lod0-mg"],[4,"tpl-bridge-debris-c-lod0-jg"],[3,"tpl-bridge-debris-b-lod0-mg"],[2,"tpl-bridge-debris-b-lod0-jg"],[1,"tpl-bridge-debris-a-lod0-mg"],[0,"tpl-bridge-debris-a-lod0-jg"]],"tpl-door-a-ag":[[2,"tpl-door-a-idle-ja"],[1,"tpl-door-a-lod0-mg"],[0,"tpl-door-a-lod0-jg"]],"tpl-door-b-ag":[[4,"tpl-door-b-idle-ja"],[3,"tpl-door-b-irrelevant-ja"],[2,"tpl-door-b-lod1-mg"],[1,"tpl-door-b-lod0-mg"],[0,"tpl-door-b-lod0-jg"]],"tpl-door-switch-ag":[[3,"tpl-door-switch-press-ja"],[2,"tpl-door-switch-idle-ja"],[1,"tpl-door-switch-lod0-mg"],[0,"tpl-door-switch-lod0-jg"]],"tpl-elec-swing-pole-ag":[[2,"tpl-elec-swing-pole-idle-ja"],[1,"tpl-elec-swing-pole-lod0-mg"],[0,"tpl-elec-swing-pole-lod0-jg"]],"tpl-elevator-ag":[[2,"tpl-elevator-idle-ja"],[1,"tpl-elevator-lod0-mg"],[0,"tpl-elevator-lod0-jg"]],"tpl-fan-three-ag":[[2,"tpl-fan-three-idle-ja"],[1,"tpl-fan-three-lod0-mg"],[0,"tpl-fan-three-lod0-jg"]],"tpl-fan-two-ag":[[2,"tpl-fan-two-idle-ja"],[1,"tpl-fan-two-lod0-mg"],[0,"tpl-fan-two-lod0-jg"]],"tpl-gate-ag":[[4,"tpl-gate-close-ja"],[3,"tpl-gate-open-ja"],[2,"tpl-gate-idle-ja"],[1,"tpl-gate-lod0-mg"],[0,"tpl-gate-lod0-jg"]],"tpl-glider-ag":[[2,"tpl-glider-idle-ja"],[1,"tpl-glider-lod0-mg"],[0,"tpl-glider-lod0-jg"]],"tpl-glider-break-ag":[[2,"tpl-glider-break-idle-ja"],[1,"tpl-glider-break-lod0-mg"],[0,"tpl-glider-break-lod0-jg"]],"tpl-glider-broken-ag":[[2,"tpl-glider-broken-idle-ja"],[1,"tpl-glider-broken-lod0-mg"],[0,"tpl-glider-broken-lod0-jg"]],"tpl-holo-eye-ag":[[5,"tpl-holo-eye-shuteye-ja"],[4,"tpl-holo-eye-openeye-ja"],[3,"tpl-holo-eye-blink-ja"],[2,"tpl-holo-eye-idle-ja"],[1,"tpl-holo-eye-lod0-mg"],[0,"tpl-holo-eye-lod0-jg"]],"tpl-inner-airlock-door-ag":[[2,"tpl-inner-airlock-door-idle-ja"],[1,"tpl-inner-airlock-door-lod0-mg"],[0,"tpl-inner-airlock-door-lod0-jg"]],"tpl-mardoor-ag":[[2,"tpl-mardoor-idle-ja"],[1,"tpl-mardoor-lod0-mg"],[0,"tpl-mardoor-lod0-jg"]],"tpl-oracle-eye-ag":[[3,"tpl-oracle-eye-open-ja"],[2,"tpl-oracle-eye-idle-ja"],[1,"tpl-oracle-eye-lod0-mg"],[0,"tpl-oracle-eye-lod0-jg"]],"tpl-outer-airlock-door-ag":[[2,"tpl-outer-airlock-door-idle-ja"],[1,"tpl-outer-airlock-door-lod0-mg"],[0,"tpl-outer-airlock-door-lod0-jg"]],"tpl-spike-trap-ag":[[4,"tpl-spike-trap-down-ja"],[3,"tpl-spike-trap-up-ja"],[2,"tpl-spike-trap-idle-ja"],[1,"tpl-spike-trap-lod0-mg"],[0,"tpl-spike-trap-lod0-jg"]],"tpl-spindle-ag":[[2,"tpl-spindle-idle-ja"],[1,"tpl-spindle-lod0-mg"],[0,"tpl-spindle-lod0-jg"]],"tpl-spinning-plat-ag":[[2,"tpl-spinning-plat-idle-ja"],[1,"tpl-spinning-plat-lod0-mg"],[0,"tpl-spinning-plat-lod0-jg"]],"tpl-stone-break-ag":[[4,"tpl-stone-break-drop-ja"],[3,"tpl-stone-break-idle-ja"],[2,"tpl-stone-break-lod1-mg"],[1,"tpl-stone-break-lod0-mg"],[0,"tpl-stone-break-lod0-jg"]],"tpl-symbol-ag":[[2,"tpl-symbol-idle-ja"],[1,"tpl-symbol-lod0-mg"],[0,"tpl-symbol-lod0-jg"]],"tpl-watcher-ag":[[6,"tpl-watcher-explode-idle-ja"],[5,"tpl-watcher-explode-lod0-mg"],[4,"tpl-watcher-explode-lod0-jg"],[3,"tpl-watcher-idle-ja"],[2,"tpl-watcher-shadow-mg"],[1,"tpl-watcher-lod0-mg"],[0,"tpl-watcher-lod0-jg"]],"transport-ag":[[6,"transport-hatch-close-ja"],[5,"transport-hatch-open-ja"],[4,"transport-idle-ja"],[3,"transport-lod2-mg"],[2,"transport-lod1-mg"],[1,"transport-lod0-mg"],[0,"transport-lod0-jg"]],"turtle-ag":[[11,"turtle-idle-ja"],[10,"turtle-shadow-mg"],[9,"turtle-lod0-mg"],[8,"turtle-lod0-jg"],[7,"turtle-wheel-blur-idle-ja"],[6,"turtle-wheel-blur-shadow-mg"],[5,"turtle-wheel-blur-lod0-mg"],[4,"turtle-wheel-blur-lod0-jg"],[3,"turtle-wheel-idle-ja"],[2,"turtle-wheel-shadow-mg"],[1,"turtle-wheel-lod0-mg"],[0,"turtle-wheel-lod0-jg"]],"turtle-wheel-fma-ag":[[3,"turtle-wheel-fma-idle-ja"],[2,"turtle-wheel-fma-shadow-mg"],[1,"turtle-wheel-fma-lod0-mg"],[0,"turtle-wheel-fma-lod0-jg"]],"urn-a-ag":[[2,"urn-a-idle-ja"],[1,"urn-a-lod0-mg"],[0,"urn-a-lod0-jg"]],"urn-b-ag":[[2,"urn-b-idle-ja"],[1,"urn-b-lod0-mg"],[0,"urn-b-lod0-jg"]],"urn-c-ag":[[2,"urn-c-idle-ja"],[1,"urn-c-lod0-mg"],[0,"urn-c-lod0-jg"]],"veger-highres-ag":[[6,"veger-highres-veger-walk-ja"],[5,"veger-highres-idle-ja"],[4,"veger-highres-veger-coatR-cg"],[3,"veger-highres-veger-coatL-cg"],[2,"veger-highres-shadow-mg"],[1,"veger-highres-lod0-mg"],[0,"veger-highres-lod0-jg"]],"vehicle-explosion-ag":[[2,"vehicle-explosion-idle-ja"],[1,"vehicle-explosion-lod0-mg"],[0,"vehicle-explosion-lod0-jg"]],"vin-ag":[[2,"vin-idle-ja"],[1,"vin-lod0-mg"],[0,"vin-lod0-jg"]],"vin-door-ctyinda-ag":[[2,"vin-door-ctyinda-idle-ja"],[1,"vin-door-ctyinda-lod0-mg"],[0,"vin-door-ctyinda-lod0-jg"]],"vin-effect-ag":[[2,"vin-effect-idle-ja"],[1,"vin-effect-lod0-mg"],[0,"vin-effect-lod0-jg"]],"vin-turbine-ag":[[2,"vin-turbine-idle-ja"],[1,"vin-turbine-lod0-mg"],[0,"vin-turbine-lod0-jg"]],"vol-balance-plat-ag":[[2,"vol-balance-plat-idle-ja"],[1,"vol-balance-plat-lod0-mg"],[0,"vol-balance-plat-lod0-jg"]],"vol-bouncer-ag":[[2,"vol-bouncer-idle-ja"],[1,"vol-bouncer-lod0-mg"],[0,"vol-bouncer-lod0-jg"]],"vol-break-ground-ag":[[4,"vol-break-ground-drop-ja"],[3,"vol-break-ground-idle-ja"],[2,"vol-break-ground-lod1-mg"],[1,"vol-break-ground-lod0-mg"],[0,"vol-break-ground-lod0-jg"]],"vol-collapsing-rock-ag":[[3,"vol-collapsing-rock-falling-ja"],[2,"vol-collapsing-rock-idle-ja"],[1,"vol-collapsing-rock-lod0-mg"],[0,"vol-collapsing-rock-lod0-jg"]],"vol-holo-eye-ag":[[5,"vol-holo-eye-shuteye-ja"],[4,"vol-holo-eye-openeye-ja"],[3,"vol-holo-eye-blink-ja"],[2,"vol-holo-eye-idle-ja"],[1,"vol-holo-eye-lod0-mg"],[0,"vol-holo-eye-lod0-jg"]],"vol-lava-ball-ag":[[2,"vol-lava-ball-idle-ja"],[1,"vol-lava-ball-lod0-mg"],[0,"vol-lava-ball-lod0-jg"]],"vol-lava-plat-ag":[[2,"vol-lava-plat-idle-ja"],[1,"vol-lava-plat-lod0-mg"],[0,"vol-lava-plat-lod0-jg"]],"vol-rising-step-a-ag":[[2,"vol-rising-step-a-idle-ja"],[1,"vol-rising-step-a-lod0-mg"],[0,"vol-rising-step-a-lod0-jg"]],"vol-rising-step-b-ag":[[2,"vol-rising-step-b-idle-ja"],[1,"vol-rising-step-b-lod0-mg"],[0,"vol-rising-step-b-lod0-jg"]],"vol-rising-step-c-ag":[[2,"vol-rising-step-c-idle-ja"],[1,"vol-rising-step-c-lod0-mg"],[0,"vol-rising-step-c-lod0-jg"]],"vol-stone-lid-ag":[[3,"vol-stone-lid-idle-ja"],[2,"vol-stone-lid-shadow-mg"],[1,"vol-stone-lid-lod0-mg"],[0,"vol-stone-lid-lod0-jg"]],"vol-unbroken-ground-ag":[[2,"vol-unbroken-ground-idle-ja"],[1,"vol-unbroken-ground-lod0-mg"],[0,"vol-unbroken-ground-lod0-jg"]],"warp-gate-ag":[[2,"warp-gate-idle-ja"],[1,"warp-gate-lod0-mg"],[0,"warp-gate-lod0-jg"]],"warp-telescope-ag":[[2,"warp-telescope-idle-ja"],[1,"warp-telescope-lod0-mg"],[0,"warp-telescope-lod0-jg"]],"warrior-ag":[[2,"warrior-warrior-idle-ja"],[1,"warrior-lod0-mg"],[0,"warrior-lod0-jg"]],"was-artifact-ag":[[2,"was-artifact-idle-ja"],[1,"was-artifact-lod0-mg"],[0,"was-artifact-lod0-jg"]],"wascity-airlock-ag":[[2,"wascity-airlock-idle-ja"],[1,"wascity-airlock-lod0-mg"],[0,"wascity-airlock-lod0-jg"]],"wascity-airlock-debris-ag":[[2,"wascity-airlock-debris-idle-ja"],[1,"wascity-airlock-debris-lod0-mg"],[0,"wascity-airlock-debris-lod0-jg"]],"wascity-airlock-small-ag":[[2,"wascity-airlock-small-idle-ja"],[1,"wascity-airlock-small-lod0-mg"],[0,"wascity-airlock-small-lod0-jg"]],"wascity-awning-a-ag":[[3,"wascity-awning-a-idle-ja"],[2,"wascity-awning-a-lod1-mg"],[1,"wascity-awning-a-lod0-mg"],[0,"wascity-awning-a-lod0-jg"]],"wascity-awning-b-ag":[[3,"wascity-awning-b-idle-ja"],[2,"wascity-awning-b-lod1-mg"],[1,"wascity-awning-b-lod0-mg"],[0,"wascity-awning-b-lod0-jg"]],"wascity-burning-bush-ag":[[2,"wascity-burning-bush-idle-ja"],[1,"wascity-burning-bush-lod0-mg"],[0,"wascity-burning-bush-lod0-jg"]],"wascity-cactus-ag":[[7,"wascity-cactus-explode-idle-ja"],[6,"wascity-cactus-explode-lod0-mg"],[5,"wascity-cactus-explode-lod0-jg"],[4,"wascity-cactus-idle-ja"],[3,"wascity-cactus-lod2-mg"],[2,"wascity-cactus-lod1-mg"],[1,"wascity-cactus-lod0-mg"],[0,"wascity-cactus-lod0-jg"]],"wascity-elevator-door-ag":[[4,"wascity-elevator-door-idle-ja"],[3,"wascity-elevator-door-lod2-mg"],[2,"wascity-elevator-door-lod1-mg"],[1,"wascity-elevator-door-lod0-mg"],[0,"wascity-elevator-door-lod0-jg"]],"wascity-flag-a-ag":[[3,"wascity-flag-a-flap-ja"],[2,"wascity-flag-a-idle-ja"],[1,"wascity-flag-a-lod0-mg"],[0,"wascity-flag-a-lod0-jg"]],"wascity-flag-b-ag":[[3,"wascity-flag-b-flap-ja"],[2,"wascity-flag-b-idle-ja"],[1,"wascity-flag-b-lod0-mg"],[0,"wascity-flag-b-lod0-jg"]],"wascity-flag-c-ag":[[3,"wascity-flag-c-flap-ja"],[2,"wascity-flag-c-idle-ja"],[1,"wascity-flag-c-lod0-mg"],[0,"wascity-flag-c-lod0-jg"]],"wascity-flag-d-ag":[[2,"wascity-flag-d-flap-ja"],[1,"wascity-flag-d-lod0-mg"],[0,"wascity-flag-d-lod0-jg"]],"wascity-skeet-ag":[[6,"wascity-skeet-explode-idle-ja"],[5,"wascity-skeet-explode-lod0-mg"],[4,"wascity-skeet-explode-lod0-jg"],[3,"wascity-skeet-idle-ja"],[2,"wascity-skeet-shadow-mg"],[1,"wascity-skeet-lod0-mg"],[0,"wascity-skeet-lod0-jg"]],"wascity-skeet-b-ag":[[6,"wascity-skeet-b-explode-idle-ja"],[5,"wascity-skeet-b-explode-lod0-mg"],[4,"wascity-skeet-b-explode-lod0-jg"],[3,"wascity-skeet-b-idle-ja"],[2,"wascity-skeet-b-shadow-mg"],[1,"wascity-skeet-b-lod0-mg"],[0,"wascity-skeet-b-lod0-jg"]],"wascity-skeet-c-ag":[[6,"wascity-skeet-c-explode-idle-ja"],[5,"wascity-skeet-c-explode-lod0-mg"],[4,"wascity-skeet-c-explode-lod0-jg"],[3,"wascity-skeet-c-idle-ja"],[2,"wascity-skeet-c-shadow-mg"],[1,"wascity-skeet-c-lod0-mg"],[0,"wascity-skeet-c-lod0-jg"]],"wascity-stad-door-ag":[[2,"wascity-stad-door-idle-ja"],[1,"wascity-stad-door-lod0-mg"],[0,"wascity-stad-door-lod0-jg"]],"wascity-turret-ag":[[7,"wascity-turret-explode-idle-ja"],[6,"wascity-turret-explode-lod0-mg"],[5,"wascity-turret-explode-lod0-jg"],[4,"wascity-turret-idle-ja"],[3,"wascity-turret-lod2-mg"],[2,"wascity-turret-lod1-mg"],[1,"wascity-turret-lod0-mg"],[0,"wascity-turret-lod0-jg"]],"wascity-water-pump-ag":[[3,"wascity-water-pump-idle-ja"],[2,"wascity-water-pump-lod1-mg"],[1,"wascity-water-pump-lod0-mg"],[0,"wascity-water-pump-lod0-jg"]],"wascity-wind-fan-ag":[[3,"wascity-wind-fan-idle-ja"],[2,"wascity-wind-fan-lod1-mg"],[1,"wascity-wind-fan-lod0-mg"],[0,"wascity-wind-fan-lod0-jg"]],"wascity-windmill-ag":[[3,"wascity-windmill-idle-ja"],[2,"wascity-windmill-lod1-mg"],[1,"wascity-windmill-lod0-mg"],[0,"wascity-windmill-lod0-jg"]],"waspala-blocker-ag":[[2,"waspala-blocker-idle-ja"],[1,"waspala-blocker-lod0-mg"],[0,"waspala-blocker-lod0-jg"]],"waspala-elevator-ag":[[2,"waspala-elevator-idle-ja"],[1,"waspala-elevator-lod0-mg"],[0,"waspala-elevator-lod0-jg"]],"waspala-paddle-wheel-a-ag":[[2,"waspala-paddle-wheel-a-idle-ja"],[1,"waspala-paddle-wheel-a-lod0-mg"],[0,"waspala-paddle-wheel-a-lod0-jg"]],"waspala-paddle-wheel-b-ag":[[2,"waspala-paddle-wheel-b-idle-ja"],[1,"waspala-paddle-wheel-b-lod0-mg"],[0,"waspala-paddle-wheel-b-lod0-jg"]],"water-anim-nst-ag":[[2,"water-anim-nst-idle-ja"],[1,"water-anim-nst-lake-lod0-mg"],[0,"water-anim-nst-lake-lod0-jg"]],"water-anim-waspala-ag":[[8,"water-anim-waspala-idle-ja"],[7,"water-anim-waspala-frontwindowwall-lod0-mg"],[6,"water-anim-waspala-frontwindowwall-lod0-jg"],[5,"water-anim-waspala-frontthrone-lod0-mg"],[4,"water-anim-waspala-frontthrone-lod0-jg"],[3,"water-anim-waspala-windowwall-lod0-mg"],[2,"water-anim-waspala-windowwall-lod0-jg"],[1,"water-anim-waspala-thronesec-lod0-mg"],[0,"water-anim-waspala-thronesec-lod0-jg"]],"wland-driver-ag":[[4,"wland-driver-pilot-car-up-down-ja"],[3,"wland-driver-pilot-car-turn-back-ja"],[2,"wland-driver-pilot-car-turn-front-ja"],[1,"wland-driver-lod0-mg"],[0,"wland-driver-lod0-jg"]],"wland-passenger-ag":[[25,"wland-passenger-vehicle-get-out-land-ja"],[24,"wland-passenger-vehicle-get-out-jump-ja"],[23,"wland-passenger-vehicle-get-out-ja"],[22,"wland-passenger-pilot-car-up-down-ja"],[21,"wland-passenger-pilot-car-turn-back-ja"],[20,"wland-passenger-pilot-car-turn-front-ja"],[19,"wland-passenger-run-for-cover-ja"],[18,"wland-passenger-idle-cover-ja"],[17,"wland-passenger-idle-wave-to-cover-ja"],[16,"wland-passenger-idle-wave-ja"],[15,"wland-passenger-vehicle-get-in-ja"],[14,"wland-passenger-vehicle-jump-to-ja"],[13,"wland-passenger-vehicle-get-in-spin-ja"],[0,"wland-passenger-lod0-jg"],[1,"wland-passenger-lod0-mg"],[2,"wland-passenger-shadow-mg"],[3,"wland-passenger-idle0-ja"],[4,"wland-passenger-walk0-ja"],[5,"wland-passenger-walk1-ja"],[6,"wland-passenger-run0-ja"],[7,"wland-passenger-getup-back-ja"],[8,"wland-passenger-getup-front-ja"],[9,"wland-passenger-knocked-back-ja"],[10,"wland-passenger-knocked-back-land-ja"],[11,"wland-passenger-knocked-forward-ja"],[12,"wland-passenger-knocked-forward-land-ja"]],"wlander-female-ag":[[27,"wlander-female-shoot-idle-ja"],[26,"wlander-female-ragdoll-ja"],[25,"wlander-female-attack-gunbutt-spin0-ja"],[24,"wlander-female-attack-kick-spin0-ja"],[23,"wlander-female-walk-gun0-ja"],[22,"wlander-female-gun-away0-ja"],[21,"wlander-female-shoot-turn1-end-ja"],[20,"wlander-female-shoot-turn1-ja"],[19,"wlander-female-shoot-turn1-start-ja"],[18,"wlander-female-shoot-turn0-ja"],[17,"wlander-female-getup-forward-ja"],[16,"wlander-female-knocked-forward-land-ja"],[15,"wlander-female-knocked-forward-ja"],[14,"wlander-female-knocked-back-2-gun-out-ja"],[13,"wlander-female-knocked-back-land-ja"],[0,"wlander-female-lod0-jg"],[1,"wlander-female-lod0-mg"],[2,"wlander-female-lod2-mg"],[3,"wlander-female-shadow-mg"],[4,"wlander-female-idle0-ja"],[5,"wlander-female-walk0-ja"],[6,"wlander-female-run0-ja"],[7,"wlander-female-gun-takeout-ja"],[8,"wlander-female-gun-out-ja"],[9,"wlander-female-gun-out-idle-ja"],[10,"wlander-female-run-2-gun-out-ja"],[11,"wlander-female-shoot0-ja"],[12,"wlander-female-knocked-back-ja"]],"wlander-male-ag":[[23,"wlander-male-ragdoll-ja"],[22,"wlander-male-shoot-turn1-end-ja"],[21,"wlander-male-shoot-turn1-ja"],[20,"wlander-male-shoot-turn1-start-ja"],[19,"wlander-male-shoot-turn0-ja"],[18,"wlander-male-knocked-forward-land-ja"],[17,"wlander-male-knocked-forward-ja"],[16,"wlander-male-knocked-back-land-ja"],[15,"wlander-male-knocked-back-ja"],[14,"wlander-male-getup-front-ja"],[13,"wlander-male-getup-back-ja"],[0,"wlander-male-lod0-jg"],[1,"wlander-male-lod0-mg"],[2,"wlander-male-lod2-mg"],[3,"wlander-male-shadow-mg"],[4,"wlander-male-idle0-ja"],[5,"wlander-male-walk0-ja"],[6,"wlander-male-walk1-ja"],[7,"wlander-male-run0-ja"],[8,"wlander-male-idle-to-shoot-ja"],[9,"wlander-male-shoot-idle-ja"],[10,"wlander-male-shoot0-ja"],[11,"wlander-male-shoot-to-idle-ja"],[12,"wlander-male-attack-rifle-butt-ja"]],"wstd-arena-plat-ag":[[2,"wstd-arena-plat-idle-ja"],[1,"wstd-arena-plat-lod0-mg"],[0,"wstd-arena-plat-lod0-jg"]],"wstd-blocker-ag":[[2,"wstd-blocker-idle-ja"],[1,"wstd-blocker-lod0-mg"],[0,"wstd-blocker-lod0-jg"]],"wstd-door-ag":[[2,"wstd-door-idle-ja"],[1,"wstd-door-lod0-mg"],[0,"wstd-door-lod0-jg"]],"wstd-fight-house-a-ag":[[3,"wstd-fight-house-a-open-ja"],[2,"wstd-fight-house-a-idle-ja"],[1,"wstd-fight-house-a-lod0-mg"],[0,"wstd-fight-house-a-lod0-jg"]],"wstd-fight-house-b-ag":[[3,"wstd-fight-house-b-open-ja"],[2,"wstd-fight-house-b-idle-ja"],[1,"wstd-fight-house-b-lod0-mg"],[0,"wstd-fight-house-b-lod0-jg"]],"wstd-fight-plat-ag":[[2,"wstd-fight-plat-idle-ja"],[1,"wstd-fight-plat-lod0-mg"],[0,"wstd-fight-plat-lod0-jg"]],"wstd-fight-plat-box-ag":[[2,"wstd-fight-plat-box-idle-ja"],[1,"wstd-fight-plat-box-lod0-mg"],[0,"wstd-fight-plat-box-lod0-jg"]],"wstd-fight-plat-large-ag":[[2,"wstd-fight-plat-large-idle-ja"],[1,"wstd-fight-plat-large-lod0-mg"],[0,"wstd-fight-plat-large-lod0-jg"]],"wstd-fight-plat-smlplat-ag":[[2,"wstd-fight-plat-smlplat-idle-ja"],[1,"wstd-fight-plat-smlplat-lod0-mg"],[0,"wstd-fight-plat-smlplat-lod0-jg"]],"wstd-flag-a-ag":[[2,"wstd-flag-a-idle-ja"],[1,"wstd-flag-a-lod0-mg"],[0,"wstd-flag-a-lod0-jg"]],"wstd-flag-ag":[[2,"wstd-flag-idle-ja"],[1,"wstd-flag-lod0-mg"],[0,"wstd-flag-lod0-jg"]],"wstd-gate-pass-ag":[[2,"wstd-gate-pass-idle-ja"],[1,"wstd-gate-pass-lod0-mg"],[0,"wstd-gate-pass-lod0-jg"]],"wstd-square-plat-a-ag":[[2,"wstd-square-plat-a-idle-ja"],[1,"wstd-square-plat-a-lod0-mg"],[0,"wstd-square-plat-a-lod0-jg"]],"wstd-square-plat-b-ag":[[2,"wstd-square-plat-b-idle-ja"],[1,"wstd-square-plat-b-lod0-mg"],[0,"wstd-square-plat-b-lod0-jg"]],"wstd-square-plat-c-ag":[[2,"wstd-square-plat-c-idle-ja"],[1,"wstd-square-plat-c-lod0-mg"],[0,"wstd-square-plat-c-lod0-jg"]],"wstd-training-dummy-ag":[[5,"wstd-training-dummy-explode-idle-ja"],[4,"wstd-training-dummy-explode-lod0-mg"],[3,"wstd-training-dummy-explode-lod0-jg"],[2,"wstd-training-dummy-idle-ja"],[1,"wstd-training-dummy-lod0-mg"],[0,"wstd-training-dummy-lod0-jg"]],"wstd-trapdoor-ag":[[5,"wstd-trapdoor-explode-idle-ja"],[4,"wstd-trapdoor-explode-lod0-mg"],[3,"wstd-trapdoor-explode-lod0-jg"],[2,"wstd-trapdoor-idle-ja"],[1,"wstd-trapdoor-lod0-mg"],[0,"wstd-trapdoor-lod0-jg"]],"yakow-ag":[[10,"yakow-kicked-in-place-ja"],[9,"yakow-walk-left-ja"],[8,"yakow-walk-right-ja"],[7,"yakow-kicked-ja"],[6,"yakow-run-ja"],[5,"yakow-walk-ja"],[4,"yakow-graze-ja"],[3,"yakow-idle-ja"],[2,"yakow-shadow-mg"],[1,"yakow-lod0-mg"],[0,"yakow-lod0-jg"]],"yellow-barrel-ag":[[2,"yellow-barrel-idle-ja"],[1,"yellow-barrel-lod0-mg"],[0,"yellow-barrel-lod0-jg"]],"yellowsage-ag":[[2,"yellowsage-yellowsage-idle-ja"],[1,"yellowsage-lod0-mg"],[0,"yellowsage-lod0-jg"]],"youngsamos-highres-ag":[[2,"youngsamos-highres-youngsamos-idle-ja"],[1,"youngsamos-highres-lod0-mg"],[0,"youngsamos-highres-lod0-jg"]]} diff --git a/decompiler/config/jak3/ntsc_v1/art_info.jsonc b/decompiler/config/jak3/ntsc_v1/art_info.jsonc index 6b782180767..99d1d1fc408 100644 --- a/decompiler/config/jak3/ntsc_v1/art_info.jsonc +++ b/decompiler/config/jak3/ntsc_v1/art_info.jsonc @@ -1,6 +1,29 @@ { - "files": {}, - "functions": {}, - "type_remap": {}, - "joint_node_hacks": {} + ////////////////////// + // ART INFO + ////////////////////// + + // defines what art group each file or function is using. + // by default, the decompiler assumes this to be the name of the current type + -ag + // so you only need to specify it when that's not the case. + + // remap names for states and behaviors of these types + "type_remap": { + "target": "jakb-ag", + "sidekick": "daxter-ag", + "wings": "jakb-ag", + "lightjak-shield": "jakb-ag", + "freeze-screen": "collectables-ag" + }, + + // remap names for types in an entire file (higher priority) + "file_override": { + "target-indax": { "target": "daxter-ag" } // in target-indax.gc, the remap for 'target' will be set to 'daxter-ag' + }, + + // some art groups (like robotboss-ag) have a name for their model that differs + // from the usual ag-name + "-lod0". you can add those exceptions here. + "joint_node_hacks": { + // "robotboss-ag": "robotboss-basic" + } } diff --git a/decompiler/config/jak3/ntsc_v1/hacks.jsonc b/decompiler/config/jak3/ntsc_v1/hacks.jsonc index f301d6660b4..7eab5fdb11d 100644 --- a/decompiler/config/jak3/ntsc_v1/hacks.jsonc +++ b/decompiler/config/jak3/ntsc_v1/hacks.jsonc @@ -109,7 +109,6 @@ // jak 3 "command-get-process", - "(method 16 ragdoll-edit-info)", "(anon-function 4 gun-states)", "(method 10 manipulator)", "(method 46 ff-squad-control)", @@ -119,7 +118,8 @@ "(method 33 task-manager-nest-cocoons)", "(method 33 rub-tower)", "(method 261 crimson-guard)", - "(anon-function 25 volcanox-obs)" + "(anon-function 25 volcanox-obs)", + "find-nearest-entity" ], // these functions use pairs and the decompiler @@ -264,7 +264,16 @@ "find-offending-process-focusable": [16, 19], "(method 19 process-drawable)": [0, 2, 3, 7, 10, 11, 30], "(anon-function 11 game-save)": [0, 3, 4, 5], - "(anon-function 3 game-save)": [15, 16] + "(anon-function 3 game-save)": [15, 16], + "(anon-function 12 lightjak-wings)": [2, 3], + "target-standard-event-handler": [ + 5, 6, 7, 20, 64, 65, 66, 67, 72, 73, 83, 84, 85, 86, 87, 88, 96, 97, 109, + 264, 265, 282, 283, 284, 290, 291, 306, 336, 350, 351, 412, 415, 427 + ], + "(method 9 curve-color-fast)": [0, 1], + "evaluate-color-curve-fast": [0, 1], + "(anon-function 0 target-death)": [71, 131, 132, 137], + "target-board-handler": [15, 16, 20] }, // Sometimes the game might use format strings that are fetched dynamically, diff --git a/decompiler/config/jak3/ntsc_v1/label_types.jsonc b/decompiler/config/jak3/ntsc_v1/label_types.jsonc index b33d1f29bc2..c6470d0b17f 100644 --- a/decompiler/config/jak3/ntsc_v1/label_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/label_types.jsonc @@ -50,7 +50,9 @@ ["L443", "cloth-params"], ["L427", "cloth-params"], ["L426", "cloth-params"], - ["L425", "cloth-params"] + ["L425", "cloth-params"], + ["L394", "vector"], + ["L387", "vector"] ], "scene-actor": [ ["L370", "cloth-params"], @@ -93,5 +95,185 @@ ["L462", "vector"] ], "settings": [["L534", "vector"]], - "main": [["L485", "(pointer time-frame)", 2]] + "main": [["L485", "(pointer time-frame)", 2]], + "generic-obs": [ + ["L1030", "uint64", true], + ["L1028", "uint64", true], + ["L1032", "uint64", true], + ["L722", "sphere"], + ["L1034", "uint64", true], + ["L1031", "uint64", true], + ["L1029", "uint64", true], + ["L1033", "uint64", true], + ["L1035", "uint64", true], + ["L791", "uint64", true], + ["L790", "uint64", true], + ["L721", "attack-info"], + ["L725", "attack-info"], + ["L792", "uint64", true], + ["L793", "uint64", true] + ], + "logic-target": [ + ["L417", "rgba", true], + ["L416", "rgba", true], + ["L415", "rgba", true], + ["L414", "rgba", true], + ["L413", "rgba", true], + ["L412", "rgba", true], + ["L411", "rgba", true], + ["L410", "(pointer time-frame)", 1], + ["L405", "attack-info"] + ], + "sidekick": [["L84", "vector"]], + "voicebox": [ + ["L144", "vector"], + ["L143", "vector"], + ["L142", "vector"], + ["L141", "vector"] + ], + "target-handler": [ + ["L516", "uint64", true], + ["L507", "attack-info"], + ["L525", "uint64", true], + ["L520", "uint64", true], + ["L524", "uint64", true], + ["L523", "uint64", true], + ["L528", "uint64", true], + ["L513", "uint64", true], + ["L514", "uint64", true], + ["L526", "uint64", true], + ["L522", "uint64", true], + ["L518", "uint64", true], + ["L527", "uint64", true], + ["L521", "uint64", true], + ["L519", "uint64", true], + ["L512", "uint64", true], + ["L517", "uint64", true], + ["L515", "uint64", true], + ["L508", "attack-info"], + ["L511", "attack-info"] + ], + "target-anim": [["L503", "uint64", true]], + "target": [ + ["L902", "uint64", true], + ["L903", "uint64", true], + ["L909", "uint64", true], + ["L904", "uint64", true], + ["L908", "uint64", true], + ["L907", "uint64", true], + ["L906", "uint64", true], + ["L905", "uint64", true] + ], + "target2": [ + ["L488", "uint64", true], + ["L487", "uint64", true] + ], + "target-swim": [["L230", "attack-info"]], + "target-lightjak": [ + ["L689", "uint64", true], + ["L688", "uint64", true], + ["L687", "uint64", true], + ["L657", "uint64", true], + ["L660", "uint64", true], + ["L659", "uint64", true], + ["L564", "vector"], + ["L563", "vector"], + ["L653", "uint64", true], + ["L656", "uint64", true], + ["L655", "uint64", true], + ["L661", "uint64", true], + ["L662", "uint64", true], + ["L654", "uint64", true], + ["L658", "uint64", true], + ["L663", "uint64", true] + ], + "target-death": [ + ["L763", "uint64", true], + ["L742", "vector"], + ["L749", "uint64", true], + ["L744", "uint64", true], + ["L750", "uint64", true], + ["L751", "uint64", true], + ["L748", "uint64", true], + ["L753", "uint64", true], + ["L745", "uint64", true], + ["L749", "uint64", true], + ["L748", "uint64", true], + ["L754", "uint64", true], + ["L747", "uint64", true], + ["L746", "uint64", true], + ["L752", "uint64", true] + ], + "target-gun": [ + ["L776", "uint64", true], + ["L778", "uint64", true], + ["L780", "rgba", true], + ["L774", "rgba", true], + ["L779", "uint64", true], + ["L772", "uint64", true], + ["L773", "uint64", true], + ["L777", "uint64", true], + ["L775", "uint64", true], + ["L771", "uint64", true] + ], + "target-board": [ + ["L598", "uint64", true], + ["L605", "uint64", true], + ["L595", "rgba", true], + ["L597", "rgba", true], + ["L581", "(pointer time-frame)", 2], + ["L582", "attack-info"], + ["L603", "uint64", true], + ["L604", "uint64", true], + ["L596", "uint64", true], + ["L602", "uint64", true], + ["L601", "uint64", true], + ["L600", "uint64", true], + ["L599", "uint64", true] + ], + "board-states": [ + ["L787", "uint64", true], + ["L786", "uint64", true], + ["L785", "uint64", true], + ["L784", "uint64", true], + ["L783", "uint64", true], + ["L782", "uint64", true], + ["L788", "uint64", true], + ["L776", "uint64", true], + ["L775", "uint64", true], + ["L773", "uint64", true], + ["L777", "uint64", true], + ["L791", "uint64", true], + ["L781", "uint64", true], + ["L780", "uint64", true], + ["L779", "uint64", true], + ["L774", "uint64", true], + ["L778", "uint64", true], + ["L789", "uint64", true], + ["L790", "uint64", true], + ["L772", "uint64", true] + ], + "crates": [ + ["L250", "attack-info"], + ["L249", "attack-info"], + ["L242", "attack-info"] + ], + "collectables": [ + ["L891", "uint64", true], + ["L892", "uint64", true], + ["L890", "uint64", true], + ["L889", "uint64", true], + ["L888", "uint64", true], + ["L677", "uint64", true], + ["L687", "uint64", true], + ["L682", "uint64", true], + ["L679", "uint64", true], + ["L684", "uint64", true], + ["L686", "uint64", true], + ["L681", "uint64", true], + ["L680", "uint64", true], + ["L683", "uint64", true], + ["L685", "uint64", true], + ["L678", "uint64", true] + ] } diff --git a/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc b/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc new file mode 100644 index 00000000000..a54c3909b17 --- /dev/null +++ b/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc @@ -0,0 +1,4 @@ +// This overrides the stack size for calls to stack-size-set! in given functions. +{ + "(method 29 target)": 2048 +} diff --git a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc index b74917709de..7b1a1c5d414 100644 --- a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc +++ b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc @@ -99,5 +99,156 @@ "(method 13 gui-control)": [[16, ["array", "sound-id", 4]]], "(method 29 game-info)": [[16, ["array", "int8", 4]]], "(method 9 joint-control)": [[16, "vector"]], - "(method 23 game-info)": [[16, ["array", "uint16", 512]]] + "(method 23 game-info)": [[16, ["array", "uint16", 512]]], + "(method 18 drawable-region-face)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 11 sound-controller)": [[16, "sync-info-params"]], + "(code explode explosion)": [[16, "overlaps-others-params"]], + "(event explode explosion)": [ + [16, "mystery-cquery-type0"], + [608, ["inline-array", "vector", 2]] + ], + "find-closest-solid-sphere-prim": [[16, "vector"]], + "explosion-init-by-other": [[16, "traffic-danger-info"]], + "(enter cam-launcher-longfall)": [[16, "vector"]], + "want-to-board?": [ + [16, "collide-query"], + [560, ["inline-array", "sphere", 3]], + [608, "vector"] + ], + "(method 16 target)": [[16, "vector"]], + "can-exit-duck?": [[560, ["inline-array", "sphere", 2]]], + "target-no-stick-post": [[32, "collide-query"]], + "target-compute-edge-rider": [[96, "bone"]], + "target-compute-edge": [[96, "bone"]], + "bend-gravity": [[32, "vector"]], + "target-update-ik": [ + [16, "collide-query"], + [624, "vector"], + [592, "vector"], + [640, "vector"], + [656, "vector"] + ], + "target-collision-reaction": [ + [16, "vector"], + [32, "vector"], + [48, "matrix"] + ], + "poly-find-nearest-edge": [[16, "vector"]], + "(method 23 task-arrow)": [[16, "cquery-with-vec"]], + "projectile-update-velocity-space-wars": [[64, "vector"]], + "projectile-move-fill-line-sphere": [[16, "collide-query"]], + "(method 38 projectile)": [[16, "collide-query"]], + "(method 10 ragdoll)": [[16, "vector"]], + "(method 19 wings-ragdoll)": [[16, "vector"]], + "find-water-with-spheres": [[16, "water-info"]], + "(method 18 ragdoll)": [ + [16, "collide-query"], + [560, "bounding-box"], + [624, ["inline-array", "water-sphere", 2]] + ], + "(method 17 ragdoll-edit-info)": [ + [224, "vector"], + [384, "matrix"], + [448, "vector"], + [608, "matrix"], + [672, "vector"] + ], + "(method 16 ragdoll-edit-info)": [ + [16, ["inline-array", "matrix", 60]], + [3984, "vector"], + [4016, "matrix"], + [4080, "matrix"], + [4144, "matrix"] + ], + "target-send-attack": [[112, "vector"]], + "target-stance-anim": [[64, ["array", "time-frame", 4]]], + "init-var-jump": [[96, "vector"]], + "(code target-running-attack)": [[112, "collide-query"]], + "(anon-function 12 target2)": [[16, "vector"]], + "lightning-start": [ + [16, "vector"], + [32, "vector"] + ], + "(method 9 curve-color-fast)": [[16, "rgbaf"]], + "(method 9 curve2d-fast)": [ + [16, "vector"], + [32, "vector"] + ], + "evaluate-color-curve-fast": [[16, "vector"]], + "evaluate-curve-fast": [ + [16, "vector"], + [32, "vector"] + ], + "lightning-trail-fractal-gen": [ + [16, "vector"], + [32, "vector"], + [48, "vector"], + [64, "vector"] + ], + "(post open lightjak-shield)": [[32, "vector"]], + "(method 24 freeze-screen)": [[32, "vector"]], + "(post target-launch-dir)": [[16, "collide-query"]], + "arrive-at-continue": [[16, "event-message-block"]], + "(code target-hit)": [[16, "vector"]], + "apply-pos-from-entity": [[208, "collide-query"]], + "target-death-main": [ + [16, "event-message-block"], + [96, ["array", "level", 1]] + ], + "find-nearest-focusable": [[48, "vector"]], + "target-gun-joint-pre0": [ + [640, ["inline-array", "sphere", 1]], + [656, "vector"] + ], + "target-gun-can-fire-yellow?": [[16, ["array", "symbol", 2]]], + "draw-beam": [[16, ["inline-array", "vector", 2]]], + "(code die gun)": [[144, "vector"]], + "light-trail-tracker-init-by-other": [[16, "vector"]], + "(method 11 light-trail)": [[16, "light-trail-breadcrumb"]], + "(method 12 light-trail)": [ + [16, ["array", "int32", 4]], + [160, "vector"], + [176, "vector"], + [32, "rgbaf"], + [48, "vector"], + [112, "vector"], + [208, ["inline-array", "vector", 5]], + [288, "rgbaf"] + ], + "target-board-ride-post": [[64, "vector"]], + "target-board-compute-edge": [ + [32, "vector"], + [128, "vector"] + ], + "board-turn-around?": [[48, "vector"]], + "target-board-green-eco-attack": [ + [16, "bounding-box"], + [32, ["array", "collide-shape", 384]] + ], + "(enter target-board-jump)": [[48, "vector"]], + "(code target-board-flip)": [[16, "vector"]], + "(code target-board-trickx)": [[16, "vector"]], + "(code target-board-tricky)": [[16, "vector"]], + "(code target-board-hold)": [[16, "vector"]], + "target-board-spin-check": [ + [16, "vector"], + [32, "vector"], + [48, "vector"] + ], + "target-board-ground-check": [[32, "vector"]], + "(method 9 plane-volume)": [ + [64, "vector"], + [112, "vector"], + [16, "vector"], + [32, "vector"], + [48, "vector"], + [80, "vector"], + [128, "vector"] + ], + "add-a-bunch": [[16, "vector"]], + "birth-pickup-at-point": [[16, "vector"]], + "(code pickup eco)": [[16, "event-message-block"]] } diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index 043f8473f45..5a1babc0ec6 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -1012,5 +1012,1045 @@ [1136, "a0", "process-focusable"], [1139, "a0", "process-focusable"] ], - "(method 18 setting-control)": [[522, "v1", "task-mask"]] + "(method 18 setting-control)": [[522, "v1", "task-mask"]], + "(exit active talker)": [[38, "v1", "process-drawable"]], + "talker-spawn-func": [ + [76, "a0", "talker"], + [79, "v1", "talker"], + [82, "v1", "talker"] + ], + "(method 11 speech-channel)": [ + [70, "v1", "process-drawable"], + [250, "s4", "process-drawable"], + [264, "s4", "process-drawable"], + [267, "s4", "process-drawable"], + [232, "v0", "sound-rpc-set-param"] + ], + "(method 17 speech-control)": [[5, "v1", "speech-type-info"]], + "(method 18 drawable-region-face)": [ + [58, "v1", "(inline-array vector)"], + [60, "v1", "(inline-array vector)"], + [62, "v1", "(inline-array vector)"], + [70, "v1", "(inline-array vector)"], + [72, "v1", "(inline-array vector)"], + [74, "v1", "(inline-array vector)"], + [83, "v1", "(inline-array vector)"], + ["_stack_", 56, "(inline-array vector)"] + ], + "region-tree-execute": [ + [114, "v1", "region-prim-area"], + [107, "v1", "region-prim-area"], + [97, "v1", "region-prim-area"], + [159, "v1", "region-prim-area"], + [204, "v1", "region-prim-area"], + [210, "v1", "region-prim-area"], + [221, "v1", "region-prim-area"], + [165, "v1", "region-prim-area"], + [169, "v1", "region-prim-area"], + [175, "a0", "region-prim-area"], + [191, "v1", "region-prim-area"], + [120, "v1", "region-prim-area"], + [124, "v1", "region-prim-area"], + [146, "v1", "region-prim-area"], + [129, "a1", "region-prim-area"], + [103, "v1", "region-prim-area"], + [[19, 29], "v1", "region-prim-area"] + ], + "(method 16 drawable-inline-array-region-prim)": [ + [1, "v1", "drawable-region-prim"] + ], + "clone-anim-once": [ + [22, "gp", "process-drawable"], + [31, "gp", "process-drawable"], + [50, "gp", "process-drawable"], + [48, "a0", "collide-shape"], + [57, "gp", "process-drawable"], + [64, "gp", "process-drawable"], + [68, "gp", "process-drawable"], + [107, "v1", "manipy"], + [52, "a0", "collide-shape"] + ], + "birth-func-simple-prim": [ + [28, "a0", "simple-prim-particle-binding"], + [25, "t0", "texture-id"], + [33, "a0", "simple-prim-particle-binding"] + ], + "(method 11 sound-controller)": [[18, "v0", "string"]], + "process-drawable-random-point!": [ + [29, "s4", "collide-shape"], + [33, "s4", "collide-shape"] + ], + "(code explode explosion)": [ + [6, "a0", "collide-shape"], + [17, "a0", "collide-shape"], + [22, "v1", "collide-shape"], + [19, "a0", "collide-shape"], + [8, "a0", "collide-shape"] + ], + "(event explode explosion)": [ + [8, "a0", "collide-shape"], + [35, "s3", "process-drawable"], + [63, "s2", "process-focusable"], + [55, "a0", "process-focusable"], + [63, "s3", "process-focusable"], + [78, "s3", "process-focusable"], + [58, "a0", "process-focusable"] + ], + "find-closest-solid-sphere-prim": [[12, "v1", "collide-shape-prim-group"]], + "explosion-init-by-other": [ + [82, "v1", "collide-shape"], + [56, "a0", "collide-shape"] + ], + "(code active touch-tracker)": [ + [65, "v1", "collide-shape"], + [22, "a0", "process-drawable"], + [31, "v1", "collide-shape"], + [32, "a0", "collide-shape"], + [43, "a0", "collide-shape"], + [55, "a0", "collide-shape"], + [26, "a0", "collide-shape"], + [45, "a0", "collide-shape"], + [57, "a0", "collide-shape"] + ], + "(event active touch-tracker)": [ + [71, "a0", "process"], + [98, "t9", "(function touch-tracker object)"] + ], + "launcher-init-by-other": [ + [85, "a0", "collide-shape"], + [136, "v0", "vector"], + [87, "a0", "collide-shape"] + ], + "(method 11 launcher)": [ + [55, "a0", "collide-shape"], + [128, "v0", "vector"], + [57, "a0", "collide-shape"] + ], + "(trans active launcher)": [[75, "v1", "collide-shape"]], + "(exit active launcher)": [[2, "v0", "sound-rpc-set-param"]], + "(event active launcher)": [ + [45, "a0", "collide-shape"], + [48, "a0", "collide-shape"], + [48, "a1", "vector"], + [51, "a0", "collide-shape"], + [53, "a0", "collide-shape"] + ], + "(event idle launcher)": [ + [12, "a0", "collide-shape"], + [18, "a0", "collide-shape"], + [20, "a0", "collide-shape"], + [15, "a0", "collide-shape"] + ], + "camera-pov-from": [ + [9, "gp", "process-drawable"], + [12, "gp", "process-drawable"], + [19, "v0", "joint"] + ], + "ja-anim-done?": [[30, "gp", "process-drawable"]], + "process-release?": [[13, "a0", "process-focusable"]], + "(exit active lightning-tracker)": [[4, "v0", "sound-rpc-set-param"]], + "(code active lightning-tracker)": [[67, "s4", "process-drawable"]], + "(method 16 lightning-tracker)": [ + [109, "s5", "process-focusable"], + [53, "a0", "process-drawable"], + [66, "a0", "process-focusable"], + [82, "a0", "process-focusable"], + [69, "a0", "process-focusable"] + ], + "manipy-init": [ + [207, "v0", "joint"], + [232, "v0", "joint"] + ], + "(code idle manipy)": [ + [61, "a1", "process-drawable"], + [82, "gp", "process-drawable"], + [88, "gp", "process-drawable"], + [131, "a0", "process-drawable"], + [193, "a0", "process-drawable"], + [164, "a0", "process"], + [[159, 190], "gp", "handle"] + ], + "(trans idle manipy)": [[62, "v1", "process-drawable"]], + "(event idle manipy)": [ + [45, "v0", "joint"], + [227, "v1", "process-drawable"], + [354, "v1", "vector"], + [362, "v1", "vector"], + [396, "t9", "(function manipy none)"], + [479, "a0", "process"], + [502, "v1", "process-drawable"], + [511, "a0", "process-drawable"], + [539, "v1", "vector"], + [547, "v1", "vector"], + [202, "v1", "float"], + [402, "v1", "float"], + [431, "v1", "float"], + [466, "v1", "float"], + [698, "a0", "float"], + [128, "v1", "float"], + [131, "v1", "float"], + [134, "v1", "float"], + [145, "v1", "float"], + [160, "v1", "float"], + [163, "v1", "float"], + [166, "v1", "float"], + [169, "v1", "float"], + [184, "v1", "float"], + [187, "v1", "float"], + [190, "v1", "float"], + [193, "v1", "float"] + ], + "swingpole-init": [[56, "a0", "process-drawable"]], + "(code idle swingpole)": [ + [6, "a0", "collide-shape"], + [8, "a0", "collide-shape"] + ], + "(code active swingpole)": [[34, "a0", "process-focusable"]], + "(method 22 swingpole)": [ + [37, "a0", "collide-shape"], + [53, "v1", "process-drawable"], + [66, "a0", "collide-shape"], + [69, "a0", "collide-shape"], + [40, "a0", "collide-shape"] + ], + "entity-lookup-part-group": [ + [29, "s3", "string"], + ["_stack_", 16, "res-tag"], + [39, "gp", "int"] + ], + "(event active part-spawner)": [[25, "v1", "vector"]], + "(method 11 part-spawner)": [ + [148, "v0", "(pointer degrees)"], + [238, "a2", "vector"] + ], + "(method 11 part-controller)": [["_stack_", 16, "res-tag"]], + "(trans linger part-tracker)": [ + [37, "v1", "process-drawable"], + [41, "v1", "process-drawable"], + [50, "v1", "process-drawable"] + ], + "(trans active part-tracker)": [ + [41, "v1", "process-drawable"], + [45, "v1", "process-drawable"], + [54, "v1", "process-drawable"] + ], + "local-space-proc-joint": [[12, "a2", "process-drawable"]], + "part-tracker-init": [ + [65, "s4", "particle-local-space-info"], + [68, "s4", "particle-local-space-info"], + [63, "s4", "particle-local-space-info"], + [78, "s4", "particle-local-space-info"] + ], + "(trans active part-tracker-subsampler)": [ + [41, "v1", "process-drawable"], + [45, "v1", "process-drawable"], + [51, "v1", "process-drawable"] + ], + "(event active part-tracker)": [ + [9, "v1", "process"], + [13, "a0", "process"], + [16, "v1", "process"], + [31, "v1", "vector"] + ], + "(method 0 carry-info)": [[42, "s5", "collide-shape"]], + "(method 11 carry-info)": [ + [211, "a0", "process-drawable"], + [212, "v1", "collide-shape"], + [218, "a2", "process-drawable"], + [225, "a1", "process-drawable"], + [231, "a0", "process-drawable"], + [232, "v1", "collide-shape"], + [219, "a1", "collide-shape"], + [226, "a0", "collide-shape"] + ], + "(method 12 carry-info)": [ + [46, "a0", "process-drawable"], + [47, "v1", "collide-shape"], + [52, "a1", "process-focusable"], + [59, "a1", "process-focusable"] + ], + "(method 13 carry-info)": [[22, "v0", "carry-info"]], + "(method 14 carry-info)": [ + [151, "a0", "process-focusable"], + [158, "a2", "process-focusable"], + [165, "a1", "process-focusable"], + [171, "a0", "process-focusable"] + ], + "(method 16 carry-info)": [[22, "v0", "carry-info"]], + "target-log-attack": [[47, "a3", "attack-info"]], + "(method 11 attack-info)": [ + [114, "s2", "process-drawable"], + [152, "s3", "process-drawable"] + ], + "(anon-function 3 target-util)": [ + [7, "a0", "process-drawable"], + [16, "v1", "process-drawable"] + ], + "external-target-spawn": [[240, "v1", "process-drawable"]], + "target-compute-pole": [ + [12, "s2", "swingpole"], + [11, "s2", "swingpole"], + [19, "s2", "swingpole"], + [27, "s2", "swingpole"], + [32, "s2", "swingpole"], + [88, "s2", "swingpole"], + [111, "s2", "swingpole"] + ], + "target-compute-edge-rider": [[48, "a0", "process-drawable"]], + "target-compute-edge": [[48, "a0", "process-drawable"]], + "history-draw": [ + [16, "a1", "int"], + [151, "a0", "uint"] + ], + "history-print": [[20, "a1", "int"]], + "target-collision-reaction": [ + [400, "a0", "process-focusable"], + [579, "a0", "process-focusable"], + [585, "a0", "process-focusable"], + [633, "a0", "process-focusable"], + ["_stack_", 96, "collide-status"], + ["_stack_", 104, "cshape-reaction-flags"] + ], + "(post sidekick-clone)": [ + [4, "a0", "target"], + [11, "a0", "target"], + [193, "a1", "target"], + [202, "a1", "target"], + [930, "v1", "process-drawable"] + ], + "(anon-function 6 sidekick)": [ + [15, "gp", "target"], + [22, "gp", "target"], + [41, "gp", "target"], + [48, "gp", "target"], + [94, "gp", "target"] + ], + "(code enter remote)": [[16, "a0", "process-focusable"]], + "(trans enter remote)": [ + [25, "a0", "process-focusable"], + [28, "a0", "process-focusable"] + ], + "remote-track": [[94, "gp", "process-focusable"]], + "(method 24 remote)": [ + [17, "a0", "process-focusable"], + [20, "a0", "process-focusable"], + [26, "s4", "process-focusable"], + [29, "s4", "process-focusable"], + [16, "s4", "process-focusable"] + ], + "(method 25 remote)": [[[8, 12], "a0", "collide-shape"]], + "(code idle judge)": [[39, "v0", "float"]], + "(event idle task-arrow)": [ + [6, "a0", "vector"], + [52, "v1", "float"], + [59, "v1", "float"] + ], + "projectile-update-velocity-space-wars": [ + [59, "a0", "process-drawable"], + [60, "a0", "collide-shape"] + ], + "(method 35 projectile)": [[5, "a1", "process"]], + "(event idle ragdoll-proc)": [ + [14, "gp", "attack-info"], + [18, "gp", "attack-info"], + [112, "gp", "attack-info"], + [115, "gp", "attack-info"], + [27, "a0", "process-drawable"], + [32, "s2", "process-drawable"], + [34, "a0", "process-drawable"], + [44, "s2", "process-drawable"], + [54, "s2", "process-drawable"], + [61, "s2", "process-drawable"], + [50, "a3", "touching-prims-entry"], + [68, "gp", "attack-info"], + [72, "gp", "attack-info"] + ], + "(trans hidden wings)": [[4, "a0", "process-focusable"]], + "wings-post": [ + [4, "v1", "process-focusable"], + [62, "v1", "process-drawable"], + [68, "v1", "process-drawable"], + [74, "v1", "process-drawable"], + [90, "v1", "process-focusable"] + ], + "(exit idle wings)": [ + [12, "a0", "ragdoll-proc"], + [15, "a0", "ragdoll-proc"] + ], + "wings-init": [[37, "v1", "process-drawable"]], + "(trans idle wings)": [ + [4, "a0", "process-focusable"], + [88, "v1", "ragdoll-proc"], + [21, "v1", "process-drawable"], + [24, "v1", "process-drawable"], + [29, "v1", "process-drawable"], + [35, "v1", "process-drawable"], + [41, "v1", "process-drawable"], + [47, "v1", "process-drawable"], + [53, "v1", "process-drawable"], + [59, "v1", "process-drawable"], + [65, "v1", "process-drawable"] + ], + "(code idle wings)": [ + [184, "a0", "process-drawable"], + [186, "a0", "ragdoll-proc"], + [189, "a0", "ragdoll-proc"], + [191, "a0", "ragdoll-proc"], + [212, "v1", "art-joint-anim"], + [117, "v1", "art-joint-anim"], + [196, "a0", "ragdoll-proc"] + ], + "(code close wings)": [[29, "v1", "art-joint-anim"]], + "(code use wings)": [[14, "v1", "art-joint-anim"]], + "(trans use wings)": [ + [8, "a1", "process-focusable"], + [[17, 62], "v1", "process-focusable"] + ], + "(method 16 ragdoll-edit-info)": [ + ["_stack_", 4368, "matrix"], + [[8, 12], "a0", "matrix"], + [47, "a0", "pointer"], + [47, "a1", "pointer"], + [[52, 56], "a3", "matrix"], + [[216, 220], "a3", "matrix"], + [[249, 253], "a3", "matrix"], + [364, "a0", "matrix"], + [380, "a0", "matrix"] + ], + "target-generic-event-handler": [ + [571, "a0", "vector"], + [1022, "v1", "(state object object object object target)"], + [1077, "a0", "process"], + [12, "v1", "float"], + [561, "v1", "float"] + ], + "target-send-attack": [ + [36, "s2", "process-focusable"], + ["_stack_", 96, "symbol"], + [168, "s4", "process"], + [167, "v1", "process"] + ], + "target-standard-event-handler": [ + [44, "v1", "(pointer process)"], + [92, "a0", "vector"], + [111, "a0", "vector"], + [130, "a0", "vector"], + [257, "v1", "(pointer process)"], + [295, "a0", "process"], + [297, "v1", "(pointer process)"], + [313, "a0", "process"], + [315, "v1", "(pointer process)"], + [348, "a0", "process"], + [350, "v1", "(pointer process)"], + [434, "s5", "process"], + [436, "v1", "(pointer process)"], + [453, "a0", "process"], + [455, "v1", "(pointer process)"], + [476, "a0", "process"], + [478, "v1", "(pointer process)"], + [534, "a0", "process"], + [536, "v1", "(pointer process)"], + [556, "a0", "process"], + [558, "v1", "(pointer process)"], + [715, "v1", "(pointer process)"], + [973, "a0", "process"], + [975, "v1", "(pointer process)"], + [1031, "v1", "(pointer process)"], + [1069, "v1", "(pointer process)"], + [67, "a0", "vector"], + [136, "v1", "float"] + ], + "(anon-function 10 target-handler)": [ + [32, "a0", "process-focusable"], + [40, "a0", "process"], + [47, "a0", "process"], + [61, "a0", "process-focusable"] + ], + "target-attacked": [ + [259, "a0", "vector"], + [313, "a0", "vector"] + ], + "target-edge-grab-anim": [ + [54, "v1", "art-joint-anim"], + [111, "v1", "art-joint-anim"] + ], + "target-attack-air-anim": [ + [83, "v1", "art-joint-anim"], + [251, "v1", "art-joint-anim"] + ], + "target-hit-ground-anim": [ + [108, "v1", "art-joint-anim"], + [189, "v1", "art-joint-anim"], + [306, "a1", "art-joint-anim"], + [458, "v1", "art-joint-anim"], + [510, "v1", "art-joint-anim"], + [663, "v1", "art-joint-anim"], + [723, "v1", "art-joint-anim"], + [895, "v1", "art-joint-anim"], + [1056, "v1", "art-joint-anim"], + [1155, "v1", "art-joint-anim"] + ], + "(anon-function 4 target-anim)": [ + [104, "v1", "art-joint-anim"], + [171, "v1", "art-joint-anim"], + [238, "v1", "art-joint-anim"], + [295, "v1", "art-joint-anim"] + ], + "(anon-function 3 target-anim)": [ + [105, "v1", "art-joint-anim"], + [165, "v1", "art-joint-anim"], + [239, "v1", "art-joint-anim"], + [297, "v1", "art-joint-anim"] + ], + "target-hit-ground-flop-anim": [[39, "v1", "art-joint-anim"]], + "(anon-function 8 target-anim)": [ + [84, "v1", "art-joint-anim"], + [179, "v1", "art-joint-anim"] + ], + "target-falling-anim": [[61, "v1", "art-joint-anim"]], + "target-stance-push": [ + [73, "v1", "art-joint-anim"], + [125, "v1", "art-joint-anim"] + ], + "target-stance-anim": [ + [949, "v1", "art-joint-anim"], + [170, "v1", "art-joint-anim"], + [236, "v1", "art-joint-anim"], + [422, "a1", "art-joint-anim"], + [512, "a1", "art-joint-anim"], + [817, "v1", "art-joint-anim"] + ], + "(anon-function 17 target-anim)": [ + [106, "gp", "art-joint-anim"], + [164, "v1", "art-joint-anim"], + [216, "v1", "art-joint-anim"] + ], + "(anon-function 13 target-anim)": [ + [31, "v1", "art-joint-anim"], + [321, "v1", "art-joint-anim"] + ], + "(anon-function 14 target-anim)": [ + [28, "v1", "art-joint-anim"], + [95, "v1", "art-joint-anim"] + ], + "(anon-function 15 target-anim)": [[158, "a1", "art-joint-anim"]], + "(anon-function 16 target-anim)": [ + [84, "a1", "art-joint-anim"], + [230, "v1", "art-joint-anim"] + ], + "(code target-slide-down)": [ + [30, "v1", "art-joint-anim"], + [102, "v1", "art-joint-anim"] + ], + "(enter target-double-jump)": [[110, "v1", "vector"]], + "(code target-flop)": [[33, "v1", "art-joint-anim"]], + "mod-var-jump": [ + [156, "v0", "vector"], + [76, "f1", "float"] + ], + "(code target-running-attack)": [ + [118, "gp", "art-joint-anim"], + [437, "v1", "art-joint-anim"], + [465, "v1", "art-joint-anim"], + [493, "v1", "art-joint-anim"], + [265, "f26", "float"], + [348, "f26", "float"] + ], + "(event target-running-attack)": [[48, "v1", "process-focusable"]], + "(code target-attack)": [ + [282, "s5", "art-joint-anim"], + [359, "a0", "process-focusable"], + [362, "a0", "process-focusable"] + ], + "(code target-falling)": [[67, "v1", "art-joint-anim"]], + "(trans target-duck-high-jump-jump)": [[11, "v0", "sound-rpc-set-param"]], + "(enter target-high-jump)": [[21, "v1", "vector"]], + "(code target-double-jump)": [ + [95, "v1", "art-joint-anim"], + [133, "v1", "art-joint-anim"] + ], + "(code target-jump-forward)": [[64, "v1", "art-joint-anim"]], + "(enter target-jump)": [[42, "v1", "vector"]], + "(code target-duck-stance)": [ + [59, "v1", "art-joint-anim"], + [369, "v1", "art-joint-anim"], + [422, "v1", "art-joint-anim"], + [112, "v1", "art-joint-anim"], + [238, "v1", "art-joint-anim"], + [297, "v1", "art-joint-anim"] + ], + "(code target-blast-recover)": [ + [23, "v1", "art-joint-anim"], + [77, "v1", "art-joint-anim"], + [134, "v1", "art-joint-anim"] + ], + "(code target-hide)": [ + [14, "v1", "art-joint-anim"], + [143, "v1", "art-joint-anim"], + [258, "v1", "art-joint-anim"], + [204, "v1", "art-joint-anim"], + [317, "v1", "art-joint-anim"], + [385, "v1", "art-joint-anim"], + [431, "v1", "art-joint-anim"], + [488, "v1", "art-joint-anim"] + ], + "(anon-function 15 target2)": [[26, "f0", "float"]], + "(code target-eco-powerup)": [ + [74, "v1", "art-joint-anim"], + [128, "v1", "art-joint-anim"], + [191, "v1", "art-joint-anim"], + [250, "v1", "art-joint-anim"] + ], + "(code target-edge-grab-jump)": [[83, "a1", "art-joint-anim"]], + "(code target-edge-grab)": [ + [21, "v1", "process-focusable"], + [25, "v1", "process-focusable"], + [278, "f0", "float"] + ], + "(exit target-edge-grab)": [ + [17, "v1", "process-focusable"], + [21, "v1", "process-focusable"] + ], + "(code target-pole-flip-forward-jump)": [[26, "t9", "(function none)"]], + "(code target-pole-flip-up)": [[23, "v1", "art-joint-anim"]], + "(code target-pole-cycle)": [ + [103, "v1", "art-joint-anim"], + [163, "v1", "art-joint-anim"] + ], + "(code target-grab-ride)": [ + [30, "a0", "process-focusable"], + [23, "a0", "process-focusable"], + [33, "a0", "process-focusable"] + ], + "(code target-grab)": [ + [154, "v1", "art-joint-anim"], + [242, "v1", "art-joint-anim"], + [419, "v1", "art-joint-anim"], + [616, "v1", "art-joint-anim"], + [689, "v1", "art-joint-anim"], + [756, "v1", "art-joint-anim"] + ], + "(event target-grab)": [[75, "a0", "process"]], + "(code target-load-wait)": [ + [21, "v1", "art-joint-anim"], + [134, "v1", "art-joint-anim"], + [191, "v1", "art-joint-anim"] + ], + "(anon-function 12 target2)": [ + [19, "s4", "target"], + [21, "s4", "target"], + [29, "s4", "target"], + [34, "s4", "target"], + [44, "s4", "target"], + [58, "s4", "target"], + [70, "s4", "target"], + [80, "s4", "target"], + [83, "s4", "target"], + [92, "s4", "target"], + [94, "s4", "target"], + [129, "s4", "target"], + [139, "s4", "target"] + ], + "(trans target-float)": [[130, "v1", "(state target)"]], + "(code target-look-around)": [[22, "v1", "float"]], + "(code target-stance-look-around)": [[13, "v1", "float"]], + "(code target-swim-up)": [[18, "v1", "art-joint-anim"]], + "(code target-swim-down)": [[70, "v1", "art-joint-anim"]], + "(exit target-swim-down)": [[56, "v0", "sound-rpc-set-param"]], + "(event target-swim-down)": [[[12, 99], "v1", "attack-info"]], + "(code target-swim-walk)": [ + [143, "v1", "art-joint-anim"], + [58, "v1", "art-joint-anim"] + ], + "(code target-swim-stance)": [[33, "v1", "art-joint-anim"]], + "(exit target-swim-stance)": [[42, "v0", "sound-rpc-set-param"]], + "lightning-draw-all": [ + [42, "v1", "connection"], + [43, "s1", "dma-buffer"] + ], + "lightning-draw": [ + [[407, 444], "v1", "(inline-array vector)"], + ["_stack_", 20, "(inline-array gcf-vertex)"], + ["_stack_", 176, "gcf-control"], + [440, "a1", "pointer"], + [441, "a0", "pointer"], + [438, "a1", "(pointer uint128)"], + [439, "a0", "(pointer uint128)"], + [[472, 487], "a0", "dma-packet"], + [[559, 576], "a0", "dma-packet"], + [[597, 602], "a0", "dma-packet"] + ], + "lightning-trail-fractal-gen": [ + [52, "v1", "float"], + [71, "v1", "float"], + [90, "v1", "float"] + ], + "lightning-trail-uniform-gen": [ + [21, "v1", "float"], + [43, "v1", "float"], + [65, "v1", "float"] + ], + "lightning-uniform-gen": [ + [38, "v1", "float"], + [60, "v1", "float"], + [82, "v1", "float"] + ], + "lightning-fractal-gen": [ + [37, "v1", "float"], + [64, "v1", "float"], + [91, "v1", "float"] + ], + "(method 19 light-trail-tracker)": [ + [17, "a1", "process-drawable"], + [21, "a1", "process-drawable"], + [30, "a1", "process-drawable"], + [34, "a1", "process-drawable"] + ], + "(code target-powerjak-get-on)": [ + [86, "v1", "art-joint-anim"], + [145, "v1", "art-joint-anim"] + ], + "(code target-lightjak-get-on)": [ + [222, "v1", "art-joint-anim"], + [686, "v1", "art-joint-anim"], + [770, "v1", "art-joint-anim"], + [484, "v0", "sound-rpc-set-param"] + ], + "(code target-lightjak-get-off)": [[159, "v1", "art-joint-anim"]], + "(code target-lightjak-swoop)": [[30, "v1", "art-joint-anim"]], + "(code target-lightjak-swoop-again)": [ + [214, "v1", "art-joint-anim"], + [112, "v1", "art-joint-anim"] + ], + "(code target-lightjak-swoop-falling)": [ + [14, "v1", "art-joint-anim"], + [66, "v1", "art-joint-anim"] + ], + "(method 10 lightjak-shield)": [[7, "v0", "sound-rpc-set-param"]], + "target-lightjak-end-mode": [[94, "v0", "sound-rpc-set-param"]], + "(exit target-lightjak-get-on)": [[2, "v0", "sound-rpc-set-param"]], + "(code active freeze-watcher)": [ + [82, "v1", "process-focusable"], + [86, "v1", "process-focusable"], + [89, "v1", "process-focusable"] + ], + "(code hit lightjak-shield)": [ + [143, "v1", "art-joint-anim"], + [198, "v1", "art-joint-anim"] + ], + "(code close lightjak-shield)": [[30, "v1", "art-joint-anim"]], + "(post open lightjak-shield)": [[9, "gp", "process-focusable"]], + "(code open lightjak-shield)": [[182, "v1", "art-joint-anim"]], + "(code target-lightjak-regen)": [ + [126, "v1", "art-joint-anim"], + [563, "v1", "art-joint-anim"], + [378, "v1", "art-joint-anim"] + ], + "(code target-lightjak-shield)": [[194, "gp", "art-joint-anim"]], + "(code idle freeze-control)": [[59, "a1", "process-focusable"]], + "(enter idle freeze-control)": [[48, "v1", "float"]], + "(code target-invisible-get-on)": [ + [72, "s5", "process-drawable"], + [112, "v1", "art-joint-anim"], + [304, "v1", "art-joint-anim"], + [248, "v1", "art-joint-anim"] + ], + "(code target-launch-dir)": [[184, "v1", "art-joint-anim"]], + "(trans target-launch-dir)": [ + [112, "f3", "float"], + [129, "f2", "float"] + ], + "(enter target-launch-dir)": [[27, "f2", "float"]], + "next-continue": [ + [4, "a2", "symbol"], + [5, "a2", "level-load-info"], + [12, "a3", "continue-point"] + ], + "(code target-hit)": [[915, "v1", "art-joint-anim"]], + "target-hit-setup-anim": [ + [153, "v1", "art-joint-anim"], + [225, "v1", "art-joint-anim"] + ], + "target-death-reset": [[21, "v1", "connection"]], + "target-continue-init-art": [ + [141, "v1", "skeleton-group"], + [159, "v1", "skeleton-group"] + ], + "(event target-continue)": [[18, "a0", "process"]], + "target-hit-effect": [ + [16, "a0", "vector"], + [70, "a0", "vector"] + ], + "arrive-at-continue": [ + [[265, 293], "s5", "handle"], + [[343, 395], "gp", "handle"], + [[422, 458], "gp", "handle"], + [312, "s5", "handle"], + [315, "s5", "handle"], + [318, "s5", "handle"] + ], + "(anon-function 4 target-death)": [[273, "v1", "art-joint-anim"]], + "(anon-function 3 target-death)": [ + [228, "v1", "art-joint-anim"], + [312, "v1", "art-joint-anim"], + [447, "v1", "art-joint-anim"], + [391, "v1", "art-joint-anim"] + ], + "(anon-function 2 target-death)": [ + [58, "v1", "art-joint-anim"], + [197, "v1", "art-joint-anim"], + [141, "v1", "art-joint-anim"] + ], + "(anon-function 1 target-death)": [[73, "v1", "art-joint-anim"]], + "(code target-death)": [ + [618, "v1", "art-joint-anim"], + [745, "v1", "art-joint-anim"], + [1003, "v1", "art-joint-anim"] + ], + "part-tracker-init-base": [ + [61, "s2", "matrix"], + [70, "s2", "matrix"] + ], + "(exit idle freeze-control)": [[72, "v0", "float"]], + "target-death-main": [ + ["_stack_", 96, "level"], + [[346, 584], "s5", "handle"], + [529, "v1", "float"], + [506, "v1", "float"], + [483, "v1", "float"] + ], + "target-gun-end-mode": [[59, "v0", "sound-rpc-set-param"]], + "find-nearest-focusable": [ + [48, "s3", "process-focusable"], + [56, "s3", "process-focusable"], + [65, "s3", "process-focusable"] + ], + "target-gun-find-track": [ + [474, "s5", "process-focusable"], + [481, "s5", "process-focusable"], + [260, "s5", "process-focusable"], + [372, "s5", "process-focusable"], + [392, "s5", "process-focusable"], + [419, "s5", "process-focusable"], + [422, "s5", "process-focusable"], + [430, "s5", "process-focusable"] + ], + "target-gun-joint-pre0": [ + [931, "a0", "process-focusable"], + [932, "a0", "process-focusable"], + [934, "a0", "process-focusable"] + ], + "target-gun-check": [[626, "v0", "sound-rpc-set-param"]], + "(trans hidden gun)": [[4, "a0", "process-focusable"]], + "gun-post": [ + [[12, 222], "gp", "target"], + [5, "gp", "gun"] + ], + "(trans idle gun)": [[9, "a0", "process-focusable"]], + "(code idle gun)": [[16, "v1", "art-joint-anim"]], + "(code use gun)": [ + [38, "v1", "art-joint-anim"], + [395, "s4", "process-focusable"], + [406, "s2", "pair"], + [500, "s4", "process-focusable"], + [521, "s4", "process-focusable"], + [542, "s2", "pair"], + [548, "s4", "process-focusable"], + [551, "s4", "process-focusable"], + [98, "v1", "art-joint-anim"], + [158, "v1", "art-joint-anim"], + [218, "v1", "art-joint-anim"], + [278, "v1", "art-joint-anim"] + ], + "(trans use gun)": [ + [8, "a1", "process-focusable"], + [23, "v1", "process-focusable"], + [28, "v1", "process-focusable"] + ], + "(post use gun)": [ + [[6, 169], "gp", "target"], + [169, "gp", "gun"] + ], + "(method 9 gun-info)": [[74, "s2", "collide-shape-prim"]], + "get-remaining-player-ammo": [[32, "v0", "float"]], + "target-gun-type-set!": [[6, "gp", "int"]], + "target-gun-joint-points": [[858, "a0", "int"]], + "(method 11 light-trail)": [ + [19, "a0", "pointer"], + [50, "v1", "pointer"], + [96, "v1", "pointer"] + ], + "(method 12 light-trail)": [ + [18, "v1", "pointer"], + [23, "a0", "pointer"], + [176, "v1", "pointer"], + [542, "v1", "pointer"], + ["_stack_", 88, "float"], + ["_stack_", 92, "float"], + ["_stack_", 96, "float"], + ["_stack_", 140, "float"], + ["_stack_", 144, "float"], + ["_stack_", 148, "float"], + ["_stack_", 152, "float"], + ["_stack_", 156, "float"] + ], + "compute-trail-scaled-t": [[17, "v1", "float"]], + "board-post": [[[6, 153], "v1", "target"]], + "(code idle board)": [ + [19, "v1", "art-joint-anim"], + [37, "v1", "art-joint-anim"] + ], + "(trans hidden board)": [[4, "a0", "target"]], + "(trans idle board)": [[4, "a0", "target"]], + "(trans use board)": [ + [8, "a0", "target"], + [22, "a1", "target"] + ], + "(code use board)": [[17, "v1", "art-joint-anim"]], + "target-board-handler": [[107, "a0", "process"]], + "target-board-green-eco-attack": [[52, "v1", "collide-shape"]], + "target-board-effect": [[334, "v0", "sound-rpc-set-param"]], + "target-board-physics": [[167, "v0", "sound-rpc-set-param"]], + "target-board-real-post": [[360, "v0", "sound-rpc-set-param"]], + "(code target-board-stance)": [[49, "v1", "art-joint-anim"]], + "(code target-board-halfpipe)": [[173, "t9", "(function none)"]], + "(code target-board-jump)": [[16, "v1", "art-joint-anim"]], + "(enter target-board-jump)": [ + [364, "v1", "process-drawable"], + [421, "v1", "process-drawable"] + ], + "(code target-board-jump-kick)": [[15, "v1", "art-joint-anim"]], + "(code target-board-wall-kick)": [ + [10, "v1", "art-joint-anim"], + [59, "f0", "float"] + ], + "(exit target-board-flip)": [[31, "v0", "sound-rpc-set-param"]], + "(enter target-board-flip)": [[78, "v0", "sound-rpc-set-param"]], + "(code target-board-flip)": [ + [319, "v1", "art-joint-anim"], + [385, "v1", "art-joint-anim"], + [108, "v1", "art-joint-anim"], + [218, "v1", "art-joint-anim"] + ], + "(exit target-board-hold)": [[9, "v0", "sound-rpc-set-param"]], + "(code target-board-hit-ground)": [ + [77, "v1", "art-joint-anim"], + [147, "v1", "art-joint-anim"] + ], + "(trans target-board-ride-edge)": [[107, "v0", "sound-rpc-set-param"]], + "(enter target-board-ride-edge)": [[6, "v0", "sound-rpc-set-param"]], + "(exit target-board-ride-edge)": [[8, "v0", "sound-rpc-set-param"]], + "(code target-board-trickx)": [ + [81, "v1", "art-joint-anim"], + [149, "v1", "art-joint-anim"], + [218, "v1", "art-joint-anim"], + [301, "v1", "art-joint-anim"] + ], + "(code target-board-tricky)": [ + [514, "v1", "art-joint-anim"], + [75, "v1", "art-joint-anim"], + [143, "v1", "art-joint-anim"], + [212, "v1", "art-joint-anim"], + [326, "v1", "art-joint-anim"] + ], + "(exit target-board-tricky)": [[27, "v0", "sound-rpc-set-param"]], + "(code target-board-hold)": [ + [615, "v1", "art-joint-anim"], + [685, "v1", "art-joint-anim"], + [755, "v1", "art-joint-anim"], + [825, "v1", "art-joint-anim"], + [131, "v1", "art-joint-anim"], + [261, "v1", "art-joint-anim"], + [391, "v1", "art-joint-anim"], + [511, "v1", "art-joint-anim"] + ], + "target-board-anim-trans": [[192, "v0", "sound-rpc-set-param"]], + "target-board-ground-check": [ + [259, "v1", "process-drawable"], + [319, "v1", "process-drawable"] + ], + "(code target-board-hit)": [[14, "v0", "sound-rpc-set-param"]], + "(enter target-board-grab)": [[21, "v0", "sound-rpc-set-param"]], + "(event target-board-grab)": [[35, "a0", "process"]], + "(code target-board-get-off)": [[78, "v1", "art-joint-anim"]], + "(code target-board-get-on)": [[55, "v1", "art-joint-anim"]], + "(event target-board-halfpipe)": [[82, "v1", "float"]], + "(method 9 plane-volume)": [["_stack_", 148, "float"]], + "(code vent-pickup)": [[27, "gp", "process-focusable"]], + "(event open light-eco-vent)": [[22, "gp", "process-drawable"]], + "(event open dark-eco-vent)": [[22, "gp", "process-drawable"]], + "crate-standard-event-handler": [ + [5, "v1", "attack-info"], + [6, "v1", "attack-info"], + [10, "v1", "attack-info"], + [66, "gp", "process-focusable"], + [177, "v1", "attack-info"], + [435, "v1", "attack-info"], + [563, "v1", "impact-control"], + [660, "a0", "vector"] + ], + "(event carry crate)": [[15, "a0", "vector"]], + "(enter fall crate)": [ + [35, "v0", "carry-info"], + [39, "a0", "carry-info"] + ], + "(code notice-blue crate)": [ + [19, "v1", "process-drawable"], + [30, "v1", "collide-shape"], + [78, "v1", "vector"] + ], + "(code die crate)": [[44, "v1", "process-focusable"]], + "(method 42 crate)": [[60, "v0", "float"]], + "(method 9 fact-info)": [ + ["_stack_", 16, "pickup-type"], + [135, "a0", "process-drawable"], + [183, "a0", "process-drawable"] + ], + "pickup-ammo-set!": [ + ["_stack_", 16, "float"], + [140, "v1", "float"], + [222, "v0", "float"], + [21, "v1", "float"] + ], + "check-blue-suck": [[19, "v1", "collide-shape"]], + "add-blue-motion": [[20, "gp", "process-focusable"]], + "collectable-standard-event-handler": [ + [115, "a0", "vector"], + [133, "a0", "vector"], + [198, "a0", "process"], + [323, "a0", "process"] + ], + "(event pickup collectable)": [ + [17, "a0", "vector"], + [18, "v1", "vector"] + ], + "(code pickup eco)": [[41, "t9", "(function none)"]], + "notify-gem-pickup": [ + [18, "f1", "float"], + [39, "f1", "float"] + ], + "(method 32 collectable)": [ + [19, "v1", "int"], + [19, "a0", "int"], + [23, "a0", "int"], + [159, "v1", "process-drawable"] + ], + "(anon-function 77 collectables)": [ + [2, "v1", "handle"], + [5, "v1", "handle"], + [13, "v1", "collectable"], + [34, "a0", "process-focusable"], + [8, "v1", "handle"], + [37, "a0", "process-focusable"] + ], + "(anon-function 78 collectables)": [ + [2, "v1", "handle"], + [5, "v1", "handle"], + [8, "v1", "handle"], + [13, "v1", "collectable"], + [34, "a0", "process-focusable"], + [27, "a0", "process-focusable"], + [37, "a0", "process-focusable"] + ], + "(code die eco)": [[54, "v0", "float"]] } diff --git a/decompiler/config/jak3/ntsc_v1/var_names.jsonc b/decompiler/config/jak3/ntsc_v1/var_names.jsonc index 9619552f14d..8a332a23402 100644 --- a/decompiler/config/jak3/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak3/ntsc_v1/var_names.jsonc @@ -770,7 +770,8 @@ }, "(method 20 process-focusable)": { "vars": { - "v1-0": "mask" + "v1-0": "mask", + "v0-0": ["search-flag", "search-info-flag"] } }, "(method 10 focus)": { @@ -1623,5 +1624,41 @@ }, "add-blackout": { "args": ["arg0", "r", "g", "b", "arg4"] + }, + "can-jump?": { + "args": ["mode"] + }, + "(method 16 ragdoll)": { + "args": ["this", "proc", "setup"] + }, + "(method 22 ragdoll)": { + "args": ["this", "idx"] + }, + "(method 25 ragdoll)": { + "args": ["this", "proc"] + }, + "target-send-attack": { + "vars": { "t1-11": ["name", "sound-name"] } + }, + "(code target-running-attack)": { + "vars": { "t1-5": ["name", "sound-name"] } + }, + "arrive-at-continue": { + "vars": { "s5-2": ["s5-2", "handle"] } + }, + "find-nearest-focusable": { + "vars": { + "s0-1": ["s0-1", "search-info-flag"], + "s1-1": ["s1-1", "search-info-flag"] + } + }, + "gun->eco": { + "vars": { "v0-0": ["v0-0", "pickup-type"] } + }, + "gun->ammo": { + "vars": { "v0-0": ["v0-0", "pickup-type"] } + }, + "gun-pickup-type->game-feature": { + "vars": { "v0-0": ["v0-0", "game-feature"] } } } diff --git a/decompiler/data/StrFileReader.cpp b/decompiler/data/StrFileReader.cpp index ab3d7c9b030..0bade91d270 100644 --- a/decompiler/data/StrFileReader.cpp +++ b/decompiler/data/StrFileReader.cpp @@ -22,6 +22,7 @@ StrFileReader::StrFileReader(const fs::path& file_path, GameVersion version) : m init_jak1(file_path); break; case GameVersion::Jak2: + case GameVersion::Jak3: init_jak2(file_path); break; default: diff --git a/decompiler/data/StrFileReader.h b/decompiler/data/StrFileReader.h index 714e34c8a49..496501748d6 100644 --- a/decompiler/data/StrFileReader.h +++ b/decompiler/data/StrFileReader.h @@ -33,6 +33,8 @@ class StrFileReader { return "/src/next/data/art-group6/"; case GameVersion::Jak2: return "/src/jak2/final/art-group7/"; + case GameVersion::Jak3: + return "/src/jak3/final/art-group8/"; default: ASSERT_MSG(false, "NYI get_file_info_string version"); break; @@ -42,6 +44,7 @@ class StrFileReader { std::string get_texture_page_file_info_string() const { switch (m_version) { case GameVersion::Jak2: + case GameVersion::Jak3: return "/src/jak2/final/texture-page8/"; default: ASSERT_MSG(false, "NYI get_file_info_string version"); diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 8665047f869..dc95949bd90 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -984,6 +984,10 @@ const std::unordered_map< ArrayFieldDecompMeta(TypeSpec("sphere"), 16, ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}}, + {"sparticle-launcher", + {{"init-specs", ArrayFieldDecompMeta(TypeSpec("sp-field-init-spec"), 16)}}}, + {"sparticle-launch-group", + {{"launcher", ArrayFieldDecompMeta(TypeSpec("sparticle-group-item"), 32)}}}, }}}; goos::Object decompile_structure(const TypeSpec& type, diff --git a/decompiler/util/sparticle_decompile.cpp b/decompiler/util/sparticle_decompile.cpp index 1c0df9dfadd..07f8858f87a 100644 --- a/decompiler/util/sparticle_decompile.cpp +++ b/decompiler/util/sparticle_decompile.cpp @@ -337,7 +337,8 @@ const SparticleFieldDecomp field_kind_jak2[73] = { const std::unordered_map field_kinds = { {GameVersion::Jak1, field_kind_jak1}, - {GameVersion::Jak2, field_kind_jak2}}; + {GameVersion::Jak2, field_kind_jak2}, + {GameVersion::Jak3, field_kind_jak2}}; float word_as_float(const LinkedWord& w) { ASSERT(w.kind() == LinkedWord::PLAIN_DATA); diff --git a/goal_src/jak3/engine/ai/traffic-h.gc b/goal_src/jak3/engine/ai/traffic-h.gc index c3352e5ecd8..4f30b5d6490 100644 --- a/goal_src/jak3/engine/ai/traffic-h.gc +++ b/goal_src/jak3/engine/ai/traffic-h.gc @@ -14,6 +14,23 @@ (defenum traffic-spawn-flags :type uint32 :bitfield #t + (tsf0 0) + (tsf1 1) + (tsf2 2) + (tsf3 3) + (tsf4 4) + (tsf5 5) + (tsf6 6) + (tsf7 7) + (tsf8 8) + (tsf9 9) + (tsf10 10) + (tsf11 11) + (tsf12 12) + (tsf13 13) + (tsf14 14) + (tsf15 15) + (tsf16 16) ) ;; ---traffic-h:traffic-spawn-flags diff --git a/goal_src/jak3/engine/ambient/ambient-h.gc b/goal_src/jak3/engine/ambient/ambient-h.gc index 7aedad9d9d2..abc073f0578 100644 --- a/goal_src/jak3/engine/ambient/ambient-h.gc +++ b/goal_src/jak3/engine/ambient/ambient-h.gc @@ -23,6 +23,7 @@ (define-extern kill-current-talker (function pair pair symbol none)) (define-extern talker-surpress! (function int)) +(define-extern voicebox-spawn (function process-drawable vector (pointer process))) ;; DECOMP BEGINS @@ -50,6 +51,7 @@ ) ) +(define-extern talker-spawn-func (function talker-speech-class process-tree vector region sound-id)) (deftype talker (process) ((trans vector :inline) @@ -76,6 +78,7 @@ ) ) +(define-extern talker-init (function talker-speech-class vector region none :behavior talker)) (define *talker-speech* (new 'static 'inline-array talker-speech-class 365 (new 'static 'talker-speech-class :name "none") diff --git a/goal_src/jak3/engine/ambient/ambient.gc b/goal_src/jak3/engine/ambient/ambient.gc index d20d73d6dd3..cfa404e2130 100644 --- a/goal_src/jak3/engine/ambient/ambient.gc +++ b/goal_src/jak3/engine/ambient/ambient.gc @@ -7,3 +7,579 @@ ;; DECOMP BEGINS +(defun can-display-query? ((arg0 process) (arg1 string) (arg2 float)) + (let ((a1-2 (gui-control-method-12 + *gui-control* + arg0 + (gui-channel query) + (gui-action play) + (if arg1 + arg1 + (symbol->string (-> arg0 type symbol)) + ) + 0 + arg2 + (new 'static 'sound-id) + ) + ) + ) + (= (get-status *gui-control* a1-2) (gui-status active)) + ) + ) + +(defun talker-surpress! () + (set! (-> *game-info* hint-play-time) (-> *display* base-clock frame-counter)) + 0 + ) + +(defun talker-displayed? () + (if (-> *setting-control* user-current hint) + #t + #f + ) + ) + +(defun kill-current-talker ((arg0 pair) (arg1 pair) (arg2 symbol)) + (if (not (member 'daxter arg1)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel daxter) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (if (not (member 'pecker arg1)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel pecker) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (if (not (member 'voicebox arg1)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel voicebox) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (if (not (member 'message arg1)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel message) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (when (not (member 'notice arg1)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel notice) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel notice-low) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + 0 + (none) + ) + +(defun string->talker-speech ((arg0 string)) + (dotimes (s5-0 365) + (let ((s4-0 (-> *talker-speech* s5-0))) + (if (string= arg0 (-> s4-0 name)) + (return s4-0) + ) + ) + ) + (-> *talker-speech* 0) + ) + +(defmethod talker-speech-class-method-9 ((this talker-speech-class)) + (and (>= (-> *game-info* unknown-arr4 (* (-> this speech) 2)) (-> this pos)) + (>= (-> this neg) (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) + ) + ) + +(defmethod play-communicator-speech! ((this talker-speech-class)) + (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) + 0 + (none) + ) + +(defmethod talker-speech-class-method-11 ((this talker-speech-class)) + (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) (the-as uint 0)) + 0 + (none) + ) + +(defmethod talker-speech-class-method-12 ((this talker-speech-class) (arg0 int)) + (if (>= arg0 0) + (set! (-> *game-info* unknown-arr4 (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (* (-> this speech) 2))) #xfff0 arg0)) + ) + (set! (-> *game-info* unknown-arr4 (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (* (-> this speech) 2))) 0 (- arg0))) + ) + ) + (if (talker-speech-class-method-9 this) + (talker-spawn-func this *entity-pool* (target-pos 0) (the-as region #f)) + ) + 0 + (none) + ) + +(defmethod talker-speech-class-method-13 ((this talker-speech-class) (arg0 int)) + (if (>= arg0 0) + (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) #xfff0 arg0)) + ) + (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) 0 (- arg0))) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs sound-id. +(defun talker-spawn-func ((arg0 talker-speech-class) (arg1 process-tree) (arg2 vector) (arg3 region)) + (local-vars (s2-0 int)) + (when (or (not arg0) (zero? (-> arg0 speech)) (not (talker-speech-class-method-9 arg0))) + (set! s2-0 0) + (goto cfg-27) + ) + (if (and (or (not (-> *setting-control* user-current play-hints)) + (= (-> *setting-control* user-current dialog-volume) 0.0) + ) + (logtest? (-> arg0 flags) (talker-flags tf0)) + ) + (play-communicator-speech! arg0) + ) + (set! s2-0 + (the-as int (lookup-gui-connection-id *gui-control* (-> arg0 name) (-> arg0 channel) (gui-action none))) + ) + (set! s2-0 (cond + ((zero? (the-as sound-id s2-0)) + (let ((v1-17 (process-spawn talker :init talker-init arg0 arg2 arg3 :name "talker" :to arg1))) + (cond + (v1-17 + (if (nonzero? (-> (the-as talker (-> v1-17 0)) voice-id)) + (the-as int (-> (the-as talker (-> v1-17 0)) voice-id)) + (the-as int (-> (the-as talker (-> v1-17 0)) message-id)) + ) + ) + (else + (empty) + s2-0 + ) + ) + ) + ) + (else + (empty) + s2-0 + ) + ) + ) + (label cfg-27) + (the-as sound-id s2-0) + ) + +(defbehavior talker-init talker ((arg0 talker-speech-class) (arg1 vector) (arg2 region)) + (set! (-> self trans quad) (-> arg1 quad)) + (let ((v1-2 (shr (the-as int (-> arg0 channel)) 4))) + (when (not (or (or (= v1-2 4) (= v1-2 5)) + (or (not (-> *setting-control* user-current play-hints)) + (= (-> *setting-control* user-current dialog-volume) 0.0) + ) + ) + ) + (set! (-> self voice-id) + (add-process *gui-control* self (-> arg0 channel) (gui-action queue) (-> arg0 name) 81920.0 0) + ) + (sound-params-set! + *gui-control* + (-> self voice-id) + #f + -1 + -1 + -1 + (-> *setting-control* user-current talker-volume) + ) + ) + ) + (when (nonzero? (-> arg0 text-message)) + (let* ((a0-7 *gui-control*) + (t9-2 (method-of-object a0-7 add-process)) + (a1-4 self) + (v1-18 (shr (the-as int (-> arg0 channel)) 4)) + ) + (set! (-> self message-id) (t9-2 + a0-7 + a1-4 + (if (or (= v1-18 4) (= v1-18 5)) + (the-as gui-channel (the-as int (-> arg0 channel))) + (gui-channel message) + ) + (gui-action play) + (-> arg0 name) + 81920.0 + 0 + ) + ) + ) + ) + (set! (-> self message) arg0) + (set! (-> self region) arg2) + (set! (-> self total-time) 0) + (set! (-> self total-off-time) 0) + (set-time! (-> self start-time)) + (set! (-> self voicebox) (the-as handle #f)) + (set! (-> self save?) #f) + (set! (-> self grab?) #f) + (if (logtest? (-> self message flags) (talker-flags tf5 tf6)) + (set! (-> self interp) 0.0) + (set! (-> self interp) 1.0) + ) + (go-virtual idle) + 0 + (none) + ) + +(defmethod deactivate ((this talker)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (send-event (handle->process (-> this voicebox)) 'die) + (call-parent-method this) + (none) + ) + +(defmethod talker-method-17 ((this talker)) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 36 310 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((f0-0 320.0)) + (let ((v1-2 gp-0)) + (set! (-> v1-2 scale) 0.75) + ) + (case (-> this message channel) + (((gui-channel notice)) + (cond + ((logtest? (-> this message flags) (talker-flags tf7)) + (let ((v1-9 gp-0) + (a1-1 36) + (a0-4 140) + ) + (set! (-> v1-9 origin x) (the float a1-1)) + (set! (-> v1-9 origin y) (the float a0-4)) + ) + ) + (else + (let ((v1-10 gp-0)) + (set! (-> v1-10 scale) 0.6) + ) + (let ((v1-11 gp-0) + (a1-2 36) + (a0-6 160) + ) + (set! (-> v1-11 origin x) (the float a1-2)) + (set! (-> v1-11 origin y) (the float a0-6)) + ) + ) + ) + (set! f0-0 160.0) + ) + ) + (let ((v1-14 gp-0)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-0)) + (set! (-> v1-15 height) (the float 140)) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning middle large)) + (if (logtest? (-> this message flags) (talker-flags tf5)) + (set! (-> gp-0 alpha) (-> this interp)) + (set! (-> gp-0 alpha) 1.0) + ) + (when (logtest? (-> this message flags) (talker-flags tf6)) + (let ((s4-0 gp-0) + (s3-0 36) + (v1-27 (the int (lerp-scale 400.0 f0-0 (-> this interp) 0.0 1.0))) + ) + (set! (-> s4-0 origin x) (the float s3-0)) + (set! (-> s4-0 origin y) (the float v1-27)) + ) + ) + ) + (let ((f0-17 (print-game-text + (lookup-text! *common-text* (-> this message text-message) #f) + gp-0 + #t + 44 + (bucket-id bucket579) + ) + ) + ) + (when (< 98.0 f0-17) + (let ((v1-32 gp-0)) + (set! (-> v1-32 scale) 0.6) + ) + ) + ) + (let ((s4-2 print-game-text) + (a0-14 (lookup-text! *common-text* (-> this message text-message) #f)) + (a2-5 #f) + (a3-3 44) + (v1-36 (-> this message channel)) + ) + (s4-2 + a0-14 + gp-0 + a2-5 + a3-3 + (if (or (= v1-36 (gui-channel notice)) (= v1-36 (gui-channel notice-low)) (= v1-36 (gui-channel subtitle))) + (bucket-id bucket581) + (bucket-id bucket579) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate idle (talker) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (the-as time-frame (-> self message delay))) + (suspend) + ) + ) + (while (or (not (time-elapsed? (-> self start-time) (the-as time-frame (+ (-> self message delay) 300)))) + (and (logtest? (-> self message flags) (talker-flags tf8)) + (not (time-elapsed? (-> self start-time) (seconds 180))) + ) + ) + (when (and (or (zero? (-> self voice-id)) (= (get-status *gui-control* (-> self voice-id)) (gui-status ready))) + (or (zero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active))) + ) + (case (-> self message channel) + (((gui-channel voicebox)) + (if (and (not (handle->process (-> self voicebox))) *target*) + (set! (-> self voicebox) (ppointer->handle (voicebox-spawn *target* (target-pos 0)))) + ) + ) + ) + (go-virtual active) + ) + (suspend) + ) + (go-virtual exit) + ) + ) + +(defstate active (talker) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (if (logtest? (-> self message flags) (talker-flags tf0)) + (play-communicator-speech! (-> self message)) + ) + (set-setting! 'hint (process->ppointer self) 0.0 0) + (set-setting! 'speech-control #f 0.0 0) + (if (nonzero? (-> self voice-id)) + (set-action! + *gui-control* + (gui-action play) + (-> self voice-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (when (and (nonzero? (-> self voice-id)) (logtest? (-> self message flags) (talker-flags tf1))) + (add-setting! 'music-volume 'rel 0.25 0) + (add-setting! 'sfx-volume 'rel 0.75 0) + (add-setting! 'dialog-volume 'rel (-> *setting-control* user-current dialog-volume-talker) 0) + ) + (if (logtest? (-> self message flags) (talker-flags tf2)) + (auto-save-user) + ) + (apply-settings *setting-control*) + ) + :exit (behavior () + (if (and (-> self grab?) *target*) + (process-release? *target*) + ) + (let ((gp-0 (-> self message on-close))) + (when gp-0 + (let* ((s5-0 (handle->process (-> self voicebox))) + (v1-9 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (script-eval gp-0 :vector (if v1-9 + (-> (the-as process-drawable v1-9) root trans) + ) + ) + ) + ) + ) + (when (and (logtest? (-> self message flags) (talker-flags tf3)) (not (-> self save?))) + (set! (-> self save?) #t) + (auto-save-user) + ) + (if (nonzero? (-> self voice-id)) + (set-action! + *gui-control* + (gui-action stop) + (-> self voice-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (if (nonzero? (-> self message-id)) + (set-action! + *gui-control* + (gui-action stop) + (-> self message-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) + (remove-setting! 'hint) + (remove-setting! 'speech-control) + (remove-setting! 'camera-name) + (apply-settings *setting-control*) + ) + :code (behavior () + (local-vars (v1-50 symbol)) + (let ((gp-0 #t)) + (while (or (and (nonzero? (-> self voice-id)) + (let ((v1-41 (get-status *gui-control* (-> self voice-id)))) + (or (= v1-41 (gui-status ready)) (= v1-41 (gui-status active))) + ) + (begin + (dotimes (s5-2 4) + (when (and (string-charp= (-> self message name) (the-as (pointer uint8) (-> *sound-iop-info* stream-name s5-2))) + (= (-> self voice-id) (-> *sound-iop-info* stream-id s5-2)) + (logtest? (-> *sound-iop-info* stream-status s5-2) (stream-status ss6)) + ) + (set! v1-50 #f) + (goto cfg-47) + ) + ) + (set! v1-50 #t) + (label cfg-47) + (and v1-50 (not (time-elapsed? (-> self state-time) (seconds 120)))) + ) + ) + (and (nonzero? (-> self message-id)) + (= (get-status *gui-control* (-> self message-id)) (gui-status active)) + (or (not (time-elapsed? (-> self state-time) (the-as time-frame (-> self message text-duration)))) + (and (logtest? (-> self message flags) (talker-flags tf4)) + (-> self region) + (point-in-region-debug! (-> self region) (target-pos 0)) + ) + ) + ) + (not (time-elapsed? (-> self state-time) (seconds 0.05))) + ) + (when (and (nonzero? (-> self voice-id)) (not gp-0) (zero? (get-status *gui-control* (-> self voice-id)))) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) + (set! gp-0 #t) + ) + (when (and (-> self message camera) (not (-> self grab?)) *target*) + (when (process-grab? *target* #f) + (set! (-> self grab?) #t) + (set-setting! 'entity-name (-> self message camera) 0.0 0) + ) + ) + (when (and (nonzero? (-> self message-id)) + (= (get-status *gui-control* (-> self message-id)) (gui-status active)) + (not (paused?)) + ) + (if (logtest? (-> self message flags) (talker-flags tf5)) + (seek! (-> self interp) 1.0 (* 0.5 (seconds-per-frame))) + (seek! (-> self interp) 1.0 (* 4.0 (seconds-per-frame))) + ) + (talker-method-17 self) + ) + (suspend) + ) + ) + (when (and (nonzero? (-> self message-id)) (logtest? (-> self message flags) (talker-flags tf5 tf6))) + (while (!= (-> self interp) 0.0) + (if (logtest? (-> self message flags) (talker-flags tf5)) + (seek! (-> self interp) 0.0 (* 0.5 (seconds-per-frame))) + (seek! (-> self interp) 0.0 (* 4.0 (seconds-per-frame))) + ) + (if (and (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (not (paused?))) + (talker-method-17 self) + ) + (suspend) + ) + ) + (when (and (logtest? (-> self message flags) (talker-flags tf3)) (not (-> self save?))) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (set! (-> self save?) #t) + (auto-save-user) + ) + (go-virtual exit) + ) + ) + +(defstate exit (talker) + :virtual #t + :code nothing + ) diff --git a/goal_src/jak3/engine/anim/aligner-h.gc b/goal_src/jak3/engine/anim/aligner-h.gc index 5cc040e932c..3c0d8a3235a 100644 --- a/goal_src/jak3/engine/anim/aligner-h.gc +++ b/goal_src/jak3/engine/anim/aligner-h.gc @@ -66,8 +66,8 @@ ) (:methods (new (symbol type process) _type_) - (align-control-method-9 () none) - (align-control-method-10 () none) + (compute-alignment! (_type_) transformq) + (align! (_type_ align-opts float float float) trsqv) (align-control-method-11 () none) (align-control-method-12 () none) (align-control-method-13 () none) @@ -77,12 +77,12 @@ ;; WARN: Return type mismatch object vs align-control. (defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process)) - (let ((v0-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) - (when (zero? (the-as align-control v0-0)) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? this) (go process-drawable-art-error "memory") (return (the-as align-control 0)) ) - (set! (-> (the-as align-control v0-0) process) (the-as process-drawable arg0)) - (the-as align-control v0-0) + (set! (-> this process) (the-as process-drawable arg0)) + (the-as align-control this) ) ) diff --git a/goal_src/jak3/engine/camera/cam-interface-h.gc b/goal_src/jak3/engine/camera/cam-interface-h.gc index 2c7452edda3..a5c8ec07b2b 100644 --- a/goal_src/jak3/engine/camera/cam-interface-h.gc +++ b/goal_src/jak3/engine/camera/cam-interface-h.gc @@ -8,6 +8,9 @@ (define-extern math-camera-matrix (function matrix)) (define-extern camera-pos (function vector)) (define-extern math-camera-pos (function vector)) +(define-extern matrix-local->world (function symbol symbol matrix)) +(define-extern matrix-world->local (function symbol object matrix)) +(define-extern camera-matrix (function matrix)) ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/camera/camera-h.gc b/goal_src/jak3/engine/camera/camera-h.gc index 3e0df9e3808..24898bca340 100644 --- a/goal_src/jak3/engine/camera/camera-h.gc +++ b/goal_src/jak3/engine/camera/camera-h.gc @@ -63,6 +63,8 @@ ) ;; ---cam-master-options-u32 +(define-extern cam-stop (function symbol)) +(define-extern cam-start (function symbol none)) ;; DECOMP BEGINS @@ -384,6 +386,36 @@ (slope-adjust cam-float-seeker :inline) (slope-quat quaternion :inline) ) + (:states + cam-bike + cam-bt-gun + cam-circular + cam-decel + cam-endlessfall + cam-eye + cam-fixed + cam-fixed-read-entity + cam-free-floating + cam-launcher-longfall + cam-launcher-shortfall + cam-lookat + cam-no-trans + cam-point-watch + cam-pov + cam-pov-track + cam-pov180 + cam-power-game + cam-really-fixed + cam-remote + cam-scorpion-gun + cam-spline + cam-standoff + cam-standoff-read-entity + cam-stick + cam-string + cam-tube-sled + cam-turret + ) ) @@ -430,8 +462,14 @@ (interest-dist float) ) (:methods - (camera-master-method-14 () none) - (camera-master-method-15 () none) + (camera-master-method-14 (_type_ vector) vector) + (camera-master-method-15 (_type_ vector) vector) (camera-master-method-16 () none) ) ) + +(define-extern cam-slave-go (function (state camera-slave) none :behavior camera-slave)) +(define-extern cam-slave-init (function (state camera-slave) entity none :behavior camera-slave)) +(define-extern cam-standard-event-handler (function process int symbol event-message-block object :behavior camera-slave)) +(define-extern cam-calc-follow! (function cam-rotation-tracker vector symbol vector)) +(define-extern slave-set-rotation! (function cam-rotation-tracker vector cam-slave-options-u32 float symbol none)) \ No newline at end of file diff --git a/goal_src/jak3/engine/camera/pov-camera-h.gc b/goal_src/jak3/engine/camera/pov-camera-h.gc index 324e28ddc5b..8f6066aa172 100644 --- a/goal_src/jak3/engine/camera/pov-camera-h.gc +++ b/goal_src/jak3/engine/camera/pov-camera-h.gc @@ -5,8 +5,8 @@ ;; name in dgo: pov-camera-h ;; dgos: GAME -;; +++pov-camera-flags -(defenum pov-camera-flags +;; +++pov-camera-flag +(defenum pov-camera-flag :bitfield #t :type int32 (notify-of-abort 0) @@ -14,13 +14,15 @@ (inherit-orientation 2) (pcf3 3) ) -;; ---pov-camera-flags +;; ---pov-camera-flag +(declare-type pov-camera process-drawable) +(define-extern pov-camera-init-by-other (function vector skeleton-group string pov-camera-flag process-drawable pair none :behavior pov-camera)) ;; DECOMP BEGINS (deftype pov-camera (process-drawable) - ((flags pov-camera-flags) + ((flags pov-camera-flag) (debounce-start-time time-frame) (notify-handle handle) (anim-name string) diff --git a/goal_src/jak3/engine/collide/collide-cache-h.gc b/goal_src/jak3/engine/collide/collide-cache-h.gc index fc236058fa4..a3616341ac0 100644 --- a/goal_src/jak3/engine/collide/collide-cache-h.gc +++ b/goal_src/jak3/engine/collide/collide-cache-h.gc @@ -100,13 +100,13 @@ It is not useful for ollision queries against a specific foreground object, like ) (:methods (collide-cache-method-9 () none) - (collide-cache-method-10 () none) - (collide-cache-method-11 () none) + (fill-and-probe-using-line-sphere (_type_ collide-query) float) + (fill-and-probe-using-spheres (_type_ collide-query) symbol) (collide-cache-method-12 () none) - (collide-cache-method-13 () none) + (fill-using-line-sphere (_type_ collide-query) none) (collide-cache-method-14 () none) (collide-cache-method-15 () none) - (collide-cache-method-16 () none) + (probe-using-line-sphere (_type_ collide-query) float) (collide-cache-method-17 () none) (collide-cache-method-18 () none) (collide-cache-method-19 () none) diff --git a/goal_src/jak3/engine/collide/collide-edge-grab-h.gc b/goal_src/jak3/engine/collide/collide-edge-grab-h.gc index e0da626b9ba..7837efd3013 100644 --- a/goal_src/jak3/engine/collide/collide-edge-grab-h.gc +++ b/goal_src/jak3/engine/collide/collide-edge-grab-h.gc @@ -52,7 +52,7 @@ (pilot-grab-interp float) ) (:methods - (edge-grab-info-method-9 () none) + (edge-grab-info-method-9 (_type_) symbol) (edge-grab-info-method-10 () none) ) ) diff --git a/goal_src/jak3/engine/collide/collide-h.gc b/goal_src/jak3/engine/collide/collide-h.gc index 201578472f2..5302b789efe 100644 --- a/goal_src/jak3/engine/collide/collide-h.gc +++ b/goal_src/jak3/engine/collide/collide-h.gc @@ -24,8 +24,8 @@ This has both inputs from the user, and collision results." (start-pos vector :inline) (move-dist vector :inline) (rlength vector :inline) - (exit-planes plane 2) - (radius float :offset 268) + (exit-planes plane 2 :inline) + (radius float :overlay-at (-> exit-planes 0 data 3)) (inv-mat matrix :inline :offset 288) (spheres (inline-array sphere) :overlay-at (-> overlay-params 0)) (num-spheres uint32 :overlay-at (-> overlay-params 1)) diff --git a/goal_src/jak3/engine/collide/collide-shape-h.gc b/goal_src/jak3/engine/collide/collide-shape-h.gc index 0f530e3d4a7..7dcbba2c9d4 100644 --- a/goal_src/jak3/engine/collide/collide-shape-h.gc +++ b/goal_src/jak3/engine/collide/collide-shape-h.gc @@ -90,6 +90,48 @@ (declare-type collide-cache basic) (declare-type rigid-body structure) +(define-extern cshape-reaction-update-state (function control-info collide-query vector none)) + +;; +++cshape-reaction-flags +(defenum cshape-reaction-flags + :bitfield #t + :type uint32 + (csrf00) + (csrf01) + (csrf02) + (csrf03) + (csrf04) + (csrf05) + (csrf06) + (csrf07) + (csrf08) + (csrf09) + (csrf10) + (csrf11) + (csrf12) + (csrf13) + (csrf14) + (csrf15) + (csrf16) + (csrf17) + (csrf18) + (csrf19) + (csrf20) + (csrf21) + (csrf22) + (csrf23) + (csrf24) + (csrf25) + (csrf26) + (csrf27) + (csrf28) + (csrf29) + (csrf30) + (csrf31) + ) +;; ---cshape-reaction-flags + + ;; DECOMP BEGINS (deftype collide-rider (structure) @@ -265,34 +307,34 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (riders (inline-array collide-rider)) (penetrate-using penetrate) (penetrated-by penetrate) - (unknown-word0 int32) - (unknown-word1 int32) + (backup-collide-as collide-spec) + (backup-collide-with collide-spec) (event-priority uint8 :offset 192) (rider-max-momentum float) ) (:methods (new (symbol type process-drawable collide-list-enum) _type_) - (collide-shape-method-28 () none) - (collide-shape-method-29 () none) + (move-by-vector! (_type_ vector) none) + (move-to-point! (_type_ vector) none) (collide-shape-method-30 () none) - (collide-shape-method-31 () none) - (collide-shape-method-32 () none) + (fill-cache-for-shape (_type_ float collide-query) none) + (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none) (collide-shape-method-33 () none) (collide-shape-method-34 () none) (detect-riders! (_type_) symbol) (collide-shape-method-36 () none) - (collide-shape-method-37 () none) + (integrate-and-collide! (_type_ vector) none) (find-collision-meshes (_type_) none) (collide-shape-method-39 () none) - (collide-shape-method-40 () none) + (find-overlapping-shapes (_type_ overlaps-others-params) symbol) (collide-shape-method-41 () none) (collide-shape-method-42 () none) (collide-shape-method-43 () none) (pull-riders! (_type_) symbol) (do-push-aways (_type_) collide-spec) (update-transforms (_type_) none) - (collide-shape-method-47 () none) - (collide-shape-method-48 () none) + (set-collide-with! (_type_ collide-spec) none) + (set-collide-as! (_type_ collide-spec) none) (collide-shape-method-49 () none) (collide-shape-method-50 () none) (collide-shape-method-51 () none) @@ -312,6 +354,9 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (cur-pat pat-surface) (ground-pat pat-surface) (status collide-status) + (old-status collide-status) + (prev-status collide-status) + (reaction-flag cshape-reaction-flags) (reaction (function control-info collide-query vector vector collide-status) :offset 316) (no-reaction (function collide-shape-moving collide-query vector vector object)) (local-normal vector :inline) @@ -331,17 +376,17 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ) (:methods (new (symbol type process-drawable collide-list-enum) _type_) - (collide-shape-moving-method-55 () none) - (collide-shape-moving-method-56 () none) + (find-ground (_type_ collide-query collide-spec float float float) symbol) + (react-to-pat! (_type_ pat-surface) cshape-reaction-flags) (collide-shape-moving-method-57 () none) (collide-shape-moving-method-58 () none) (collide-shape-moving-method-59 () none) (collide-shape-moving-method-60 () none) (collide-shape-moving-method-61 () none) - (collide-shape-moving-method-62 () none) + (compute-acc-due-to-gravity (_type_ vector float) vector) (collide-shape-moving-method-63 () none) (collide-shape-moving-method-64 () none) - (collide-shape-moving-method-65 () none) + (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol) (collide-shape-moving-method-66 () none) (collide-shape-moving-method-67 () none) ) diff --git a/goal_src/jak3/engine/collide/collide-target-h.gc b/goal_src/jak3/engine/collide/collide-target-h.gc index d5a0ea4e4b8..46d188c8764 100644 --- a/goal_src/jak3/engine/collide/collide-target-h.gc +++ b/goal_src/jak3/engine/collide/collide-target-h.gc @@ -8,6 +8,226 @@ ;; DECOMP BEGINS (deftype control-info (collide-shape-moving) - ((pad uint8 5944) + ((unknown-float00 float :overlay-at ground-impact-vel) + (unknown-float01 float :overlay-at surface-angle) + (unknown-float02 float :overlay-at poly-angle) + (unknown-float03 float :overlay-at touch-angle) + (transv-ctrl vector :inline :offset 480) + (target-transv vector :inline :offset 496) + (bent-gravity-normal vector :inline :offset 512) + (quat-for-control quaternion :inline :offset 528) + (override-quat quaternion :inline :offset 544) + (override-quat-alpha float :offset 560) + (ctrl-xz-vel float :offset 564) + (unknown-float003 float :offset 568) + (turn-go-the-long-way float :offset 572) + (velocity-after-thrust float :offset 576) + (turn-lockout-end-time time-frame :offset 584) + (turn-to-alt-heading vector :inline :offset 592) + (last-transv vector :inline :offset 608) + (last-quat-for-control quaternion :inline :offset 624) + (trans-log-trans vector 128 :inline :offset 640) + (trans-log-times time-frame 128 :offset 2688) + (trans-log-idx int32 :offset 3712) + (draw-offset vector :inline :offset 3728) + (cspace-offset vector :inline :offset 3744) + (anim-collide-offset-local vector :inline :offset 3760) + (anim-collide-offset-world vector :inline :offset 3776) + (old-anim-collide-offset-world vector :inline :offset 3792) + (anim-collide-offset-delta-world vector :inline :offset 3808) + (standard-dynamics dynamics :offset 3824) + (mod-surface surface :offset 3828) + (current-surface surface :offset 3832) + (prev-surf surface :offset 3836) + (time-of-last-surface-change time-frame :offset 3840) + (cpad cpad-info :offset 3848) + (turn-to-angle float :offset 3852) + (last-turn-to-angle float :offset 3856) + (turn-to-magnitude float :offset 3860) + (last-turn-to-magnitude float :offset 3864) + (to-target-pt-xz vector :inline :offset 3872) + (last-to-target-pt-xz vector :inline :offset 3888) + (turn-to-target vector :inline :offset 3904) + (last-turn-to-target vector :inline :offset 3920) + (turn-history-ctrl vector 7 :inline :offset 3936) + (pad-xz-dir vector :inline :offset 4064) + (last-pad-xz-dir vector :inline :offset 4080) + (pad-magnitude float :offset 4096) + (last-pad-magnitude float :offset 4100) + (time-of-last-pad-read time-frame :offset 4104) + (w-R-c matrix :inline :offset 4112) + (c-R-w matrix :inline :offset 4176) + (ctrl-orientation matrix :inline :offset 4240) + (pre-collide-local-normal vector :inline :offset 4320) + (camera-pos vector :inline :offset 4336) + (cam-R-w matrix :inline :offset 4352) + (update-cam-R-w-start-time int64 :offset 4416) + (force-turn-to-direction vector :inline :offset 4432) + (force-turn-to-speed float :offset 4448) + (unknown-floatiujh1bnb2n3i1 float :offset 4452) + (force-turn-to-strength float :offset 4456) + (tongue-counter int32 :offset 4460) + (collide-extra-velocity vector :inline :offset 4464) + (additional-decaying-velocity vector :inline :offset 4480) + (additional-decaying-velocity-end-time time-frame :offset 4496) + (additional-decaying-velocity-decay-start-time time-frame :offset 4504) + (gravity-normal vector :inline :offset 4512) + (last-gravity-normal vector :inline :offset 4528) + (last-trans-any-surf vector :inline :offset 4544) + (unknown-float16 float :overlay-at (-> last-trans-any-surf y)) + (ground-contact-normal vector :inline :offset 4560) + (last-trans-on-ground vector :inline :offset 4576) + (ground-contact-sphere-center vector :inline :offset 4592) + (transv-on-last-impact vector :inline :offset 4608) + (list-time-on-ground time-frame :offset 4624) + (ground-local-norm-dot-grav float :offset 4632) + (local-slope-z float :offset 4636) + (local-slope-x float :offset 4640) + (surface-slope-z float :offset 4644) + (surface-slope-x float :offset 4648) + (last-time-on-surface time-frame :offset 4656) + (normal-impact-vel float :offset 4664) + (last-time-touching-actor time-frame :offset 4672) + (wall-contact-pat pat-surface :offset 4680) + (wall-contact-pt vector :inline :offset 4688) + (wall-contact-poly-normal vector :inline :offset 4704) + (wall-contact-normal vector :inline :offset 4720) + (actor-contact-pt vector :inline :offset 4736) + (actor-contact-normal vector :inline :offset 4752) + (actor-contact-handle handle :offset 4768) + (gspot-pat-surfce pat-surface :offset 4776) + (gspot-slope-z float :offset 4780) + (gspot-slope-x float :offset 4784) + (ctrl-slope-heading float :offset 4788) + (ctrl-slope-z float :offset 4792) + (ctrl-slope-x float :offset 4796) + (unknown-word000 int32 :offset 4800) + (unknown-float002 float :offset 4804) + (unknown-float-n12iuh3n1 float :offset 4808) + (unknown-float-ki1jhbn23hj float :offset 4812) + (time-of-last-lc time-frame :offset 4816) + (low-coverage-pat-next1 pat-surface :offset 4828) + (low-coverage-dist-to-next2 float :offset 4832) + (low-coverage-pat-next2 pat-surface :offset 4836) + (low-coverage-slope-to-next1 float :offset 4824) + (low-coverage-norm-of-next1 vector :inline :offset 4848) + (low-coverage-norm-of-next2 vector :inline :offset 4864) + (low-coverage-overhang-plane-normal vector :inline :offset 4912) + (low-coverage-tangent vector :inline :offset 4928) + (low-coverage-tangent-xz vector :inline :offset 4944) + (btransv vector :inline :offset 4976) + (blocked-factor float :offset 4992) + (blocked-in-air-factor float :offset 4996) + (time-of-last-clear-wall-in-jump time-frame :offset 5000) + (time-of-last-lc-touch-edge time-frame :offset 5008) + (collision-spheres collide-shape-prim-sphere 10 :offset 5016) + (unknown-word02 int32 :offset 5064) + (last-roll-end-time time-frame :offset 5072) + (last-running-attack-end-time time-frame :offset 5080) + (last-hands-attempt-time time-frame :offset 5088) + (last-attack-end-time time-frame :offset 5096) + (last-feet-attempt-time time-frame :offset 5104) + (unknown-time-frame13 time-frame :offset 5112) + (last-time-of-stuck time-frame :offset 5120) + (bend-amount float :offset 5132) + (bend-target float :offset 5136) + (bend-speed float :offset 5140) + (ctrl-to-head-offset vector :inline :offset 5152) + (lhand-cspace cspace :offset 5168) + (rhand-cspace cspace :offset 5172) + (midpoint-of-hands vector :inline :offset 5184) + (ctrl-to-hands-offset vector :inline :offset 5200) + (sidekick-root cspace :inline :offset 5216) + (collide-mode symbol :offset 5248) + (collide-mode-transition float :offset 5252) + (duck-gun-tube-transision float :offset 5256) + (transv-history vector 15 :inline :offset 5264) + (average-xz-vel float :offset 5520) + (idx-of-fastest-xz-vel int32 :offset 5524) + (hand-to-edge-dist float :offset 5528) + (unknown-symbol000 symbol :offset 5532) + (edge-grab-edge-dir vector :inline :offset 5536) + (unknown-vector35 vector :inline :offset 5552) + (edge-grab-across-edge-dir vector :inline :offset 5568) + (last-successful-compute-edge-time time-frame :offset 5584) + (edge-grab-start-time time-frame :offset 5592) + (unknown-handle000 handle :offset 5600) + (anim-handle handle :offset 5608) + (unknown-word04 uint32 :offset 5616) + (unknown-spool-anim00 spool-anim :overlay-at unknown-word04) + (unknown-word05 int32 :overlay-at unknown-spool-anim00) + (unknown-symbol01 symbol :overlay-at unknown-word05) + (unknown-float34 float :overlay-at unknown-symbol01) + (did-move-to-pole-or-max-jump-height float :offset 5620) + (unknown-symbol03 float :offset 5624) + (unknown-float35 float :offset 5628) + (unknown-float36 float :offset 5632) + (unknown-float37 float :offset 5636) + (unknown-vector37 vector :inline :offset 5648) + (unknown-vector38 vector :inline :offset 5664) + (unknown-vector39 vector :inline :offset 5680) + (unknown-vector40 vector :inline :offset 5696) + (sliding-start-time time-frame :offset 5712) + (unknown-time-frame18 time-frame :offset 5720) + (unknown-sound-id00 sound-id :offset 5776) + (lightjak-sound-id sound-id :offset 5780) + (unknown-handle02 handle :offset 5792) + (impact-ctrl impact-control :inline :offset 5824) + (unknown-word06 int32 :offset 5832) + (unknown-vector41 vector :inline :offset 5888) + (last-trans-leaving-surf vector :inline :offset 5904) + (unknown-float38 float :overlay-at (-> last-trans-leaving-surf y)) + (highest-jump-mark vector :inline :offset 5920) + (unknown-float39 float :overlay-at (-> highest-jump-mark y)) + (unknown-time-frame19 time-frame :offset 5936) + (time-of-last-debug-float time-frame :offset 5944) + (danger-mode symbol :offset 5984) + (target-attack-id uint32 :offset 5988) + (attacked-by-id int32 :offset 5992) + (bomb-scale float :offset 5996) + (attack-count uint64 :offset 6000) + (send-attack-dest handle :offset 6008) + (send-attack-time time-frame :offset 6016) + (unknown-combo-tracker00 combo-tracker :inline :offset 6032) + (unknown-time-frame21 time-frame :offset 6072) + (unknown-dword07 int64 :offset 6096) + (unknown-dword08 int64 :offset 6104) + (unknown-dword09 int64 :offset 6112) + (unknown-dword10 int64 :offset 6120) + (jump-kind symbol :offset 6144) + (unknown-quaternion04 quaternion :inline :offset 6160) + (unknown-sound-id01 sound-id :offset 6176) + (unknown-float41 float :offset 6180) + (unknown-float42 float :offset 6184) + (history-idx uint16 :offset 6188) + (history-length uint16 :offset 6190) + (remaining-ctrl-iterations int32 :offset 6192) + (invul1-on-time time-frame :offset 6200) + (invul1-off-time time-frame :offset 6208) + (invul2-on-time time-frame :offset 6216) + (invul2-off-time time-frame :offset 6224) + (unknown-float43 float :offset 6232) + (unknown-float001 float :offset 6236) + (board-jump-and-swim-sound sound-id :offset 6240) + (bubbles-sound sound-id :offset 6244) + (unknown-time-frame26 time-frame :offset 6248) + (unknown-time-frame27 time-frame :offset 6256) + (yellow-eco-last-use-time int64 :offset 6264) + (align-xz-vel vector :inline :offset 6272) + (zx-vel-frac float :offset 6288) + (unknown-sound-id04 sound-id :offset 6292) + (unknown-float45 float :offset 6296) + (default-collide-as-all collide-spec :offset 6300) + (default-collide-as-fgnd collide-spec :offset 6304) + (default-collide-with-all collide-spec :offset 6308) + (default-collide-with-fgnd collide-spec :offset 6312) + (time-of-last-zero-input time-frame :offset 6320) + (time-of-last-nonzero-input time-frame :offset 6328) + (time-between-zero-inputs time-frame :offset 6336) + (time-of-last-debug-heal time-frame :offset 6368) + (last-nonzero-input-dir-targ quaternion :inline :offset 6384) + (time-of-last-wall-hide-first-check-pass time-frame :offset 6400) + (time-of-first-wall-hide-first-check-pass time-frame :offset 6408) + (pad uint8 4) ) ) diff --git a/goal_src/jak3/engine/collide/collide-touch-h.gc b/goal_src/jak3/engine/collide/collide-touch-h.gc index 9b83819d839..2705cd142b8 100644 --- a/goal_src/jak3/engine/collide/collide-touch-h.gc +++ b/goal_src/jak3/engine/collide/collide-touch-h.gc @@ -98,8 +98,8 @@ storing a record of the primitives involved." (get-head (_type_) touching-prims-entry) (get-next (_type_ touching-shapes-entry) touching-prims-entry) (touching-shapes-entry-method-11 () none) - (touching-shapes-entry-method-12 () none) - (touching-shapes-entry-method-13 () none) + (prims-touching? (_type_ collide-shape uint) touching-prims-entry) + (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic) (touching-shapes-entry-method-14 () none) ) ) diff --git a/goal_src/jak3/engine/collide/find-nearest.gc b/goal_src/jak3/engine/collide/find-nearest.gc index 6d237e8230e..20879bccff3 100644 --- a/goal_src/jak3/engine/collide/find-nearest.gc +++ b/goal_src/jak3/engine/collide/find-nearest.gc @@ -7,3 +7,279 @@ ;; DECOMP BEGINS +(deftype search-info (structure) + ((point vector :inline) + (best-point vector :inline) + (match-handle handle) + (match process-focusable) + (best float) + (radius float) + (rating search-info-flag) + (require search-info-flag) + (mask search-info-flag) + (rot-base vector :inline) + (back-point vector :inline) + (rot-range float) + ) + ) + + +(define *search-info* (new 'global 'search-info)) + +;; ERROR: Stack slot load at 720 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 784 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 720 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 784 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 720 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 784 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 720 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 784 mismatch: defined as size 4, got size 16 +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] +(defun find-nearest-focusable ((arg0 (array collide-shape)) + (arg1 vector) + (arg2 float) + (arg3 search-info-flag) + (arg4 search-info-flag) + (arg5 vector) + (arg6 vector) + (arg7 float) + ) + (local-vars + (f0-12 float) + (sv-704 (function float float float)) + (sv-720 float) + (sv-736 vector) + (sv-752 vector) + (sv-768 (function float float float)) + (sv-784 float) + ) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 *search-info*)) + (set! (-> gp-0 match) #f) + (set! (-> gp-0 point quad) (-> arg1 quad)) + (set! (-> gp-0 radius) arg2) + (set! (-> gp-0 best) 1000000000000000000000.0) + (set! (-> gp-0 rating) (search-info-flag)) + (set! (-> gp-0 require) arg4) + (set! (-> gp-0 mask) arg3) + (set! (-> gp-0 rot-base quad) (-> arg5 quad)) + (if arg6 + (set! (-> gp-0 back-point quad) (-> arg6 quad)) + (set! (-> gp-0 back-point quad) (-> gp-0 rot-base quad)) + ) + (set! arg7 (cond + ((= arg7 65536.0) + -2.0 + ) + (else + (empty) + arg7 + ) + ) + ) + (set! (-> gp-0 rot-range) arg7) + (let ((s4-0 (-> arg0 length))) + (while (begin (label cfg-104) (nonzero? s4-0)) + (+! s4-0 -1) + (let* ((s0-0 (-> arg0 s4-0)) + (s2-0 (-> s0-0 process)) + (s3-0 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when s3-0 + (let ((s1-0 (process-mask->search-info-flag (the-as process-focusable s3-0)))) + (when (and (and s3-0 (not (logtest? (-> (the-as process-focusable s3-0) focus-status) (focus-status disable dead)))) + (logtest? s1-0 (search-info-flag crate guard attackable enemy attackable-priority high-priority)) + ) + (let* ((s2-1 (get-trans (the-as process-focusable s3-0) 3)) + (f30-0 (- (vector-vector-distance (-> gp-0 point) s2-1) (-> s2-1 w))) + ) + (when (nonzero? (-> s0-0 root-prim prim-core collide-as)) + (let ((s0-1 (search-info-flag))) + 0.0 + (set! sv-736 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s2-1 (-> gp-0 point)) 1.0)) + (let ((f28-0 (cond + ((logtest? (-> gp-0 mask) (search-info-flag prefer-xz)) + (set! sv-704 deg-diff) + (set! sv-720 (vector-y-angle (-> gp-0 rot-base))) + (let ((a1-6 (vector-y-angle sv-736))) + (fabs (sv-704 sv-720 a1-6)) + ) + ) + ((logtest? (-> gp-0 mask) (search-info-flag prefer-angle)) + (- -9999.0 (vector-dot sv-736 (-> gp-0 rot-base))) + ) + ((logtest? (search-info-flag prefer-center) (-> gp-0 mask)) + (* f30-0 (fmax 0.01 (- 1.0 (vector-dot sv-736 (-> gp-0 rot-base))))) + ) + (else + f30-0 + ) + ) + ) + ) + (cond + ((logtest? (-> gp-0 mask) (search-info-flag cull-angle-simple)) + (let* ((v1-41 (-> gp-0 rot-base)) + ; (f0-11 (-> sv-736 x)) + ; (f1-6 (-> sv-736 y)) + ; (f2-2 (-> sv-736 z)) + ; (f3-0 (-> v1-41 x)) + ; (f4-0 (-> v1-41 y)) + ; (f5-0 (-> v1-41 z)) + ) + ;; og:preserve-this + ; (.mula.s f0-11 f3-0) + ; (.madda.s f1-6 f4-0) + ; (.madd.s f0-12 f2-2 f5-0) + (set! f0-12 (vector-dot sv-736 v1-41)) + ) + (if (< f0-12 (cos (-> gp-0 rot-range))) + (return (the-as process-focusable #f)) + ) + ) + ((logtest? (-> gp-0 mask) (search-info-flag cull-angle)) + (cond + ((< (-> gp-0 rot-range) 14563.556) + (let ((f26-1 (vector-dot (vector-! (new 'stack-no-clear 'vector) s2-1 (-> gp-0 point)) (-> gp-0 rot-base)))) + (set! sv-752 (new 'stack-no-clear 'vector)) + (let ((v1-53 (-> gp-0 point)) + (a0-27 (-> gp-0 rot-base)) + (f0-17 f26-1) + ) + (.lvf vf2 (&-> a0-27 quad)) + (.lvf vf1 (&-> v1-53 quad)) + (let ((v1-54 f0-17)) + (.mov vf3 v1-54) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> sv-752 quad) vf4) + (let ((f26-2 (* f26-1 (tan (-> gp-0 rot-range)))) + (t9-10 vector-vector-distance) + (a1-8 s2-1) + ) + (if (< f26-2 (- (t9-10 sv-752 a1-8) (-> s2-1 w))) + (goto cfg-104) + ) + ) + ) + ) + (else + (if (< (vector-dot sv-736 (-> gp-0 rot-base)) (cos (-> gp-0 rot-range))) + (return (the-as process-focusable #f)) + ) + ) + ) + ) + ((logtest? (-> gp-0 mask) (search-info-flag cull-xz)) + (let ((f26-4 (-> gp-0 rot-range))) + (set! sv-768 deg-diff) + (set! sv-784 (vector-y-angle (-> gp-0 rot-base))) + (let ((a1-9 (vector-y-angle sv-736))) + (if (< f26-4 (fabs (sv-768 sv-784 a1-9))) + (goto cfg-104) + ) + ) + ) + ) + ) + (when (logtest? (-> gp-0 mask) (search-info-flag back-point)) + (if (< (vector-dot + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s2-1 (-> gp-0 back-point)) 1.0) + (-> gp-0 rot-base) + ) + 0.0 + ) + (goto cfg-104) + ) + ) + (when (logtest? (-> gp-0 mask) (search-info-flag combo)) + (if (not (send-event s3-0 'combo)) + (goto cfg-104) + ) + ) + (if (logtest? s1-0 (search-info-flag high-priority)) + (set! s0-1 (the-as search-info-flag (logior (the-as int s0-1) (search-info-flag high-priority)))) + ) + (if (logtest? s1-0 (search-info-flag guard enemy attackable-priority high-priority)) + (set! s0-1 (the-as search-info-flag (logior (the-as int s0-1) (search-info-flag enemy)))) + ) + (if (logtest? s1-0 (search-info-flag attackable)) + (set! s0-1 (the-as search-info-flag (logior (the-as int s0-1) (search-info-flag attackable)))) + ) + (if (logtest? s1-0 (search-info-flag crate)) + (set! s0-1 (the-as search-info-flag (logior (the-as int s0-1) (search-info-flag crate)))) + ) + (if (and (nonzero? (-> s3-0 draw)) (logtest? (-> s3-0 draw status) (draw-control-status on-screen))) + (set! s0-1 (the-as search-info-flag (logior (the-as int s0-1) (search-info-flag on-screen)))) + ) + (let ((s1-1 (the-as search-info-flag (logand (the-as int s0-1) (-> gp-0 mask))))) + (when (and (>= (the-as int s1-1) (the-as int (-> gp-0 rating))) + (or (zero? (-> gp-0 require)) (logtest? (the-as int s1-1) (-> gp-0 require))) + (or (and (logtest? (the-as int s1-1) (search-info-flag high-priority)) + (not (logtest? (-> gp-0 rating) (search-info-flag high-priority))) + ) + (and (logtest? (the-as int s1-1) (search-info-flag high-priority)) + (logtest? (-> gp-0 rating) (search-info-flag high-priority)) + (< f28-0 (-> gp-0 best)) + ) + (< f28-0 (-> gp-0 best)) + ) + (< f30-0 (-> gp-0 radius)) + ) + (when (logtest? (search-info-flag probe) (-> gp-0 mask)) + (let ((a1-13 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-13 start-pos quad) (-> gp-0 back-point quad)) + (vector-! (-> a1-13 move-dist) s2-1 (-> gp-0 back-point)) + (let ((v1-124 a1-13)) + (set! (-> v1-124 radius) 1228.8) + (set! (-> v1-124 collide-with) (collide-spec backgnd)) + (set! (-> v1-124 ignore-process0) pp) + (set! (-> v1-124 ignore-process1) #f) + (set! (-> v1-124 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-124 action-mask) (collide-action solid)) + ) + (let ((f0-34 (fill-and-probe-using-line-sphere *collide-cache* a1-13))) + (if (and (>= f0-34 0.0) (< f0-34 1.0)) + (goto cfg-104) + ) + ) + ) + ) + (set! (-> gp-0 match) (the-as process-focusable s3-0)) + (set! (-> gp-0 best) f28-0) + (set! (-> gp-0 rating) (the-as search-info-flag s1-1)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (-> gp-0 match) + ) + ) + ) + ) diff --git a/goal_src/jak3/engine/common-obs/cloth-art-h.gc b/goal_src/jak3/engine/common-obs/cloth-art-h.gc index 0c628d40aa7..c7a25ab30ba 100644 --- a/goal_src/jak3/engine/common-obs/cloth-art-h.gc +++ b/goal_src/jak3/engine/common-obs/cloth-art-h.gc @@ -133,9 +133,12 @@ ) ) -(defmacro static-cloth-params (args) +(defmacro static-cloth-params (ag-name args) `(let ((parms (new 'static 'cloth-params))) - ,@(apply (lambda (x) `(set! (-> parms ,(car x)) ,(cadr x))) args) + ,@(apply (lambda (x) (if (and (eq? (car x) 'mesh) (not (integer? (cadr x)))) + `(set! (-> parms ,(car x)) ,(art-elt-index ag-name (cadr x))) + `(set! (-> parms ,(car x)) ,(cadr x)) + )) args) parms ) ) diff --git a/goal_src/jak3/engine/common-obs/collectables.gc b/goal_src/jak3/engine/common-obs/collectables.gc index 6fa9e259dfe..2d16c97c11b 100644 --- a/goal_src/jak3/engine/common-obs/collectables.gc +++ b/goal_src/jak3/engine/common-obs/collectables.gc @@ -5,5 +5,3037 @@ ;; name in dgo: collectables ;; dgos: GAME +;; +++collectable-flag +(defenum collectable-flag + :type uint32 + :bitfield #t + (bounce 0) ;; 1 + (fadeout 1) ;; 2 + (pickup 2) ;; 4 + (do-fadeout 3) ;; 8 + (suck-in 4) ;; 16 + (no-eco-blue 5) ;; 32 + (no-bob 6) ;; 64 + (no-distance-check-fadeout 7) ;; 128 + ) +;; ---collectable-flag + + +(declare-type collectable process-drawable) +(declare-type eco collectable) +(declare-type ammo collectable) +(define-extern process-contact-action (function process none :behavior target)) +(define-extern eco-blue-glow (function vector none)) + ;; DECOMP BEGINS +(defskelgroup skel-health collectables collectables-health-lod0-jg collectables-health-idle-ja + ((collectables-health-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + ) + +(defskelgroup skel-gem collectables collectables-gem-lod0-jg collectables-gem-idle-ja + ((collectables-gem-lod0-mg (meters 20)) (collectables-gem-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.6) + :texture-level 10 + ) + +(defskelgroup skel-gun-yellow-up yellow-barrel yellow-barrel-lod0-jg yellow-barrel-idle-ja + ((yellow-barrel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :shadow-joint-index 3 + ) + +(defskelgroup skel-gun-dark-up dark-barrel 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :shadow-joint-index 3 + ) + +(defskelgroup skel-skill collectables collectables-skill-lod0-jg collectables-skill-idle-ja + ((collectables-skill-lod0-mg (meters 20)) + (collectables-skill-lod1-mg (meters 40)) + (collectables-skill-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 0.6) + :shadow collectables-skill-shadow-mg + :texture-level 10 + :origin-joint-index 3 + ) + +(deftype collectable (process-drawable) + ((root collide-shape-moving :override) + (pickup-type pickup-type) + (pickup-amount float) + (notify handle) + (old-base vector :inline) + (base vector :inline) + (extra-trans vector :inline) + (jump-pos vector :inline) + (flags collectable-flag) + (birth-time time-frame) + (collect-timeout time-frame) + (fadeout-timeout time-frame) + (bob-offset uint64) + (bob-amount float) + (pickup-handle handle) + (actor-pause symbol) + (collect-effect sparticle-launch-group) + (collect-effect2 sparticle-launch-group) + (target handle) + (suck-time time-frame) + (suck-y-offset float) + (speed vector :inline) + (movie-pos-index int32) + ) + (:state-methods + blocked + wait + deploy + (suck handle) + jump + fade + (pickup symbol handle) + die + (notice-blue handle) + ) + (:methods + (init-common (_type_ entity-actor pickup-type float) none) + (initialize-effects (_type_ pickup-type) none) + (go-to-initial-state (_type_) object) + (initialize-options (_type_ int float fact-info) collectable) + (initialize-allocations (_type_) none) + (common-post (_type_) none) + (do-pickup (_type_ handle) none) + ) + ) + + +(defmethod go-to-initial-state ((this collectable)) + (cond + ((logtest? (-> this fact options) (actor-option wait-for-task-complete)) + (go (method-of-object this blocked)) + ) + ((logtest? (-> this flags) (collectable-flag bounce)) + (go (method-of-object this deploy)) + ) + (else + (go (method-of-object this wait)) + ) + ) + ) + +(defmethod initialize-options ((this collectable) (arg0 int) (arg1 float) (arg2 fact-info)) + (logclear! (-> this mask) (process-mask crate enemy platform ambient)) + (logior! (-> this mask) (process-mask collectable)) + (set! (-> this flags) (collectable-flag pickup no-eco-blue)) + (set! (-> this bob-amount) arg1) + (set! (-> this bob-offset) (the-as uint (+ (the-as int (-> this root trans x)) + (the-as int (-> this root trans y)) + (the-as int (-> this root trans z)) + ) + ) + ) + (cond + ((or (= (vector-length (-> this root transv)) 0.0) + (logtest? (-> this fact options) (actor-option auto-pickup)) + ) + (vector-reset! (-> this root transv)) + ) + (else + (logior! (-> this flags) (collectable-flag bounce)) + (logclear! (-> this flags) (collectable-flag pickup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this bob-amount) 0.0) + ) + ) + (when (> arg0 0) + (logior! (-> this flags) (collectable-flag fadeout)) + (set! (-> this fadeout-timeout) (the-as time-frame arg0)) + (if (logtest? (actor-option no-distance-check-fadeout) (-> arg2 options)) + (logior! (-> this flags) (collectable-flag no-distance-check-fadeout)) + ) + ) + (set! (-> this collect-timeout) (seconds 0.33)) + (set-time! (-> this birth-time)) + (set! (-> this base quad) (-> this root trans quad)) + (set! (-> this old-base quad) (-> this root trans quad)) + (set! (-> this pickup-handle) (the-as handle #f)) + (case (-> this fact pickup-type) + (((pickup-type eco-pill-green) + (pickup-type eco-pill-dark) + (pickup-type eco-pill-light) + (pickup-type eco-green) + (pickup-type money) + (pickup-type gem) + (pickup-type skill) + (pickup-type eco-blue) + (pickup-type health) + (pickup-type trick-point) + ) + (logclear! (-> this flags) (collectable-flag no-eco-blue)) + ) + ) + (if (logtest? (-> this fact options) (actor-option big-collision)) + (set! (-> this root root-prim local-sphere w) (* 2.5 (-> this root root-prim local-sphere w))) + ) + (when (and arg2 (nonzero? (-> this draw))) + (let* ((s5-0 (-> arg2 process)) + (v1-56 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (if v1-56 + (set! (-> this draw light-index) (-> (the-as process-drawable v1-56) draw light-index)) + ) + ) + ) + this + ) + +(defmethod initialize-allocations ((this collectable)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-11 local-sphere) 0.0 3276.8 0.0 3276.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-11) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-14 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + 0 + (none) + ) + +;; WARN: Return type mismatch ambient-sound vs none. +(defmethod initialize-effects ((this collectable) (arg0 pickup-type)) + (let ((s5-0 (the-as sparticle-launch-group #f)) + (s4-0 (the-as sound-spec #f)) + ) + (set! (-> this fact pickup-type) arg0) + (case (-> this fact pickup-type) + (((pickup-type eco-blue) + (pickup-type eco-red) + (pickup-type eco-green) + (pickup-type eco-yellow) + (pickup-type health) + (pickup-type eco-pill-dark) + (pickup-type eco-pill-light) + (pickup-type trick-point) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + ) + ) + (case arg0 + (((pickup-type eco-yellow)) + (set! s5-0 (-> *part-group-id-table* 164)) + (set! (-> this collect-effect) (-> *part-group-id-table* 170)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 165)) + (set! s4-0 (static-sound-spec "yel-eco-idle" :group 1 :fo-max 15)) + ) + (((pickup-type eco-red)) + (set! s5-0 (-> *part-group-id-table* 158)) + (set! (-> this collect-effect) (-> *part-group-id-table* 171)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 159)) + (set! s4-0 (static-sound-spec "red-eco-idle" :group 1 :fo-max 15)) + ) + (((pickup-type eco-blue)) + (set! s5-0 (-> *part-group-id-table* 154)) + (set! (-> this collect-effect) (-> *part-group-id-table* 169)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 155)) + (set! s4-0 (static-sound-spec "blue-eco-idle" :group 1 :fo-max 15)) + ) + (((pickup-type eco-green)) + (set! s5-0 (-> *part-group-id-table* 129)) + (set! (-> this collect-effect) (-> *part-group-id-table* 141)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 124)) + (set! s4-0 (static-sound-spec "green-eco-idle" :group 1 :fo-max 15)) + ) + (((pickup-type health)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-health" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-37 (-> this root root-prim local-sphere))) + (set! (-> v1-37 y) 2457.6) + (set! (-> v1-37 w) 4096.0) + ) + (set! (-> this collect-effect) (-> *part-group-id-table* 141)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 124)) + (set! s4-0 (static-sound-spec "green-eco-idle" :group 1 :fo-max 15)) + ) + (((pickup-type eco-pill-green)) + (set! s5-0 (-> *part-group-id-table* 125)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 126)) + ) + (((pickup-type eco-pill-dark)) + (set! s5-0 (-> *part-group-id-table* 128)) + (set! (-> this collect-effect) (-> *part-group-id-table* 140)) + ) + (((pickup-type eco-pill-light)) + (set! s5-0 (-> *part-group-id-table* 127)) + (set! (-> this collect-effect) (-> *part-group-id-table* 127)) + ) + ) + (if s5-0 + (set! (-> this part) (create-launch-control s5-0 this)) + ) + (if s4-0 + (set! (-> this sound) (new 'process 'ambient-sound s4-0 (-> this root trans) 0.0)) + ) + ) + (none) + ) + +(defbehavior initialize-eco-by-other eco ((arg0 vector) (arg1 vector) (arg2 fact-info)) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (case (-> self fact pickup-type) + (((pickup-type eco-blue) (pickup-type eco-yellow) (pickup-type eco-red)) + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 0 + ) + 1024.0 + arg2 + ) + ) + (else + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 4500 + ) + 1024.0 + arg2 + ) + ) + ) + (update-transforms (-> self root)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-common ((this collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> this pickup-amount) arg2) + (set! (-> this pickup-type) arg1) + (initialize-allocations this) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (initialize-effects this (-> this fact pickup-type)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (if (logtest? (-> this fact options) (actor-option wait-for-task-complete)) + (go (method-of-object this blocked)) + ) + (go-to-initial-state this) + (none) + ) + +(defmethod common-post ((this collectable)) + (let ((s5-0 (-> this part)) + (s4-0 (-> this root root-prim prim-core)) + ) + (if (nonzero? (-> this draw)) + (ja-post) + ) + (if (nonzero? s5-0) + (spawn s5-0 (the-as vector s4-0)) + ) + ) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) + ) + 0 + (none) + ) + +(defmethod do-pickup ((this collectable) (arg0 handle)) + (set! (-> this pickup-handle) arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((v1-3 (-> this root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) + ) + (if (nonzero? (-> this draw)) + (logior! (-> this draw status) (draw-control-status no-draw)) + ) + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + (case (-> this fact pickup-type) + (((pickup-type eco-yellow)) + (sound-play "y-eco-pickup") + ) + (((pickup-type eco-red)) + (sound-play "r-eco-pickup") + ) + (((pickup-type eco-blue)) + (sound-play "b-eco-pickup") + ) + (((pickup-type eco-green) (pickup-type health)) + (sound-play "g-eco-pickup") + (+! (-> *game-info* health-collected) 1.0) + ) + (((pickup-type eco-pill-green)) + (sound-play "pill-pickup") + ) + (((pickup-type eco-pill-dark)) + (sound-play "pill-pickup") + (when (>= (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) + (set! (-> this collect-effect) (the-as sparticle-launch-group 0)) + (set! (-> this collect-effect2) (the-as sparticle-launch-group 0)) + 0 + ) + ) + (((pickup-type eco-pill-light)) + (sound-play "pill-pickup") + (when (>= (-> *game-info* eco-pill-light) (-> *FACT-bank* eco-pill-light-max-default)) + (set! (-> this collect-effect) (the-as sparticle-launch-group 0)) + (set! (-> this collect-effect2) (the-as sparticle-launch-group 0)) + 0 + ) + ) + (((pickup-type fuel-cell)) + (sound-play "pu-powercell") + ) + (((pickup-type ammo-yellow) + (pickup-type ammo-red) + (pickup-type ammo-blue) + (pickup-type ammo-dark) + (pickup-type gun-red-1) + (pickup-type gun-red-2) + (pickup-type gun-red-3) + (pickup-type gun-yellow-1) + (pickup-type gun-yellow-2) + (pickup-type gun-yellow-3) + (pickup-type gun-blue-1) + (pickup-type gun-blue-2) + (pickup-type gun-blue-3) + (pickup-type gun-dark-1) + (pickup-type gun-dark-2) + (pickup-type gun-dark-3) + (pickup-type board) + ) + (sound-play "ammo-pickup") + ) + (((pickup-type skill)) + (talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (let ((s5-1 (handle->process arg0))) + (when s5-1 + (when (nonzero? (-> this collect-effect)) + (cond + ((logtest? (-> this collect-effect flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (let ((s4-10 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s4-10 + (let ((t9-23 (method-of-type part-tracker-subsampler activate))) + (t9-23 (the-as part-tracker-subsampler s4-10) s5-1 "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-24 run-function-in-process) + (a0-77 s4-10) + (a1-33 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> this collect-effect)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) part-tracker-track-target) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-24) a0-77 a1-33 *part-tracker-subsampler-params-default*) + ) + (-> s4-10 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (let ((s4-11 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s4-11 + (let ((t9-26 (method-of-type part-tracker activate))) + (t9-26 (the-as part-tracker s4-11) s5-1 "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-27 run-function-in-process) + (a0-84 s4-11) + (a1-36 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> this collect-effect)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) part-tracker-track-target) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-27) a0-84 a1-36 *part-tracker-params-default*) + ) + (-> s4-11 ppointer) + ) + ) + ) + ) + ) + (when (nonzero? (-> this collect-effect2)) + (cond + ((logtest? (-> this collect-effect2 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-2 + (let ((t9-29 (method-of-type part-tracker-subsampler activate))) + (t9-29 (the-as part-tracker-subsampler s5-2) this "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-30 run-function-in-process) + (a0-91 s5-2) + (a1-39 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> this collect-effect2)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) + (lambda ((arg0 part-tracker)) + (let ((v1-1 (handle->process (-> arg0 userdata)))) + (when (the-as process v1-1) + (let* ((s5-0 (handle->process (-> (the-as collectable v1-1) pickup-handle))) + (a0-9 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (a2-0 (if (not a0-9) + (-> arg0 root trans) + (get-trans (the-as process-focusable a0-9) 3) + ) + ) + ) + (vector-lerp! + (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (/ (the float (- (current-time) (-> arg0 state-time))) (the float (-> arg0 part group duration))) + ) + ) + ) + ) + ) + ) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint (process->handle this))) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-30) a0-91 a1-39 *part-tracker-subsampler-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (let ((s5-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-3 + (let ((t9-32 (method-of-type part-tracker activate))) + (t9-32 (the-as part-tracker s5-3) this "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-33 run-function-in-process) + (a0-98 s5-3) + (a1-42 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> this collect-effect2)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) + (lambda ((arg0 part-tracker)) + (let ((v1-1 (handle->process (-> arg0 userdata)))) + (when (the-as process v1-1) + (let* ((s5-0 (handle->process (-> (the-as collectable v1-1) pickup-handle))) + (a0-9 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (a2-0 (if (not a0-9) + (-> arg0 root trans) + (get-trans (the-as process-focusable a0-9) 3) + ) + ) + ) + (vector-lerp! + (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (/ (the float (- (current-time) (-> arg0 state-time))) (the float (-> arg0 part group duration))) + ) + ) + ) + ) + ) + ) + (set! (-> *part-tracker-params-default* userdata) (the-as uint (process->handle this))) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-33) a0-98 a1-42 *part-tracker-params-default*) + ) + (-> s5-3 ppointer) + ) + ) + ) + ) + ) + ) + ) + (send-event (handle->process (-> this notify)) 'notify 'pickup) + 0 + (none) + ) + +(defun add-blue-shake ((arg0 vector) (arg1 vector) (arg2 vector)) + (let* ((f0-0 (vector-vector-distance arg1 arg2)) + (f30-0 (lerp-scale 409.6 0.0 f0-0 (-> *FACT-bank* suck-suck-dist) (-> *FACT-bank* suck-bounce-dist))) + ) + (+! (-> arg0 x) (rand-vu-float-range (- f30-0) f30-0)) + (+! (-> arg0 y) (rand-vu-float-range (- f30-0) f30-0)) + (+! (-> arg0 z) (rand-vu-float-range (- f30-0) f30-0)) + ) + arg0 + ) + +(defbehavior check-blue-suck eco ((arg0 process-drawable)) + (let ((v1-0 (if (type? arg0 process-drawable) + arg0 + ) + ) + ) + (when v1-0 + (let* ((gp-1 (-> v1-0 root)) + (v1-1 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (when v1-1 + (let ((a0-5 (-> self root root-prim prim-core)) + (a1-2 (-> (the-as collide-shape v1-1) root-prim prim-core)) + ) + (when (< (vector-vector-distance (the-as vector a0-5) (the-as vector a1-2)) (-> *FACT-bank* suck-suck-dist)) + (logior! (-> self flags) (collectable-flag suck-in)) + #t + ) + ) + ) + ) + ) + ) + ) + +(defbehavior add-blue-motion eco ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 symbol)) + (let* ((gp-0 (handle->process (-> self target))) + (s1-0 (if (type? gp-0 process-drawable) + (the-as process-focusable gp-0) + ) + ) + ) + (when s1-0 + (let ((s4-0 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when s4-0 + (let ((s1-1 (-> self root root-prim prim-core)) + (gp-1 (get-trans s4-0 3)) + ) + (if (and arg1 (rand-vu-percent? 0.25)) + (eco-blue-glow (the-as vector s1-1)) + ) + (let ((f0-0 (vector-vector-distance (the-as vector s1-1) gp-1))) + (cond + ((and arg3 (< f0-0 8192.0)) + (return #t) + ) + ((begin + (set! arg0 + (and (or (not arg2) + (or (< f0-0 (-> *FACT-bank* suck-suck-dist)) (logtest? (-> self flags) (collectable-flag suck-in))) + ) + arg0 + ) + ) + arg0 + ) + (logior! (-> self flags) (collectable-flag suck-in)) + (when (= (-> self speed w) 0.0) + (set-time! (-> self suck-time)) + (set! (-> self speed x) (rand-vu-float-range 327680.0 819200.0)) + ) + (+! (-> self speed w) + (* (lerp-scale 40960.0 (-> self speed x) (the float (- (current-time) (-> self suck-time))) 45.0 60.0) + (seconds-per-frame) + ) + ) + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> self base) gp-1))) + (vector-normalize! s5-2 (fmax + (if (focus-test? s4-0 pilot) + -4096.0 + 0.0 + ) + (- (vector-length s5-2) (* (-> self speed w) (seconds-per-frame))) + ) + ) + (when (< (vector-length s5-2) 81920.0) + (+! (-> self speed y) (* 72817.78 (seconds-per-frame))) + (set! (-> self speed y) (fmin (fmin 291271.12 (-> self speed y)) (-> self speed y))) + (vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (seconds-per-frame))) + ) + (set! (-> self suck-y-offset) + (* 2048.0 (sin (* 873.81335 (the float (mod (- (current-time) (-> self suck-time)) 75))))) + ) + (vector+! (-> self base) gp-1 s5-2) + ) + ) + ((and arg2 (and (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) + (not (logtest? (-> self flags) (collectable-flag suck-in))) + ) + ) + (go-virtual wait) + ) + (arg1 + (add-blue-shake (-> self root trans) (the-as vector s1-1) gp-1) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +(defbehavior collectable-standard-event-handler collectable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-4 object)) + (when (and (or (= arg2 'touch) (= arg2 'attack)) + (or (logtest? (-> self flags) (collectable-flag pickup)) + (and (-> self next-state) (= (-> self next-state name) 'deploy)) + (< (-> self clock clock-ratio) 1.0) + ) + (and (time-elapsed? + (-> self birth-time) + (the int (* 2.0 (-> self clock clock-ratio) (the float (-> self collect-timeout)))) + ) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (-> *setting-control* user-current pickups) + (send-event arg0 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-contact-action arg0) + (go-virtual pickup #f (process->handle arg0)) + ) + (cond + ((= arg2 'trans) + (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (update-transforms (-> self root)) + (ja-post) + ) + ((= arg2 'jump) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self jump-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (go-virtual jump) + ) + ((= arg2 'pickup) + (when (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (if (and (> arg1 0) (-> arg3 param 0)) + (move-to-point! (-> self root) (the-as vector (-> arg3 param 0))) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-contact-action arg0) + (go-virtual pickup #f (the-as handle #f)) + ) + ) + ((= arg2 'suck) + (when (not (and (-> self next-state) (let ((v1-69 (-> self next-state name))) + (or (= v1-69 'suck) (= v1-69 'pickup)) + ) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual suck (process->handle (the-as process (-> arg3 param 0)))) + ) + ) + ((= arg2 'die) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual die) + ) + ((= arg2 'movie-pos) + (set! v0-4 (-> arg3 param 0)) + (set! (-> self movie-pos-index) (the-as int v0-4)) + v0-4 + ) + ((= arg2 'actor-pause) + (cond + ((-> arg3 param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (set! v0-4 #t) + (set! (-> self actor-pause) (the-as symbol v0-4)) + v0-4 + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + ((= arg2 'fade) + (logior! (-> self flags) (collectable-flag fadeout)) + (set! (-> self fadeout-timeout) (seconds 0.1)) + (set! v0-4 (current-time)) + (set! (-> self birth-time) (the-as time-frame v0-4)) + v0-4 + ) + ((= arg2 'anim) + (cond + ((-> arg3 param 0) + (set! v0-4 (logclear (-> self flags) (collectable-flag no-bob))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + (else + (set! v0-4 (logior (-> self flags) (collectable-flag no-bob))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + ) + v0-4 + ) + ((= arg2 'collide-shape) + (cond + ((-> arg3 param 0) + (let ((v1-106 (-> self root root-prim))) + (set! (-> v1-106 prim-core collide-as) (-> self root backup-collide-as)) + (set! v0-4 (-> self root backup-collide-with)) + (set! (-> v1-106 prim-core collide-with) (the-as collide-spec v0-4)) + ) + v0-4 + ) + (else + (let ((v1-108 (-> self root root-prim))) + (set! (-> v1-108 prim-core collide-as) (collide-spec)) + (set! (-> v1-108 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + ((= arg2 'get-notify) + (cond + ((= (-> arg3 param 0) #t) + (let ((v1-112 (ppointer->process (-> self parent)))) + (cond + ((logtest? (-> v1-112 mask) (process-mask process-tree)) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (process->handle v1-112)) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) + ) + ) + ((= (-> arg3 param 0) #f) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (process->handle (the-as process (-> arg3 param 0)))) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) + ) + ((= arg2 'effect) + (when (not (-> arg3 param 0)) + (set! (-> self collect-effect) (the-as sparticle-launch-group 0)) + (set! (-> self collect-effect2) (the-as sparticle-launch-group 0)) + 0 + ) + ) + ) + ) + +(defstate blocked (collectable) + :virtual #t + :trans (behavior () + (if (task-complete? *game-info* (-> self entity extra perm task)) + (go-virtual wait) + ) + ) + :code sleep-code + ) + +(defstate jump (collectable) + :virtual #t + :code (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (new 'stack 'trajectory) + (set! (-> self base y) (-> self jump-pos y)) + (let ((t9-1 (method-of-type trajectory trajectory-method-12))) + (-> self root trans) + (-> self jump-pos) + #x43960000 + -1072586060 + (t9-1) + ) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) + (the float (- (current-time) (-> self state-time))) + (let ((t9-2 (method-of-type trajectory trajectory-method-9))) + (-> self root trans) + (t9-2) + ) + (transform-post) + (common-post self) + (suspend) + (if (nonzero? (-> self skel)) + (ja :num! (loop! 0.5)) + ) + ) + (set! (-> self root trans quad) (-> self jump-pos quad)) + (set! (-> self base quad) (-> self root trans quad)) + (vector-reset! (-> self root transv)) + (update-transforms (-> self root)) + (logclear! (-> self flags) (collectable-flag bounce)) + (logior! (-> self flags) (collectable-flag pickup)) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (go-virtual wait) + ) + ) + +(defstate deploy (collectable) + :virtual #t + :event collectable-standard-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (case (-> self pickup-type) + (((pickup-type gem)) + (sound-play "gem-spawn") + ) + (((pickup-type eco-pill-dark) (pickup-type eco-pill-light)) + (sound-play "pill-spawn") + ) + ) + (if (and (logtest? (-> self fact options) (actor-option suck-in)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + *target* + (not (focus-test? *target* dead)) + (-> *setting-control* user-current pickups) + ) + (go-virtual suck (process->handle *target*)) + ) + ) + :exit (behavior () + (vector-reset! (-> self root transv)) + (logclear! (-> self flags) (collectable-flag bounce)) + (logior! (-> self flags) (collectable-flag pickup)) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (set! (-> self base quad) (-> self root trans quad)) + (logclear! (-> self root root-prim prim-core action) (collide-action solid)) + (set! (-> self root root-prim prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set! (-> self root root-prim prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + ) + :trans (behavior () + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (let ((t9-2 (method-of-object (-> self root) collide-shape-moving-method-57))) + (-> self root transv) + (t9-2) + ) + (when (and (>= 0.0 (-> self root transv y)) (>= (-> self base y) (-> self root trans y))) + (set! (-> self root trans y) (-> self base y)) + (cond + ((< (-> self root transv y) -8192.0) + (set! (-> self root transv y) (* -0.5 (-> self root transv y))) + ) + (else + (if (and (logtest? (-> self fact options) (actor-option suck-in)) + (not (logtest? (-> self flags) (collectable-flag no-eco-blue))) + ) + (go-virtual notice-blue (process->handle *target*)) + ) + (when (and (logtest? (-> self fact options) (actor-option auto-pickup suck-in)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (-> *setting-control* user-current pickups) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (process-contact-action *target*) + (go-virtual pickup #f (process->handle *target*)) + ) + (go-virtual wait) + ) + ) + ) + ) + :code (behavior () + (until #f + (common-post self) + (suspend) + ) + #f + ) + ) + +(defstate suck (collectable) + :virtual #t + :event collectable-standard-event-handler + :enter (behavior ((arg0 handle)) + (sound-play "pickup-suck") + (set! (-> self target) arg0) + (set! (-> self speed quad) (the-as uint128 0)) + (set! (-> self speed z) (if (rand-vu-percent? 0.5) + 1.0 + -1.0 + ) + ) + (set! (-> self suck-y-offset) 0.0) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self flags) (collectable-flag pickup suck-in)) + ) + :code (behavior ((arg0 handle)) + (until #f + (if (and *target* (focus-test? *target* dead)) + (go-virtual fade) + ) + (set! (-> self root trans quad) (-> self base quad)) + (add-blue-motion #t #f #f #f) + (update-transforms (-> self root)) + (common-post self) + (suspend) + ) + #f + ) + ) + +(defstate wait (collectable) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('eco-blue) + (when (and (not (logtest? (-> self flags) (collectable-flag do-fadeout no-eco-blue))) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (and (if (and (check-blue-suck (the-as process-drawable proc)) (-> *setting-control* user-current pickups)) + (go-virtual suck (process->handle proc)) + ) + (logtest? (-> self flags) (collectable-flag pickup)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual notice-blue (process->handle proc)) + ) + ) + (else + (collectable-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (when (and (logtest? (-> self fact options) (actor-option auto-pickup suck-in)) + (logtest? (-> self flags) (collectable-flag pickup)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (-> *setting-control* user-current pickups) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (process-contact-action *target*) + (go-virtual pickup #f (process->handle *target*)) + ) + ) + :code (behavior () + (until #f + (if (and (logtest? (-> self flags) (collectable-flag fadeout)) + (begin + (if (movie?) + (set-time! (-> self birth-time)) + ) + (time-elapsed? (-> self birth-time) (-> self fadeout-timeout)) + ) + (or (or (not *target*) (or (< 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (focus-test? *target* teleporting) + ) + ) + (logtest? (-> self flags) (collectable-flag no-distance-check-fadeout)) + ) + ) + (go-virtual fade) + ) + (common-post self) + (suspend) + ) + #f + ) + ) + +(defstate fade (collectable) + :virtual #t + :event collectable-standard-event-handler + :code (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + (logior! (-> self flags) (collectable-flag do-fadeout)) + (logior! (-> self state-flags) (state-flags sf0)) + (let ((gp-0 (current-time))) + (until #f + (let ((f0-1 (- 300.0 (the float (- (current-time) gp-0))))) + (cond + ((< f0-1 0.0) + (process-entity-status! self (entity-perm-status dead) #t) + (if (nonzero? (-> self notify)) + (send-event (handle->process (-> self notify)) 'notify 'die) + ) + (deactivate self) + ) + (else + (if (nonzero? (-> self part)) + (set! (-> self part fade) (* 0.0033333334 f0-1)) + ) + (when (nonzero? (-> self draw)) + (logior! (-> self draw status) (draw-control-status force-fade)) + (set! (-> self draw force-fade) (the-as uint (max 0 (min 128 (the int (* 0.42666668 f0-1)))))) + ) + ) + ) + ) + (common-post self) + (suspend) + ) + ) + #f + ) + ) + +(defstate notice-blue (collectable) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) + (and (logtest? (-> self flags) (collectable-flag pickup)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (process->handle proc)) + ) + ) + :enter (behavior ((arg0 handle)) + (set! (-> self target) arg0) + (set! (-> self speed quad) (the-as uint128 0)) + (set! (-> self speed z) (if (rand-vu-percent? 0.5) + 1.0 + -1.0 + ) + ) + (set! (-> self suck-y-offset) 0.0) + (logclear! (-> self mask) (process-mask actor-pause)) + ) + :exit (behavior () + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'powerup)) + (set! (-> a1-0 param 1) (the-as uint 3)) + (if (and (not (send-event-function *target* a1-0)) (not (logtest? (-> self flags) (collectable-flag suck-in)))) + (go-virtual wait) + ) + ) + ) + :code (behavior ((arg0 handle)) + (until #f + (set! (-> self root trans quad) (-> self base quad)) + (add-blue-motion #t #f #t #f) + (update-transforms (-> self root)) + (common-post self) + (suspend) + ) + #f + ) + ) + +(defstate pickup (collectable) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-movie-pos) + (let ((v1-2 (res-lump-struct (-> self entity) 'movie-pos structure))) + (when v1-2 + (set! (-> (the-as vector v1-2) quad) (-> (the-as vector (-> block param 0)) quad)) + v1-2 + ) + ) + ) + (('actor-pause) + (cond + ((-> block param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v0-1 (the-as object #t))) + (set! (-> self actor-pause) (the-as symbol v0-1)) + v0-1 + ) + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (deactivate self) + ) + (('effect) + (when (not (-> block param 0)) + (set! (-> self collect-effect) (the-as sparticle-launch-group 0)) + (set! (-> self collect-effect2) (the-as sparticle-launch-group 0)) + 0 + ) + ) + ) + ) + :enter (behavior ((arg0 symbol) (arg1 handle)) + (do-pickup self arg1) + ) + :code (behavior ((arg0 symbol) (arg1 handle)) + (while (-> self child) + (suspend) + ) + (go-virtual die) + ) + ) + +(defstate die (collectable) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + ) + ) + +(deftype eco (collectable) + ((respawn-delay time-frame) + ) + ) + + +(defmethod initialize-allocations ((this eco)) + (let ((t9-0 (method-of-type collectable initialize-allocations))) + (t9-0 this) + ) + (if (logtest? (-> this fact options) (actor-option respawn-delay)) + (set! (-> this respawn-delay) (-> this fact fade-time)) + ) + 0 + (none) + ) + +(defstate die (eco) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (deactivate self) + ) + (('die) + (go-virtual die) + ) + ) + ) + :exit (behavior () + (process-entity-status! self (entity-perm-status no-kill) #f) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status no-kill) #t) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self fact options) (actor-option auto-pickup suck-in)) + (if (nonzero? (-> self part)) + (kill-particles (-> self part)) + ) + (cond + ((nonzero? (-> self respawn-delay)) + (let ((gp-0 (current-time))) + (while (not (time-elapsed? gp-0 (-> self respawn-delay))) + (suspend) + ) + ) + ) + (else + (while (let ((f30-0 0.0)) + (< f30-0 (send-event *target* 'query 'pickup (-> self fact pickup-type))) + ) + (suspend) + ) + ) + ) + (set! (-> self base quad) (-> self old-base quad)) + (set! (-> self root trans quad) (-> self base quad)) + (let ((v1-26 (-> self root root-prim))) + (set! (-> v1-26 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-26 prim-core collide-with) (-> self root backup-collide-with)) + ) + (+! (-> self clock ref-count) -1) + (+! (-> *display* entity-clock ref-count) 1) + (set! (-> self clock) (-> *display* entity-clock)) + (if (nonzero? (-> self draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (go-virtual wait) + ) + ) + +(defstate pickup (eco) + :virtual #t + :code (behavior ((arg0 symbol) (arg1 handle)) + (if (not (logtest? (-> self fact options) (actor-option no-reaction))) + (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (let ((t9-2 (-> (find-parent-state) code))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +(deftype eco-yellow (eco) + () + ) + + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) + (init-common this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) + ) + +(deftype eco-red (eco) + () + ) + + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) + (init-common this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) + ) + +(deftype eco-blue (eco) + () + ) + + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) + (init-common this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) + ) + +(deftype eco-green (eco) + () + ) + + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this eco-green) (arg0 entity-actor)) + (init-common this arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) + ) + +(deftype health (collectable) + () + ) + + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this health) (arg0 entity-actor)) + (init-common this arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) + ) + +(deftype eco-pill (collectable) + () + ) + + +(defstate wait (eco-pill) + :virtual #t + :trans (behavior () + (if (and (and *target* + (and (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (and (not (focus-test? *target* dead hit)) + (-> *setting-control* user-current pickups) + (case (-> self fact pickup-type) + (((pickup-type eco-pill-dark)) + (< (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) + ) + (((pickup-type eco-pill-light)) + (< (-> *game-info* eco-pill-light) (-> *FACT-bank* eco-pill-light-max-default)) + ) + (else + #t + ) + ) + ) + ) + (send-event self 'suck *target*) + ) + ) + ) + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) + (init-common this arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) + ) + +(defmethod deactivate ((this eco-pill)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (+! (-> *game-info* live-eco-pill-count) -1) + ((method-of-type collectable deactivate) this) + (none) + ) + +(defmethod initialize-allocations ((this eco-pill)) + (+! (-> *game-info* live-eco-pill-count) 1) + (stack-size-set! (-> this main-thread) 128) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-13 local-sphere) 0.0 3276.8 0.0 1638.4) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-13) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-16 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + 0 + (none) + ) + +(deftype money (collectable) + () + ) + + +(defmethod run-logic? ((this money)) + "Should this process be run? Checked by execute-process-tree." + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) + ) + ) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) + ) + ) + ) + +(defmethod deactivate ((this money)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (when (and (-> this next-state) (= (-> this next-state name) 'pickup)) + (case (-> this pickup-type) + (((pickup-type gem)) + (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status save)))) + (format #t "~A ~A was killed in pickup~%" (-> this type) (-> this name)) + ) + (process-entity-status! this (entity-perm-status dead) #t) + ) + (else + (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status dead)))) + (format #t "~A ~A was killed in pickup~%" (-> this type) (-> this name)) + ) + ) + ) + ) + ((method-of-type collectable deactivate) this) + (none) + ) + +(defmethod common-post ((this money)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) + (let ((f30-0 (-> this bob-amount))) + (when (< 0.0 f30-0) + (set! (-> this root trans y) + (+ (-> this base y) + (-> this suck-y-offset) + (* f30-0 + (sin + (* 109.22667 + (the float (mod (+ (- (current-time) (-> this birth-time)) (the-as time-frame (-> this bob-offset))) 600)) + ) + ) + ) + ) + ) + (update-transforms (-> this root)) + ) + ) + (let ((a0-7 (-> this part)) + (a1-1 (-> this root root-prim prim-core)) + ) + (if (nonzero? a0-7) + (spawn a0-7 (the-as vector a1-1)) + ) + ) + (ja-post) + (none) + ) + +(defstate notice-blue (money) + :virtual #t + :code (behavior ((arg0 handle)) + (until #f + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame))) + (set! (-> self root trans quad) (-> self base quad)) + (add-blue-motion #t #t #t #f) + (let ((f30-0 (-> self bob-amount))) + (if (< 0.0 f30-0) + (set! (-> self root trans y) + (+ (-> self base y) + (-> self suck-y-offset) + (* f30-0 + (sin + (* 109.22667 + (the float (mod (+ (- (current-time) (-> self birth-time)) (the-as time-frame (-> self bob-offset))) 600)) + ) + ) + ) + ) + ) + ) + ) + (transform-post) + (suspend) + ) + #f + ) + ) + +(defstate pickup (money) + :virtual #t + :code (behavior ((arg0 symbol) (arg1 handle)) + (process-entity-status! self (entity-perm-status dead) #t) + ) + ) + +(defmethod initialize-allocations ((this money)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type money) 1.0)) + (let ((a0-11 (-> this entity))) + (if (when a0-11 + (let ((a0-12 (-> a0-11 extra perm task))) + (if a0-12 + (= a0-12 (game-task none)) + ) + ) + ) + (set! (-> this entity extra perm task) (game-task complete)) + ) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (-> this entity) + (nav-mesh-connect-from-ent this) + ) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + 0 + (none) + ) + +(defmethod init-from-entity! ((this money) (arg0 entity-actor)) + (initialize-allocations this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) + ) + +(defbehavior money-init-by-other money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor) (arg4 time-frame)) + (let ((s2-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (process-entity-set! self arg3) + (set! (-> self pickup-type) s2-0) + (set! (-> self pickup-amount) f30-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s2-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (let ((v1-5 (ppointer->process (-> self parent)))) + (set! (-> self notify) (if (logtest? (-> v1-5 mask) (process-mask process-tree)) + (the-as handle #f) + (process->handle v1-5) + ) + ) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (set! (-> self root transv quad) (-> arg1 quad)) + (initialize-options + self + (the-as int (cond + ((and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (-> arg2 fade-time) + ) + (else + (empty) + arg4 + ) + ) + ) + 1024.0 + arg2 + ) + (update-transforms (-> self root)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + ) + +(defbehavior money-init-by-other-no-bob money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 float) (arg4 entity-actor)) + (process-entity-set! self arg4) + (set! (-> self pickup-type) (the-as pickup-type arg2)) + (set! (-> self pickup-amount) arg3) + (initialize-allocations self) + (set! (-> self fact pickup-type) (the-as pickup-type arg2)) + (set! (-> self fact pickup-amount) arg3) + (let ((v1-4 (ppointer->process (-> self parent)))) + (set! (-> self notify) (if (logtest? (-> v1-4 mask) (process-mask process-tree)) + (the-as handle #f) + (process->handle v1-4) + ) + ) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (set! (-> self root transv quad) (-> arg1 quad)) + (initialize-options self 4500 0.0 (the-as fact-info #f)) + (logior! (-> self flags) (collectable-flag no-eco-blue)) + (update-transforms (-> self root)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + ) + +(deftype gem (money) + ((roty-speed degrees) + (bounce-time time-frame) + (gem-pool uint8) + ) + ) + + +(defmethod deactivate ((this gem)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (+! (-> *game-info* live-gem-count) -1) + (call-parent-method this) + (none) + ) + +(defmethod common-post ((this gem)) + (seek! (-> this roty-speed) 20024.889 (* 65536.0 (seconds-per-frame))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* (-> this roty-speed) (seconds-per-frame))) + (logclear! (-> this draw status) (draw-control-status no-draw-temp uninited)) + (do-joint-math (-> this draw) (-> this node-list) (-> this skel)) + (let ((a0-7 (-> this part)) + (a1-3 (-> this draw skeleton bones 3)) + ) + (if (nonzero? a0-7) + (sparticle-launch-control-method-17 a0-7 (the-as matrix a1-3)) + ) + ) + 0 + (none) + ) + +(defstate suck (gem) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-1 object)) + (case message + (('handle-gem-pickup) + (return (notify-gem-pickup (-> self gem-pool))) + v0-1 + ) + (else + (collectable-standard-event-handler proc argc message block) + ) + ) + ) + ) + +(defstate deploy (gem) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-1 object)) + (case message + (('handle-gem-pickup) + (return (notify-gem-pickup (-> self gem-pool))) + v0-1 + ) + (else + (collectable-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((t9-0 (-> (method-of-type collectable deploy) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-vector! + (-> self root transv) + (rand-vu-float-range -20480.0 20480.0) + 81920.0 + (rand-vu-float-range -20480.0 20480.0) + 1.0 + ) + (when (-> *setting-control* user-current gem-seek-target-dir?) + (let ((gp-2 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)))) + 0.0 + (set! (-> gp-2 y) 0.0) + (let ((f30-0 (vector-normalize-ret-len! gp-2 1.0))) + (let ((a0-6 gp-2)) + (set! (-> a0-6 quad) (-> gp-2 quad)) + (set! (-> a0-6 y) 0.0) + (vector-normalize! a0-6 1.0) + ) + (vector-float*! gp-2 gp-2 (rand-vu-float-range (* 0.25 f30-0) (* 0.75 f30-0))) + ) + (set! (-> self root transv quad) (-> gp-2 quad)) + ) + (set! (-> self root transv y) 81920.0) + ) + (set-gravity-length (-> self root dynam) 122880.0) + (set! (-> self roty-speed) 186413.52) + (logior! (-> self flags) (collectable-flag pickup)) + (set! (-> self root root-prim prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> self root root-prim prim-core collide-as) (collide-spec collectable)) + (set! (-> self root max-iteration-count) (the-as uint 2)) + (logior! (-> self root root-prim prim-core action) (collide-action solid)) + (set! (-> self root reaction) projectile-bounce-reaction) + (set! (-> self root penetrated-by) (the-as penetrate -1)) + ) + :exit (behavior () + (set! (-> self roty-speed) (fmin 262144.0 (-> self roty-speed))) + (set-gravity-length (-> self root dynam) 245760.0) + (set! (-> self root root-prim local-sphere w) 6144.0) + (update-transforms (-> self root)) + (let ((t9-2 (-> (method-of-type collectable deploy) exit))) + (if t9-2 + (t9-2) + ) + ) + ) + :trans #f + :code sleep-code + :post (behavior () + (let ((gp-0 #t)) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (when (-> self entity) + (when (get-simple-travel-vector + (-> self entity) + (-> self root transv) + (-> self root trans) + (-> self root transv) + (* 1.5 (-> self root root-prim prim-core world-sphere w)) + 0.8 + ) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (f30-0 (-> self root transv y)) + ) + (project-point-to-nav-mesh (-> self entity) s5-1 (-> self root trans) (the-as nav-poly #f) 40960000.0) + (when (>= (vector-vector-xz-distance s5-1 (-> self root trans)) 204.8) + (vector-! (-> self root transv) s5-1 (-> self root trans)) + (vector-normalize! (-> self root transv) 40960.0) + (set! (-> self root transv y) (if (< 0.0 (-> self root transv y)) + (+ f30-0 (* 4.0 (seconds-per-frame) (-> self root transv y))) + f30-0 + ) + ) + (set! gp-0 #f) + ) + ) + ) + ) + (cond + (gp-0 + (let ((v1-31 (-> self root)) + (a2-3 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> a2-3 collide-with) (-> v1-31 root-prim prim-core collide-with)) + (set! (-> a2-3 ignore-process0) self) + (set! (-> a2-3 ignore-process1) #f) + (set! (-> a2-3 ignore-pat) (-> v1-31 pat-ignore-mask)) + (set! (-> a2-3 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-31 (-> v1-31 transv) a2-3 (meters 0)) + ) + ) + (else + (let ((t9-7 (method-of-object (-> self root) collide-shape-moving-method-57))) + (-> self root transv) + (t9-7) + ) + ) + ) + ) + (let* ((gp-1 (-> self root)) + (s5-2 (-> gp-1 status)) + ) + (cond + ((logtest? s5-2 (collide-status touch-surface)) + (set! (-> gp-1 transv x) (* 0.7 (-> gp-1 transv x))) + (set! (-> gp-1 transv y) (* (-> gp-1 transv y) (rand-vu-float-range 0.7 0.75))) + (set! (-> gp-1 transv z) (* 0.7 (-> gp-1 transv z))) + (set! (-> self roty-speed) + (fmin + 131072.0 + (+ (-> self roty-speed) (lerp-scale 0.0 131072.0 (-> self root ground-impact-vel) 0.0 122880.0)) + ) + ) + (if (or (and (logtest? s5-2 (collide-status on-surface)) (< (vector-length (-> gp-1 transv)) 1228.8)) + (time-elapsed? (-> self state-time) (seconds 10)) + ) + (go-virtual wait) + ) + (when (time-elapsed? (-> self bounce-time) (seconds 0.1)) + (set-time! (-> self bounce-time)) + (sound-play-by-name + (static-sound-name "gem-bounce") + (new-sound-id) + (the int (* 1024.0 (lerp-scale 0.5 1.0 (-> self root ground-impact-vel) 0.0 40960.0))) + 0 + 0 + (sound-group) + #t + ) + ) + ) + ((time-elapsed? (-> self state-time) (seconds 15)) + (go-virtual wait) + ) + ) + ) + (seek! (-> self roty-speed) 0.0 (* 16384.0 (seconds-per-frame))) + (common-post self) + ) + ) + +(defmethod initialize-allocations ((this gem)) + (+! (-> *game-info* live-gem-count) 1) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-11 local-sphere) 0.0 2048.0 0.0 2048.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-11) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-14 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this roty-speed) 40049.777) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (rand-vu-float-range 0.0 65536.0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type gem) 1.0)) + (let ((v1-22 (-> this entity))) + (if (and (-> this entity) + (-> v1-22 extra perm task) + (= (-> v1-22 extra perm task) (game-task none)) + (type-type? (-> v1-22 etype) crate) + ) + (set! (-> this entity extra perm task) (game-task complete)) + ) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (if (-> this entity) + (nav-mesh-connect-from-ent this) + ) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 134) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 135)) + (set! (-> this gem-pool) (the-as uint 0)) + 0 + (none) + ) + +(define *collectable-dummy-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #x2)) + :shadow-dir (new 'static 'vector :y -1.0 :w 163840.0) + :bot-plane (new 'static 'plane :y 1.0 :w 40960.0) + :top-plane (new 'static 'plane :y 1.0 :w -4096.0) + ) + ) + ) + +(deftype skill (money) + () + ) + + +(defstate wait (skill) + :virtual #t + :code (behavior () + (until #f + (if (and (logtest? (-> self flags) (collectable-flag fadeout)) + (begin + (if (movie?) + (set-time! (-> self birth-time)) + ) + (time-elapsed? (-> self birth-time) (-> self fadeout-timeout)) + ) + ) + (go-virtual fade) + ) + (common-post self) + (suspend) + ) + #f + ) + ) + +(defmethod initialize-allocations ((this skill)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this root pause-adjust-distance) 409600.0) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type skill) 1.0)) + (let ((a0-11 (-> this entity))) + (if (when a0-11 + (let ((a0-12 (-> a0-11 extra perm task))) + (if a0-12 + (= a0-12 (game-task none)) + ) + ) + ) + (set! (-> this entity extra perm task) (game-task complete)) + ) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-skill" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw shadow-ctrl) *collectable-dummy-shadow-control*) + (if (-> this entity) + (nav-mesh-connect-from-ent this) + ) + (cond + ((>= (-> this pickup-amount) (-> *FACT-bank* super-skill-inc)) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 1.0 0.2 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 133) this)) + ) + (else + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 132) this)) + ) + ) + 0 + (none) + ) + +(deftype fuel-cell (process-hidden) + () + ) + + +(deftype trick-point (collectable) + () + ) + + +(deftype skate-point (trick-point) + () + ) + + +(defmethod initialize-allocations ((this trick-point)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this root pause-adjust-distance) 204800.0) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type trick-point) 100.0)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 142) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 143)) + 0 + (none) + ) + +(defmethod init-from-entity! ((this trick-point) (arg0 entity-actor)) + (initialize-allocations this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) + ) + +(deftype ammo-collectable (collectable) + ((ammo-effect basic) + ) + ) + + +(defmethod go-to-initial-state ((this ammo-collectable)) + (if (-> *setting-control* user-current gun-special-mode) + (go empty-state) + (call-parent-method this) + ) + ) + +(defmethod initialize-allocations ((this ammo-collectable)) + (stack-size-set! (-> this main-thread) 128) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-10 local-sphere) 0.0 3276.8 0.0 6553.6) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-10) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (rand-vu-float-range 0.0 65536.0)) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + (case (-> this pickup-type) + (((pickup-type ammo-yellow)) + (set! (-> this collect-effect) (-> *part-group-id-table* 136)) + ) + (((pickup-type ammo-red)) + (set! (-> this collect-effect) (-> *part-group-id-table* 137)) + ) + (((pickup-type ammo-blue)) + (set! (-> this collect-effect) (-> *part-group-id-table* 138)) + ) + (((pickup-type ammo-dark)) + (set! (-> this collect-effect) (-> *part-group-id-table* 139)) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod initialize-effects ((this ammo-collectable) (arg0 pickup-type)) + (set! (-> this fact pickup-type) arg0) + (case arg0 + (((pickup-type ammo-yellow)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 2.5 2.5 2.5 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 164)) + ) + (((pickup-type ammo-red)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 4.0 4.0 4.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 158)) + ) + (((pickup-type ammo-blue)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 4.0 4.0 4.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 154)) + ) + (((pickup-type ammo-dark)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 129)) + ) + (((pickup-type gun-yellow-1) (pickup-type gun-yellow-2) (pickup-type gun-yellow-3)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-yellow-up" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) + (let ((v1-34 (-> this node-list data))) + (set! (-> v1-34 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-34 0 param1) (the-as basic (-> this root trans))) + (set! (-> v1-34 0 param2) (the-as basic (-> this extra-trans))) + ) + (set-vector! (-> this extra-trans) 0.0 1638.4 0.0 1.0) + ) + (((pickup-type gun-dark-1) (pickup-type gun-dark-2) (pickup-type gun-dark-3)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-dark-up" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) + ) + (((pickup-type board)) + (process-entity-set! this (the-as entity #f)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-board" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (let ((v1-48 (-> this skel root-channel 0))) + (set! (-> v1-48 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + ) + (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) + (let ((v1-52 (-> this node-list data))) + (set! (-> v1-52 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-52 0 param1) (the-as basic (-> this root trans))) + (set! (-> v1-52 0 param2) (the-as basic (-> this extra-trans))) + ) + (set-vector! (-> this extra-trans) 0.0 2048.0 0.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) + ) + (((pickup-type shield)) + (set! (-> this ammo-effect) (-> *part-group-id-table* 125)) + ) + (((pickup-type trick-point)) + ) + ) + (none) + ) + +(defbehavior initialize-ammo-by-other ammo ((arg0 vector) (arg1 vector) (arg2 fact-info)) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (initialize-options self 4500 1024.0 arg2) + (update-transforms (-> self root)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-common ((this ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> this pickup-amount) arg2) + (set! (-> this pickup-type) arg1) + (initialize-allocations this) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (initialize-effects this (-> this fact pickup-type)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) + (none) + ) + +(defmethod common-post ((this ammo-collectable)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) + ((method-of-type collectable common-post) this) + 0 + (none) + ) + +(defstate die (ammo-collectable) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + ) + ) + +(deftype ammo (ammo-collectable) + () + ) + + +(deftype shield (ammo-collectable) + () + ) + + +(deftype upgrade-collectable (ammo-collectable) + () + ) + + +(defbehavior initialize-upgrade-by-other upgrade-collectable ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) + (process-entity-set! self arg3) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 0 + ) + 1024.0 + (the-as fact-info #f) + ) + (set! (-> self collect-timeout) (seconds 1)) + (update-transforms (-> self root)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + ) + +(defmethod init-from-entity! ((this eco) (arg0 entity-actor)) + (let ((v1-1 (res-lump-value (-> this entity) 'eco-info uint128 :time -1000000000.0))) + (set! (-> this type) (cond + ((= (the-as uint v1-1) 3) + eco-blue + ) + ((= (the-as uint v1-1) 2) + eco-red + ) + ((= (the-as uint v1-1) 1) + eco-yellow + ) + ((= (the-as uint v1-1) 5) + eco-green + ) + ((= (the-as uint v1-1) 20) + health + ) + ((= (the-as uint v1-1) 10) + money + ) + ((= (the-as uint v1-1) 21) + trick-point + ) + ((= (the-as uint v1-1) 23) + gem + ) + ((= (the-as uint v1-1) 24) + skill + ) + ((= (the-as uint v1-1) 11) + fuel-cell + ) + (else + eco-pill + ) + ) + ) + ) + (init-from-entity! this arg0) + ) + +;; WARN: Return type mismatch int vs pickup-type. +(defun verify-pickup-type ((arg0 pickup-type)) + (case arg0 + (((pickup-type eco-pill-light)) + (if (not (logtest? (game-feature lightjak) (-> *game-info* features))) + (set! arg0 (pickup-type none)) + ) + ) + (((pickup-type ammo-red)) + (if (not (logtest? (-> *game-info* features) (game-feature gun-red-1))) + (set! arg0 (pickup-type ammo-yellow)) + ) + ) + (((pickup-type ammo-blue)) + (if (not (logtest? (-> *game-info* features) (game-feature gun-blue-1))) + (set! arg0 (pickup-type ammo-yellow)) + ) + ) + (((pickup-type ammo-dark)) + (if (not (logtest? (-> *game-info* features) (game-feature gun-dark-1))) + (set! arg0 (pickup-type ammo-yellow)) + ) + ) + ) + (the-as pickup-type arg0) + ) + +;; WARN: Return type mismatch object vs (pointer process). +(defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info)) + (local-vars + (v1-56 pickup-type) + (v1-68 pickup-type) + (sv-32 vector) + (sv-36 float) + (sv-40 (pointer process)) + (sv-48 int) + (sv-56 fact-info) + (sv-64 int) + (sv-72 int) + ) + (let ((s2-0 (verify-pickup-type arg1))) + (if (= s2-0 (pickup-type none)) + (return (the-as (pointer process) 0)) + ) + (set! sv-32 (new-stack-vector0)) + (set! sv-36 (res-lump-float + (if (and arg5 (nonzero? (-> arg5 process))) + (-> arg5 process entity) + ) + 'pickup-radius + :default (cond + ((= s2-0 (pickup-type buzzer)) + 0.0 + ) + ((= arg2 1.0) + 409.6 + ) + (else + 8192.0 + ) + ) + ) + ) + (set! sv-40 (the-as (pointer process) #f)) + (set! sv-48 (the int arg2)) + (set! sv-56 (new 'static 'fact-info)) + (set! (-> sv-56 options) (actor-option)) + (set! (-> sv-56 process) #f) + (if arg5 + (mem-copy! (&-> sv-56 type) (&-> arg5 type) 40) + ) + (set! (-> sv-56 pickup-type) s2-0) + (if (not (logtest? (actor-option dont-override-fact) (-> sv-56 options))) + (set! (-> sv-56 pickup-spawn-amount) 1.0) + ) + (while (> sv-48 0) + (set! sv-48 (+ sv-48 -1)) + (when arg3 + (set-vector! sv-32 0.0 57001.605 sv-36 1.0) + (vector-rotate-around-y! sv-32 sv-32 (/ (* 65536.0 (the float sv-48)) arg2)) + ) + (case s2-0 + (((pickup-type eco-yellow)) + (set! sv-40 (process-spawn + eco-yellow + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "eco-yellow" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type eco-red)) + (set! sv-40 (process-spawn + eco-red + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "eco-red" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type eco-blue)) + (set! sv-40 (process-spawn + eco-blue + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "eco-blue" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type eco-green)) + (set! sv-40 (process-spawn + eco-green + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "eco-green" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type health)) + (if (not (logtest? (actor-option dont-override-fact) (-> sv-56 options))) + (set! (-> sv-56 pickup-spawn-amount) arg2) + ) + (set! sv-40 (process-spawn + health + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "health" + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type eco-pill-green) (pickup-type eco-pill-dark) (pickup-type eco-pill-light)) + (set! sv-64 (cond + ((logtest? (actor-option dont-override-fact) (-> sv-56 options)) + (the int (-> sv-56 pickup-spawn-amount)) + ) + ((begin (set! v1-56 s2-0) (= v1-56 (pickup-type eco-pill-dark))) + 2 + ) + ((= v1-56 (pickup-type eco-pill-light)) + 20 + ) + (else + 1 + ) + ) + ) + (set! (-> sv-56 pickup-spawn-amount) (the float sv-64)) + (set! sv-40 (process-spawn + eco-pill + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "eco-pill" + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 (- sv-48 (+ sv-64 -1))) + ) + (((pickup-type ammo-yellow) + (pickup-type ammo-red) + (pickup-type ammo-blue) + (pickup-type ammo-dark) + (pickup-type shield) + ) + (set! sv-72 (cond + ((logtest? (actor-option dont-override-fact) (-> sv-56 options)) + (the int (-> sv-56 pickup-spawn-amount)) + ) + ((begin (set! v1-68 s2-0) (= v1-68 (pickup-type ammo-red))) + 5 + ) + ((= v1-68 (pickup-type ammo-dark)) + 1 + ) + (else + 10 + ) + ) + ) + (set! (-> sv-56 pickup-spawn-amount) (the float sv-72)) + (set! sv-40 (process-spawn + ammo-collectable + :init initialize-ammo-by-other + arg0 + sv-32 + sv-56 + :name "ammo-collectable" + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 (- sv-48 (+ sv-72 -1))) + ) + (((pickup-type gun-red-1) + (pickup-type gun-red-2) + (pickup-type gun-red-3) + (pickup-type gun-yellow-1) + (pickup-type gun-yellow-2) + (pickup-type gun-yellow-3) + (pickup-type gun-blue-1) + (pickup-type gun-blue-2) + (pickup-type gun-blue-3) + (pickup-type gun-dark-1) + (pickup-type gun-dark-2) + (pickup-type gun-dark-3) + (pickup-type board) + ) + (set! sv-40 (process-spawn + upgrade-collectable + :init initialize-upgrade-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + :name "upgrade-collectable" + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type trick-point)) + (if (not (logtest? (actor-option dont-override-fact) (-> sv-56 options))) + (set! (-> sv-56 pickup-spawn-amount) arg2) + ) + (set! sv-40 (process-spawn + trick-point + :init initialize-ammo-by-other + arg0 + sv-32 + sv-56 + :name "trick-point" + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type money)) + (set! sv-40 + (process-spawn money arg0 sv-32 sv-56 (-> self entity) 0 :name "money" :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type trick-point)) + (set! sv-40 + (process-spawn money arg0 sv-32 sv-56 (-> self entity) 4500 :name "money" :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type gem)) + (if (>= (-> *game-info* live-gem-count) 20) + (return (the-as (pointer process) #f)) + ) + (set! sv-40 (process-spawn + gem + :init money-init-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + 4500 + :name "gem" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type skill)) + (when (>= arg2 (-> *FACT-bank* super-skill-inc)) + (if (not (logtest? (actor-option dont-override-fact) (-> sv-56 options))) + (set! (-> sv-56 pickup-spawn-amount) arg2) + ) + (set! sv-48 0) + 0 + ) + (set! sv-40 (process-spawn + skill + :init money-init-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + 0 + :name "skill" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (else + (format 0 "ERROR: unknown type of eco ~d~%" s2-0) + ) + ) + ) + ) + (the-as (pointer process) sv-40) + ) + +(defun pickup-dark-set! ((arg0 fact-info) (arg1 (pointer pickup-type)) (arg2 (pointer float)) (arg3 int)) + (-> arg2 0) + (you-suck-stage *game-info* #f 0) + (cond + ((or (< 20 (-> *game-info* live-eco-pill-count)) + (not (logtest? (game-feature feature58) (-> *game-info* features))) + ) + (return (the-as pickup-type #f)) + ) + ((< 10 (-> *game-info* live-eco-pill-count)) + (set! (-> arg1 0) (pickup-type eco-pill-dark)) + (set! (-> arg2 0) 2.0) + ) + ((type? arg0 fact-info-enemy) + (set! (-> arg1 0) (pickup-type eco-pill-dark)) + (set! (-> arg2 0) (+ (rand-vu-float-range 6.0 (+ 10.0 (-> arg2 0))) (fmin 10.0 (the float arg3)))) + ) + (else + (set! (-> arg1 0) (pickup-type eco-pill-dark)) + (set! (-> arg2 0) (+ (rand-vu-float-range 4.0 (+ 6.0 (-> arg2 0))) (fmin 10.0 (the float arg3)))) + ) + ) + (-> arg1 0) + ) + +;; WARN: Return type mismatch number vs pickup-type. +(defun pickup-light-set! ((arg0 fact-info) (arg1 (pointer pickup-type)) (arg2 (pointer float)) (arg3 int)) + (the-as pickup-type (cond + ((logtest? (game-feature feature57) (-> *game-info* features)) + (set! (-> arg1 0) (pickup-type eco-pill-light)) + (set! (-> arg2 0) 20.0) + ) + (else + (set! (-> arg1 0) (pickup-type none)) + 0 + ) + ) + ) + ) + +(defun pickup-ammo-set! ((arg0 fact-info) (arg1 (pointer pickup-type)) (arg2 (pointer float)) (arg3 int)) + (local-vars (v0-5 number) (sv-16 float)) + (let ((s2-0 (-> *game-info* features))) + 0.0 + (let ((f22-0 0.0) + (f26-0 0.0) + (f28-0 0.0) + (f30-0 0.0) + ) + (set! sv-16 (the-as float (if (logtest? s2-0 (game-feature gun-yellow-1 gun-yellow-2 gun-yellow-3)) + (get-max-ammo-for-gun *game-info* (pickup-type ammo-yellow)) + 0.0 + ) + ) + ) + (let* ((f20-0 (if (logtest? s2-0 (game-feature gun-red-1 gun-red-2 gun-red-3)) + (get-max-ammo-for-gun *game-info* (pickup-type ammo-red)) + 0.0 + ) + ) + (f24-0 (if (logtest? s2-0 (game-feature gun-blue-1 gun-blue-2 gun-blue-3)) + (get-max-ammo-for-gun *game-info* (pickup-type ammo-blue)) + 0.0 + ) + ) + (f0-2 (if (logtest? (game-feature gun-dark-1 gun-dark-2 gun-dark-3) s2-0) + (get-max-ammo-for-gun *game-info* (pickup-type ammo-dark)) + 0.0 + ) + ) + (f4-0 (if (logtest? s2-0 (game-feature gun-yellow-1 gun-yellow-2 gun-yellow-3)) + (-> *game-info* gun-ammo 0) + 0.0 + ) + ) + (f1-2 (if (logtest? s2-0 (game-feature gun-red-1 gun-red-2 gun-red-3)) + (-> *game-info* gun-ammo 1) + 0.0 + ) + ) + (f2-1 (if (logtest? s2-0 (game-feature gun-blue-1 gun-blue-2 gun-blue-3)) + (-> *game-info* gun-ammo 2) + 0.0 + ) + ) + (f3-1 (if (logtest? (game-feature gun-dark-1 gun-dark-2 gun-dark-3) s2-0) + (-> *game-info* gun-ammo 3) + 0.0 + ) + ) + (f22-1 (+ f22-0 (- sv-16 f4-0))) + ) + (if (< 0.0 sv-16) + (set! f22-1 (/ f22-1 sv-16)) + ) + (let ((f1-4 (+ f26-0 (- f20-0 f1-2)))) + (if (< 0.0 f20-0) + (set! f1-4 (/ f1-4 f20-0)) + ) + (let ((f2-3 (+ f28-0 (- f24-0 f2-1)))) + (if (< 0.0 f24-0) + (set! f2-3 (/ f2-3 f24-0)) + ) + (let ((f3-3 (+ f30-0 (- f0-2 f3-1)))) + (if (< 0.0 f0-2) + (set! f3-3 (/ f3-3 f0-2)) + ) + (let ((f26-1 (+ f22-1 f1-4 f2-3 f3-3))) + (when (= f26-1 0.0) + (set! f22-1 1.0) + (set! f26-1 1.0) + ) + (cond + ((!= f26-1 0.0) + (let* ((f24-1 (+ f1-4 f22-1)) + (f28-1 (+ f2-3 f24-1)) + (f30-1 (+ f3-3 f28-1)) + (v1-39 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-40 (the-as number (logior #x3f800000 v1-39))) + (f0-10 (* (+ -1.0 (the-as float v1-40)) f26-1)) + ) + (set! v0-5 (cond + ((and (>= f22-1 f0-10) (logtest? s2-0 (game-feature gun-yellow-1 gun-yellow-2 gun-yellow-3))) + (set! v0-5 15) + (set! (-> arg1 0) (the-as pickup-type v0-5)) + v0-5 + ) + ((and (>= f24-1 f0-10) (logtest? s2-0 (game-feature gun-red-1 gun-red-2 gun-red-3))) + (set! (-> arg1 0) (pickup-type ammo-red)) + (if (>= 1 (mod (the-as int (rand-uint31-gen *random-generator*)) 3)) + (set! (-> arg2 0) (* 0.5 (-> arg2 0))) + ) + ) + ((and (>= f28-1 f0-10) (logtest? s2-0 (game-feature gun-blue-1 gun-blue-2 gun-blue-3))) + (set! v0-5 17) + (set! (-> arg1 0) (the-as pickup-type v0-5)) + v0-5 + ) + ((and (>= f30-1 f0-10) (logtest? (game-feature gun-dark-1 gun-dark-2 gun-dark-3) s2-0)) + (set! (-> arg1 0) (pickup-type ammo-dark)) + (set! (-> arg2 0) (the float (the int (fmax 1.0 (* 0.06666667 (-> arg2 0)))))) + ) + (else + (pickup-dark-set! arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + (else + (set! (-> arg1 0) (pickup-type none)) + 0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + (-> arg1 0) + ) + +(defmethod drop-pickup ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int) (arg4 symbol)) + (local-vars (sv-16 pickup-type) (sv-20 float)) + (set! sv-16 (-> this pickup-type)) + (set! sv-20 (-> this pickup-amount)) + (if (not arg4) + (set! sv-20 (fmin 10.0 sv-20)) + ) + (cond + ((= sv-16 (pickup-type ammo-random)) + (pickup-ammo-set! this (& sv-16) (& sv-20) arg3) + ) + ((= sv-16 (pickup-type eco-pill-random)) + (if (rand-vu-percent? 0.1) + (pickup-light-set! this (& sv-16) (& sv-20) arg3) + (pickup-dark-set! this (& sv-16) (& sv-20) arg3) + ) + ) + ((= sv-16 (pickup-type light-random)) + (cond + ((rand-vu-percent? 0.1) + (pickup-light-set! this (& sv-16) (& sv-20) arg3) + ) + (else + (set! sv-16 (pickup-type none)) + 0 + ) + ) + ) + ((= sv-16 (pickup-type ammo-light-random)) + (let ((v1-17 (rand-vu-int-count 100))) + (cond + ((< v1-17 10) + (pickup-light-set! this (& sv-16) (& sv-20) arg3) + ) + ((< v1-17 50) + (pickup-ammo-set! this (& sv-16) (& sv-20) arg3) + ) + (else + (set! sv-16 (pickup-type none)) + 0 + ) + ) + ) + ) + ((= sv-16 (pickup-type ammo-dark-light-random)) + (let ((v1-23 (rand-vu-int-count 100))) + (cond + ((< v1-23 10) + (pickup-light-set! this (& sv-16) (& sv-20) arg3) + ) + ((< v1-23 55) + (pickup-ammo-set! this (& sv-16) (& sv-20) arg3) + ) + (else + (pickup-dark-set! this (& sv-16) (& sv-20) arg3) + ) + ) + ) + ) + ) + (if (= sv-16 (pickup-type none)) + (return (the-as (pointer process) #f)) + ) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) + (set-vector! (-> s3-1 move-dist) 0.0 -81920.0 0.0 1.0) + (+! (-> s3-1 start-pos y) 12288.0) + (let ((v1-33 s3-1)) + (set! (-> v1-33 radius) 40.96) + (set! (-> v1-33 collide-with) (collide-spec backgnd hit-by-others-list pusher)) + (set! (-> v1-33 ignore-process0) #f) + (set! (-> v1-33 ignore-process1) #f) + (set! (-> v1-33 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-33 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-1) 0.0) + (set! (-> s3-1 start-pos quad) (-> s3-1 best-other-tri intersect quad)) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) + ) + (if (= sv-16 (pickup-type fuel-cell)) + (+! (-> s3-1 start-pos y) 6144.0) + ) + (birth-pickup-at-point (-> s3-1 start-pos) sv-16 sv-20 arg0 arg1 this) + ) + ) + +;; WARN: Return type mismatch int vs game-feature. +(defun gun-pickup-type->game-feature ((arg0 pickup-type)) + (let ((v1-0 arg0)) + (the-as game-feature (cond + ((= v1-0 (pickup-type gun-red-1)) + (the-as game-feature (game-feature gun-red-1)) + ) + ((= v1-0 (pickup-type gun-red-2)) + (the-as game-feature (game-feature gun-red-2)) + ) + ((= v1-0 (pickup-type gun-red-3)) + (the-as game-feature (game-feature gun-red-3)) + ) + ((= v1-0 (pickup-type gun-yellow-1)) + (the-as game-feature (game-feature gun-yellow-1)) + ) + ((= v1-0 (pickup-type gun-yellow-2)) + (the-as game-feature (game-feature gun-yellow-2)) + ) + ((= v1-0 (pickup-type gun-yellow-3)) + (the-as game-feature (game-feature gun-yellow-3)) + ) + ((= v1-0 (pickup-type gun-blue-1)) + (the-as game-feature (game-feature gun-blue-1)) + ) + ((= v1-0 (pickup-type gun-blue-2)) + (the-as game-feature (game-feature gun-blue-2)) + ) + ((= v1-0 (pickup-type gun-blue-3)) + (the-as game-feature (game-feature gun-blue-3)) + ) + ((= v1-0 (pickup-type gun-dark-1)) + (the-as game-feature (game-feature gun-dark-1)) + ) + ((= v1-0 (pickup-type gun-dark-2)) + (the-as game-feature (game-feature gun-dark-2)) + ) + ((= v1-0 (pickup-type gun-dark-3)) + (the-as game-feature (game-feature gun-dark-3)) + ) + (else + (the-as game-feature (game-feature)) + ) + ) + ) + ) + ) diff --git a/goal_src/jak3/engine/common-obs/crates.gc b/goal_src/jak3/engine/common-obs/crates.gc index 9633be4b80c..9b23494e07a 100644 --- a/goal_src/jak3/engine/common-obs/crates.gc +++ b/goal_src/jak3/engine/common-obs/crates.gc @@ -5,5 +5,1596 @@ ;; name in dgo: crates ;; dgos: GAME +(declare-type collectable process-drawable) + ;; DECOMP BEGINS +(defskelgroup skel-crate-krimson crate crate-krimson-lod0-jg crate-idle-ja + ((crate-krimson-lod0-mg (meters 20)) (crate-krimson-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 10 + ) + +(defskelgroup skel-crate-cty-blue ctycrate ctycrate-blue-lod0-jg ctycrate-idle-ja + ((ctycrate-blue-lod0-mg (meters 20)) (ctycrate-blue-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +(defskelgroup skel-crate-cty-metal ctycrate ctycrate-metal-lod0-jg ctycrate-idle-ja + ((ctycrate-metal-lod0-mg (meters 20)) (ctycrate-metal-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +(defskelgroup skel-crate-urn-a urn-a urn-a-lod0-jg urn-a-idle-ja + ((urn-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +(defskelgroup skel-crate-urn-b urn-b urn-b-lod0-jg urn-b-idle-ja + ((urn-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +(defskelgroup skel-crate-urn-c urn-c urn-c-lod0-jg urn-c-idle-ja + ((urn-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +(deftype crate-bank (basic) + ((COLLIDE_YOFF float) + (COLLIDE_RADIUS float) + (DARKECO_EXPLODE_RADIUS float) + ) + ) + + +(define *CRATE-bank* + (new 'static 'crate-bank :COLLIDE_YOFF 4096.0 :COLLIDE_RADIUS 6963.2 :DARKECO_EXPLODE_RADIUS 16384.0) + ) + +(deftype crate (process-focusable) + ((root collide-shape-moving :override) + (fact fact-info-crate :override) + (smush smush-control :inline) + (base vector :inline) + (look symbol) + (defense symbol) + (incoming-attack-id uint32) + (target handle) + (child-count int32) + (victory-anim spool-anim) + ) + (:state-methods + hide + idle + (die symbol int) + special-contents-die + bounce-on + (notice-blue handle) + carry + fall + ) + (:methods + (init! (_type_ entity-actor) none) + (init-skel! (_type_) none) + (init-collision! (_type_) none) + (params-set! (_type_ symbol symbol) none) + (go-initial-state (_type_) none) + (smush-update! (_type_) none) + (should-hide? (_type_) symbol) + ) + ) + + +(method-set! crate 12 (method-of-type process run-logic?)) + +(defbehavior collectable-count crate ((arg0 process-tree)) + (set! *global-search-count* 0) + (iterate-process-tree + arg0 + (lambda ((arg0 process)) + (if (type? arg0 collectable) + (set! *global-search-count* (+ *global-search-count* 1)) + ) + #t + ) + *null-kernel-context* + ) + *global-search-count* + ) + +(defbehavior crate-post crate () + (rider-trans) + (smush-update! self) + (rider-post) + (carry-info-method-9 (-> self carry)) + (none) + ) + +(defpart 810 + :init-specs ((:texture (new 'static 'texture-id :page #x4)) + (:num 16.0) + (:y (meters 0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 32.0) + (:g 128.0 32.0) + (:b 128.0 32.0) + (:a 32.0 16.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -1.2) (degrees 1.2)) + (:accel-y (meters 0.00066666666)) + (:timer (seconds 0.4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 set-conerot)) + (:next-time (seconds 0.1) (seconds 0.197)) + (:next-launcher 811) + (:conerot-x (degrees 70) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 811 + :init-specs ((:fade-a -1.0666667)) + ) + +(defpart 812 + :init-specs ((:texture (new 'static 'texture-id :index #x3e :page #x4)) + (:num 4.0) + (:y (meters 0.75)) + (:scale-x (meters 6)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3) (meters 1)) + (:r 192.0) + (:g 192.0) + (:b 64.0 128.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 set-conerot)) + (:next-time (seconds 0.05)) + (:next-launcher 813) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 813 + :init-specs ((:fade-a -2.1333334)) + ) + +(defpart 814 + :init-specs ((:texture (new 'static 'texture-id :index #x4b :page #x4)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 196.0) + (:b 196.0) + (:a 28.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 set-conerot)) + ) + ) + +(defpart 815 + :init-specs ((:texture (new 'static 'texture-id :index #x6 :page #x4)) + (:num 5.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.25) (meters 1.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.6) 2.0 (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3)) + (:r 160.0) + (:g 160.0) + (:b 160.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-x (degrees 1.2)) + (:rotvel-y (degrees 2.4)) + (:rotvel-z (degrees 0) 2 (degrees 2.4)) + (:accel-y (meters -0.0033333334)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 set-conerot)) + (:next-time (seconds 0.25)) + (:next-launcher 816) + (:conerot-x (degrees 40) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 816 + :init-specs ((:scalevel-x (meters -0.0033333334)) (:scalevel-y :copy scalevel-x) (:fade-a -3.4)) + ) + +(defpart 817 + :init-specs ((:texture (new 'static 'texture-id :index #x5 :page #x4)) + (:num 4.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.25) (meters 1.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.3) 1 (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3)) + (:r 100.0) + (:g 100.0) + (:b 100.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-x (degrees 1.2)) + (:rotvel-y (degrees 2.4)) + (:rotvel-z (degrees 0) 3 (degrees 2.4)) + (:accel-y (meters -0.0033333334)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 set-conerot)) + (:next-time (seconds 0.25)) + (:next-launcher 816) + (:conerot-x (degrees 40) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-crate-explode + :id 195 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 810 :flags (sp7)) + (sp-item 812 :flags (sp7)) + (sp-item 814 :flags (sp7)) + (sp-item 815 :flags (sp7)) + (sp-item 817 :flags (sp7)) + ) + ) + +(defpartgroup group-crate-steel-explode + :id 196 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 810) (sp-item 812) (sp-item 814) (sp-item 817) (sp-item 817) (sp-item 817)) + ) + +(defpartgroup group-dark-eco-box-explosion + :id 197 + :duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 145 :fade-after (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 143) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 818 :fade-after (meters 160) :period (seconds 2) :length (seconds 0.017)) + (sp-item 146 :period (seconds 2) :length (seconds 0.017)) + (sp-item 147 :fade-after (meters 80) :falloff-to (meters 80) :period (seconds 2) :length (seconds 0.135)) + (sp-item 148 :period (seconds 2) :length (seconds 0.067)) + (sp-item 819 :fade-after (meters 120) :falloff-to (meters 120) :period (seconds 2) :length (seconds 0.067)) + ) + ) + +(defpart 147 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 6.0) + (:scale-x (meters 0.2) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g 0.0 32.0) + (:b 96.0 64.0) + (:a 32.0 96.0) + (:vel-y (meters 0.026666667) (meters 0.10666667)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.1) (seconds 0.097)) + (:next-launcher 820) + (:conerot-x (degrees 0) (degrees 140)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 2) (meters 4)) + ) + ) + +(defpart 820 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -1.4222223)) + ) + +(defpart 819 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 3.0) + (:scale-x (meters 0.2)) + (:rot-z (degrees 0) (degrees 180)) + (:scale-y (meters 8)) + (:r 64.0 192.0) + (:g 0.0 32.0) + (:b 128.0 64.0) + (:a 32.0 64.0) + (:scalevel-y (meters 0.42666668)) + (:fade-a -1.6) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 146 + :init-specs ((:texture (new 'static 'texture-id :index #x4b :page #x4)) + (:num 1.0) + (:scale-x (meters 16)) + (:scale-y :copy scale-x) + (:r 64.0 192.0) + (:g 0.0 32.0) + (:b 128.0 64.0) + (:a 96.0) + (:fade-a -1.7454545) + (:timer (seconds 0.18)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 148 + :init-specs ((:texture (new 'static 'texture-id :page #x4)) + (:num 4.0) + (:scale-x (meters 2.5) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 96.0) + (:g 0.0 32.0) + (:b 64.0 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.053333335) (meters 0.013333334)) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.8) + (:timer (seconds 1.7)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 145 + :init-specs ((:texture (new 'static 'texture-id :index #x4b :page #x4)) + (:num 16.0) + (:y (meters 1)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:a 0.0) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:accel-y (meters -0.00033333333)) + (:friction 0.94) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 140)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 143 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3) (meters 0.3)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 96.0) + (:g 0.0 32.0) + (:b 64.0 32.0) + (:a 64.0 64.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.026666667) (meters 0.10666667)) + (:scalevel-x (meters -0.000909091)) + (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.26666668) + (:fade-a -0.19393939) + (:timer (seconds 0.3) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 144 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g 0.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.0006190476)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.01904762) + (:accel-y (meters -0.000100000005) (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 599) + ) + ) + +(defpart 818 + :init-specs ((:texture (new 'static 'texture-id :index #x5 :page #x4)) + (:num 8.0 16.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.25) (meters 1.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.3) 1 (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3)) + (:r 128.0) + (:g 64.0 1 32.0) + (:b 32.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-x (degrees 1.2)) + (:rotvel-y (degrees 2.4)) + (:rotvel-z (degrees 0) 3 (degrees 2.4)) + (:accel-y (meters -0.0033333334)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.25)) + (:next-launcher 821) + (:conerot-x (degrees 40) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 821 + :init-specs ((:scalevel-x (meters -0.0033333334)) (:scalevel-y :copy scalevel-x) (:fade-a -3.4)) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this crate)) + (the-as search-info-flag (if (logtest? (actor-option no-track) (-> this fact options)) + 0 + 2 + ) + ) + ) + +(defbehavior crate-standard-event-handler crate ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (let* ((v1-1 (the-as attack-info (-> arg3 param 1))) + (s4-0 (-> v1-1 id)) + (s5-0 (-> v1-1 count)) + ) + (case (-> self defense) + (('iron) + (case (-> v1-1 mode) + (('flop 'uppercut 'explode 'eco-yellow 'racer 'board 'tube 'flut-bonk 'flut-attack 'darkjak 'mech-punch) + (if (and (logtest? (-> self fact options) (actor-option racer-only)) + (= (-> arg0 type) target) + (not (logtest? (focus-status pilot) (-> (the-as process-focusable arg0) focus-status))) + ) + (return #f) + ) + (send-event arg0 'get-attack-count 1) + (process-contact-action arg0) + (set! (-> self target) (process->handle arg0)) + (go-virtual die #f (the-as int s5-0)) + ) + (else + (when (and (!= s4-0 (-> self incoming-attack-id)) (= (-> self root trans y) (-> self base y))) + (talker-spawn-func (-> *talker-speech* 39) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self incoming-attack-id) s4-0) + (if (not (!= (-> self smush amp) 0.0)) + (sound-play "icrate-nobreak") + ) + (activate! (-> self smush) 0.1 90 150 1.0 1.0 (-> self clock)) + (go-virtual bounce-on) + ) + #f + ) + ) + ) + (('steel) + (case (-> v1-1 mode) + (('explode 'eco-yellow 'tube 'flut-bonk 'flut-attack 'racer 'board 'darkjak 'mech-punch) + (send-event arg0 'get-attack-count 1) + (when (logtest? (-> self draw status) (draw-control-status on-screen)) + (talker-spawn-func (-> *talker-speech* 40) *entity-pool* (target-pos 0) (the-as region #f)) + (talker-spawn-func (-> *talker-speech* 41) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (process-contact-action arg0) + (set! (-> self target) (process->handle arg0)) + (go-virtual die #f (the-as int s5-0)) + ) + (else + (when (and (!= s4-0 (-> self incoming-attack-id)) (= (-> self root trans y) (-> self base y))) + (talker-spawn-func (-> *talker-speech* 42) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self incoming-attack-id) s4-0) + (if (not (!= (-> self smush amp) 0.0)) + (sound-play "scrate-nobreak") + ) + (activate! (-> self smush) 0.1 90 150 1.0 1.0 (-> self clock)) + (go-virtual bounce-on) + ) + #f + ) + ) + ) + (('darkeco) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'darkeco)) + ) + ) + (when (= (-> arg0 type) target) + (talker-spawn-func (-> *talker-speech* 43) *entity-pool* (target-pos 0) (the-as region #f)) + (talker-spawn-func (-> *talker-speech* 38) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (process-contact-action arg0) + (set! (-> self target) (process->handle arg0)) + (go-virtual die #f (the-as int s5-0)) + ) + (else + (-> v1-1 mode) + (send-event arg0 'get-attack-count 1) + (process-contact-action arg0) + (set! (-> self target) (process->handle arg0)) + (go-virtual die #f (the-as int s5-0)) + ) + ) + ) + ) + (('touch) + (case (-> self defense) + (('darkeco) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'darkeco)) + ) + ) + (process-contact-action arg0) + (set! (-> self target) (process->handle arg0)) + (go-virtual die #f 0) + ) + ) + ) + (('bonk) + (when (= (-> self root trans y) (-> self base y)) + (activate! (-> self smush) -0.1 75 150 1.0 1.0 (-> self clock)) + (go-virtual bounce-on) + ) + ) + (('impact-impulse) + (let ((v1-115 (the-as object (-> arg3 param 0)))) + (when (< 122880.0 (-> (the-as impact-control v1-115) trans 1 x)) + (logior! (-> self root penetrated-by) (penetrate vehicle)) + (go-virtual die #f 0) + #t + ) + ) + ) + (('wake) + (let ((v0-0 (the-as object (logclear (-> self mask) (process-mask sleep))))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 + ) + ) + (('hide) + (go-virtual hide) + ) + (('die) + (go-virtual die #f 0) + ) + (('eco-blue) + (if (not (or (= (-> self defense) 'darkeco) + (and (-> self next-state) (let ((v1-131 (-> self next-state name))) + (or (= v1-131 'notice-blue) (= v1-131 'die)) + ) + ) + (!= (-> self root trans y) (-> self base y)) + ) + ) + (go-virtual notice-blue (process->handle arg0)) + ) + ) + (('fall) + (when (not (and (-> self next-state) (= (-> self next-state name) 'fall))) + (set! (-> self root transv quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (go-virtual fall) + ) + ) + ) + ) + +(defstate hide (crate) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #f) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (vector+! (-> self draw origin) (-> self root trans) (-> self draw bounds)) + (set! (-> self draw origin w) (-> self draw bounds w)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-9 (-> self root root-prim))) + (set! (-> v1-9 prim-core collide-as) (collide-spec)) + (set! (-> v1-9 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-post) + (while (or (should-hide? self) + (and (sphere-in-view-frustum? (the-as sphere (-> self draw origin))) + (< (vector-vector-distance (camera-pos) (-> self root trans)) 327680.0) + ) + (and *target* (and (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + ) + (suspend) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-29 (-> self root root-prim))) + (set! (-> v1-29 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-29 prim-core collide-with) (-> self root backup-collide-with)) + ) + (go-virtual idle) + ) + ) + +(defstate idle (crate) + :virtual #t + :event crate-standard-event-handler + :trans (behavior () + (if (-> *setting-control* user-current hide-crates?) + (go-virtual hide) + ) + ) + :code (behavior () + (suspend) + (update-transforms (-> self root)) + (carry-info-method-9 (-> self carry)) + (logior! (-> self mask) (process-mask sleep)) + (until #f + (suspend) + ) + #f + ) + :post ja-post + ) + +(defstate carry (crate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('carry? 'carry-info) + (-> self carry) + ) + (('drop) + (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) + (go-virtual fall) + ) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + (carry-info-method-9 (-> self carry)) + (carry-info-method-13 (-> self carry)) + (update-transforms (-> self root)) + ) + ) + +(defstate fall (crate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('carry-info) + (-> self carry) + ) + (('carry? 'pickup) + (the-as carry-info #f) + ) + ) + ) + :enter (behavior () + (if (handle->process (-> self carry other)) + (drop-impl! + (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) + (-> self carry) + ) + ) + (set! (-> self root status) (collide-status)) + (set! (-> self root root-prim local-sphere w) (-> self carry carry-radius)) + (logior! + (-> self root root-prim prim-core collide-with) + (collide-spec backgnd crate obstacle hit-by-others-list pusher) + ) + ) + :trans (behavior () + (when (and (logtest? (-> self root status) (collide-status on-surface)) (< 0.8 (-> self root surface-angle))) + (vector-reset! (-> self root transv)) + (when (= (vector-length (-> self root transv)) 0.0) + (set! (-> self root root-prim local-sphere w) (-> self carry backup-radius)) + (set! (-> self base quad) (-> self root trans quad)) + (let ((v1-16 (-> self root root-prim))) + (set! (-> v1-16 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-16 prim-core collide-with) (-> self root backup-collide-with)) + ) + (go-virtual idle) + ) + ) + ) + :code sleep-code + :post (behavior () + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (if (< (-> self root dynam gravity-max) (vector-length (-> self root transv))) + (vector-normalize! (-> self root transv) (-> self root dynam gravity-max)) + ) + (let ((gp-1 (-> self root))) + (let ((a2-1 (new 'stack-no-clear 'collide-query))) + (set! (-> gp-1 root-prim type) collide-shape-prim-sphere) + (set! (-> a2-1 collide-with) (collide-spec backgnd crate obstacle pusher)) + (set! (-> a2-1 ignore-process0) self) + (set! (-> a2-1 ignore-process1) #f) + (set! (-> a2-1 ignore-pat) (-> gp-1 pat-ignore-mask)) + (set! (-> a2-1 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide gp-1 (-> gp-1 transv) a2-1 (meters 0)) + ) + (set! (-> gp-1 root-prim type) collide-shape-prim-mesh) + ) + (crate-post) + ) + ) + +(defstate bounce-on (crate) + :virtual #t + :event crate-standard-event-handler + :code (behavior () + (while (!= (-> self smush amp) 0.0) + (suspend) + ) + (go-virtual idle) + ) + :post crate-post + ) + +(defstate notice-blue (crate) + :virtual #t + :event crate-standard-event-handler + :trans (behavior () + (cond + ((not (send-event *target* 'query 'powerup (pickup-type eco-blue))) + (logior! (-> self mask) (process-mask sleep-code)) + (if (not (!= (-> self smush amp) 0.0)) + (go-virtual idle) + ) + ) + (else + (logclear! (-> self mask) (process-mask sleep-code)) + ) + ) + ) + :code (behavior ((arg0 handle)) + (set! (-> self target) arg0) + (until #f + (let* ((gp-0 (handle->process (-> self target))) + (v1-3 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (when v1-3 + (let* ((gp-1 (-> (the-as process-drawable v1-3) root)) + (v1-4 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (when v1-4 + (let* ((gp-2 (-> self root root-prim prim-core)) + (a1-3 (-> (the-as collide-shape v1-4) root-prim prim-core)) + (f30-0 (vector-vector-distance (the-as vector gp-2) (the-as vector a1-3))) + ) + (when (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (!= (-> self defense) 'steel)) + (logior! (-> self fact options) (actor-option suck-in)) + (process-contact-action (handle->process (-> self target))) + (go-virtual die #f 0) + ) + (when (rand-vu-percent? 0.5) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (the-as uint128 (the-as vector (-> gp-2 world-sphere quad)))) + (dotimes (gp-3 3) + (+! (-> s5-0 data gp-3) (rand-vu-float-range -5324.8 5324.8)) + ) + (eco-blue-glow s5-0) + ) + ) + (activate! + (-> self smush) + (lerp-scale + (rand-vu-float-range 0.1 0.3) + (rand-vu-float-range 0.0 0.02) + f30-0 + (-> *FACT-bank* suck-suck-dist) + (-> *FACT-bank* suck-bounce-dist) + ) + 60 + 60 + 1.0 + 1.0 + (-> self clock) + ) + ) + ) + ) + ) + ) + (suspend) + ) + #f + ) + :post crate-post + ) + +(defstate die (crate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (case (-> self defense) + (('darkeco) + (send-event + proc + 'attack + (-> block param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'darkeco)) + ) + ) + ) + ) + ) + ) + ) + :code (behavior ((arg0 symbol) (arg1 int)) + (+! (-> *game-info* crates-opened) 1.0) + (logior! (-> self focus-status) (focus-status dead)) + (let ((v1-6 (-> self root root-prim))) + (set! (-> v1-6 prim-core collide-as) (collide-spec)) + (set! (-> v1-6 prim-core collide-with) (collide-spec)) + ) + 0 + (if (nonzero? (-> self sound)) + (stop! (-> self sound)) + ) + (let ((v1-13 (handle->process (-> self target)))) + (if (and (and v1-13 (= (-> v1-13 type) target) (focus-test? (the-as process-focusable v1-13) flut tube board pilot)) + (and (!= (-> self fact pickup-type) 11) (not arg0)) + ) + (logior! (-> self fact options) (actor-option suck-in)) + ) + ) + (when (not arg0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 0.04)) + (suspend) + ) + ) + (case (-> self look) + (('iron) + (sound-play "icrate-break") + ) + (('steel) + (sound-play "scrate-break") + ) + (('darkeco) + (sound-play "dcrate-break") + ) + (('urn-a 'urn-b 'urn-c) + (sound-play "vase-smash") + ) + (else + (sound-play "wcrate-break") + ) + ) + (case (-> self defense) + (('darkeco) + (let ((f0-2 (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root trans) (target-pos 0)) 8192.0 40960.0))) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 f0-2)) (seconds 0.3)) + ) + (process-spawn + touch-tracker + :init touch-tracker-init + (-> self root trans) + (-> *CRATE-bank* DARKECO_EXPLODE_RADIUS) + 30 + :name "touch-tracker" + :to self + ) + ) + ) + (let ((v1-55 (-> self look))) + (cond + ((= v1-55 'darkeco) + (cond + ((logtest? (-> *part-group-id-table* 197 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-9 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-9 + (let ((t9-19 (method-of-type part-tracker-subsampler activate))) + (t9-19 (the-as part-tracker-subsampler s5-9) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-20 run-function-in-process) + (a0-41 s5-9) + (a1-20 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 197)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-20) a0-41 a1-20 *part-tracker-subsampler-params-default*) + ) + (-> s5-9 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-10 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-10 + (let ((t9-22 (method-of-type part-tracker activate))) + (t9-22 (the-as part-tracker s5-10) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-23 run-function-in-process) + (a0-47 s5-10) + (a1-23 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 197)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-23) a0-47 a1-23 *part-tracker-params-default*) + ) + (-> s5-10 ppointer) + ) + ) + ) + ) + ) + ((or (= v1-55 'steel) (= v1-55 'iron)) + (cond + ((logtest? (-> *part-group-id-table* 196 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-11 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-11 + (let ((t9-25 (method-of-type part-tracker-subsampler activate))) + (t9-25 (the-as part-tracker-subsampler s5-11) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-26 run-function-in-process) + (a0-55 s5-11) + (a1-27 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 196)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-26) a0-55 a1-27 *part-tracker-subsampler-params-default*) + ) + (-> s5-11 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-12 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-12 + (let ((t9-28 (method-of-type part-tracker activate))) + (t9-28 (the-as part-tracker s5-12) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-29 run-function-in-process) + (a0-61 s5-12) + (a1-30 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 196)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-29) a0-61 a1-30 *part-tracker-params-default*) + ) + (-> s5-12 ppointer) + ) + ) + ) + ) + ) + ((logtest? (-> *part-group-id-table* 195 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-13 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-13 + (let ((t9-31 (method-of-type part-tracker-subsampler activate))) + (t9-31 (the-as part-tracker-subsampler s5-13) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-32 run-function-in-process) + (a0-67 s5-13) + (a1-33 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 195)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-32) a0-67 a1-33 *part-tracker-subsampler-params-default*) + ) + (-> s5-13 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-14 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-14 + (let ((t9-34 (method-of-type part-tracker activate))) + (t9-34 (the-as part-tracker s5-14) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-35 run-function-in-process) + (a0-73 s5-14) + (a1-36 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 195)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-35) a0-73 a1-36 *part-tracker-params-default*) + ) + (-> s5-14 ppointer) + ) + ) + ) + ) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (ja-post) + (case (-> self fact pickup-type) + (((pickup-type money) + (pickup-type buzzer) + (pickup-type eco-blue) + (pickup-type eco-yellow) + (pickup-type eco-red) + (pickup-type fuel-cell) + (pickup-type gem) + (pickup-type skill) + ) + (go-virtual special-contents-die) + ) + (((pickup-type health)) + (talker-spawn-func (-> *talker-speech* 5) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1 #t) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 5)) + (suspend) + ) + ) + (when (logtest? (actor-option cond-respawn) (-> self fact options)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 15)) + (suspend) + ) + ) + (go-virtual hide) + ) + ) + ) + +(defstate special-contents-die (crate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (let ((gp-0 (-> self entity extra perm))) + (logior! (-> gp-0 status) (entity-perm-status bit-5)) + (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) + (+! (-> self child-count) -1) + (when (<= (-> self child-count) 0) + (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) + (process-entity-status! self (entity-perm-status bit-4) #f) + ) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (process-entity-status! self (entity-perm-status bit-15) #f) + (set! (-> gp-0 user-int8 0) 2) + (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) + (set! (-> self mask) v0-0) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) + :trans (-> (method-of-type crate die) trans) + :code (behavior () + (logior! (-> self focus-status) (focus-status dead)) + (when (or (= (-> self fact pickup-type) (pickup-type money)) + (= (-> self fact pickup-type) (pickup-type gem)) + (= (-> self fact pickup-type) (pickup-type skill)) + (= (-> self defense) 'iron) + (= (-> self defense) 'steel) + ) + (let ((a0-6 (-> self entity))) + (if (when a0-6 + (let ((a0-7 (-> a0-6 extra perm task))) + (if a0-7 + (= a0-7 (game-task none)) + ) + ) + ) + (set! (-> self entity extra perm task) (game-task complete)) + ) + ) + ) + (let ((v1-20 (-> self root root-prim))) + (set! (-> v1-20 prim-core collide-as) (collide-spec)) + (set! (-> v1-20 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (drop-pickup (-> self fact) #t self (the-as fact-info #f) 0 #t) + (set! (-> self child-count) (collectable-count self)) + (process-entity-status! self (entity-perm-status bit-4) #t) + (process-entity-status! self (entity-perm-status bit-15) #t) + (when (-> self entity) + (let ((v1-31 (-> self entity extra perm))) + (logior! (-> v1-31 status) (entity-perm-status bit-5)) + (set! (-> v1-31 user-int8 0) 1) + ) + ) + (when (-> self child) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + (while (-> self child) + (suspend) + ) + ) + ) + ) + +;; WARN: Return type mismatch none vs object. +(defbehavior crate-init-by-other crate ((arg0 entity) (arg1 vector) (arg2 symbol) (arg3 fact-info-crate)) + (process-entity-set! self arg0) + (init! self (the-as entity-actor arg0)) + (set! (-> self root trans quad) (-> arg1 quad)) + (set! (-> self look) arg2) + (set! (-> self defense) arg2) + (init-skel! self) + (when arg3 + (set! (-> self fact pickup-type) (-> arg3 pickup-type)) + (set! (-> self fact pickup-amount) (-> arg3 pickup-spawn-amount)) + (set! (-> self fact options) (-> arg3 options)) + ) + (set! (-> self draw light-index) (the-as uint 10)) + (go-initial-state self) + ) + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this crate) (arg0 entity-actor)) + (init! this arg0) + (init-skel! this) + (set! (-> this draw light-index) (the-as uint 10)) + (go-initial-state this) + ) + +(defmethod init-collision! ((this crate)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate notice-blue-eco-powerup)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 3072.0 0.0 (-> *CRATE-bank* COLLIDE_RADIUS)) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech + mech-punch + dark-skin + dark-punch + dark-smack + flut + knocked + ) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch crate vs none. +(defmethod init! ((this crate) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask crate)) + (init-collision! this) + (set! (-> this fact) + (new 'process 'fact-info-crate this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (when (-> this entity) + (let ((v1-12 (-> this entity extra perm))) + (set! (-> this fact pickup-amount) + (fmax 0.0 (- (-> this fact pickup-amount) (the float (-> v1-12 user-int8 1)))) + ) + ) + ) + (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (set! (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-amount) 0.0) + ) + (when arg0 + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + ) + (let ((v1-27 + ((method-of-type res-lump get-property-struct) + (-> this entity) + 'crate-type + 'interp + -1000000000.0 + (the-as structure 'wood) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! (-> this look) (the-as symbol v1-27)) + (set! (-> this defense) (the-as symbol v1-27)) + ) + (set! (-> this carry) + (new 'process 'carry-info this 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0) + ) + (set! (-> this carry max-pull) 3686.4) + (set! (-> this carry carry-radius) 3276.8) + (set! (-> this target) (the-as handle #f)) + (none) + ) + +;; WARN: Return type mismatch crate vs none. +(defmethod init-skel! ((this crate)) + (case (-> this look) + (('iron) + (set! (-> this root penetrated-by) (penetrate flop uppercut tube vehicle flut-attack board dark-skin explode)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('steel) + (set! (-> this root penetrated-by) (penetrate tube vehicle flut-attack board dark-skin explode)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('blue) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-cty-blue" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('metal) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-cty-metal" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('darkeco) + (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + ) + (('none) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this draw status) (draw-control-status no-draw)) + ) + (('urn-a) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-urn-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('urn-b) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-urn-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('urn-c) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-urn-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (else + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + ) + (set! (-> this base quad) (-> this root trans quad)) + (crate-post) + (nav-mesh-connect-from-ent this) + (none) + ) + +;; WARN: Return type mismatch crate vs none. +(defmethod params-set! ((this crate) (arg0 symbol) (arg1 symbol)) + (if arg0 + (set! (-> this look) arg0) + ) + (if arg1 + (set! (-> this defense) arg1) + ) + (none) + ) + +(defmethod go-initial-state ((this crate)) + (if (-> *setting-control* user-current hide-crates?) + (go (method-of-object this hide)) + ) + (when (-> this entity) + (if (and (>= (-> this entity extra perm user-int8 0) 1) + (-> this entity) + (logtest? (-> this entity extra perm status) (entity-perm-status bit-15)) + ) + (go (method-of-object this die) #t 0) + ) + ) + (cond + ((logtest? (actor-option cond-hide) (-> this fact options)) + (go (method-of-object this hide)) + ) + ((logtest? (actor-option fall) (-> this fact options)) + (go (method-of-object this fall)) + ) + (else + (go (method-of-object this idle)) + ) + ) + 0 + (none) + ) + +(defmethod smush-update! ((this crate)) + (let ((f0-0 (update! (-> this smush)))) + (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale y) (+ 1.0 f0-0)) + (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) + ) + 0 + (none) + ) + +;; WARN: disable def twice: 62. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod should-hide? ((this crate)) + (with-pp + (cond + ((or (and (> (-> this fact suck-count) 0) (< (you-suck-stage *game-info* #f 0) (-> this fact suck-count))) + (-> *setting-control* user-current hide-crates?) + ) + #t + ) + ((logtest? (actor-option cond-low-ammo) (-> this fact options)) + (case (-> this fact pickup-type) + (((pickup-type ammo-yellow) (pickup-type ammo-red) (pickup-type ammo-blue) (pickup-type ammo-dark)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer pp)) + (set! (-> a1-4 num-params) 1) + (set! (-> a1-4 message) 'test-pickup) + (set! (-> a1-4 param 0) (the-as uint (-> this fact pickup-type))) + (let ((v1-17 (the-as float (send-event-function *target* a1-4)))) + (or (not v1-17) (< 10.0 v1-17)) + ) + ) + ) + (else + #f + ) + ) + ) + (else + #f + ) + ) + ) + ) + +(deftype pickup-spawner (crate) + ((blocker entity-actor) + ) + ) + + +;; WARN: Return type mismatch pickup-spawner vs none. +(defmethod init! ((this pickup-spawner) (arg0 entity-actor)) + (let ((t9-0 (method-of-type crate init!))) + (t9-0 this arg0) + ) + (set! (-> this look) 'none) + (set! (-> this blocker) #f) + (if (logtest? (-> this fact options) (actor-option blocked)) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + ) + (none) + ) + +(defmethod go-initial-state ((this pickup-spawner)) + (go (method-of-object this idle)) + 0 + (none) + ) + +(defstate idle (pickup-spawner) + :virtual #t + :code (behavior () + (until #f + (if (or (not (-> self blocker)) + (logtest? (-> self blocker extra perm status) (entity-perm-status subtask-complete)) + ) + (go-virtual die #t 0) + ) + (suspend) + ) + #f + ) + ) + +(deftype urn-a (crate) + () + ) + + +;; WARN: Return type mismatch urn-a vs none. +(defmethod init! ((this urn-a) (arg0 entity-actor)) + (let ((t9-0 (method-of-type crate init!))) + (t9-0 this arg0) + ) + (set! (-> this look) 'urn-a) + (none) + ) + +(deftype urn-b (crate) + () + ) + + +;; WARN: Return type mismatch urn-b vs none. +(defmethod init! ((this urn-b) (arg0 entity-actor)) + (let ((t9-0 (method-of-type crate init!))) + (t9-0 this arg0) + ) + (set! (-> this look) 'urn-b) + (none) + ) + +(deftype urn-c (crate) + () + ) + + +;; WARN: Return type mismatch urn-c vs none. +(defmethod init! ((this urn-c) (arg0 entity-actor)) + (let ((t9-0 (method-of-type crate init!))) + (t9-0 this arg0) + ) + (set! (-> this look) 'urn-c) + (none) + ) diff --git a/goal_src/jak3/engine/common-obs/curves.gc b/goal_src/jak3/engine/common-obs/curves.gc index 54ac0b88573..f1dd334b236 100644 --- a/goal_src/jak3/engine/common-obs/curves.gc +++ b/goal_src/jak3/engine/common-obs/curves.gc @@ -5,5 +5,515 @@ ;; name in dgo: curves ;; dgos: GAME +(declare-type curve2d basic) +(declare-type curve-color basic) +(declare-type curve-color-fast curve-color) +(declare-type curve2d-piecewise curve2d) +(declare-type curve2d-fast basic) + +(define-extern *curve-unity* curve2d-fast) +(define-extern *curve-linear-up* curve2d-fast) +(define-extern *curve-linear-down* curve2d-fast) +(define-extern *curve-linear-up-hold* curve2d-piecewise) +(define-extern *curve-linear-up-down* curve2d-fast) +(define-extern *trail-color-curve-white* curve-color-fast) +(define-extern particle-color-curve-white* curve-color-fast) +(define-extern *trail-color-curve-red* curve-color-fast) + ;; DECOMP BEGINS +(deftype float-pair (structure) + ((first float) + (second float) + (x float :overlay-at first) + (y float :overlay-at second) + ) + ) + + +(deftype float-pair-array (inline-array-class) + ((data float-pair :inline :dynamic) + ) + ) + + +(set! (-> float-pair-array heap-base) (the-as uint 16)) + +(deftype curve2d (basic) + () + (:methods + (curve2d-method-9 (_type_ float int) float) + ) + ) + + +(deftype curve-color (basic) + () + (:methods + (curve-color-method-9 (_type_ float rgbaf int) rgbaf) + ) + ) + + +(deftype curve2d-piecewise (curve2d) + ((pts float-pair-array) + (default-loop-behavior uint64) + ) + (:methods + (curve2d-piecewise-method-10 (_type_ int symbol uint) none) + (curve2d-piecewise-method-11 (_type_) none) + ) + ) + + +(deftype curve2d-fast (curve2d) + ((xs vector :inline) + (ys vector :inline) + (one-over-x-deltas vector :inline) + ) + ) + + +(defun rgbaf-lerp! ((arg0 rgbaf) (arg1 rgbaf) (arg2 rgbaf) (arg3 float)) + (vector-lerp! arg0 arg1 arg2 arg3) + (set! (-> arg0 w) (lerp (-> arg1 w) (-> arg2 w) arg3)) + arg0 + ) + +(deftype curve-color-fast (curve-color) + ((xs vector :inline) + (ys vector 4 :inline) + (one-over-x-deltas vector :inline) + ) + ) + + +(deftype color-pair (structure) + ((first float) + (second rgbaf :inline) + (x float :overlay-at first) + (y rgbaf :inline :overlay-at second) + ) + ) + + +(deftype color-pair-array (inline-array-class) + ((data color-pair :inline :dynamic) + ) + ) + + +(set! (-> color-pair-array heap-base) (the-as uint 32)) + +(deftype curve-color-piecewise (curve-color) + ((pts color-pair-array) + (default-loop-behavior uint64) + ) + (:methods + (curve-color-piecewise-method-10 (_type_ int symbol uint) none) + ) + ) + + +(defmethod curve2d-piecewise-method-10 ((this curve2d-piecewise) (arg0 int) (arg1 symbol) (arg2 uint)) + (set! (-> this pts) ((method-of-type float-pair-array new) arg1 float-pair-array arg0)) + (set! (-> this default-loop-behavior) (the-as uint (if arg2 + 0 + 1 + ) + ) + ) + 0 + (none) + ) + +(defmethod curve-color-piecewise-method-10 ((this curve-color-piecewise) (arg0 int) (arg1 symbol) (arg2 uint)) + (set! (-> this pts) ((method-of-type color-pair-array new) arg1 color-pair-array arg0)) + (set! (-> this default-loop-behavior) (the-as uint (if arg2 + 0 + 1 + ) + ) + ) + 0 + (none) + ) + +(defmethod curve-color-method-9 ((this curve-color-piecewise) (arg0 float) (arg1 rgbaf) (arg2 int)) + (when (or (< 1.0 arg0) (< arg0 0.0)) + (if (= arg2 3) + (set! arg2 (the-as int (-> this default-loop-behavior))) + ) + (let ((v1-8 arg2)) + (cond + ((zero? v1-8) + (set! arg0 (- arg0 (* (the float (the int (/ arg0 1.0))) 1.0))) + ) + ((= v1-8 1) + (set! arg0 (fmax 0.0 (fmin 1.0 arg0))) + ) + ) + ) + ) + (when (= arg0 0.0) + (set! (-> arg1 quad) (-> this pts data 0 second quad)) + (return arg1) + ) + (dotimes (s4-0 (-> this pts length)) + (when (>= (-> this pts data s4-0 first) arg0) + (let ((a3-4 (lerp-scale 0.0 1.0 arg0 (-> this pts data (+ s4-0 -1) first) (-> this pts data s4-0 first)))) + (return (rgbaf-lerp! + arg1 + (the-as rgbaf (+ (the-as uint (-> this pts data 0 second)) (* (+ s4-0 -1) 32))) + (the-as rgbaf (+ (the-as uint (-> this pts data 0 second)) (* s4-0 32))) + a3-4 + ) + ) + ) + ) + ) + (the-as rgbaf #f) + ) + +(defmethod curve2d-method-9 ((this curve2d-piecewise) (arg0 float) (arg1 int)) + (when (or (< 1.0 arg0) (< arg0 0.0)) + (if (= arg1 3) + (set! arg1 (the-as int (-> this default-loop-behavior))) + ) + (let ((v1-8 arg1)) + (cond + ((zero? v1-8) + (set! arg0 (- arg0 (* (the float (the int (/ arg0 1.0))) 1.0))) + ) + ((= v1-8 1) + (set! arg0 (fmax 0.0 (fmin 1.0 arg0))) + ) + ) + ) + ) + (if (= arg0 0.0) + (return (-> this pts data 0 second)) + ) + (dotimes (v1-18 (-> this pts length)) + (if (>= (-> this pts data v1-18 first) arg0) + (return (lerp-scale + (-> this pts data (+ v1-18 -1) second) + (-> this pts data v1-18 second) + arg0 + (-> this pts data (+ v1-18 -1) first) + (-> this pts data v1-18 first) + ) + ) + ) + ) + 0.0 + ) + +;; WARN: Return type mismatch number vs float. +(defun evaluate-curve-fast ((arg0 curve2d-fast) (arg1 rgbaf) (arg2 rgbaf)) + (local-vars (v0-0 number)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + ) + (init-vf0-vector) + (let ((a2-1 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (.mov vf27 arg1) + (.lvf vf24 (&-> arg0 xs quad)) + (.lvf vf25 (&-> arg0 ys quad)) + (.lvf vf26 (&-> arg0 one-over-x-deltas quad)) + (.min.w.vf vf27 vf27 vf0) + (.max.x.vf vf27 vf27 vf0) + (.add.x.vf vf28 vf24 vf27) + (.mul.w.vf acc vf25 vf0) + (.add.mul.vf vf29 vf28 vf26 acc) + (.svf (&-> a2-1 quad) vf28) + (.svf (&-> v1-0 quad) vf29) + (let ((a0-1 (-> a2-1 z)) + (a1-1 (-> a2-1 y)) + ) + (nop!) + (b! (>= (the-as int a0-1) 0) cfg-3 :delay (set! v0-0 (-> v1-0 z))) + (b! (>= (the-as int a1-1) 0) cfg-3 :delay (set! v0-0 (-> v1-0 y))) + ) + (set! v0-0 (-> v1-0 x)) + ) + (label cfg-3) + (the-as float v0-0) + ) + ) + +;; WARN: Return type mismatch number vs float. +(defmethod curve2d-method-9 ((this curve2d-fast) (arg0 float) (arg1 int)) + (local-vars (v0-0 number)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + ) + (init-vf0-vector) + (let ((a1-1 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (let ((a2-1 arg0)) + (.mov vf27 a2-1) + ) + (.lvf vf24 (&-> this xs quad)) + (.lvf vf25 (&-> this ys quad)) + (.lvf vf26 (&-> this one-over-x-deltas quad)) + (.min.w.vf vf27 vf27 vf0) + (.max.x.vf vf27 vf27 vf0) + (.add.x.vf vf28 vf24 vf27) + (.mul.w.vf acc vf25 vf0) + (.add.mul.vf vf29 vf28 vf26 acc) + (.svf (&-> a1-1 quad) vf28) + (.svf (&-> v1-0 quad) vf29) + (let ((a0-1 (-> a1-1 z)) + (a1-2 (-> a1-1 y)) + ) + (nop!) + (b! (>= (the-as int a0-1) 0) cfg-3 :delay (set! v0-0 (-> v1-0 z))) + (b! (>= (the-as int a1-2) 0) cfg-3 :delay (set! v0-0 (-> v1-0 y))) + ) + (set! v0-0 (-> v1-0 x)) + ) + (label cfg-3) + (the-as float v0-0) + ) + ) + +(defun evaluate-color-curve-fast ((arg0 curve-color-fast) (arg1 rgbaf) (arg2 rgbaf)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf23 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf28 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (.mov vf26 arg1) + (.lvf vf23 (&-> arg0 xs quad)) + (.lvf vf25 (&-> arg0 one-over-x-deltas quad)) + (.max.w.vf vf3 vf0 vf0) + (.mul.vf acc vf25 vf23) + (.add.mul.x.vf vf28 vf25 vf26 acc) + (.svf (&-> v1-0 quad) vf28) + (let ((a1-1 (-> v1-0 z)) + (v1-1 (-> v1-0 y)) + ) + (b! (>= (the-as int a1-1) 0) cfg-4 :delay (nop!)) + (b! (>= (the-as int v1-1) 0) cfg-3 :delay (nop!)) + ) + ) + (.lvf vf1 (&-> arg0 ys 0 quad)) + (.lvf vf2 (&-> arg0 ys 1 quad)) + (.sub.x.vf vf4 vf3 vf28) + (.mul.x.vf acc vf2 vf28) + (.add.mul.x.vf vf5 vf1 vf4 acc) + (b! #t cfg-5 :delay (.svf (&-> arg2 quad) vf5)) + (label cfg-3) + (.lvf vf1 (&-> arg0 ys 1 quad)) + (.lvf vf2 (&-> arg0 ys 2 quad)) + (.sub.y.vf vf4 vf3 vf28) + (.mul.y.vf acc vf2 vf28) + (.add.mul.y.vf vf5 vf1 vf4 acc) + (b! #t cfg-5 :delay (.svf (&-> arg2 quad) vf5)) + (label cfg-4) + (.lvf vf1 (&-> arg0 ys 2 quad)) + (.lvf vf2 (&-> arg0 ys 3 quad)) + (.sub.z.vf vf4 vf3 vf28) + (.mul.z.vf acc vf2 vf28) + (.add.mul.z.vf vf5 vf1 vf4 acc) + (.svf (&-> arg2 quad) vf5) + (label cfg-5) + arg2 + ) + ) + +(defmethod curve-color-method-9 ((this curve-color-fast) (arg0 float) (arg1 rgbaf) (arg2 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf23 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf28 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 this) + (f0-0 arg0) + (a0-1 arg1) + ) + (let ((a1-1 (new 'stack-no-clear 'rgbaf))) + (let ((a3-1 f0-0)) + (.mov vf26 a3-1) + ) + (.lvf vf23 (&-> v1-0 xs quad)) + (.lvf vf25 (&-> v1-0 one-over-x-deltas quad)) + (.max.w.vf vf3 vf0 vf0) + (.mul.vf acc vf25 vf23) + (.add.mul.x.vf vf28 vf25 vf26 acc) + (.svf (&-> a1-1 quad) vf28) + (let ((a3-2 (-> a1-1 z)) + (a1-2 (-> a1-1 y)) + ) + (b! (>= (the-as int a3-2) 0) cfg-4 :delay (nop!)) + (b! (>= (the-as int a1-2) 0) cfg-3 :delay (nop!)) + ) + ) + (.lvf vf1 (&-> v1-0 ys 0 quad)) + (.lvf vf2 (&-> v1-0 ys 1 quad)) + (.sub.x.vf vf4 vf3 vf28) + (.mul.x.vf acc vf2 vf28) + (.add.mul.x.vf vf5 vf1 vf4 acc) + (b! #t cfg-5 :delay (.svf (&-> a0-1 quad) vf5)) + (label cfg-3) + (.lvf vf1 (&-> v1-0 ys 1 quad)) + (.lvf vf2 (&-> v1-0 ys 2 quad)) + (.sub.y.vf vf4 vf3 vf28) + (.mul.y.vf acc vf2 vf28) + (.add.mul.y.vf vf5 vf1 vf4 acc) + (b! #t cfg-5 :delay (.svf (&-> a0-1 quad) vf5)) + (label cfg-4) + (.lvf vf1 (&-> v1-0 ys 2 quad)) + (.lvf vf2 (&-> v1-0 ys 3 quad)) + (.sub.z.vf vf4 vf3 vf28) + (.mul.z.vf acc vf2 vf28) + (.add.mul.z.vf vf5 vf1 vf4 acc) + (.svf (&-> a0-1 quad) vf5) + ) + (label cfg-5) + (set! (-> arg1 w) 1.0) + arg1 + ) + ) + +;; WARN: Return type mismatch rgba vs int. +(defun rgba<-rgbaf ((arg0 rgba) (arg1 rgbaf)) + (the-as int (copy-and-set-field + (copy-and-set-field + (copy-and-set-field + (copy-and-set-field arg0 r (the int (* 128.0 (-> arg1 x)))) + g + (the int (* 128.0 (-> arg1 y))) + ) + b + (the int (* 128.0 (-> arg1 z))) + ) + a + (the int (* 128.0 (-> arg1 w))) + ) + ) + ) + +(if #t + (set! *curve-unity* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-linear-up* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-linear-down* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x -1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(when (or (zero? *curve-linear-up-hold*) (!= loading-level global)) + (set! *curve-linear-up-hold* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *curve-linear-up-hold* 2 'loading-level (the-as uint #f)) + ) + +(set! (-> *curve-linear-up-hold* pts data 0 first) 0.0) + +(set! (-> *curve-linear-up-hold* pts data 0 second) 0.0) + +(set! (-> *curve-linear-up-hold* pts data 1 first) 1.0) + +(set! (-> *curve-linear-up-hold* pts data 1 second) 1.0) + +(if #t + (set! *curve-linear-up-down* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y -2.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *trail-color-curve-white* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! particle-color-curve-white* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *trail-color-curve-red* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 0.3 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.25 :z 1.0 :w 1.0) + ) + ) + ) diff --git a/goal_src/jak3/engine/common-obs/gem-pool.gc b/goal_src/jak3/engine/common-obs/gem-pool.gc index a10f0f463c3..92f94fa617b 100644 --- a/goal_src/jak3/engine/common-obs/gem-pool.gc +++ b/goal_src/jak3/engine/common-obs/gem-pool.gc @@ -7,3 +7,85 @@ ;; DECOMP BEGINS +(defun get-gem-pool-size ((arg0 int)) + (case arg0 + ((1) + (cond + ((task-node-closed? (game-task-node city-power-game-resolution)) + 1000.0 + ) + ((task-node-closed? (game-task-node city-port-assault-resolution)) + 120.0 + ) + ((task-node-closed? (game-task-node city-port-assault-introduction)) + 90.0 + ) + (else + 60.0 + ) + ) + ) + ((2) + 10.0 + ) + (else + 0.0 + ) + ) + ) + +(defun compare-gems ((arg0 int) (arg1 (pointer float))) + (< (-> arg1 0) (get-gem-pool-size arg0)) + ) + +(defun gems-available? ((arg0 int)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + #t + ) + ((= v1-0 1) + (let ((a1-1 (task-perm-by-index *game-info* 6))) + (compare-gems arg0 (the-as (pointer float) a1-1)) + ) + ) + ((= v1-0 2) + (let ((a1-3 (task-perm-by-index *game-info* 41))) + (compare-gems arg0 (the-as (pointer float) a1-3)) + ) + ) + (else + #f + ) + ) + ) + ) + +(defun notify-gem-pickup ((arg0 uint)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + #f + ) + ((= v1-0 1) + (let ((v1-2 (task-perm-by-index *game-info* 6))) + (logior! (-> v1-2 status) (entity-perm-status bit-5)) + (set! (-> v1-2 user-object 0) (+ 1.0 (the-as float (-> v1-2 user-object 0)))) + (logior! (-> v1-2 status) (entity-perm-status bit-14)) + ) + #t + ) + ((= v1-0 2) + (let ((v1-4 (task-perm-by-index *game-info* 41))) + (logior! (-> v1-4 status) (entity-perm-status bit-5)) + (set! (-> v1-4 user-object 0) (+ 1.0 (the-as float (-> v1-4 user-object 0)))) + (logior! (-> v1-4 status) (entity-perm-status bit-14)) + ) + #t + ) + (else + #f + ) + ) + ) + ) diff --git a/goal_src/jak3/engine/common-obs/generic-obs-h.gc b/goal_src/jak3/engine/common-obs/generic-obs-h.gc index 780cbd1a611..82015b44d6a 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs-h.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs-h.gc @@ -9,10 +9,15 @@ (defenum task-arrow-flags :type uint32 :bitfield #t - (task-arrow-flag-00 0) - (task-arrow-flag-01 1) - (task-arrow-flag-02 2) - (task-arrow-flag-03 3) + (taf0 0) + (taf1 1) + (taf2 2) + (taf3 3) + (taf4 4) + (taf5 5) + (taf6 6) + (taf7 7) + (taf8 8) ) ;; ---task-arrow-flags @@ -21,13 +26,18 @@ (defenum manipy-options :bitfield #t :type uint32 - (mo-0 0) + (mo0 0) + (mo1 1) + (mo2 2) + (mo3 3) + (mo4 4) ) ;; ---manipy-options (declare-type joint-mod basic) (declare-type sparticle-launch-group basic) +(declare-type sparticle-subsampler basic) (define-extern process-grab? (function process symbol symbol :behavior process)) (define-extern process-release? (function process symbol :behavior process)) @@ -50,7 +60,7 @@ (new-post-hook (function none)) (cur-post-hook (function none)) (clone-copy-trans symbol) - (shadow-backup basic) + (shadow-backup shadow-geo) (draw? symbol) (userdata uint64) (prefix basic) @@ -69,9 +79,9 @@ "A process that spawns a specified particle group." ((root trsqv) (part sparticle-launch-control) - (path basic) + (path path-control) (sound ambient-sound) - (sound-extra basic) + (sound-extra ambient-sound) (mode (pointer sparticle-launch-group)) (enable symbol) (path-pos float) @@ -84,7 +94,7 @@ active ) (:methods - (part-spawner-method-15 () none) + (is-in-view? (_type_) symbol) ) ) @@ -106,11 +116,13 @@ (target handle) (target-joint int32) ) + (:state-methods + active + linger + die + ) (:methods - (part-tracker-method-14 () none) - (part-tracker-method-15 () none) - (part-tracker-method-16 () none) - (part-tracker-method-17 () none) + (notify-parent-of-death (_type_) none) ) ) @@ -120,8 +132,8 @@ (duration time-frame) (group sparticle-launch-group) (callback (function part-tracker vector)) - (target basic) - (mat-joint basic) + (target process-drawable) + (mat-joint object) ) ) @@ -131,15 +143,15 @@ (duration time-frame) (group sparticle-launch-group) (callback (function part-tracker vector)) - (target basic) - (mat-joint basic) + (target process-drawable) + (mat-joint object) (subsample-num float) ) ) (deftype part-tracker-subsampler (part-tracker) - ((subsampler basic) + ((subsampler sparticle-subsampler) ) ) @@ -162,10 +174,12 @@ (user-vector vector :inline) (user-handle handle 2 :offset 288) ) + (:state-methods + active + ) (:methods - (lightning-tracker-method-14 () none) - (lightning-tracker-method-15 () none) - (lightning-tracker-method-16 () none) + (notify-parent-of-death (_type_) none) + (update (_type_) none) ) ) @@ -176,10 +190,10 @@ (event symbol) (run-function (function object)) (callback (function touch-tracker none)) - (event-mode basic) + (event-mode symbol) ) - (:methods - (touch-tracker-method-20 () none) + (:state-methods + active ) ) @@ -192,12 +206,14 @@ (dir vector :inline) (sync sync-eased :inline) ) + (:state-methods + idle + (active handle) + ) (:methods - (swingpole-method-20 () none) - (swingpole-method-21 () none) - (swingpole-method-22 () none) - (swingpole-method-23 () none) - (swingpole-method-24 () none) + (swingpole-method-22 (_type_) none) + (init-collision! (_type_) none) + (get-trans (_type_) vector) ) ) @@ -249,7 +265,7 @@ (damage-scale float) (vehicle-damage-factor float) (vehicle-impulse-factor float) - (ignore-proc uint64) + (ignore-proc handle) ) ) @@ -262,10 +278,12 @@ (mat matrix :inline) (params explosion-init-params :inline) ) + (:state-methods + explode + ) (:methods - (explosion-method-20 () none) (explosion-method-21 () none) - (explosion-method-22 () none) + (explosion-method-22 (_type_) none) ) ) @@ -281,22 +299,24 @@ (deftype simple-prim (process-drawable) ((strip prim-strip) ) + (:state-methods + active + ) (:methods - (simple-prim-method-20 () none) - (simple-prim-method-21 () none) - (simple-prim-method-22 () none) - (simple-prim-method-23 () none) - (simple-prim-method-24 () none) - (simple-prim-method-25 () none) + (init-strip! (_type_) none) + (strip-setup (_type_) none) + (get-alpha (_type_) int) + (allocate-trans-and-strip! (_type_) prim-strip) + (get-color (_type_) rgba) ) ) -(define *simple-prim-additive* 72) +(define *simple-prim-additive* (new 'static 'gs-alpha :b #x2 :d #x1)) -(define *simple-prim-alpha-blend* 68) +(define *simple-prim-alpha-blend* (new 'static 'gs-alpha :b #x1 :d #x1)) -(define *simple-prim-subtractive* 66) +(define *simple-prim-subtractive* (new 'static 'gs-alpha :a #x2 :d #x1)) (deftype task-arrow-params (structure) ((flags task-arrow-flags) @@ -311,7 +331,7 @@ ((pause-time time-frame) (blur symbol) ) - (:methods - (external-camera-controller-method-14 () none) + (:state-methods + active ) ) diff --git a/goal_src/jak3/engine/common-obs/generic-obs.gc b/goal_src/jak3/engine/common-obs/generic-obs.gc index b688a6b9d1c..f3312713c64 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs.gc @@ -5,5 +5,4061 @@ ;; name in dgo: generic-obs ;; dgos: GAME +(deftype mystery-cquery-type0 (structure) + "(event explode explosion)" + ((cquery collide-query :inline) + (explosion-trans vector :inline) + (proc-trans vector :inline) + (probe float) + (dist float) + ) + ) + +(define-extern lookup-part-group-pointer-by-name (function string (pointer object))) + +(define-extern process-entity-set! (function process entity entity)) +(define-extern cshape-reaction-default (function control-info collide-query vector vector collide-status)) + ;; DECOMP BEGINS +(define *part-tracker-params-default* (new 'static 'part-tracker-init-params)) + +(define *part-tracker-subsampler-params-default* (new 'static 'part-tracker-subsampler-init-params)) + +(defskelgroup skel-spotlight spotlight spotlight-lod0-jg -1 + ((spotlight-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :shadow-joint-index 5 + ) + +;; WARN: Return type mismatch object vs (pointer sparticle-launch-group). +(defun entity-lookup-part-group ((arg0 entity-actor) (arg1 (pointer string)) (arg2 symbol)) + (local-vars (sv-16 res-tag)) + (let ((gp-0 (the-as object #f))) + (set! sv-16 (new 'static 'res-tag)) + (let ((s4-0 (res-lump-data arg0 arg2 pointer :tag-ptr (& sv-16)))) + (if (not s4-0) + (go process-drawable-art-error (the-as string #f)) + ) + (let ((s3-0 (the-as object (-> (the-as (pointer uint32) s4-0))))) + (cond + ((part-group-pointer? (the-as pointer s3-0)) + (set! gp-0 (-> (the-as (pointer uint32) s4-0))) + ) + ((= (-> (the-as string s3-0) type) string) + (if arg1 + (set! (-> arg1 0) (the-as string s3-0)) + ) + (set! gp-0 (lookup-part-group-pointer-by-name (the-as string s3-0))) + (if (the-as (pointer object) gp-0) + (set! (-> (the-as (pointer int32) s4-0)) (the-as int gp-0)) + ) + ) + (else + (go process-drawable-art-error (the-as string s3-0)) + ) + ) + ) + ) + (the-as (pointer sparticle-launch-group) gp-0) + ) + ) + +(defbehavior clone-anim-once process-drawable ((arg0 handle) (arg1 symbol) (arg2 string)) + (logclear! (-> self skel status) (joint-control-status valid-spooled-frame)) + (let ((gp-0 (handle->process arg0))) + (if gp-0 + (joint-control-copy! (-> self skel) (-> (the-as process-drawable gp-0) skel)) + ) + (cond + ((and gp-0 (joint-control-remap! + (-> self skel) + (-> self draw art-group) + (-> (the-as process-drawable gp-0) draw art-group) + '() + 0 + arg2 + ) + ) + (when arg1 + (let* ((s5-1 (-> self root)) + (a0-7 (if (type? s5-1 collide-shape) + s5-1 + ) + ) + ) + (if a0-7 + (move-to-point! (the-as collide-shape a0-7) (-> (the-as process-drawable gp-0) root trans)) + (set! (-> self root trans quad) (-> (the-as process-drawable gp-0) root trans quad)) + ) + ) + (quaternion-copy! (-> self root quat) (-> (the-as process-drawable gp-0) root quat)) + ) + (if (logtest? (-> (the-as process-drawable gp-0) skel status) (joint-control-status valid-spooled-frame)) + (logior! (-> self skel status) (joint-control-status valid-spooled-frame)) + ) + (logclear! (-> self draw status) (draw-control-status no-draw no-draw-temp uninited)) + (if (or (zero? (-> self skel active-channels)) (not (-> self skel root-channel 0 frame-group))) + (logior! (-> self draw status) (draw-control-status no-draw-temp)) + ) + (let* ((gp-1 self) + (v1-38 (if (type? gp-1 manipy) + gp-1 + ) + ) + ) + (if (and v1-38 (not (-> (the-as manipy v1-38) draw?))) + (logior! (-> self draw status) (draw-control-status no-draw-temp)) + ) + ) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + (let ((a0-22 (-> self skel effect))) + (if a0-22 + (effect-control-method-9 a0-22) + ) + ) + (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) + (merc-blend-shape self) + ) + (if (logtest? (-> self skel status) (joint-control-status eye-anim-valid eye-anim)) + (merc-eye-anim self) + ) + (cloth-post) + ) + (else + (set! (-> self skel active-channels) (the-as uint 0)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (ja-post) + ) + ) + ) + 0 + (none) + ) + +(defbehavior clone-anim process-drawable ((arg0 handle) (arg1 symbol) (arg2 string)) + (ja-post) + (while (handle->process arg0) + (clone-anim-once arg0 #t arg2) + (suspend) + ) + (logclear! (-> self skel status) (joint-control-status valid-spooled-frame)) + 0 + (none) + ) + +(defmethod swingpole-method-22 ((this swingpole)) + (with-pp + (if (nonzero? (-> this draw)) + (ja-post) + ) + (cond + ((nonzero? (-> this path)) + (set! (-> this path-pos) (get-norm! (-> this sync) 0)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (get-point-at-percent-along-path! (-> this path) s5-0 (-> this path-pos) 'interp) + (set! (-> this speed) (* (vector-vector-distance s5-0 (-> this root trans)) (-> pp clock frames-per-second))) + (move-to-point! (the-as collide-shape (-> this root)) s5-0) + ) + ) + ((>= (-> this joint-track) 0) + (let ((v1-15 (ppointer->process (-> this parent))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (let ((s4-0 (-> (the-as process-drawable v1-15) node-list data (-> this joint-track)))) + (vector<-cspace! s5-1 s4-0) + (vector-normalize-copy! (-> this dir) (the-as vector (-> s4-0 bone transform)) 1.0) + ) + (move-to-point! (the-as collide-shape (-> this root)) s5-1) + ) + ) + ) + (when (nonzero? (-> this sound)) + (set! (-> this sound trans quad) (-> this root trans quad)) + (let ((f30-0 (lerp-scale -0.1 -0.05 (-> this speed) 8192.0 20480.0)) + (f0-6 (lerp-scale 0.7 1.0 (-> this speed) 8192.0 20480.0)) + ) + (set! (-> this sound pitch) (the int (* 1524.0 f30-0))) + (set! (-> this sound volume) (the int (* 1024.0 f0-6))) + ) + (update! (-> this sound)) + ) + 0 + (none) + ) + ) + +(defstate idle (swingpole) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (if (send-event proc 'pole-grab (-> block param 0)) + (go-virtual active (process->handle proc)) + ) + #f + ) + ) + ) + :code (behavior () + (if (nonzero? (-> self draw)) + (ja-post) + ) + (update-transforms (the-as collide-shape (-> self root))) + (cond + ((or (nonzero? (-> self path)) (>= (-> self joint-track) 0)) + (until #f + (swingpole-method-22 self) + (suspend) + ) + #f + ) + (else + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + ) + ) + ) + ) + +(defstate active (swingpole) + :virtual #t + :code (behavior ((arg0 handle)) + (swingpole-method-22 self) + (suspend) + (while (let* ((s5-0 (handle->process arg0)) + (a0-7 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (and a0-7 (focus-test? (the-as process-focusable a0-7) pole)) + ) + (swingpole-method-22 self) + (suspend) + ) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.5)) + (swingpole-method-22 self) + (suspend) + ) + ) + (go-virtual idle) + ) + ) + +(defmethod get-trans ((this swingpole)) + (-> this root trans) + ) + +(defmethod init-collision! ((this swingpole)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this swingpole) (arg0 entity-actor)) + "Copy defaults from the entity." + (stack-size-set! (-> this main-thread) 128) + (init-collision! this) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (vector-y-quaternion! (-> this dir) (-> this root quat)) + (set! (-> this joint-track) -1) + (let ((a1-5 (res-lump-struct (-> this entity) 'art-name structure))) + (if a1-5 + (initialize-skeleton-by-name this (the-as string a1-5)) + ) + ) + (set! (-> this dir y) 0.0) + (vector-normalize! (-> this dir) 1.0) + (set! (-> this edge-length) 8192.0) + (let ((s4-0 (new 'stack-no-clear 'sync-info-params))) + (let ((a0-13 (res-lump-value arg0 'options uint128 :time -1000000000.0)) + (v1-17 0) + ) + (if (not (logtest? (the-as int a0-13) 8)) + (set! v1-17 (logior v1-17 1)) + ) + (set! (-> s4-0 sync-type) 'sync-eased) + (set! (-> s4-0 sync-flags) (the-as sync-flags v1-17)) + ) + (set! (-> s4-0 period) (the-as uint 0)) + (set! (-> s4-0 entity) arg0) + (set! (-> s4-0 percent) 0.0) + (set! (-> s4-0 ease-in) 0.2) + (set! (-> s4-0 ease-out) 0.2) + (set! (-> s4-0 pause-in) 0.0) + (set! (-> s4-0 pause-out) 0.0) + (initialize! (-> this sync) s4-0) + ) + (when (nonzero? (-> this sync period)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + ) + (set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans) 0.0)) + (go (method-of-object this idle)) + ) + +(defbehavior swingpole-init swingpole ((arg0 int)) + (stack-size-set! (-> self main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-4) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-7 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self joint-track) arg0) + (set-vector! (-> self dir) 0.0 0.0 1.0 1.0) + (set! (-> self edge-length) 8192.0) + (go-virtual idle) + ) + +(defstate die (process-hidden) + :virtual #t + :code nothing + ) + +(defmethod init-from-entity! ((this process-hidden) (arg0 entity-actor)) + "Copy defaults from the entity." + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die)) + ) + +(deftype target-start (process-hidden) + () + ) + + +(deftype camera-start (process-hidden) + () + ) + + +(deftype cam-slope (process-hidden) + () + ) + + +(defbehavior manipy-post manipy () + ((-> self cur-post-hook)) + (when (and (>= (-> self shadow-volume-joint) 0) (-> self draw shadow-ctrl)) + (let ((a2-0 (-> self node-list data (-> self shadow-volume-joint))) + (a3-0 (-> self draw shadow-ctrl)) + ) + (format *stdcon* "shadow-volume for ~A ~A~%" a2-0 a3-0) + ) + ) + 0 + (none) + ) + +(defstate idle (manipy) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (s4-0 object)) + (case message + (('blend-shape) + (when (nonzero? (-> self skel)) + (cond + ((-> block param 0) + (set! s4-0 (logior (-> self skel status) (joint-control-status blend-shape eye-anim))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + (else + (set! s4-0 (logclear (-> self skel status) (joint-control-status blend-shape eye-anim))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + ) + s4-0 + ) + ) + (('shadow) + (when (nonzero? (-> self draw)) + (cond + ((-> block param 0) + (set! s4-0 (-> self shadow-backup)) + (set! (-> self draw shadow) (the-as shadow-geo s4-0)) + s4-0 + ) + (else + (set! (-> self draw shadow) #f) + #f + ) + ) + ) + ) + (('shadow-volume) + (let ((v1-14 (the-as + joint + (get-art-by-name-method (-> self draw jgeo) (the-as string (-> block param 0)) (the-as type #f)) + ) + ) + ) + (if v1-14 + (set! (-> self shadow-volume-joint) (+ (-> v1-14 number) 1)) + ) + ) + (when (and (-> self draw shadow-ctrl) (< 1 argc) (>= (the-as int (-> block param 1)) 0)) + (let ((v0-1 (command-get-int (-> block param 1) 0))) + (set! (-> self draw shadow-ctrl settings flags) (the-as shadow-flags v0-1)) + v0-1 + ) + ) + ) + (('shadow-type) + (if (and (-> self draw shadow-ctrl) (> argc 0)) + (set! (-> self draw shadow-ctrl settings shadow-type) (command-get-int (-> block param 0) 0)) + ) + ) + (('shadow-disable-smooth) + (when (nonzero? (-> self draw)) + (cond + ((-> block param 0) + (when (-> self draw shadow-ctrl) + (set! s4-0 (logior (-> self draw shadow-ctrl settings flags) (shadow-flags shdf08))) + (set! (-> self draw shadow-ctrl settings flags) (the-as shadow-flags s4-0)) + s4-0 + ) + ) + (else + (when (-> self draw shadow-ctrl) + (set! s4-0 (logclear (-> self draw shadow-ctrl settings flags) (shadow-flags shdf08))) + (set! (-> self draw shadow-ctrl settings flags) (the-as shadow-flags s4-0)) + s4-0 + ) + ) + ) + ) + ) + (('shadow-dir) + (when (and (-> self draw shadow-ctrl) (> argc 0)) + (set! s4-0 (-> self draw shadow-ctrl settings shadow-dir)) + (set! (-> (the-as vector s4-0) x) (the-as float (-> block param 0))) + (set! (-> (the-as vector s4-0) y) (the-as float (-> block param 1))) + (set! (-> (the-as vector s4-0) z) (the-as float (-> block param 2))) + (set! (-> (the-as vector s4-0) w) (the-as float (if (< 3 argc) + (command-get-param (-> block param 3) #f) + 409600.0 + ) + ) + ) + s4-0 + ) + ) + (('shadow-top-plane) + (when (and (-> self draw shadow-ctrl) (>= argc 4)) + (set! s4-0 (-> self draw shadow-ctrl settings top-plane)) + (set! (-> (the-as plane s4-0) x) (the-as float (-> block param 0))) + (set! (-> (the-as plane s4-0) y) (the-as float (-> block param 1))) + (set! (-> (the-as plane s4-0) z) (the-as float (-> block param 2))) + (set! (-> (the-as plane s4-0) w) (the-as float (-> block param 3))) + s4-0 + ) + ) + (('shadow-bot-plane) + (when (and (-> self draw shadow-ctrl) (>= argc 4)) + (set! s4-0 (-> self draw shadow-ctrl settings bot-plane)) + (set! (-> (the-as plane s4-0) x) (the-as float (-> block param 0))) + (set! (-> (the-as plane s4-0) y) (the-as float (-> block param 1))) + (set! (-> (the-as plane s4-0) z) (the-as float (-> block param 2))) + (set! (-> (the-as plane s4-0) w) (the-as float (-> block param 3))) + s4-0 + ) + ) + (('shadow-fade-dist) + (if (-> self draw shadow-ctrl) + (set! (-> self draw shadow-ctrl settings fade-dist) (the-as float (-> block param 0))) + ) + ) + (('no-fog) + (set! s4-0 (logior (-> self draw status) (draw-control-status disable-fog))) + (set! (-> self draw status) (the-as draw-control-status s4-0)) + s4-0 + ) + (('setup-spotlight-shadow) + (when (-> self draw shadow-ctrl) + (let ((v1-80 (command-get-process "spotlight" *target*))) + (when v1-80 + (let ((s5-1 (-> (the-as process-drawable v1-80) node-list data 3))) + (vector<-cspace! (new 'stack-no-clear 'vector) s5-1) + (let ((s5-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-1 bone transform fvec) -1.0)) + (s4-1 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self draw shadow-joint-index))) + ) + (f30-0 1638400.0) + (s3-0 (new 'stack-no-clear 'collide-query)) + (f28-0 122880.0) + ) + (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) + (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) + (let ((v1-91 s3-0)) + (set! (-> v1-91 radius) 1638.4) + (set! (-> v1-91 collide-with) (collide-spec obstacle hit-by-others-list)) + (set! (-> v1-91 ignore-process0) self) + (set! (-> v1-91 ignore-process1) #f) + (set! (-> v1-91 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-91 action-mask) (collide-action solid)) + ) + (let* ((f0-14 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) + (f28-1 (if (< 0.0 f0-14) + (* f0-14 f28-0) + 122880.0 + ) + ) + ) + (shadow-control-method-14 + (-> self draw shadow-ctrl) + s4-1 + s5-2 + f30-0 + (- f28-1 (command-get-float (-> block param 0) 0.0)) + (+ f28-1 (command-get-float (-> block param 1) 0.0)) + ) + ) + ) + ) + ) + ) + ) + ) + (('color-mult) + (when (>= argc 4) + (set! s4-0 (-> self draw color-mult)) + (set! (-> (the-as rgbaf s4-0) x) (command-get-float (-> block param 0) 0.0)) + (set! (-> (the-as rgbaf s4-0) y) (command-get-float (-> block param 1) 0.0)) + (set! (-> (the-as rgbaf s4-0) z) (command-get-float (-> block param 2) 0.0)) + (set! (-> (the-as rgbaf s4-0) w) (command-get-float (-> block param 3) 0.0)) + s4-0 + ) + ) + (('color-mult-vector) + (set! s4-0 (-> self draw color-mult)) + (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + (('color-emissive-vector) + (set! s4-0 (-> self draw color-emissive)) + (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + (('segment) + (let ((a1-34 (/ (the-as int (-> block param 0)) 8)) + (a2-5 (/ (the-as int (-> block param 1)) 8)) + ) + (setup-masks (-> self draw) (the-as int a1-34) (the-as int a2-5)) + ) + ) + (('trans-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self new-trans-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('post-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self new-post-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('user-data) + (set! s4-0 (-> block param 0)) + (set! (-> self userdata) (the-as uint s4-0)) + s4-0 + ) + (('eval) + ((the-as (function manipy none) (-> block param 0)) self) + ) + (('speed) + (set! (-> self speed) (the-as float (-> block param 0))) + ) + (('event-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self cur-event-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('art-joint-anim) + (set! (-> self new-joint-anim) + (get-art-by-name (-> self draw art-group) (the-as string (-> block param 0)) art-joint-anim) + ) + (set! (-> self new-joint-anim-blend) (the-as uint (if (>= argc 2) + (the-as int (-> block param 1)) + 0 + ) + ) + ) + (set! (-> self new-joint-anim-frame) (the-as float (if (>= argc 3) + (-> block param 2) + 0.0 + ) + ) + ) + ) + (('anim-mode) + (when (nonzero? (-> self skel)) + (set! (-> self anim-mode) (the-as symbol (-> block param 0))) + (if (= (-> self anim-mode) 'clone-anim) + (ja-post) + ) + (-> self anim-mode) + ) + ) + (('origin-joint-index 'center-joint) + (set! (-> self draw origin-joint-index) (-> block param 0)) + (set! s4-0 (-> block param 0)) + (set! (-> self draw shadow-joint-index) (the-as uint s4-0)) + s4-0 + ) + (('max-vis-dist) + (set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> block param 0))) + ) + (('grab) + (set! (-> self cur-grab-handle) (process->handle (the-as process (-> block param 0)))) + (let ((v1-127 (handle->process (-> self cur-grab-handle)))) + (when v1-127 + (set! s4-0 (-> self old-grab-pos)) + (set! (-> (the-as vector s4-0) quad) (-> (the-as process-drawable v1-127) root trans quad)) + s4-0 + ) + ) + ) + (('target) + (set! s4-0 (process->handle (the-as process (-> block param 0)))) + (set! (-> self cur-target-handle) (the-as handle s4-0)) + s4-0 + ) + (('trans) + (cond + ((type? (-> self root) collide-shape) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + ) + (else + (set! s4-0 (-> self root trans)) + (set! (-> (the-as vector s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + ) + ) + (('scale) + (set! s4-0 (-> self root scale)) + (set! (-> (the-as vector s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + (('rot) + (let ((s5-3 (new 'stack-no-clear 'matrix))) + (matrix-rotate-y! s5-3 (the-as float (-> block param 0))) + (matrix->quaternion (-> self root quat) s5-3) + ) + ) + (('rot-quat) + (quaternion-copy! (-> self root quat) (the-as quaternion (-> block param 0))) + ) + (('clone-copy-trans) + (set! s4-0 (-> block param 0)) + (set! (-> self clone-copy-trans) (the-as symbol s4-0)) + s4-0 + ) + (('release) + (set! (-> self cur-grab-handle) (the-as handle #f)) + #f + ) + (('draw) + (set! (-> self draw?) (the-as symbol (-> block param 0))) + (cond + ((-> block param 0) + (let ((v1-146 (logtest? (-> self draw status) (draw-control-status no-draw)))) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (when v1-146 + (cond + ((nonzero? (-> self skel)) + (let ((gp-1 (-> self skel status))) + (logior! (-> self skel status) (joint-control-status sync-math)) + (set! s4-0 (ja-post)) + (set! (-> self skel status) gp-1) + ) + s4-0 + ) + (else + (ja-post) + ) + ) + ) + ) + ) + (else + (set! s4-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status s4-0)) + s4-0 + ) + ) + ) + (('sync) + (when (nonzero? (-> self skel)) + (cond + ((-> block param 0) + (set! s4-0 (logior (-> self skel status) (joint-control-status sync-math))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + (else + (set! s4-0 (logclear (-> self skel status) (joint-control-status sync-math))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + ) + s4-0 + ) + ) + (('query) + (case (-> block param 0) + (('grab) + (handle->process (-> self cur-grab-handle)) + ) + (('done) + (case (-> self anim-mode) + (('play1 'play) + (>= (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -2))) + ) + ) + ) + ) + ) + (('set-frame-num) + (let ((v1-179 (-> self skel root-channel 0))) + (set! (-> v1-179 num-func) num-func-identity) + (set! (-> v1-179 frame-num) (the-as float (-> block param 0))) + ) + ) + (('prefix) + (set! s4-0 (-> block param 0)) + (set! (-> self prefix) (the-as basic s4-0)) + s4-0 + ) + (('light-index) + (let ((v0-29 (command-get-int (-> block param 0) 0))) + (set! (-> self draw light-index) (the-as uint v0-29)) + v0-29 + ) + ) + (('eye-slot) + (set! (-> self draw mgeo header eye-ctrl eye-slot) (command-get-int (-> block param 0) 0)) + ) + (('shadow-mask) + (let ((v0-31 (command-get-int (-> block param 0) 0))) + (set! (-> self draw shadow-mask) (the-as uint v0-31)) + v0-31 + ) + ) + (('shadow-values) + (let ((v0-32 (command-get-int (-> block param 0) 0))) + (set! (-> self draw shadow-values) (the-as uint v0-32)) + v0-32 + ) + ) + (('mirror) + (cond + ((-> block param 0) + (set! s4-0 (-> self node-list data 2)) + (set! (-> (the-as cspace s4-0) param0) + (the-as (function cspace transformq none) cspace<-parented-matrix-mirror!) + ) + (set! (-> (the-as cspace s4-0) param1) (the-as basic (-> *math-camera* mirror-trans))) + (set! (-> (the-as cspace s4-0) param2) (the-as basic (-> *math-camera* mirror-normal))) + ) + (else + (set! s4-0 (-> self node-list data 2)) + (set! (-> (the-as cspace s4-0) param0) #f) + ) + ) + s4-0 + ) + (('draw-mirror) + (send-event (ppointer->process (-> self child)) 'draw (-> block param 0)) + ) + (('user) + (set! s4-0 (-> block param 1)) + (set! (-> self user-uint64 (/ (the-as int (-> block param 0)) 8)) (the-as uint s4-0)) + s4-0 + ) + (('die) + (deactivate self) + ) + (('do-effect) + (if (and (nonzero? (-> self skel)) (-> self skel effect)) + (do-effect (-> self skel effect) (the-as symbol (-> block param 0)) (the-as float (-> block param 1)) -1) + ) + ) + (('no-actor-pause) + (set! s4-0 (logclear (-> self mask) (process-mask actor-pause))) + (set! (-> self mask) (the-as process-mask s4-0)) + s4-0 + ) + (else + (if (-> self cur-event-hook) + ((-> self cur-event-hook)) + ) + ) + ) + ) + :trans (behavior () + (if (!= (-> self cur-trans-hook) (-> self new-trans-hook)) + (set! (-> self cur-trans-hook) (-> self new-trans-hook)) + ) + (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 (!= (ja-group) (-> self new-joint-anim)) (!= (-> self anim-mode) 'clone-anim)) + ) + (ja-channel-push! 1 (the-as time-frame (-> self new-joint-anim-blend))) + (ja :group! (-> self new-joint-anim) :num! (identity (ja-aframe (-> self new-joint-anim-frame) 0))) + ) + (let ((v1-20 (handle->process (-> self cur-grab-handle)))) + (when v1-20 + (let ((gp-1 (-> (the-as process-drawable v1-20) root trans))) + (if (type? (-> self root) collide-shape) + (move-by-vector! (-> self root) (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self old-grab-pos))) + (vector+! + (-> self root trans) + (-> self root trans) + (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self old-grab-pos)) + ) + ) + (set! (-> self old-grab-pos quad) (-> gp-1 quad)) + ) + ) + ) + ((-> self cur-trans-hook)) + ) + :code (behavior () + (logclear! (-> self mask) (process-mask heap-shrunk)) + (until #f + (case (-> self anim-mode) + (('loop) + (ja-post) + (manipy-post) + (suspend) + (ja :num! (loop!)) + ) + (('play) + (ja-post) + (manipy-post) + (suspend) + (ja :num! (seek!)) + ) + (('copy-parent) + (let ((v1-17 (-> self skel root-channel 0))) + (set! (-> v1-17 num-func) num-func-identity) + (let ((a0-10 (-> self parent))) + (set! (-> v1-17 frame-num) (-> (the-as process-drawable (if a0-10 + (the-as process-drawable (-> a0-10 0 self)) + ) + ) + skel + root-channel + 0 + frame-num + ) + ) + ) + ) + (ja-post) + (manipy-post) + (suspend) + 0 + ) + (('clone-parent) + (let ((gp-0 (ppointer->process (-> self parent)))) + (set! (-> self post-hook) #f) + (joint-control-copy! (-> self skel) (-> (the-as process-drawable gp-0) skel)) + (joint-control-remap! + (-> self skel) + (-> self draw art-group) + (-> (the-as process-drawable gp-0) draw art-group) + '() + 0 + "" + ) + ) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + (manipy-post) + (suspend) + 0 + ) + (('clone-anim) + (clone-anim-once + (if (handle->process (-> self cur-target-handle)) + (the-as handle (-> self cur-target-handle)) + (ppointer->handle (-> self parent)) + ) + (-> self clone-copy-trans) + (the-as string (-> self prefix)) + ) + (manipy-post) + (suspend) + 0 + ) + (('mirror) + (let ((gp-1 (if (handle->process (-> self cur-target-handle)) + (-> self cur-target-handle) + (ppointer->handle (-> self parent)) + ) + ) + ) + (clone-anim-once gp-1 (-> self clone-copy-trans) (the-as string (-> self prefix))) + (logior! (-> self draw global-effect) (draw-control-global-effect disable-envmap)) + (set! (-> self draw light-index) (the-as uint 5)) + (if (logtest? (-> (the-as process-drawable (handle->process gp-1)) draw status) + (draw-control-status no-draw no-draw-temp no-draw-bounds) + ) + (logior! (-> self draw status) (draw-control-status no-draw-temp)) + ) + ) + (manipy-post) + (suspend) + 0 + ) + (('still) + (ja-post) + (manipy-post) + (suspend) + 0 + ) + (('play1) + (ja-post) + (manipy-post) + (suspend) + (ja :num! (seek! max (-> self speed))) + (if (ja-done? 0) + (deactivate self) + ) + ) + ) + ) + #f + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior manipy-init manipy ((arg0 vector) (arg1 entity-actor) (arg2 skeleton-group) (arg3 vector) (arg4 manipy-options)) + (stack-size-set! (-> self main-thread) 128) + (logior! (-> self mask) (process-mask heap-shrunk)) + (process-entity-set! self arg1) + (cond + ((= arg3 'collide-shape-moving) + (let ((s3-1 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) + (set! (-> s3-1 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s3-1 reaction) cshape-reaction-default) + (set! (-> s3-1 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s3-1 (the-as uint 0)))) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s3-1 total-prims) (the-as uint 1)) + (set! (-> s3-1 root-prim) v1-11) + ) + (set! (-> s3-1 nav-radius) (* 0.75 (-> s3-1 root-prim local-sphere w))) + (let ((v1-14 (-> s3-1 root-prim))) + (set! (-> s3-1 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s3-1 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> self root) s3-1) + ) + ) + (arg3 + (let ((s3-2 (new 'process 'collide-shape self (collide-list-enum hit-by-player)))) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s3-2 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list)) + (set-vector! (-> v1-18 local-sphere) (-> arg3 x) (-> arg3 y) (-> arg3 z) (-> arg3 w)) + (set! (-> s3-2 total-prims) (the-as uint 1)) + (set! (-> s3-2 root-prim) v1-18) + ) + (set! (-> s3-2 nav-radius) (* 0.75 (-> s3-2 root-prim local-sphere w))) + (let ((v1-21 (-> s3-2 root-prim))) + (set! (-> s3-2 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s3-2 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> self root) s3-2) + ) + ) + (else + (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) + ) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton self arg2 (the-as pair 0)) + (if (type? (-> self root) collide-shape) + (update-transforms (-> self root)) + ) + (set! (-> self shadow-backup) (-> self draw shadow)) + (set! (-> self shadow-volume-joint) -1) + (set! (-> self options) arg4) + (when (-> self draw shadow) + (set! (-> self draw shadow-ctrl) (new + 'process + 'shadow-control + 0.0 + 0.0 + 614400.0 + (the-as vector #f) + 0.000000000000000000000000000000000000000000084 + 245760.0 + ) + ) + (quad-copy! (the-as pointer (-> self draw shadow-ctrl settings)) (the-as pointer *default-shadow-settings*) 5) + ) + (set! (-> self new-trans-hook) nothing) + (set! (-> self cur-trans-hook) nothing) + (set! (-> self new-post-hook) nothing) + (set! (-> self cur-post-hook) nothing) + (set! (-> self cur-event-hook) #f) + (set! (-> self cur-grab-handle) (the-as handle #f)) + (set! (-> self cur-target-handle) (the-as handle #f)) + (set! (-> self clone-copy-trans) #t) + (set! (-> self draw?) #t) + (set! (-> self prefix) "") + (set! (-> self speed) 1.0) + (when (logtest? (-> self options) (manipy-options mo0)) + (let ((v1-56 (the-as joint (get-art-by-name-method (-> self draw jgeo) "neckA" (the-as type #f))))) + (when v1-56 + (set! (-> self joint 0) (new 'process 'joint-mod (joint-mod-mode flex-blend) self (+ (-> v1-56 number) 1))) + (set! (-> self joint 0 parented-scale?) #t) + ) + ) + ) + (when (logtest? (-> self options) (manipy-options mo1)) + (let ((v1-64 (the-as joint (get-art-by-name-method (-> self draw jgeo) "horns" (the-as type #f))))) + (when v1-64 + (set! (-> self joint 1) (new 'process 'joint-mod (joint-mod-mode joint-set) self (+ (-> v1-64 number) 1))) + (set! (-> self joint 1 parented-scale?) #t) + (set! (-> self joint 1 track-mode) (track-mode no-trans no-rotate)) + (trs-set! (-> self joint 1) (the-as vector #f) (the-as quaternion #f) *null-vector*) + ) + ) + ) + (cond + ((nonzero? (-> self skel)) + (set! (-> self new-joint-anim) (ja-group)) + (set! (-> self new-joint-anim-frame) 0.0) + (set! (-> self anim-mode) 'loop) + ) + (else + (set! (-> self anim-mode) 'still) + ) + ) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + (none) + ) + +(defmethod deactivate ((this part-tracker)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + ((method-of-type process deactivate) this) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod notify-parent-of-death ((this part-tracker)) + (with-pp + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) (process->ppointer pp)) + (set! (-> gp-0 num-params) 1) + (set! (-> gp-0 message) 'notify) + (set! (-> gp-0 param 0) (the-as uint 'die)) + (let ((s5-0 send-event-function) + (s4-0 (ppointer->process (-> this parent))) + ) + (s5-0 + (if (type? s4-0 process) + s4-0 + ) + gp-0 + ) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch process vs part-tracker-subsampler. +(defmethod relocate ((this part-tracker-subsampler) (offset int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (if (nonzero? (-> this subsampler)) + (&+! (-> this subsampler) offset) + ) + (the-as part-tracker-subsampler ((method-of-type process relocate) this offset)) + ) + +(defstate active (part-tracker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (case message + (('clock) + (+! (-> self clock ref-count) -1) + (+! (-> (the-as process (-> block param 0)) clock ref-count) 1) + (set! v0-0 (-> (the-as process (-> block param 0)) clock)) + (set! (-> self clock) (the-as clock v0-0)) + v0-0 + ) + (('draw) + (when (not (-> block param 0)) + (set! v0-0 1) + (set! (-> self duration) (the-as time-frame v0-0)) + v0-0 + ) + ) + (('trans) + (set! v0-0 (-> self root trans)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad)) + v0-0 + ) + (('die) + (deactivate self) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (and (nonzero? (-> self duration)) (time-elapsed? (-> self state-time) (-> self duration))) + (go-virtual linger) + ) + (if (-> self callback) + ((-> self callback) self) + ) + (let* ((gp-0 (handle->process (-> self target))) + (v1-15 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (cond + ((and v1-15 + (nonzero? (-> (the-as process-drawable v1-15) root)) + (nonzero? (-> (the-as process-drawable v1-15) node-list)) + ) + (sparticle-launch-control-method-18 + (-> self part) + (-> (the-as process-drawable v1-15) node-list data (-> self target-joint)) + ) + (set! (-> self root trans quad) (-> self part origin trans quad)) + ) + (else + (let ((a0-11 (-> self root trans))) + (set! (-> self mat trans quad) (-> a0-11 quad)) + ) + (sparticle-launch-control-method-17 (-> self part) (-> self mat)) + ) + ) + ) + ) + :code sleep-code + ) + +(defstate linger (part-tracker) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (-> self linger-callback) + ((-> self linger-callback) self) + ) + (if (time-elapsed? (-> self state-time) (-> self linger-duration)) + (go-virtual die) + ) + (let* ((gp-0 (handle->process (-> self target))) + (v1-13 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (if (and v1-13 + (nonzero? (-> (the-as process-drawable v1-13) root)) + (nonzero? (-> (the-as process-drawable v1-13) node-list)) + ) + (vector<-cspace! + (-> self root trans) + (-> (the-as process-drawable v1-13) node-list data (-> self target-joint)) + ) + ) + ) + ) + :code sleep-code + ) + +(defstate die (part-tracker) + :virtual #t + :enter (behavior () + (notify-parent-of-death self) + ) + :code (behavior () + (suspend) + 0 + ) + ) + +(defstate active (part-tracker-subsampler) + :virtual #t + :trans (behavior () + (if (and (nonzero? (-> self duration)) (time-elapsed? (-> self state-time) (-> self duration))) + (go-virtual linger) + ) + (if (-> self callback) + ((-> self callback) self) + ) + (let* ((gp-0 (handle->process (-> self target))) + (v1-15 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (cond + ((and v1-15 + (nonzero? (-> (the-as process-drawable v1-15) root)) + (nonzero? (-> (the-as process-drawable v1-15) node-list)) + ) + (sparticle-subsampler-method-10 + (-> self subsampler) + (-> (the-as process-drawable v1-15) node-list data (-> self target-joint) bone transform) + ) + (set! (-> self root trans quad) (-> self subsampler spawn-mat trans quad)) + ) + (else + (let ((a0-11 (-> self root trans))) + (set! (-> self mat trans quad) (-> a0-11 quad)) + ) + (sparticle-subsampler-method-10 (-> self subsampler) (-> self mat)) + ) + ) + ) + ) + ) + +(defbehavior part-tracker-init-base part-tracker ((arg0 sparticle-launch-group) + (arg1 time-frame) + (arg2 (function part-tracker vector)) + (arg3 uint) + (arg4 process-drawable) + (arg5 object) + ) + (stack-size-set! (-> self main-thread) 16) + (when (= pointer process-tree) + (+! (-> self clock ref-count) -1) + (+! (-> *display* part-clock ref-count) 1) + (set! (-> self clock) (-> *display* part-clock)) + ) + (set! (-> self target) (process->handle arg4)) + (cond + (arg4 + (set! (-> self target-joint) (the-as int arg5)) + ) + ((logtest? (-> arg0 flags) (sp-group-flag sp5)) + (let* ((s1-1 (-> self mat)) + (a2-1 (math-camera-matrix)) + (v1-18 (-> a2-1 rvec quad)) + (a0-10 (-> a2-1 uvec quad)) + (a1-2 (-> a2-1 fvec quad)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> s1-1 rvec quad) v1-18) + (set! (-> s1-1 uvec quad) a0-10) + (set! (-> s1-1 fvec quad) a1-2) + (set! (-> s1-1 trans quad) a2-2) + ) + (set! (-> self mat trans quad) (-> (the-as matrix arg5) trans quad)) + (set! (-> self offset quad) (-> self mat trans quad)) + ) + (else + (let* ((v1-21 (-> self mat)) + (a3-1 (the-as matrix arg5)) + (a0-15 (-> a3-1 rvec quad)) + (a1-3 (-> a3-1 uvec quad)) + (a2-3 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-21 rvec quad) a0-15) + (set! (-> v1-21 uvec quad) a1-3) + (set! (-> v1-21 fvec quad) a2-3) + (set! (-> v1-21 trans quad) a3-2) + ) + (set! (-> self offset quad) (-> self mat trans quad)) + ) + ) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> self mat trans quad)) + (if (zero? arg0) + (go process-drawable-art-error "null group") + ) + (set! (-> self callback) arg2) + (set! (-> self linger-callback) #f) + (set! (-> self userdata) arg3) + (set! arg1 (cond + ((> arg1 0) + (empty) + arg1 + ) + ((= arg1 -1) + 0 + ) + (else + (the-as time-frame (-> arg0 duration)) + ) + ) + ) + (set! (-> self duration) (the-as time-frame arg1)) + (set! (-> self linger-duration) (the-as time-frame (-> arg0 linger-duration))) + (if (or (zero? (+ (-> self duration) (seconds 0.007))) (= (-> self duration) (seconds 218.447))) + (deactivate self) + ) + (none) + ) + +(defpart 57 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:timer (seconds 0.1)) + ) + ) + +(defbehavior part-tracker-subsampler-init part-tracker-subsampler ((arg0 part-tracker-subsampler-init-params)) + (part-tracker-init-base + (-> arg0 group) + (-> arg0 duration) + (-> arg0 callback) + (-> arg0 userdata) + (-> arg0 target) + (-> arg0 mat-joint) + ) + (dotimes (s5-0 1) + (let* ((v1-2 (-> arg0 group launcher s5-0)) + (s4-0 (-> *part-id-table* (-> v1-2 launcher))) + ) + (let ((a2-1 (if (logtest? (-> v1-2 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + ) + ) + self + (set! (-> self subsampler) + (new 'process 'sparticle-subsampler a2-1 (-> *part-id-table* 57) (-> arg0 subsample-num)) + ) + ) + (set! (-> self subsampler sp-launcher) s4-0) + ) + ) + (go-virtual active) + ) + +(defbehavior part-tracker-init part-tracker ((arg0 part-tracker-init-params)) + (part-tracker-init-base + (-> arg0 group) + (-> arg0 duration) + (-> arg0 callback) + (-> arg0 userdata) + (-> arg0 target) + (-> arg0 mat-joint) + ) + (set! (-> self part) (create-launch-control (-> arg0 group) self)) + (when (and (-> arg0 target) (logtest? (-> self part group flags) (sp-group-flag sp12 sp14))) + (let* ((gp-0 (-> self part)) + (s5-0 (method-of-object gp-0 sparticle-launch-control-method-20)) + (s4-0 (add-connection *part-local-space-engine* self local-space-proc-joint (-> self target-joint) 0 0)) + ) + (let ((v1-10 (process->handle (-> arg0 target)))) + (if (= v1-10 #f) + (set! v1-10 (process->handle self)) + ) + (set! (-> (the-as particle-local-space-info s4-0) hand) (the-as handle v1-10)) + ) + (matrix-identity! (-> (the-as particle-local-space-info s4-0) mat-new)) + (matrix-identity! (-> (the-as particle-local-space-info s4-0) mat-prev)) + (set! (-> (the-as particle-local-space-info s4-0) flags) + (if (logtest? (-> self part group flags) (sp-group-flag sp14)) + (part-local-space-flags pls0) + (part-local-space-flags) + ) + ) + (s5-0 gp-0 (the-as float s4-0)) + ) + ) + (set! (-> self event-hook) (-> (method-of-object self active) event)) + (go-virtual active) + ) + +(defun part-tracker-track-root ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-3 (-> arg1 key proc root trans))) + (set! (-> arg2 x) (-> v1-3 x)) + (set! (-> arg2 y) (-> v1-3 y)) + (set! (-> arg2 z) (-> v1-3 z)) + ) + 0 + (none) + ) + +(defun part-tracker-move-to-target ((arg0 part-tracker)) + (let* ((a0-1 *target*) + (a2-0 (if (not a0-1) + (-> arg0 root trans) + (get-trans a0-1 3) + ) + ) + ) + (vector-lerp! + (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (* 0.006666667 (the float (- (current-time) (-> arg0 state-time)))) + ) + ) + ) + +(defun part-tracker-track-target ((arg0 part-tracker)) + (set! (-> arg0 linger-callback) (-> arg0 callback)) + (let* ((a0-1 *target*) + (v1-2 (if (not a0-1) + (-> arg0 root trans) + (get-trans a0-1 3) + ) + ) + (v0-1 (-> arg0 root trans)) + ) + (set! (-> v0-1 quad) (-> v1-2 quad)) + v0-1 + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod notify-parent-of-death ((this lightning-tracker)) + (with-pp + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) (process->ppointer pp)) + (set! (-> gp-0 num-params) 1) + (set! (-> gp-0 message) 'notify) + (set! (-> gp-0 param 0) (the-as uint 'die)) + (let ((s5-0 send-event-function) + (s4-0 (ppointer->process (-> this parent))) + ) + (s5-0 + (if (type? s4-0 process) + s4-0 + ) + gp-0 + ) + ) + ) + (none) + ) + ) + +(defmethod update ((this lightning-tracker)) + (if (-> this callback) + ((-> this callback) this) + ) + (let ((a0-6 (cond + ((>= (-> this target-joint0) 0) + (let ((s5-0 (handle->process (-> this target0)))) + (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (else + (the-as process #f) + ) + ) + ) + ) + (cond + ((< (-> this target-joint0) 0) + (when (and (!= (-> this lightning spec rand-func) 3) (!= (-> this lightning spec rand-func) 2)) + (let ((v1-17 (-> this lightning)) + (a0-9 (-> this offset0)) + ) + (set! (-> v1-17 state meet data 0 quad) (-> a0-9 quad)) + ) + ) + ) + ((or (not a0-6) (zero? (-> (the-as process-drawable a0-6) root))) + (deactivate this) + ) + ((= (-> this target-joint0) 256) + (let ((s5-1 (-> this lightning)) + (a0-12 (get-trans (the-as process-focusable a0-6) 3)) + ) + (set! (-> s5-1 state meet data 0 quad) (-> a0-12 quad)) + ) + ) + (else + (let ((s5-2 (-> this lightning)) + (a0-16 (vector<-cspace! + (new 'stack-no-clear 'vector) + (-> (the-as process-focusable a0-6) node-list data (-> this target-joint0)) + ) + ) + ) + (set! (-> s5-2 state meet data 0 quad) (-> a0-16 quad)) + ) + ) + ) + ) + (let ((a0-22 (cond + ((>= (-> this target-joint1) 0) + (let ((s5-3 (handle->process (-> this target1)))) + (if (type? s5-3 process-drawable) + (the-as process-focusable s5-3) + ) + ) + ) + (else + (the-as process-focusable #f) + ) + ) + ) + ) + (cond + ((< (-> this target-joint1) 0) + (when (and (!= (-> this lightning spec rand-func) 3) (!= (-> this lightning spec rand-func) 2)) + (let ((a0-26 (-> this lightning)) + (v1-44 (-> this offset1)) + ) + (set! (-> a0-26 state meet data (+ (-> a0-26 state points-to-draw) -1) quad) (-> v1-44 quad)) + ) + ) + ) + ((or (not a0-22) (zero? (-> a0-22 root))) + (deactivate this) + ) + ((= (-> this target-joint1) 256) + (let ((gp-1 (-> this lightning)) + (v1-51 (get-trans a0-22 3)) + ) + (set! (-> gp-1 state meet data (+ (-> gp-1 state points-to-draw) -1) quad) (-> v1-51 quad)) + ) + ) + (else + (let ((s5-4 (-> this lightning)) + (v1-54 (vector<-cspace! (new 'stack-no-clear 'vector) (-> a0-22 node-list data (-> this target-joint1)))) + ) + (set! (-> s5-4 state meet data (+ (-> s5-4 state points-to-draw) -1) quad) (-> v1-54 quad)) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate active (lightning-tracker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (deactivate self) + ) + ) + ) + :exit (behavior () + (when (nonzero? (-> self sound)) + (let ((v1-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-1 command) (sound-command set-param)) + (set! (-> v1-1 id) (-> self sound)) + (set! (-> v1-1 params volume) -4) + (set! (-> v1-1 auto-time) 240) + (set! (-> v1-1 auto-from) 2) + (set! (-> v1-1 params mask) (the-as uint 17)) + (-> v1-1 id) + ) + ) + ) + :code (behavior () + (set! (-> self sound) (new 'static 'sound-id)) + (when (!= (+ (-> self lightning spec delay) (-> self lightning spec delay-rand)) 0.0) + (let ((gp-0 (current-time)) + (s5-0 (the int (rand-vu-float-range + (-> self lightning spec delay) + (+ (-> self lightning spec delay) (-> self lightning spec delay-rand)) + ) + ) + ) + ) + (while (not (time-elapsed? gp-0 s5-0)) + (suspend) + ) + ) + ) + (let ((gp-1 (-> self lightning spec sound))) + (when gp-1 + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> self offset1 quad)) + (when (and (>= (-> self target-joint1) 0) (< (-> self target-joint1) 256)) + (let* ((s4-0 (handle->process (-> self target1))) + (v1-28 (if (type? s4-0 process-drawable) + (the-as process-drawable s4-0) + ) + ) + ) + (if (and v1-28 (nonzero? (-> v1-28 root))) + (set! (-> s5-1 quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-28 node-list data (-> self target-joint1))) quad) + ) + ) + ) + ) + (set! (-> self sound) (sound-play-by-spec (the-as sound-spec gp-1) (new-sound-id) s5-1)) + ) + ) + ) + (let ((v1-33 (-> self lightning)) + (a0-10 1) + ) + (let ((a1-10 (!= a0-10 (-> v1-33 state mode)))) + (case a0-10 + ((3) + (if a1-10 + (set! (-> v1-33 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-33 state start-color) (-> v1-33 spec start-color)) + (set! (-> v1-33 state end-color) (-> v1-33 spec end-color)) + ) + ) + ) + (set! (-> v1-33 state mode) (the-as uint a0-10)) + ) + (set-time! (-> self start-time)) + (while (or (zero? (-> self duration)) (not (time-elapsed? (-> self start-time) (-> self duration)))) + (update self) + (suspend) + ) + (let ((f30-0 (-> self lightning spec fade-time))) + (when (< 0.0 f30-0) + (let ((v1-47 (-> self lightning)) + (a0-14 3) + ) + (let ((a1-20 (!= a0-14 (-> v1-47 state mode)))) + (case a0-14 + ((3) + (if a1-20 + (set! (-> v1-47 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-47 state start-color) (-> v1-47 spec start-color)) + (set! (-> v1-47 state end-color) (-> v1-47 spec end-color)) + ) + ) + ) + (set! (-> v1-47 state mode) (the-as uint a0-14)) + ) + (set-time! (-> self start-time)) + (while (not (time-elapsed? (-> self start-time) (the int f30-0))) + (suspend) + ) + ) + ) + (let ((v1-54 (-> self lightning)) + (a0-17 0) + ) + (let ((a1-30 (!= a0-17 (-> v1-54 state mode)))) + (case a0-17 + ((3) + (if a1-30 + (set! (-> v1-54 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-54 state start-color) (-> v1-54 spec start-color)) + (set! (-> v1-54 state end-color) (-> v1-54 spec end-color)) + ) + ) + ) + (set! (-> v1-54 state mode) (the-as uint a0-17)) + ) + (notify-parent-of-death self) + (suspend) + 0 + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior lightning-tracker-init lightning-tracker ((arg0 lightning-spec) (arg1 time-frame) (arg2 symbol) (arg3 process-drawable) (arg4 vector) (arg5 vector)) + (stack-size-set! (-> self main-thread) 128) + (set! (-> self target0) (process->handle arg3)) + (let ((s1-1 (ppointer->process (-> self parent)))) + (set! (-> self target1) (process->handle (the-as process (if (type? s1-1 process-drawable) + s1-1 + ) + ) + ) + ) + ) + (cond + ((>= 256 (the-as int arg4)) + (set! (-> self target-joint0) (the-as int arg4)) + (vector-identity! (-> self offset0)) + ) + (else + (set! (-> self target-joint0) -1) + (set! (-> self offset0 quad) (-> arg4 quad)) + ) + ) + (cond + ((>= 256 (the-as int arg5)) + (set! (-> self target-joint1) (the-as int arg5)) + (vector-identity! (-> self offset1)) + ) + (else + (set! (-> self target-joint1) -1) + (set! (-> self offset1 quad) (-> arg5 quad)) + ) + ) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self callback) (the-as (function lightning-tracker none) arg2)) + (set! arg1 + (cond + ((> arg1 0) + (empty) + arg1 + ) + ((= arg1 -1) + 0 + ) + (else + (the-as + time-frame + (the int (rand-vu-float-range (-> arg0 duration) (+ (-> arg0 duration) (-> arg0 duration-rand)))) + ) + ) + ) + ) + (set! (-> self duration) (the-as time-frame arg1)) + (set! (-> self lightning) (new 'process 'lightning-control arg0 self 0.0)) + (let ((v1-21 (-> self lightning)) + (a0-17 0) + ) + (let ((a1-7 (!= a0-17 (-> v1-21 state mode)))) + (case a0-17 + ((3) + (if a1-7 + (set! (-> v1-21 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-21 state start-color) (-> v1-21 spec start-color)) + (set! (-> v1-21 state end-color) (-> v1-21 spec end-color)) + ) + ) + ) + (set! (-> v1-21 state mode) (the-as uint a0-17)) + ) + (go-virtual active) + (none) + ) + +;; WARN: Return type mismatch object vs symbol. +(defbehavior process-grab? process ((arg0 process) (arg1 symbol)) + (let ((a0-1 (command-get-process arg0 *target*))) + (the-as symbol (if a0-1 + (send-event a0-1 'change-mode 'grab (cond + ((= arg1 #t) + #f + ) + ((= arg1 'dead) + 'dead + ) + (else + #t + ) + ) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defbehavior process-release? process ((arg0 process)) + (let* ((gp-0 (command-get-process arg0 *target*)) + (a0-2 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (the-as symbol (if (and a0-2 (focus-test? (the-as process-focusable a0-2) grabbed)) + (send-event a0-2 'end-mode 'grab) + #t + ) + ) + ) + ) + +(defun camera-look-at ((arg0 pair) (arg1 uint)) + (let ((gp-0 (command-get-process arg0 *target*))) + (if gp-0 + (send-event *camera* 'change-target gp-0 arg1) + ) + gp-0 + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defun ja-anim-done? ((arg0 process)) + (with-pp + (let ((gp-0 (command-get-process arg0 *target*))) + (the-as + symbol + (when gp-0 + (cond + ((type? gp-0 manipy) + (send-event gp-0 'query 'done) + ) + ((type? gp-0 process-drawable) + (when (not (logtest? (-> (the-as process-drawable gp-0) skel status) (joint-control-status spooling-not-last-block)) + ) + (let ((s5-0 pp)) + (set! pp gp-0) + (let ((v0-1 (the-as object (ja-done? 0)))) + (set! pp s5-0) + v0-1 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(defun camera-pov-from ((arg0 pair) (arg1 uint)) + (let ((gp-0 (command-get-process arg0 *target*))) + (when gp-0 + (when (= arg1 -10) + (set! arg1 (the-as uint 0)) + (when (> (-> (the-as process-drawable gp-0) skel active-channels) 0) + (let ((v1-7 (the-as + joint + (get-art-by-name-method (-> (the-as process-drawable gp-0) draw jgeo) "camera" (the-as type #f)) + ) + ) + ) + (if v1-7 + (set! arg1 (the-as uint (+ (-> v1-7 number) 1))) + ) + ) + ) + ) + (let ((v1-9 (process->ppointer gp-0))) + (set-setting! 'pov-handle v1-9 (the float arg1) (-> v1-9 0 pid)) + ) + ) + gp-0 + ) + ) + +(deftype med-res-level (process-drawable) + ((level-name symbol) + (part-mode symbol) + (index int32) + ) + (:state-methods + idle + ) + ) + + +(defstate idle (med-res-level) + :virtual #t + :code (behavior () + (until #f + (let ((v1-1 (level-get *level* (-> self level-name)))) + (cond + ((and v1-1 (= (-> v1-1 display?) 'special)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (if (nonzero? (-> self skel)) + (ja :num! (loop!)) + ) + ) + ((and v1-1 (= (-> v1-1 status) 'active)) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + (else + (logclear! (-> self draw status) (draw-control-status no-draw)) + (if (nonzero? (-> self skel)) + (ja :num! (loop!)) + ) + ) + ) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this med-res-level) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (res-lump-struct arg0 'art-name structure)) + (s3-0 (res-lump-struct (-> this entity) 'level structure)) + (v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0)) + ) + (when s3-0 + (set! (-> this level-name) (the-as symbol s3-0)) + (set! (-> this index) (the-as int v1-5)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton-by-name this (the-as string s4-0)) + (logior! (-> this draw status) (draw-control-status no-closest-distance)) + (if (nonzero? (-> this draw)) + (go (method-of-object this idle)) + ) + ) + ) + ) + +(defmethod deactivate ((this part-spawner)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) + ) + (if (nonzero? (-> this sound-extra)) + (stop! (-> this sound-extra)) + ) + ((method-of-type process deactivate) this) + (none) + ) + +(defmethod is-in-view? ((this part-spawner)) + (sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius)) + (sphere-in-view-frustum? (-> this world-sphere)) + ) + +(defstate active (part-spawner) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stop) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (set! (-> self enable) #f) + #t + ) + (('start) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (set! (-> self enable) #t) + #t + ) + (('trans) + (let ((v0-1 (the-as object (-> (the-as vector (-> block param 0)) quad)))) + (set! (-> self root trans quad) (the-as uint128 v0-1)) + v0-1 + ) + ) + ) + ) + :trans (behavior () + (when (-> self enable) + (when (nonzero? (-> self path)) + (path-control-method-9 (-> self path)) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-pos) 'interp) + (displacement-between-points-at-percent-normalized! (-> self path) (-> self last-velocity) (-> self path-pos)) + (let ((f0-3 (+ (-> self path-pos) (* (-> self path-speed) (seconds-per-frame))))) + (set! (-> self path-pos) f0-3) + (set! (-> self path-pos) (- f0-3 (* (the float (the int (/ f0-3 1.0))) 1.0))) + ) + ) + (spawn (-> self part) (-> self root trans)) + (when (nonzero? (-> self sound)) + (update-trans! (-> self sound) (-> self root trans)) + (update! (-> self sound)) + ) + (when (nonzero? (-> self sound-extra)) + (update-trans! (-> self sound-extra) (-> self root trans)) + (update! (-> self sound-extra)) + ) + ) + ) + :code sleep-code + ) + +(defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) + (local-vars (sv-16 string)) + (stack-size-set! (-> this main-thread) 16) + (logior! (-> this mask) (process-mask ambient)) + (+! (-> this clock ref-count) -1) + (+! (-> *display* part-clock ref-count) 1) + (set! (-> this clock) (-> *display* part-clock)) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (set! (-> this radius) 12288.0) + (set! (-> this enable) + (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) + ) + (set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans) 0.0)) + (set! (-> this sound-extra) (new 'process 'ambient-sound (-> this entity) (-> this root trans) 1.0)) + (when (res-lump-data arg0 'path pointer) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-speed) (res-lump-float arg0 'speed :default 1.0)) + ) + (let ((v1-36 (res-lump-struct arg0 'trans-offset structure))) + (if v1-36 + (vector+! (-> this root trans) (-> this root trans) (the-as vector v1-36)) + ) + ) + (let ((s4-0 (res-lump-struct arg0 'rot-offset (pointer degrees)))) + (when s4-0 + (if (< 0.0 (-> s4-0 0)) + (quaternion-rotate-local-x! (-> this root quat) (-> this root quat) (-> s4-0 0)) + ) + (if (< 0.0 (-> s4-0 1)) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) (-> s4-0 1)) + ) + (if (< 0.0 (-> s4-0 2)) + (quaternion-rotate-local-z! (-> this root quat) (-> this root quat) (-> s4-0 2)) + ) + ) + ) + (set! sv-16 "#f") + (set! (-> this mode) (entity-lookup-part-group arg0 (& sv-16) 'art-name)) + (when (-> this mode) + (let ((s5-1 (-> this mode 0))) + (when (and (nonzero? s5-1) (= (-> s5-1 type) sparticle-launch-group)) + (cond + ((logtest? (-> s5-1 flags) (sp-group-flag sp8)) + (countdown (v1-60 (-> s5-1 length)) + (let* ((a0-34 (-> s5-1 launcher v1-60)) + (a2-12 (-> *part-id-table* (-> a0-34 launcher))) + ) + (when (nonzero? a2-12) + (let ((a1-22 (-> this level part-engine))) + (when (and a1-22 (< (-> a1-22 length) (-> a1-22 allocated-length))) + (let ((a3-14 (-> a1-22 data (-> a1-22 length)))) + (set! (-> a3-14 next1) (the-as connectable a2-12)) + (set! (-> a3-14 prev1) (the-as connectable (-> a0-34 hour-mask))) + (set! (-> (the-as vector (&-> a3-14 param0)) quad) (-> this root trans quad)) + (set! (-> a3-14 param3) (the-as int (-> a0-34 fade-after))) + ) + (+! (-> a1-22 length) 1) + ) + ) + ) + ) + ) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) + ) + ((logtest? (-> s5-1 flags) (sp-group-flag sp9)) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) + ) + (else + (set! (-> this part) (create-launch-control s5-1 this)) + (when (logtest? (-> s5-1 flags) (sp-group-flag sp10)) + (process-entity-status! this (entity-perm-status subtask-complete) #t) + (set! (-> this enable) #f) + ) + (go (method-of-object this active)) + ) + ) + ) + ) + ) + (go process-drawable-art-error sv-16) + ) + +(deftype launcher (process-drawable) + ((spring-height meters) + (camera state) + (active-distance float) + (seek-time time-frame) + (dest vector :inline) + (sound-id sound-id) + ) + (:state-methods + idle + active + deactivated + ) + ) + + +(defpartgroup group-beach-launcher + :id 7 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 58 :fade-after (meters 100) :falloff-to (meters 100)) + (sp-item 59 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 60 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 61 :fade-after (meters 50) :falloff-to (meters 80)) + (sp-item 62 :fade-after (meters 70) :falloff-to (meters 100)) + ) + ) + +(defpart 58 + :init-specs ((:num 1.5) + (:x (meters 1.5)) + (:y (meters -0.5)) + (:rot-x 5) + (:r 4096.0) + (:g 2867.2) + (:b 3276.8) + (:vel-y (meters 0.026666667)) + (:timer (seconds 0.9)) + (:flags (distort)) + (:next-time (seconds 0.6)) + (:next-launcher 63) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 63 + :init-specs ((:fade-b -4.551111)) + ) + +(defpart 59 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 1.0) + (:x (meters 0) (meters 1.8)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2.5) (meters 2.5)) + (:r 0.0 1 128.0) + (:g 64.0 196.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0025)) + (:scalevel-y (meters 0.24414062) (meters 0.48828125)) + (:timer (seconds 0.27)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 60 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 2.0) + (:x (meters 1.8) (meters 1)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 0.0 1 128.0) + (:g 64.0 196.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0025)) + (:scalevel-y (meters 0.048828125) (meters 0.09765625)) + (:timer (seconds 0.27)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 61 + :init-specs ((:texture (new 'static 'texture-id :index #x50 :page #x4)) + (:num 1.5) + (:x (meters 2.9) (meters 2.5)) + (:y (meters -0.5)) + (:scale-x (meters 0.3) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1) (meters 0.1)) + (:r 10.0 6.0) + (:g 64.0 128.0) + (:b 10.0 6.0) + (:a 80.0) + (:vel-x (meters -0.011666667) (meters -0.0033333334)) + (:vel-y (meters 0)) + (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) + (:fade-a -0.2) + (:accel-y (meters 0.0016666667)) + (:friction 0.996) + (:timer (seconds 0.6) (seconds 0.397)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 62 + :init-specs ((:texture (new 'static 'texture-id :page #x4)) + (:num 0.5) + (:x (meters 2.9) (meters 2.5)) + (:y (meters -0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 10.0 5.0) + (:a 0.0) + (:vel-x (meters -0.011666667) (meters -0.0033333334)) + (:vel-y (meters 0)) + (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) + (:fade-a 0.6) + (:accel-y (meters 0.0016666667)) + (:friction 0.996) + (:timer (seconds 0.9)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.15)) + (:next-launcher 64) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 64 + :init-specs ((:fade-a -0.18)) + ) + +(defpartgroup group-jungle-launcher + :id 8 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 58 :fade-after (meters 100) :falloff-to (meters 100)) + (sp-item 65 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 66 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 67 :fade-after (meters 70) :falloff-to (meters 100)) + ) + ) + +(defpart 65 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 1.0) + (:x (meters 0) (meters 1.4)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2.5) (meters 2.5)) + (:r 0.0 1 128.0) + (:g 64.0 196.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0025)) + (:scalevel-y (meters 0.24414062) (meters 0.48828125)) + (:timer (seconds 0.27)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 66 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 2.0) + (:x (meters 1.4) (meters 0.9)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 0.0 1 128.0) + (:g 64.0 196.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0025)) + (:scalevel-y (meters 0.048828125) (meters 0.09765625)) + (:timer (seconds 0.27)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 67 + :init-specs ((:texture (new 'static 'texture-id :page #x4)) + (:num 0.5) + (:x (meters 2.9) (meters 2.5)) + (:y (meters -0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 32.0 32.0) + (:b 10.0 5.0) + (:a 0.0) + (:vel-x (meters -0.011666667) (meters -0.0033333334)) + (:vel-y (meters 0)) + (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) + (:fade-a 0.6) + (:accel-y (meters 0.0016666667)) + (:friction 0.996) + (:timer (seconds 0.9)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.15)) + (:next-launcher 64) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-swamp-launcher + :id 9 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 58 :fade-after (meters 100) :falloff-to (meters 100)) + (sp-item 59 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 60 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 68 :fade-after (meters 70) :falloff-to (meters 100)) + ) + ) + +(defpart 68 + :init-specs ((:texture (new 'static 'texture-id :page #x4)) + (:num 0.5) + (:x (meters 2.9) (meters 2.5)) + (:y (meters -0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 16.0 16.0) + (:g 16.0 16.0) + (:b 5.0 2.5) + (:a 0.0) + (:vel-x (meters -0.011666667) (meters -0.0033333334)) + (:vel-y (meters 0)) + (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) + (:fade-a 0.6) + (:accel-y (meters 0.0016666667)) + (:friction 0.996) + (:timer (seconds 0.9)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.15)) + (:next-launcher 64) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defbehavior cam-launcher-joystick camera-slave () + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (set! (-> s5-0 rvec quad) (the-as uint128 0)) + (set! (-> s5-0 uvec quad) (the-as uint128 0)) + (set! (-> s5-0 fvec quad) (the-as uint128 0)) + (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((gp-0 (vector-reset! (new 'stack-no-clear 'vector)))) + (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) + (f0-1 (* -546.13336 f0-0)) + (f0-3 (fmin 546.13336 (fmax -546.13336 f0-1))) + ) + (matrix-axis-angle! s5-0 (-> *camera* local-down) f0-3) + ) + (vector-! gp-0 (-> self trans) (-> *camera* tpos-curr)) + (vector-matrix*! gp-0 gp-0 s5-0) + (vector+! (-> self trans) gp-0 (-> *camera* tpos-curr)) + ) + ) + ) + ) + +(defstate cam-launcher-shortfall (camera-slave) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (when (not (-> self enter-has-run)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) + (vector-flatten! gp-0 (-> self tracking inv-mat fvec) (-> *camera* local-down)) + (vector-normalize! gp-0 1.0) + (set! (-> self pivot-pt quad) (-> gp-0 quad)) + (vector+float*! gp-0 gp-0 (-> *camera* local-down) 1000.0) + (vector-normalize-copy! (-> self tracking inv-mat fvec) gp-0 1.0) + ) + (vector-cross! + (-> self tracking inv-mat uvec) + (-> self tracking inv-mat fvec) + (the-as vector (-> self tracking)) + ) + (set! (-> self blend-from-type) (camera-blend-from-type unknown-0)) + (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) + 0 + ) + ) + :trans (behavior () + (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) + (cam-slave-go cam-free-floating) + ) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until #f + (when (not (paused?)) + (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) + (send-event *camera* 'teleport) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) + (send-event *camera* 'change-state cam-string (seconds 0.5)) + ) + ) + (suspend) + ) + ) + #f + ) + ) + +(defbehavior cam-launcher-long-joystick camera-slave () + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (set! (-> gp-0 rvec quad) (the-as uint128 0)) + (set! (-> gp-0 uvec quad) (the-as uint128 0)) + (set! (-> gp-0 fvec quad) (the-as uint128 0)) + (set! (-> gp-0 trans quad) (the-as uint128 0)) + (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) + (f0-1 (* -546.13336 f0-0)) + (f0-3 (fmin 546.13336 (fmax -546.13336 f0-1))) + ) + (matrix-axis-angle! gp-0 (-> *camera* local-down) f0-3) + ) + (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) + ) + (vector-normalize! (-> self view-flat) 4096.0) + ) + ) + +(defstate cam-launcher-longfall (camera-slave) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (when (not (-> self enter-has-run)) + (new 'stack-no-clear 'vector) + (vector-negate! (-> self view-flat) (-> self tracking inv-mat fvec)) + (vector-normalize! (-> self view-flat) 4096.0) + (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) + (vector+! (-> self trans) (-> self trans) (-> self view-flat)) + (set! (-> self blend-from-type) (camera-blend-from-type unknown-0)) + (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) + (cam-calc-follow! (-> self tracking) (-> self trans) #f) + (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) + ) + ) + :trans (behavior () + (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) + (cam-slave-go cam-free-floating) + ) + (cam-launcher-long-joystick) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until #f + (when (not (paused?)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + 0.0 + (send-event *camera* 'teleport) + (let* ((f0-4 (vector-dot (-> self velocity) (-> *camera* local-down))) + (f30-0 (* 0.975 f0-4)) + ) + (vector--float*! s4-0 (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) + (vector-! s4-0 s4-0 (-> self trans)) + (let ((f28-0 (vector-dot s4-0 (-> *camera* local-down)))) + (vector--float*! s5-0 s4-0 (-> *camera* local-down) f28-0) + (cond + ((< f28-0 f30-0) + (set! f30-0 f28-0) + ) + ((< 20480.0 f28-0) + (let ((f28-1 (+ -20480.0 f28-0))) + (let ((f0-8 (lerp f30-0 f28-1 0.005))) + (if (< f30-0 f0-8) + (set! f30-0 f0-8) + ) + ) + (if (< (* 0.09 f28-1) f30-0) + (set! f30-0 (* 0.09 f28-1)) + ) + ) + ) + ) + ) + (vector+float*! (-> self velocity) s5-0 (-> *camera* local-down) f30-0) + ) + ) + (vector+! (-> self trans) (-> self trans) (-> self velocity)) + (set! (-> self trans x) (-> *camera* tpos-curr x)) + (set! (-> self trans z) (-> *camera* tpos-curr z)) + (vector+! (-> self trans) (-> self trans) (-> self view-flat)) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) + (send-event *camera* 'change-state cam-string (seconds 0.5)) + ) + ) + (vector-reset! (-> self tracking follow-off)) + (vector+! (-> self tracking follow-pt) (-> *camera* tpos-curr-adj) (-> self tracking follow-off)) + (vector--float*! + (-> self tracking follow-pt) + (-> self tracking follow-pt) + (-> *camera* local-down) + (-> *camera* settings target-height) + ) + (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) + (suspend) + ) + ) + #f + ) + ) + +(defstate idle (launcher) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('instant-death) + (go-virtual deactivated) + ) + (('trans) + (move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> block param 0))) + (update-transforms (the-as collide-shape (-> self root))) + ) + ) + ) + :trans (behavior () + (when (and *target* + (and (>= (-> self active-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (cond + ((send-event *target* 'query 'powerup (pickup-type eco-blue)) + (go-virtual active) + ) + (else + (let ((gp-0 'target-launch)) + (if (= (send-event *target* 'query 'mode) gp-0) + (send-event *target* 'end-mode 'launch) + ) + ) + ) + ) + (if (and (and *target* (and (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) + ) + (talker-spawn-func (-> *talker-speech* 44) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + :code sleep-code + ) + +(defstate active (launcher) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (or (= message 'touch) (= message 'attack)) + (set-time! (-> self state-time)) + (send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) + ) + (cond + ((= message 'instant-death) + (go-virtual deactivated) + ) + ((= message 'trans) + (move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> block param 0))) + (update-transforms (the-as collide-shape (-> self root))) + ) + ) + ) + :exit (behavior () + (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-0 command) (sound-command set-param)) + (set! (-> v1-0 id) (-> self sound-id)) + (set! (-> v1-0 params volume) -4) + (set! (-> v1-0 auto-time) 120) + (set! (-> v1-0 auto-from) 2) + (set! (-> v1-0 params mask) (the-as uint 17)) + (-> v1-0 id) + ) + ) + :trans (behavior () + (if (or (or (not *target*) + (or (< (-> self active-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (focus-test? *target* teleporting) + ) + ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) + ) + (go-virtual idle) + ) + (spawn (-> self part) (-> self root trans)) + (sound-play "launch-idle" :id (-> self sound-id)) + (if (and (and *target* + (and (>= (+ 2867.2 (-> (the-as collide-shape (-> self root)) root-prim prim-core world-sphere w)) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + ) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) + ) + (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) + ) + ) + :code (behavior () + (sound-play "launch-start") + (sleep-code) + ) + ) + +(defstate deactivated (launcher) + :virtual #t + :code sleep-code + ) + +(defmethod init-from-entity! ((this launcher) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-4) + ) + (set! (-> s4-0 nav-radius) 13926.4) + (let ((v1-6 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-6 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-6 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (update-transforms (the-as collide-shape (-> this root))) + (set! (-> this active-distance) 409600.0) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) + (let ((s4-1 (res-lump-value arg0 'mode uint128 :time -1000000000.0))) + (let ((v1-14 (-> this level name))) + (set! (-> this part) (create-launch-control + (cond + ((= v1-14 'beach) + (-> *part-group-id-table* 7) + ) + ((= v1-14 'swamp) + (-> *part-group-id-table* 9) + ) + (else + (-> *part-group-id-table* 8) + ) + ) + this + ) + ) + ) + (let ((v1-20 (logand (the-as int s4-1) 255))) + (cond + ((= (the-as uint v1-20) 1) + (set! (-> this camera) cam-launcher-longfall) + ) + ((= (the-as uint v1-20) 2) + (set! (-> this camera) #f) + ) + (else + (set! (-> this camera) cam-launcher-shortfall) + ) + ) + ) + ) + (let ((v1-25 (res-lump-struct arg0 'alt-vector vector))) + (when v1-25 + (set-vector! (-> this dest) (-> v1-25 x) (-> v1-25 y) (-> v1-25 z) 1.0) + (set! (-> this seek-time) (the-as time-frame (the int (* 300.0 (-> v1-25 w))))) + ) + ) + (set! (-> this sound-id) (new-sound-id)) + (nav-mesh-connect-from-ent this) + (go (method-of-object this idle)) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior launcher-init-by-other launcher ((arg0 vector) (arg1 float) (arg2 int) (arg3 float)) + (stack-size-set! (-> self main-thread) 128) + (let ((s2-0 (new 'process 'collide-shape self (collide-list-enum hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s2-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s2-0 total-prims) (the-as uint 1)) + (set! (-> s2-0 root-prim) v1-4) + ) + (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) + (let ((v1-7 (-> s2-0 root-prim))) + (set! (-> s2-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s2-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> self root) s2-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (set-vector! (-> self root quat) 0.0 0.0 0.0 1.0) + (update-transforms (the-as collide-shape (-> self root))) + (set! (-> self spring-height) arg1) + (set! (-> self active-distance) arg3) + (let ((v1-18 (-> self level name))) + (set! (-> self part) (create-launch-control + (cond + ((= v1-18 'beach) + (-> *part-group-id-table* 7) + ) + ((= v1-18 'swamp) + (-> *part-group-id-table* 9) + ) + (else + (-> *part-group-id-table* 8) + ) + ) + self + ) + ) + ) + (case (logand arg2 255) + ((1) + (set! (-> self camera) cam-launcher-longfall) + ) + ((2) + (set! (-> self camera) #f) + ) + (else + (set! (-> self camera) cam-launcher-shortfall) + ) + ) + (let ((v1-29 (res-lump-struct (-> self entity) 'alt-vector vector))) + (when v1-29 + (set-vector! (-> self dest) (-> v1-29 x) (-> v1-29 y) (-> v1-29 z) 1.0) + (set! (-> self seek-time) (the-as time-frame (the int (* 300.0 (-> v1-29 w))))) + ) + ) + (set! (-> self sound-id) (new-sound-id)) + (go-virtual idle) + (none) + ) + +(defstate active (touch-tracker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (case message + (('touched) + (let ((v1-1 (ppointer->process (-> self parent)))) + (when (!= v1-1 proc) + (cond + ((= (-> self event) 'attack) + (send-event + proc + (-> self event) + :from v1-1 + #f + (static-attack-info ((mode (-> self event-mode)) (id (new-attack-id)))) + ) + ) + ((-> self event) + (send-event proc (-> self event) :from v1-1) + ) + (else + (let ((t0-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> t0-5 from) (process->ppointer proc)) + (set! (-> t0-5 num-params) argc) + (set! (-> t0-5 message) message) + (set! (-> t0-5 param 0) (-> block param 0)) + (set! (-> t0-5 param 1) (-> block param 1)) + (set! (-> t0-5 param 2) (-> block param 2)) + (set! (-> t0-5 param 3) (-> block param 3)) + (set! (-> t0-5 param 4) (-> block param 4)) + (set! (-> t0-5 param 5) (-> block param 5)) + (send-event-function v1-1 t0-5) + ) + ) + ) + ) + ) + ) + (('target) + (set! v0-0 (process->handle (the-as process (-> block param 0)))) + (set! (-> self target) (the-as handle v0-0)) + v0-0 + ) + (('event) + (set! (-> self event) (the-as symbol (-> block param 0))) + (set! v0-0 (-> block param 1)) + (set! (-> self event-mode) (the-as symbol v0-0)) + v0-0 + ) + (('exit) + (set! v0-0 (-> block param 0)) + (set! (-> self run-function) (the-as (function object) v0-0)) + v0-0 + ) + (('eval) + ((the-as (function touch-tracker object) (-> block param 0)) self) + ) + (('function) + (set! v0-0 (-> block param 0)) + (set! (-> self callback) (the-as (function touch-tracker none) v0-0)) + v0-0 + ) + ) + ) + :code (behavior () + (set-time! (-> self state-time)) + (while ((-> self run-function)) + (let* ((gp-0 (handle->process (-> self target))) + (a0-4 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (when a0-4 + (let* ((gp-1 (-> (the-as process-drawable a0-4) root)) + (a0-6 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (if a0-6 + (set! (-> (the-as collide-shape (-> self root)) trans quad) + (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere quad) + ) + ) + ) + ) + ) + (if (-> self callback) + ((-> self callback) self) + ) + (update-transforms (the-as collide-shape (-> self root))) + (let ((a1-3 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-3 options) (overlaps-others-options oo1)) + (set! (-> a1-3 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-3 tlist) *touching-list*) + (find-overlapping-shapes (the-as collide-shape (-> self root)) a1-3) + ) + (suspend) + ) + (let ((v1-21 (-> (the-as collide-shape (-> self root)) root-prim))) + (set! (-> v1-21 prim-core collide-as) (collide-spec)) + (set! (-> v1-21 prim-core collide-with) (collide-spec)) + ) + 0 + (suspend) + 0 + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior touch-tracker-init touch-tracker ((arg0 vector) (arg1 float) (arg2 time-frame)) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec jak enemy)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + ) + ) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 arg1) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-9 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self duration) arg2) + (set! (-> self target) (the-as handle #f)) + (set! (-> self event) #f) + (set! (-> self callback) #f) + (set! (-> self run-function) + (lambda :behavior touch-tracker () (not (time-elapsed? (-> self state-time) (-> self duration)))) + ) + (set! (-> self event-hook) (-> (method-of-object self active) event)) + (go-virtual active) + (none) + ) + +(defmethod explosion-method-22 ((this explosion)) + 0 + (none) + ) + +(defbehavior explosion-init-by-other explosion ((arg0 explosion-init-params)) + (mem-copy! (the-as pointer (-> self params)) (the-as pointer arg0) 72) + (logclear! (-> self mask) (process-mask actor-pause movie)) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum hit-by-player)))) + (set! (-> s5-0 penetrate-using) (penetrate explode)) + (let ((v1-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-5 prim-core action) (collide-action solid)) + (set-vector! (-> v1-5 local-sphere) 0.0 0.0 0.0 0.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-5) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-8 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-8 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-8 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (set! (-> (the-as collide-shape (-> self root)) event-self) 'touched) + (set! (-> self root trans quad) (-> arg0 spawn-point quad)) + (quaternion-copy! (-> self root quat) (-> arg0 spawn-quat)) + (vector-identity! (-> self root scale)) + (vector-float*! (-> self root scale) (-> self root scale) (-> arg0 scale)) + (trs-matrix-calc! (-> self root) (-> self mat)) + (let ((v1-19 (-> (the-as collide-shape (-> self root)) root-prim))) + (set! (-> v1-19 local-sphere w) (-> arg0 radius)) + (set! (-> v1-19 prim-core world-sphere w) (-> arg0 radius)) + (set! (-> v1-19 prim-core collide-with) (-> arg0 collide-with)) + ) + (let* ((v1-20 *game-info*) + (a0-19 (+ (-> v1-20 attack-id) 1)) + ) + (set! (-> v1-20 attack-id) a0-19) + (set! (-> self attack-id) a0-19) + ) + (let ((a0-20 (-> arg0 group))) + (when a0-20 + (set! (-> self duration) (-> a0-20 duration)) + (set! (-> self linger-duration) (-> a0-20 linger-duration)) + (set! (-> self part) (create-launch-control a0-20 self)) + ) + ) + (let ((v1-26 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> v1-26 sphere quad) (-> self root trans quad)) + (vector-reset! (-> v1-26 velocity)) + (set! (-> v1-26 sphere r) (* 2.0 (-> arg0 radius))) + (set! (-> v1-26 notify-radius) 204800.0) + (set! (-> v1-26 danger-level) 1.0) + (set! (-> v1-26 decay-rate) 0.0) + (set! (-> v1-26 flags) (the-as uint 1)) + (set! (-> v1-26 danger-type) (the-as uint 5)) + (send-event *traffic-manager* 'add-danger-sphere v1-26) + ) + (explosion-method-22 self) + (go-virtual explode) + ) + +(defun explosion-spawn-legacy-version ((arg0 process-drawable) (arg1 type) (arg2 explosion-init-params)) + (let ((s4-0 (get-process *default-dead-pool* arg1 #x4000 1))) + (when s4-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s4-0 arg0 "explosion" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 explosion-init-by-other arg2) + (-> s4-0 ppointer) + ) + ) + ) + +;; WARN: Return type mismatch process vs none. +(defun explosion-spawn ((arg0 process-drawable) (arg1 type) (arg2 explosion-init-params)) + (let* ((gp-0 (the-as process #f)) + (s3-0 (get-process *default-dead-pool* explosion #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type explosion activate))) + (t9-1 (the-as explosion s3-0) (the-as process-tree arg1) "explosion" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 explosion-init-by-other arg0) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (none) + ) + +(defun find-closest-solid-sphere-prim ((arg0 collide-shape) (arg1 vector) (arg2 collide-spec)) + (let ((gp-0 (the-as collide-shape-prim #f))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 x) (the-as float #x7f800000)) + (let ((s2-0 (-> arg0 root-prim)) + (s1-0 1) + ) + (when (zero? (-> s2-0 prim-core prim-type)) + (let ((v1-3 s2-0)) + (set! s2-0 (-> (the-as collide-shape-prim-group v1-3) child 0)) + (set! s1-0 (the-as int (-> v1-3 specific 0))) + ) + ) + (while (nonzero? s1-0) + (+! s1-0 -1) + (when (and (= (-> s2-0 prim-core prim-type) -1) + (logtest? (-> s2-0 prim-core action) (collide-action solid)) + (logtest? (-> s2-0 prim-core collide-as) arg2) + ) + (set! (-> s3-0 y) (vector-vector-distance arg1 (the-as vector (-> s2-0 prim-core)))) + (set! (-> s3-0 y) (fmax 0.0 (- (-> s3-0 y) (-> s2-0 prim-core world-sphere w)))) + (when (< (-> s3-0 y) (-> s3-0 x)) + (set! (-> s3-0 x) (-> s3-0 y)) + (set! gp-0 s2-0) + ) + ) + (&+! s2-0 80) + ) + ) + ) + gp-0 + ) + ) + +(define *explosion-debug-sphere* (new 'static 'sphere)) + +(defstate explode (explosion) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (a0-13 process)) + (case message + (('touched) + (let ((s4-0 (new 'stack-no-clear 'mystery-cquery-type0))) + (set! (-> s4-0 explosion-trans quad) + (-> (the-as collide-shape (-> self root)) root-prim prim-core world-sphere quad) + ) + (let* ((s2-0 proc) + (s3-0 (if (type? s2-0 process-drawable) + s2-0 + ) + ) + ) + (when (and s3-0 (!= s3-0 (handle->process (-> self params ignore-proc)))) + (let ((v1-6 (find-closest-solid-sphere-prim + (the-as collide-shape (-> (the-as process-drawable s3-0) root)) + (-> s4-0 explosion-trans) + (-> self params collide-with) + ) + ) + ) + (cond + (v1-6 + (set! (-> s4-0 proc-trans quad) (-> v1-6 prim-core world-sphere quad)) + ) + ((begin + (let ((s2-2 proc)) + (set! a0-13 (if (type? s2-2 process-focusable) + s2-2 + ) + ) + ) + a0-13 + ) + (set! (-> s4-0 proc-trans quad) (-> (get-trans (the-as process-focusable a0-13) 3) quad)) + ) + (else + (let* ((s2-4 (-> (the-as process-focusable s3-0) root)) + (v1-12 (if (type? s2-4 collide-shape) + s2-4 + ) + ) + ) + (if v1-12 + (set! (-> s4-0 proc-trans quad) (-> v1-12 root-prim prim-core world-sphere quad)) + (set! (-> s4-0 proc-trans quad) (-> (the-as process-focusable s3-0) root trans quad)) + ) + ) + ) + ) + ) + (set! (-> s4-0 dist) (vector-vector-distance (-> s4-0 proc-trans) (-> s4-0 explosion-trans))) + (set! (-> s4-0 dist) (fmax 0.0 (- (-> s4-0 dist) (-> s4-0 proc-trans w)))) + (set! (-> s4-0 probe) -1.0) + (when (< 0.0 (-> s4-0 dist)) + (set! (-> s4-0 cquery start-pos quad) (-> s4-0 explosion-trans quad)) + (vector-! (-> s4-0 cquery move-dist) (-> s4-0 proc-trans) (-> s4-0 explosion-trans)) + (let ((v1-23 (-> s4-0 cquery))) + (set! (-> v1-23 radius) 40.96) + (set! (-> v1-23 collide-with) (collide-spec backgnd)) + (set! (-> v1-23 ignore-process0) #f) + (set! (-> v1-23 ignore-process1) #f) + (set! (-> v1-23 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-23 action-mask) (collide-action solid)) + ) + (set! (-> s4-0 probe) (fill-and-probe-using-line-sphere *collide-cache* (-> s4-0 cquery))) + ) + (when (< (-> s4-0 probe) 0.0) + (let ((s3-1 (new 'stack-no-clear 'inline-array 'vector 2))) + (vector-! (-> s3-1 0) (-> s4-0 proc-trans) (-> s4-0 explosion-trans)) + (set! (-> s3-1 1 x) (- 1.0 (fmin 1.0 (/ (-> s4-0 dist) (-> self params radius))))) + (set! (-> s3-1 1 y) (+ 1.0 (* (-> s3-1 1 x) (+ -1.0 (-> self params damage-scale))))) + (set! (-> s3-1 1 z) (* (-> s3-1 1 y) (-> self params damage))) + (vector-normalize! (-> s3-1 0) (-> s3-1 1 w)) + (send-event + proc + 'attack + (-> block param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (-> self attack-id)) + (damage (-> s3-1 1 z)) + (vehicle-damage-factor (-> self params vehicle-damage-factor)) + (vehicle-impulse-factor (-> self params vehicle-impulse-factor)) + (mode 'explode) + (attacker-velocity (-> s3-1 0)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code (behavior () + (set-time! (-> self start-time)) + (when (nonzero? (-> self params collide-with)) + (update-transforms (the-as collide-shape (-> self root))) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (the-as collide-shape (-> self root)) a1-0) + ) + ) + (let ((v1-11 (-> (the-as collide-shape (-> self root)) root-prim))) + (set! (-> v1-11 prim-core collide-as) (collide-spec)) + (set! (-> v1-11 prim-core collide-with) (collide-spec)) + ) + 0 + (while (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self duration)))) + (sparticle-launch-control-method-17 (-> self part) (-> self mat)) + (suspend) + ) + (set-time! (-> self start-time)) + (while (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self linger-duration)))) + (suspend) + ) + ) + ) + +(defun process-drawable-random-point! ((arg0 process-drawable) (arg1 vector)) + (let ((v1-1 (-> arg0 node-list length)) + (s4-0 (-> arg0 root)) + ) + (cond + ((>= v1-1 7) + (let ((v1-2 (rand-vu-int-range 3 (+ v1-1 -1)))) + (vector<-cspace! arg1 (-> arg0 node-list data v1-2)) + ) + ) + ((and (nonzero? s4-0) (type? s4-0 collide-shape)) + (vector+! + arg1 + (the-as vector (-> (the-as collide-shape s4-0) root-prim prim-core)) + (rand-vu-sphere-point! arg1 (-> (the-as collide-shape s4-0) root-prim prim-core world-sphere w)) + ) + ) + (else + (vector+! arg1 (-> arg0 root trans) (rand-vu-sphere-point! arg1 (-> arg0 draw bounds w))) + ) + ) + ) + arg1 + ) + +(defun process-drawable-pair-random-point! ((arg0 process-drawable) (arg1 process-drawable) (arg2 vector) (arg3 float)) + (let ((s4-0 (new-stack-vector0)) + (s3-0 (new-stack-vector0)) + ) + (process-drawable-random-point! arg0 s4-0) + (process-drawable-random-point! arg1 s3-0) + (vector-lerp! arg2 s4-0 s3-0 arg3) + ) + ) + +(deftype simple-prim (process-drawable) + ((strip prim-strip) + ) + (:state-methods + active + ) + (:methods + (init-strip! (_type_) none) + (strip-setup (_type_) none) + (get-alpha (_type_) int) + (allocate-trans-and-strip! (_type_) prim-strip) + (get-color (_type_) rgba) + ) + ) + + +(defmethod init-from-entity! ((this simple-prim) (arg0 entity-actor)) + (allocate-trans-and-strip! this) + (process-entity-set! this arg0) + (process-drawable-from-entity! this arg0) + (let ((v1-3 ((method-of-type res-lump get-property-struct) + (-> this entity) + 'trans-offset + 'interp + -1000000000.0 + *zero-vector* + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (vector+! (-> this root trans) (-> this root trans) (the-as vector v1-3)) + ) + (let ((f0-0 (res-lump-float (-> this entity) 'scale :default 1.0))) + (vector-float*! (-> this root scale) (-> this root scale) f0-0) + ) + (vector-float*! (-> this root scale) (-> this root scale) 4096.0) + (let ((f0-2 (res-lump-float (-> this entity) 'rotoffset))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-2) + ) + (let ((f0-3 (res-lump-float (-> this entity) 'tiltmin))) + (quaternion-rotate-local-x! (-> this root quat) (-> this root quat) f0-3) + ) + (set! (-> this strip tex-id) (new 'static 'texture-id :index #x3 :page #x1)) + (go (method-of-object this active)) + ) + +(defmethod allocate-trans-and-strip! ((this simple-prim)) + "Allocate transform and strip." + (set! (-> this root) (new 'process 'trsqv)) + (quaternion-identity! (-> this root quat)) + (let ((v0-2 (new 'process 'prim-strip 4 (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)))) + (set! (-> this strip) v0-2) + v0-2 + ) + ) + +(defbehavior simple-prim-init-by-other simple-prim ((arg0 vector) (arg1 vector) (arg2 texture-id)) + (allocate-trans-and-strip! self) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root scale quad) (-> arg1 quad)) + (set! (-> self strip tex-id) arg2) + (go-virtual active) + ) + +(defmethod strip-setup ((this simple-prim)) + (set! (-> this strip num-verts) (the-as uint 4)) + (set! (-> this strip alpha) *simple-prim-alpha-blend*) + (set! (-> this strip adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip data0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + ) + (none) + ) + +(defstate active (simple-prim) + :virtual #t + :enter (behavior () + '() + ) + :trans (behavior () + (strip-setup self) + (init-strip! self) + ) + :code sleep-code + ) + +(defmethod get-alpha ((this simple-prim)) + 128 + ) + +(defmethod get-color ((this simple-prim)) + *color-gray* + ) + +;; WARN: Return type mismatch rgba vs none. +(defmethod init-strip! ((this simple-prim)) + (quaternion-normalize! (-> this root quat)) + (let ((s2-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (gp-0 (get-alpha this)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (get-color this)) + ) + (vector-normalize! s2-0 (-> this root scale x)) + (vector-normalize! s3-0 (-> this root scale y)) + (let ((v1-8 (-> this strip data))) + (vector+! s4-0 (-> this root trans) s2-0) + (vector+! s4-0 s4-0 s3-0) + (set! (-> v1-8 0 pos quad) (-> s4-0 quad)) + (set! (-> v1-8 0 stq z) 0.0) + (set! (-> v1-8 0 stq x) 0.0) + (set! (-> v1-8 0 stq y) 0.0) + (set! (-> v1-8 0 col) s5-0) + (set! (-> v1-8 0 col a) gp-0) + (let ((v1-9 (-> v1-8 1))) + (vector+float*! s4-0 (-> this root trans) s2-0 -1.0) + (vector+! s4-0 s4-0 s3-0) + (set! (-> v1-9 pos quad) (-> s4-0 quad)) + (set! (-> v1-9 stq z) 0.0) + (set! (-> v1-9 stq x) 1.0) + (set! (-> v1-9 stq y) 0.0) + (set! (-> v1-9 col) s5-0) + (set! (-> v1-9 col a) gp-0) + (let ((v1-10 (&+ v1-9 32))) + (vector+! s4-0 (-> this root trans) s2-0) + (vector+float*! s4-0 s4-0 s3-0 -1.0) + (set! (-> v1-10 pos quad) (-> s4-0 quad)) + (set! (-> v1-10 stq z) 0.0) + (set! (-> v1-10 stq x) 0.0) + (set! (-> v1-10 stq y) 1.0) + (set! (-> v1-10 col) s5-0) + (set! (-> v1-10 col a) gp-0) + (let ((v1-11 (&+ v1-10 32))) + (vector+float*! s4-0 (-> this root trans) s2-0 -1.0) + (vector+float*! s4-0 s4-0 s3-0 -1.0) + (set! (-> v1-11 pos quad) (-> s4-0 quad)) + (set! (-> v1-11 stq z) 0.0) + (set! (-> v1-11 stq x) 1.0) + (set! (-> v1-11 stq y) 1.0) + (set! (-> v1-11 col) s5-0) + (set! (-> v1-11 col a) gp-0) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod relocate ((this simple-prim) (offset int)) + (if (nonzero? (-> this strip)) + (&+! (-> this strip) offset) + ) + (call-parent-method this offset) + ) + +(deftype simple-prim-zbuf-mask (simple-prim) + () + ) + + +(defmethod strip-setup ((this simple-prim-zbuf-mask)) + (set! (-> this strip num-verts) (the-as uint 4)) + (set! (-> this strip alpha) *simple-prim-additive*) + (set! (-> this strip adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip data0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + ) + (set! (-> this strip bucket) (bucket-id bucket569)) + (set! (-> this strip sink) (the-as uint 65)) + (none) + ) + +(defmethod get-color ((this simple-prim-zbuf-mask)) + *color-black* + ) + +(deftype simple-prim-particle-binding (simple-prim) + ((color rgba) + (lifetime time-frame) + ) + (:state-methods + die + ) + (:methods + (setup! (_type_ int sparticle-cpuinfo sparticle-launchinfo) none) + ) + ) + + +(defmethod get-color ((this simple-prim-particle-binding)) + (-> this color) + ) + +(defstate die (simple-prim-particle-binding) + :virtual #t + :code nothing + ) + +(defstate active (simple-prim-particle-binding) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (init-strip! self) + (if (time-elapsed? (-> self state-time) (-> self lifetime)) + (go-virtual die) + ) + ) + :code sleep-code + ) + +(defmethod setup! ((this simple-prim-particle-binding) (arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + "Set up this prim with the given particle info." + (set! (-> this lifetime) (seconds 5)) + (set! (-> this root scale x) (-> arg2 launchrot w)) + (set! (-> this root scale y) (-> arg2 conerot w)) + (set! (-> this color r) (the int (* 128.0 (-> arg2 rotate-x)))) + (set! (-> this color g) (the int (* 128.0 (-> arg2 rotate-y)))) + (set! (-> this color b) (the int (* 128.0 (-> arg2 rotate-z)))) + (set! (-> this color a) (the int (* 128.0 (-> arg2 coneradius)))) + (set-vector! (-> this root trans) (-> arg2 launchrot x) (-> arg2 launchrot y) (-> arg2 launchrot z) 1.0) + (set! (-> this strip adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip data0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + ) + (cond + ((logtest? (-> arg1 flags) (sp-cpuinfo-flag aux-list)) + (set! (-> this strip alpha) *simple-prim-additive*) + (set! (-> this color) *color-black*) + ) + ((logtest? (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-3)) + (set! (-> this strip alpha) *simple-prim-additive*) + ) + (else + (set! (-> this strip alpha) *simple-prim-alpha-blend*) + ) + ) + (set! (-> this strip num-verts) (the-as uint 4)) + (none) + ) + +(defun birth-func-simple-prim ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s3-0 (get-process *default-dead-pool* simple-prim-particle-binding #x4000 1))) + (setup! + (the-as simple-prim-particle-binding (-> (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 *entity-pool* "prim" (the-as pointer #x70004000)) + ) + (run-now-in-process + s3-0 + simple-prim-init-by-other + *zero-vector* + *zero-vector* + (new 'static 'texture-id :index #x3 :page #x1) + ) + (-> s3-0 ppointer) + ) + 0 + ) + ) + arg0 + arg1 + arg2 + ) + ) + (none) + ) + +(deftype part-controller (process) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (spawn-delay time-frame) + (current-part-index uint16) + (state-time time-frame) + (next-reset-time time-frame) + (reset-interval-min time-frame) + (reset-interval-max time-frame) + (particle-launchers (array (pointer sparticle-launch-group))) + (spawn-sound sound-name) + ) + (:state-methods + active + ) + ) + + +(defmethod relocate ((this part-controller) (offset int)) + (if (nonzero? (-> this particle-launchers)) + (&+! (-> this particle-launchers) offset) + ) + (call-parent-method this offset) + ) + +(defmethod run-logic? ((this part-controller)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod init-from-entity! ((this part-controller) (arg0 entity-actor)) + (local-vars (sv-16 res-tag) (sv-32 string)) + (stack-size-set! (-> this main-thread) 32) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-3 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-3 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-3)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (when (<= (-> this actor-group-count) 0) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) + (return 0) + ) + (let ((a0-9 ((method-of-type res-lump get-property-struct) + arg0 + 'sound-name + 'interp + -1000000000.0 + "" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! (-> this spawn-sound) (string->sound-name (the-as string a0-9))) + ) + (let ((a3-2 (+ 0 (-> this actor-group 0 length)))) + (set! (-> this particle-launchers) + (the-as (array (pointer sparticle-launch-group)) (new 'process 'boxed-array pointer a3-2)) + ) + ) + (set! (-> this particle-launchers length) 0) + (dotimes (s4-0 (min 1 (-> this actor-group-count))) + (dotimes (s3-0 (-> this actor-group s4-0 length)) + (set! sv-32 "#f") + (set! (-> this particle-launchers (-> this particle-launchers length)) + (entity-lookup-part-group + (the-as entity-actor (-> this actor-group s4-0 data s3-0 actor)) + (& sv-32) + 'art-name + ) + ) + (+! (-> this particle-launchers length) 1) + ) + ) + (set! (-> this spawn-delay) (the-as time-frame (the int (* 300.0 (res-lump-float arg0 'delay :default 1.0))))) + (let ((s4-1 (the int (* 300.0 (res-lump-float arg0 'base-time :default 4.0)))) + (v1-50 (the int (* 300.0 (res-lump-float arg0 'offset-time :default 2.0)))) + ) + (set! (-> this reset-interval-min) (the-as time-frame (- s4-1 v1-50))) + (set! (-> this reset-interval-max) (the-as time-frame (+ s4-1 v1-50))) + ) + (go (method-of-object this active)) + ) + +(defstate active (part-controller) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self next-reset-time) (+ (current-time) + (-> self reset-interval-min) + (mod + (the-as int (rand-uint31-gen *random-generator*)) + (+ (- 1 (-> self reset-interval-min)) (-> self reset-interval-max)) + ) + ) + ) + ) + :trans (behavior () + (when (< (-> self next-reset-time) (current-time)) + (set! (-> self current-part-index) (the-as uint 0)) + (set! (-> self state-time) 0) + (set! (-> self next-reset-time) (+ (current-time) + (-> self reset-interval-min) + (mod + (the-as int (rand-uint31-gen *random-generator*)) + (+ (- 1 (-> self reset-interval-min)) (-> self reset-interval-max)) + ) + ) + ) + ) + (when (and (time-elapsed? (-> self state-time) (-> self spawn-delay)) + (< (-> self current-part-index) (the-as uint (-> self particle-launchers length))) + ) + (when (-> self particle-launchers (-> self current-part-index)) + (let ((gp-1 (-> self actor-group 0 data (-> self current-part-index) actor extra trans))) + (sound-play-by-name (-> self spawn-sound) (new-sound-id) 1024 0 0 (sound-group) gp-1) + (cond + ((logtest? (-> self particle-launchers (-> self current-part-index) 0 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-2 + (let ((t9-4 (method-of-type part-tracker-subsampler activate))) + (t9-4 + (the-as part-tracker-subsampler gp-2) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-5 run-function-in-process) + (a0-18 gp-2) + (a1-3 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) + (-> self particle-launchers (-> self current-part-index) 0) + ) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-5) a0-18 a1-3 *part-tracker-subsampler-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-3 + (let ((t9-7 (method-of-type part-tracker activate))) + (t9-7 (the-as part-tracker gp-3) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-8 run-function-in-process) + (a0-23 gp-3) + (a1-6 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> self particle-launchers (-> self current-part-index) 0)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-8) a0-23 a1-6 *part-tracker-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + ) + ) + ) + (+! (-> self current-part-index) 1) + (set-time! (-> self state-time)) + ) + ) + :code sleep-code + ) + +(deftype sound-controller (process) + ((spawn-sound sound-name) + (sync sync-linear :inline) + (prev-val float) + (pos vector :inline) + ) + (:state-methods + active + die + ) + ) + + +(defmethod init-from-entity! ((this sound-controller) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 32) + (let ((a0-3 (the-as string ((method-of-type res-lump get-property-struct) + arg0 + 'sound-name + 'interp + -1000000000.0 + "" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (set! (-> this spawn-sound) (string->sound-name a0-3)) + ) + (set! (-> this pos quad) (-> arg0 extra trans quad)) + (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-5 0)) + (if #f + (set! v1-5 (logior v1-5 1)) + ) + (set! (-> a1-3 sync-type) 'sync-linear) + (set! (-> a1-3 sync-flags) (the-as sync-flags v1-5)) + ) + (set! (-> a1-3 entity) arg0) + (set! (-> a1-3 period) (the-as uint #x6fc23b000)) + (set! (-> a1-3 percent) 0.0) + (initialize! (-> this sync) a1-3) + ) + (set! (-> this prev-val) (get-norm! (-> this sync) 0)) + (go (method-of-object this active)) + ) + +(defmethod deactivate ((this sound-controller)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (call-parent-method this) + (none) + ) + +(defstate die (sound-controller) + :virtual #t + :code (behavior () + '() + ) + ) + +(defstate active (sound-controller) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual die) + ) + (('reset) + (-> self sync) + (let ((t9-1 (method-of-type sync-linear sync-info-method-15))) + 0 + (t9-1) + ) + ) + (('play) + (sound-play-by-name (-> self spawn-sound) (new-sound-id) 1024 0 0 (sound-group) (-> self pos)) + ) + ) + ) + :trans (behavior () + (let ((f30-0 (get-norm! (-> self sync) 0))) + (if (< f30-0 (-> self prev-val)) + (sound-play-by-name (-> self spawn-sound) (new-sound-id) 1024 0 0 (sound-group) (-> self pos)) + ) + (set! (-> self prev-val) f30-0) + ) + ) + :code sleep-code + ) + +(deftype sound-on-path (process-drawable) + "An [[ambient-sound]] that is being moved along a path." + ((spawn-sound sound-name) + (loop-sound uint32 :offset 228) + (amb-sound ambient-sound) + (is-spooling? symbol) + ) + (:state-methods + active + die + no-play + ) + ) + + +(defmethod deactivate ((this sound-on-path)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this amb-sound)) + (stop! (-> this amb-sound)) + ) + (if (nonzero? (-> this loop-sound)) + (sound-stop (the-as sound-id (-> this loop-sound))) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; WARN: Return type mismatch process-drawable vs sound-on-path. +(defmethod relocate ((this sound-on-path) (offset int)) + (if (nonzero? (-> this amb-sound)) + (&+! (-> this amb-sound) offset) + ) + (the-as sound-on-path ((method-of-type process-drawable relocate) this offset)) + ) + +(defmethod init-from-entity! ((this sound-on-path) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 32) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (let ((s4-0 ((method-of-type res-lump get-property-struct) + arg0 + 'sound-name + 'interp + -1000000000.0 + "" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! (-> this is-spooling?) (nonzero? (res-lump-value arg0 'spooling-val uint128 :time -1000000000.0))) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logclear! (-> this mask) (process-mask actor-pause)) + (when (= s4-0 "") + (go (method-of-object this no-play)) + (return 0) + ) + (cond + ((-> this is-spooling?) + (set! (-> this loop-sound) + (the-as + uint + (add-process *gui-control* this (gui-channel background) (gui-action queue) (the-as string s4-0) -99.0 0) + ) + ) + ) + (else + (set! (-> this amb-sound) (new 'process 'ambient-sound (the-as basic s4-0) (-> this root trans) 0.0)) + (let ((f0-0 (res-lump-float arg0 'sound-falloff-far :default 245760.0))) + (set-falloff-far! (-> this amb-sound) f0-0) + ) + (update-vol! (-> this amb-sound) 1.0) + (update-pitch-mod! (-> this amb-sound) 0.0) + ) + ) + ) + (go (method-of-object this active)) + ) + +(defmethod run-logic? ((this sound-on-path)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defstate die (sound-on-path) + :virtual #t + :code (behavior () + '() + ) + ) + +(defstate no-play (sound-on-path) + :virtual #t + :code sleep-code + ) + +(defstate active (sound-on-path) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual die) + ) + ) + ) + :trans (behavior () + (let ((f0-0 (path-control-method-25 (-> self path) (target-pos 0))) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (get-point-at-percent-along-path! (-> self path) gp-1 f0-0 'interp) + (set! (-> self root trans quad) (-> gp-1 quad)) + (cond + ((-> self is-spooling?) + (case (get-status *gui-control* (the-as sound-id (-> self loop-sound))) + (((gui-status ready)) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self loop-sound)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + ) + (else + (update-trans! (-> self amb-sound) gp-1) + (update! (-> self amb-sound)) + ) + ) + ) + ) + :code sleep-code + ) + +(defstate active (external-camera-controller) + :virtual #t + :trans (behavior () + (set-zero! *camera-smush-control*) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status no-kill) #t) + (set-setting! 'calm #t 0.0 0) + (while (not (process-grab? *target* #f)) + (suspend) + ) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 450.0 0) + (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0.0 0) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (-> self pause-time)) + (suspend) + ) + ) + (if (-> self blur) + (set-setting! 'blur-a 'abs 0.5 0) + ) + (remove-setting! 'mode-name) + (remove-setting! 'entity-name) + (remove-setting! 'interp-time) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.5)) + (suspend) + ) + ) + (while (not (process-release? *target*)) + (suspend) + ) + (remove-setting! 'interp-time) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 0.5)) + (suspend) + ) + ) + (remove-setting! 'blur-a) + (process-entity-status! self (entity-perm-status no-kill) #f) + ) + ) + +(defbehavior external-camera-controller-init-by-other external-camera-controller ((arg0 entity) (arg1 time-frame) (arg2 symbol)) + (process-entity-set! self arg0) + (set! (-> self pause-time) arg1) + (set! (-> self blur) arg2) + (go-virtual active) + ) + +(deftype level-exit (process-drawable) + ((minimap connection-minimap) + (task-counter uint32) + (ent basic) + ) + (:state-methods + active + ) + ) + + +(defmethod init-from-entity! ((this level-exit) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this minimap) #f) + (set! (-> this task-counter) (the-as uint 0)) + (set! (-> this ent) arg0) + (go (method-of-object this active)) + ) + +(defmethod run-logic? ((this level-exit)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod deactivate ((this level-exit)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this minimap) + (kill-callback (-> *minimap* engine) (-> this minimap)) + ) + (call-parent-method this) + (none) + ) + +(defstate active (level-exit) + :virtual #t + :trans (behavior () + (set! (-> self task-counter) (-> *game-info* task-counter)) + (if *bigmap* + (bigmap-method-16 *bigmap*) + ) + (let ((gp-0 (res-lump-struct (-> self entity) 'on-running structure))) + (cond + ((or (not gp-0) (and gp-0 (script-eval (the-as pair gp-0)))) + (if (not (-> self minimap)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 14) (the-as int #f) (the-as vector #t) 0)) + ) + ) + (else + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + ) + ) + ) + ) + :code sleep-code + ) diff --git a/goal_src/jak3/engine/common-obs/projectile-h.gc b/goal_src/jak3/engine/common-obs/projectile-h.gc index ee242fc45e0..e3ee11c3aa2 100644 --- a/goal_src/jak3/engine/common-obs/projectile-h.gc +++ b/goal_src/jak3/engine/common-obs/projectile-h.gc @@ -5,24 +5,60 @@ ;; name in dgo: projectile-h ;; dgos: GAME +;; +++projectile-options (defenum projectile-options :bitfield #t :type uint64 + (po0 0) + (po1 1) + (po2 2) + (po3 3) + (po4 4) + (po5 5) + (po6 6) + (po7 7) + (po8 8) + (po9 9) + (po10 10) + (po11 11) + (po12 12) + (po13 13) + (po14 14) + (po15 15) + (po16 16) + (po17 17) + (po18 18) + (po19 19) + (po20 20) + (po21 21) + (po22 22) + (po23 23) + (po24 24) + (po25 25) + (po26 26) + (po27 27) + (po28 28) + (po29 29) + (po30 30) + (po31 31) ) +;; ---projectile-options + (declare-type projectile process) (declare-type projectile-init-by-other-params structure) -(define-extern projectile-init-by-other (function projectile-init-by-other-params projectile :behavior projectile)) - +(define-extern projectile-init-by-other (function projectile-init-by-other-params object :behavior projectile)) ;; DECOMP BEGINS (deftype projectile (process-drawable) - ((starting-pos vector :inline) - (starting-dir vector :inline) - (target-pos vector :inline) - (base-target-pos vector :inline) - (pre-move-transv vector :inline) + ((parent (pointer process-drawable) :override) + (root collide-shape-moving :override) + (starting-pos vector :inline) + (starting-dir vector :inline) + (target-pos vector :inline) + (base-target-pos vector :inline) + (pre-move-transv vector :inline) (timeout time-frame) (spawn-time time-frame) (options projectile-options) @@ -34,7 +70,7 @@ (move (function projectile none)) (pick-target (function projectile none)) (max-speed float) - (old-dist float 16) + (old-dist float 16) (old-dist-count int32) (hits int32) (max-hits int32) @@ -49,30 +85,32 @@ (stop-speed meters) (invinc-time time-frame) (desired-target uint64) - (desired-target-pos vector :inline) + (desired-target-pos vector :inline) ) + (:state-methods + die + dissipate + impact + moving + ) (:methods - (projectile-method-20 () none) - (projectile-method-21 () none) - (projectile-method-22 () none) - (projectile-method-23 () none) - (projectile-method-24 () none) - (projectile-method-25 () none) - (projectile-method-26 () none) - (projectile-method-27 () none) - (projectile-method-28 () none) - (projectile-method-29 () none) - (projectile-method-30 () none) - (projectile-method-31 () none) - (projectile-method-32 () none) - (projectile-method-33 () none) - (projectile-method-34 () none) - (projectile-method-35 () none) - (projectile-method-36 () none) - (projectile-method-37 () none) - (projectile-method-38 () none) - (projectile-method-39 () none) - (projectile-method-40 () none) + (projectile-method-24 (_type_) none) + (projectile-method-25 (_type_) none) + (projectile-method-26 (_type_) none) + (projectile-method-27 (_type_) none) + (play-impact-sound (_type_ projectile-options) none) + (projectile-method-29 (_type_) none) + (setup-collision! (_type_) none) + (projectile-method-31 (_type_) none) + (projectile-method-32 (_type_) none) + (go-impact! (_type_) none) + (projectile-method-34 (_type_) none) + (event-handler! (_type_ process int symbol event-message-block) object) + (handle-proj-hit! (_type_ process event-message-block) object) + (deal-damage! (_type_ process event-message-block) symbol) + (made-impact? (_type_) symbol) + (projectile-method-39 (_type_) none) + (projectile-method-40 (_type_) int) ) ) @@ -115,9 +153,11 @@ (tumble-quat quaternion :inline) (gravity float) ) + (:state-methods + sitting + ) (:methods - (projectile-bounce-method-41 () none) - (projectile-bounce-method-42 () none) - (projectile-bounce-method-43 () none) + (projectile-bounce-method-42 (_type_) none) + (projectile-bounce-method-43 (_type_) none) ) ) diff --git a/goal_src/jak3/engine/common-obs/projectile.gc b/goal_src/jak3/engine/common-obs/projectile.gc index c65d0ee2412..f80ebd17980 100644 --- a/goal_src/jak3/engine/common-obs/projectile.gc +++ b/goal_src/jak3/engine/common-obs/projectile.gc @@ -7,3 +7,674 @@ ;; DECOMP BEGINS +(defun cshape-reaction-projectile ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (let ((s5-0 (cshape-reaction-default arg0 arg1 arg2 arg3))) + (case (-> arg1 best-other-tri pat material) + (((pat-material stopproj)) + (send-event (-> arg0 process) 'die) + ) + ) + s5-0 + ) + ) + +(defmethod projectile-method-39 ((this projectile)) + 0 + (none) + ) + +(defmethod event-handler! ((this projectile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('tracked) + (let ((v0-0 (the-as object (process->handle (the-as process (-> arg3 param 0)))))) + (set! (-> this last-target) (the-as handle v0-0)) + v0-0 + ) + ) + (('touched 'touch) + (handle-proj-hit! this arg0 arg3) + ) + (('die) + (projectile-method-34 this) + ) + ) + ) + +;; WARN: Return type mismatch object vs projectile. +(defbehavior projectile-event-handler projectile ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as projectile (event-handler! self arg0 arg1 arg2 arg3)) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod deal-damage! ((this projectile) (arg0 process) (arg1 event-message-block)) + (let ((v1-1 (new 'stack 'attack-info))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 mode) (-> this attack-mode)) + (set! (-> a0-2 id) (-> this attack-id)) + (set! (-> a0-2 mask) (attack-mask mode id)) + ) + (when (!= (-> this owner-handle) #f) + (set! (-> v1-1 attacker) (-> this owner-handle)) + (logior! (-> v1-1 mask) (attack-mask attacker)) + ) + (when (logtest? (-> this options) (projectile-options po13)) + (set! (-> v1-1 attacker-velocity quad) (-> this pre-move-transv quad)) + (logior! (-> v1-1 mask) (attack-mask attacker-velocity)) + ) + (set! (-> v1-1 damage) (-> this damage)) + (set! (-> v1-1 vehicle-damage-factor) (-> this vehicle-damage-factor)) + (set! (-> v1-1 vehicle-impulse-factor) (-> this vehicle-impulse-factor)) + (logior! (-> v1-1 mask) (attack-mask damage vehicle-damage-factor vehicle-impulse-factor)) + (when (logtest? (projectile-options po18) (-> this options)) + (set! (-> v1-1 invinc-time) (-> this invinc-time)) + (logior! (-> v1-1 mask) (attack-mask invinc-time)) + ) + (the-as symbol (send-event + arg0 + (if (logtest? (projectile-options po19) (-> this options)) + 'attack-invinc + 'attack + ) + arg1 + v1-1 + ) + ) + ) + ) + +(defmethod handle-proj-hit! ((this projectile) (arg0 process) (arg1 event-message-block)) + (when (-> this attack-mode) + (let* ((a2-1 (-> arg1 param 0)) + (s5-0 (deal-damage! this arg0 (the-as event-message-block a2-1))) + ) + (when s5-0 + (let ((v1-2 (-> this notify-handle))) + (send-event (handle->process v1-2) 'notify 'attack arg0) + ) + (+! (-> this hits) 1) + (when (and (>= (-> this hits) (-> this max-hits)) + (not (and (-> this next-state) (= (-> this next-state name) 'impact))) + ) + (if (= s5-0 'no-impact) + (logior! (-> this options) (projectile-options po20)) + ) + (go (method-of-object this impact)) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod projectile-method-34 ((this projectile)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) + (go (method-of-object this impact)) + ) + #t + (none) + ) + +(defmethod projectile-method-24 ((this projectile)) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this projectile)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) + ) + 0 + (none) + ) + +(defmethod projectile-method-26 ((this projectile)) + 0 + (none) + ) + +(defmethod projectile-method-27 ((this projectile)) + 0 + (none) + ) + +(defmethod play-impact-sound ((this projectile) (arg0 projectile-options)) + 0 + (none) + ) + +(defmethod projectile-method-29 ((this projectile)) + (when (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + (set! (-> this sound-id) (new 'static 'sound-id)) + 0 + ) + 0 + (none) + ) + +(defmethod made-impact? ((this projectile)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a1-0 t1-0)) + (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (handle->process (-> this ignore-handle))) + (set! (-> a1-0 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a1-0 action-mask) (collide-action solid)) + ) + (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) + ) + ) + +(defun projectile-move-fill-all-dirs ((arg0 projectile)) + (let ((v1-0 (-> arg0 root)) + (a2-0 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> a2-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a2-0 ignore-process0) arg0) + (set! (-> a2-0 ignore-process1) (handle->process (-> arg0 ignore-handle))) + (set! (-> a2-0 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a2-0 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-0 (-> v1-0 transv) a2-0 (meters 0)) + ) + 0 + (none) + ) + +(defun projectile-move-fill-line-sphere ((arg0 projectile)) + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg0 root))) + (let ((a1-0 (new 'stack-no-clear 'collide-query))) + (let ((a2-0 (-> gp-0 root-prim))) + (set! (-> a1-0 start-pos quad) (-> gp-0 trans quad)) + (let ((v1-1 (-> a1-0 move-dist))) + (.lvf vf1 (&-> (-> gp-0 transv) quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-1 quad) vf1) + ) + (let ((v1-2 a1-0)) + (set! (-> v1-2 radius) (-> a2-0 prim-core world-sphere w)) + (set! (-> v1-2 collide-with) (-> a2-0 prim-core collide-with)) + (set! (-> v1-2 ignore-process0) arg0) + (set! (-> v1-2 ignore-process1) (handle->process (-> arg0 ignore-handle))) + (set! (-> v1-2 ignore-pat) (-> gp-0 pat-ignore-mask)) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + ) + (fill-using-line-sphere *collide-cache* a1-0) + ) + (integrate-and-collide! gp-0 (-> gp-0 transv)) + ) + 0 + (none) + ) + ) + +(defun projectile-update-velocity-add-gravity ((arg0 projectile)) + (vector-v++! (-> arg0 root transv) (compute-acc-due-to-gravity (-> arg0 root) (new-stack-vector0) 1.0)) + 0 + (none) + ) + +(defun projectile-update-velocity-space-wars ((arg0 projectile)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target-pos) (-> arg0 root trans)))) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root transv) 1.0)) + (f30-0 (vector-length (-> arg0 root transv))) + ) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (vector-flatten! s5-1 s5-1 (-> arg0 root local-normal)) + ) + (vector-normalize-copy! s4-0 s5-1 1.0) + (if (and (or (not (handle->process (-> arg0 last-target))) + (zero? (-> (the-as collide-shape (-> (the-as process-drawable (handle->process (-> arg0 last-target))) root)) + root-prim + prim-core + collide-as + ) + ) + ) + (< (vector-dot s4-0 s3-0) 0.0) + ) + (go (method-of-object arg0 dissipate)) + ) + (vector-deg-slerp (-> arg0 root transv) s3-0 s4-0 (-> arg0 tween)) + (vector-normalize! (-> arg0 root transv) f30-0) + ) + (vector+! (-> arg0 root transv) (-> arg0 root transv) s5-1) + ) + (vector-v++! (-> arg0 root transv) (compute-acc-due-to-gravity (-> arg0 root) (new-stack-vector0) 0.0)) + (if (< (-> arg0 max-speed) (vector-length (-> arg0 root transv))) + (vector-normalize! (-> arg0 root transv) (-> arg0 max-speed)) + ) + (if (logtest? (-> arg0 options) (projectile-options po0)) + (set! (-> arg0 root transv y) -40960.0) + ) + 0 + (none) + ) + +(defstate moving (projectile) + :virtual #t + :event projectile-event-handler + :exit (behavior () + (projectile-method-29 self) + ) + :trans (behavior () + (if (time-elapsed? (-> self spawn-time) (-> self timeout)) + (go-virtual dissipate) + ) + (let ((t9-1 (-> self pick-target))) + (if t9-1 + (t9-1 self) + ) + ) + (let ((t9-2 (-> self update-velocity))) + (if t9-2 + (t9-2 self) + ) + ) + (when (logtest? (-> self options) (projectile-options po1)) + (seek! (-> self tween) 1.0 (* 0.5 (seconds-per-frame))) + (let ((f0-4 (vector-vector-distance (-> self root trans) (-> self target-pos)))) + (cond + ((< f0-4 20480.0) + (seek! (-> self tween) 1.0 (* 3.0 (seconds-per-frame))) + ) + ((< f0-4 40960.0) + (seek! (-> self tween) 1.0 (seconds-per-frame)) + ) + ) + ) + ) + (let ((gp-0 (-> self root))) + (set! (-> self pre-move-transv quad) (-> gp-0 transv quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> gp-0 trans quad)) + ((-> self move) self) + (projectile-method-39 self) + (set! (-> self old-dist (-> self old-dist-count)) (* 0.0625 (vector-vector-distance s5-0 (-> gp-0 trans)))) + ) + ) + (set! (-> self old-dist-count) (logand (+ (-> self old-dist-count) 1) 15)) + (let ((f0-14 0.0)) + (countdown (v1-38 16) + (+! f0-14 (-> self old-dist v1-38)) + ) + (if (or (and (logtest? (-> self options) (projectile-options po4)) + (and (logtest? (-> self root status) (collide-status touch-wall)) (< f0-14 2048.0)) + ) + (< f0-14 (-> self stop-speed)) + ) + (go-impact! self) + ) + ) + ) + :code (behavior () + (until #f + (projectile-method-25 self) + (play-impact-sound self (projectile-options po0 po1)) + (suspend) + ) + #f + ) + ) + +(defstate impact (projectile) + :virtual #t + :event projectile-event-handler + :enter (behavior () + (projectile-method-26 self) + (play-impact-sound self (projectile-options po0)) + ) + :code (behavior () + (suspend) + (go-virtual die) + ) + ) + +(defstate dissipate (projectile) + :virtual #t + :event projectile-event-handler + :enter (behavior () + (projectile-method-27 self) + (play-impact-sound self (projectile-options po1)) + ) + :code (behavior () + (suspend) + (go-virtual die) + ) + ) + +(defstate die (projectile) + :virtual #t + :code (behavior () + (let ((v1-0 (-> self notify-handle))) + (send-event (handle->process v1-0) 'notify 'die) + ) + (cleanup-for-death self) + ) + ) + +(defmethod projectile-method-31 ((this projectile)) + 0 + (none) + ) + +(defmethod setup-collision! ((this projectile)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-projectile) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec backgnd crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set-vector! (-> v1-6 local-sphere) 0.0 5324.8 0.0 5324.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 2)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod projectile-method-32 ((this projectile)) + (go (method-of-object this moving)) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-impact! ((this projectile)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) + (go (method-of-object this impact)) + ) + (none) + ) + +(defmethod deactivate ((this projectile)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (projectile-method-29 this) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +(defmethod projectile-method-40 ((this projectile)) + 32 + ) + +;; WARN: Return type mismatch int vs object. +(defbehavior projectile-init-by-other projectile ((arg0 projectile-init-by-other-params)) + (let ((a1-0 (projectile-method-40 self))) + (stack-size-set! (-> self main-thread) a1-0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-entity-set! self (-> arg0 ent)) + (set! (-> self charge-level) (-> arg0 charge)) + (set! (-> self options) (-> arg0 options)) + (set! (-> self notify-handle) (-> arg0 notify-handle)) + (set! (-> self owner-handle) (-> arg0 owner-handle)) + (set! (-> self ignore-handle) (-> arg0 ignore-handle)) + (set! (-> self attack-id) (-> arg0 attack-id)) + (set! (-> self damage) (if (logtest? (-> arg0 options) (projectile-options po14)) + (-> arg0 damage) + 2.0 + ) + ) + (set! (-> self vehicle-damage-factor) (if (logtest? (-> arg0 options) (projectile-options po15)) + (-> arg0 vehicle-damage-factor) + 1.0 + ) + ) + (set! (-> self vehicle-impulse-factor) (if (logtest? (projectile-options po16) (-> arg0 options)) + (-> arg0 vehicle-impulse-factor) + 1.0 + ) + ) + (set! (-> self attack-mode) #f) + (set! (-> self max-speed) 40960.0) + (set! (-> self tween) 1.0) + (set! (-> self last-target) (the-as handle #f)) + (set! (-> self timeout) (-> arg0 timeout)) + (set! (-> self max-hits) 1) + (set-time! (-> self spawn-time)) + (set! (-> self update-velocity) #f) + (set! (-> self move) projectile-move-fill-line-sphere) + (set! (-> self pick-target) #f) + (set! (-> self stop-speed) 204.8) + (set! (-> self desired-target) (-> arg0 target-handle)) + (set! (-> self desired-target-pos quad) (-> arg0 target-pos quad)) + (countdown (v1-29 16) + (set! (-> self old-dist v1-29) 4095996000.0) + ) + (logior! (-> self options) (projectile-options po4)) + (setup-collision! self) + (let ((s5-0 (-> self root))) + (when (type? s5-0 collide-shape-moving) + (set! (-> self root dynam gravity y) 1228800.0) + (set! (-> self root dynam gravity-length) 1228800.0) + (set! (-> self root dynam gravity-max) 1228800.0) + ) + (logior! (-> self mask) (process-mask projectile)) + (logclear! (-> self mask) (process-mask enemy)) + (set! (-> s5-0 trans quad) (-> arg0 pos quad)) + (set! (-> self starting-pos quad) (-> arg0 pos quad)) + (quaternion-copy! (-> s5-0 quat) (-> self parent 0 root quat)) + (vector-identity! (-> s5-0 scale)) + (set! (-> s5-0 transv quad) (-> arg0 vel quad)) + (set! (-> self pre-move-transv quad) (-> arg0 vel quad)) + (vector-normalize-copy! (-> self starting-dir) (-> arg0 vel) 1.0) + (vector+float*! (-> self base-target-pos) (-> s5-0 trans) (-> self starting-dir) 2048000.0) + ) + (set! (-> self target-pos quad) (-> self base-target-pos quad)) + (set! (-> self event-hook) projectile-event-handler) + (projectile-method-31 self) + (update-transforms (-> self root)) + (projectile-method-24 self) + (play-impact-sound self (projectile-options)) + (when (logtest? (projectile-options po17) (-> self options)) + (if (made-impact? self) + (go-virtual impact) + ) + ) + (projectile-method-32 self) + 0 + ) + +(defbehavior projectile-bounce-update-velocity projectile ((arg0 projectile-bounce)) + (set! (-> arg0 root transv y) (- (-> arg0 root transv y) (* (-> arg0 gravity) (seconds-per-frame)))) + 0 + (none) + ) + +(defmethod projectile-bounce-method-43 ((this projectile-bounce)) + 0 + (none) + ) + +(defmethod projectile-method-40 ((this projectile-bounce)) + 256 + ) + +(defbehavior projectile-bounce-falling-post projectile-bounce () + (let ((gp-0 (-> self root)) + (s4-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (projectile-bounce-update-velocity self) + (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-v++! s5-0 (-> gp-0 transv)) + (let* ((a0-4 gp-0) + (t9-2 (method-of-object a0-4 find-ground)) + (a2-0 #x100249) + (a3-0 4096.0) + (t0-0 81920.0) + (t1-0 1024.0) + ) + (when (t9-2 a0-4 s4-0 (the-as collide-spec a2-0) a3-0 t0-0 t1-0) + (let ((f30-0 (+ (-> gp-0 gspot-pos y) (-> self root root-prim local-sphere w)))) + (when (>= f30-0 (-> s5-0 y)) + (projectile-bounce-method-43 self) + (set! (-> s5-0 y) f30-0) + (vector-reset! (-> gp-0 transv)) + ) + ) + ) + ) + (move-to-point! gp-0 s5-0) + ) + (transform-post) + 0 + (none) + ) + +(defstate sitting (projectile-bounce) + :virtual #t + :event projectile-event-handler + :trans (behavior () + (projectile-bounce-method-42 self) + (if (time-elapsed? (-> self spawn-time) (-> self timeout)) + (go-virtual impact) + ) + ) + :code sleep-code + :post projectile-bounce-falling-post + ) + +(defmethod projectile-bounce-method-42 ((this projectile-bounce)) + 0 + (none) + ) + +(defstate dissipate (projectile-bounce) + :virtual #t + :enter (behavior () + (go-virtual impact) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-impact! ((this projectile-bounce)) + (go (method-of-object this sitting)) + (none) + ) + +(defmethod projectile-method-25 ((this projectile-bounce)) + (ja-post) + 0 + (none) + ) + +(defun projectile-bounce-move ((arg0 projectile-bounce)) + (seek-toward-heading-vec! (-> arg0 root) (-> arg0 root transv) 131072.0 (seconds 0.1)) + (quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> arg0 tumble-quat)) + (projectile-move-fill-all-dirs arg0) + (none) + ) + +(defun projectile-bounce-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (cshape-reaction-update-state arg0 arg1 arg3) + (let ((f30-0 (vector-dot arg3 (-> arg0 surface-normal))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (vector-float*! s2-0 (-> arg0 surface-normal) (* f30-0 (rand-vu-float-range 1.6 2.2))) + (vector-! arg2 arg3 s2-0) + ) + (-> arg0 status) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod projectile-method-39 ((this projectile-bounce)) + (let* ((a2-0 (-> this root)) + (v1-0 (-> a2-0 status)) + ) + (if (logtest? v1-0 (collide-status touch-surface)) + (vector-float*! (-> a2-0 transv) (-> a2-0 transv) 0.6) + ) + (when (and (logtest? v1-0 (collide-status impact-surface)) + (time-elapsed? (-> this played-bounce-time) (seconds 0.3)) + ) + (set-time! (-> this played-bounce-time)) + (sound-play "dark-shot-bounc") + ) + ) + (none) + ) + +(defmethod setup-collision! ((this projectile-bounce)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) projectile-bounce-reaction) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate jak-dark-shot)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 819.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 2)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set-collide-with! + (-> this root) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set-collide-as! (-> this root) (collide-spec projectile)) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +(defmethod projectile-method-31 ((this projectile-bounce)) + (set! (-> this max-speed) 450560.0) + (set! (-> this timeout) (seconds 1.6)) + (set! (-> this update-velocity) projectile-bounce-update-velocity) + (set! (-> this move) projectile-bounce-move) + (set! (-> this gravity) 184320.0) + (set! (-> this root dynam gravity y) 184320.0) + (set! (-> this root dynam gravity-length) 184320.0) + (set! (-> this root dynam gravity-max) 184320.0) + (let ((f0-5 1092.2667)) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-5) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/common-obs/secrets-menu.gc b/goal_src/jak3/engine/common-obs/secrets-menu.gc index b7453deb2d0..79c5e24ce5d 100644 --- a/goal_src/jak3/engine/common-obs/secrets-menu.gc +++ b/goal_src/jak3/engine/common-obs/secrets-menu.gc @@ -7,3 +7,390 @@ ;; DECOMP BEGINS +(define *menu-secrets-array* (new 'static 'boxed-array :type secret-item-option + (new 'static 'secret-item-option + :name (text-id progress-secrets-weapon-upgrades) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-red-ammo-capacity) + :cost 4 + :secret (game-secrets gun-upgrade-ammo-red) + :avail-after (game-task-node arena-fight-3-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-yellow-ammo-capacity) + :cost 4 + :secret (game-secrets gun-upgrade-ammo-yellow) + :avail-after (game-task-node arena-fight-3-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-blue-ammo-capacity) + :cost 4 + :secret (game-secrets gun-upgrade-ammo-blue) + :avail-after (game-task-node mine-boss-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-dark-ammo-capacity) + :cost 4 + :secret (game-secrets gun-upgrade-ammo-dark) + :avail-after (game-task-node city-blow-barricade-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-yellow-1) + :cost 6 + :secret (game-secrets gun-upgrade-yellow-1) + :avail-after (game-task-node arena-fight-2-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-red-1) + :cost 6 + :secret (game-secrets gun-upgrade-red-1) + :avail-after (game-task-node arena-fight-2-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-blue-1) + :cost 6 + :secret (game-secrets gun-upgrade-blue-1) + :avail-after (game-task-node arena-fight-3-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-dark-1) + :cost 6 + :secret (game-secrets gun-upgrade-dark-1) + :avail-after (game-task-node city-blow-barricade-resolution) + :flags (secret-item-option-flags sf3) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-yellow-2) + :cost 8 + :secret (game-secrets gun-upgrade-yellow-2) + :avail-after (game-task-node arena-fight-3-resolution) + :required-secrets (game-secrets gun-upgrade-yellow-1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-red-2) + :cost 8 + :secret (game-secrets gun-upgrade-red-2) + :avail-after (game-task-node arena-fight-3-resolution) + :required-secrets (game-secrets gun-upgrade-red-1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-blue-2) + :cost 8 + :secret (game-secrets gun-upgrade-blue-2) + :avail-after (game-task-node mine-boss-resolution) + :required-secrets (game-secrets gun-upgrade-blue-1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-dark-2) + :cost 8 + :secret (game-secrets gun-upgrade-dark-2) + :avail-after (game-task-node temple-defend-resolution) + :required-secrets (game-secrets gun-upgrade-dark-1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-yellow-3) + :cost 10 + :secret (game-secrets gun-upgrade-yellow-3) + :avail-after (game-task-node city-gun-course-1-resolution) + :required-secrets (game-secrets gun-upgrade-yellow-2) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-red-3) + :cost 10 + :secret (game-secrets gun-upgrade-red-3) + :avail-after (game-task-node city-gun-course-2-resolution) + :required-secrets (game-secrets gun-upgrade-red-2) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-blue-3) + :cost 10 + :secret (game-secrets gun-upgrade-blue-3) + :avail-after (game-task-node city-destroy-grid-resolution) + :required-secrets (game-secrets gun-upgrade-blue-2) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-dark-3) + :cost 10 + :secret (game-secrets gun-upgrade-dark-3) + :avail-after (game-task-node city-blow-tower-resolution) + :required-secrets (game-secrets gun-upgrade-dark-2) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gungame-ratchet) + :cost 5 + :secret (game-secrets gungame-ratchet) + :avail-after (game-task-node city-gun-course-2-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-vehicle-upgrades) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-vehicle-hit-points) + :cost 15 + :secret (game-secrets vehicle-hit-points) + :avail-after (game-task-node nest-hunt-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-vehicle-fox) + :cost 15 + :secret (game-secrets vehicle-fox) + :avail-after (game-task-node desert-oasis-defense-introduction) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-vehicle-mirage) + :cost 15 + :secret (game-secrets vehicle-mirage) + :avail-after (game-task-node desert-artifact-race-2-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-vehicle-x-ride) + :cost 20 + :secret (game-secrets vehicle-x-ride) + :avail-after (game-task-node desert-artifact-race-2-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-unlimited-turbos) + :cost 30 + :secret (game-secrets unlimited-turbos) + :avail-after (game-task-node factory-boss-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-crazy-stuff) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-toggle-beard) + :cost 2 + :secret (game-secrets toggle-beard) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-big-head) + :cost 3 + :secret (game-secrets big-head) + :avail-after (game-task-node city-start-introduction) + :mask-secrets (game-secrets little-head) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-little-head) + :cost 3 + :secret (game-secrets little-head) + :avail-after (game-task-node city-start-introduction) + :mask-secrets (game-secrets big-head) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-kleever-diaper) + :cost 4 + :secret (game-secrets kleever-diaper) + :avail-after (game-task-node desert-course-race-resolution) + :flags (secret-item-option-flags sf1 sf3) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-bad-weather) + :cost 5 + :secret (game-secrets bad-weather) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-hflip-screen) + :cost 5 + :secret (game-secrets hflip-screen) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-fast-movie) + :cost 5 + :secret (game-secrets fast-movie) + :avail-after (game-task-node city-start-introduction) + :mask-secrets (game-secrets slow-movie) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-slow-movie) + :cost 5 + :secret (game-secrets slow-movie) + :avail-after (game-task-node city-start-introduction) + :mask-secrets (game-secrets fast-movie) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-expert-options) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-level-select-act-1) + :cost 5 + :secret (game-secrets level-select-1) + :avail-after (game-task-node mine-boss-resolution) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-level-select-act-2) + :cost 5 + :secret (game-secrets level-select-2) + :avail-after (game-task-node factory-boss-resolution) + :required-secrets (game-secrets level-select-1) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-level-select-act-3) + :cost 5 + :secret (game-secrets level-select-3) + :avail-after (game-task-node desert-final-boss-resolution) + :required-secrets (game-secrets level-select-2) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-hero-mode) + :cost 5 + :secret (game-secrets hero-mode) + :avail-after (game-task-node desert-final-boss-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-cheats) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-board-fast) + :cost 5 + :secret (game-secrets board-fast) + :avail-after (game-task-node desert-oasis-defense-resolution) + :flags (secret-item-option-flags sf1 sf3) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-darkjak-tracking) + :cost 3 + :secret (game-secrets darkjak-tracking) + :avail-after (game-task-node city-destroy-darkeco-resolution) + :flags (secret-item-option-flags sf1 sf3) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-button-invis) + :cost 25 + :secret (game-secrets button-invis) + :avail-after (game-task-node desert-final-boss-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-endless-ammo) + :cost 50 + :secret (game-secrets endless-ammo) + :avail-after (game-task-node desert-final-boss-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-invulnerable) + :cost 100 + :secret (game-secrets invulnerable) + :avail-after (game-task-node desert-final-boss-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-endless-dark) + :cost 50 + :secret (game-secrets endless-dark) + :avail-after (game-task-node desert-final-boss-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-endless-light) + :cost 50 + :secret (game-secrets endless-light) + :avail-after (game-task-node desert-final-boss-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-art-gallery) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-scrap-book) + :cost 2 + :secret (game-secrets scrap-book-1) + :avail-after (game-task-node mine-boss-resolution) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-mega-scrap-book) + :cost 2 + :secret (game-secrets scrap-book-2) + :avail-after (game-task-node desert-final-boss-resolution) + :required-secrets (game-secrets scrap-book-1) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-jak1-mdl-viewer) + :cost 2 + :secret (game-secrets model-viewer-1) + :avail-after (game-task-node mine-boss-resolution) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-jak2-mdl-viewer) + :cost 2 + :secret (game-secrets model-viewer-2) + :avail-after (game-task-node factory-boss-resolution) + :required-secrets (game-secrets model-viewer-1) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-jak3-mdl-viewer) + :cost 2 + :secret (game-secrets model-viewer-3) + :avail-after (game-task-node desert-final-boss-resolution) + :required-secrets (game-secrets model-viewer-2) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-scene-player-act-1) + :cost 2 + :secret (game-secrets scene-player-1) + :avail-after (game-task-node mine-boss-resolution) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-scene-player-act-2) + :cost 2 + :secret (game-secrets scene-player-2) + :avail-after (game-task-node factory-boss-resolution) + :required-secrets (game-secrets scene-player-1) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-scene-player-act-3) + :cost 2 + :secret (game-secrets scene-player-3) + :avail-after (game-task-node desert-final-boss-resolution) + :required-secrets (game-secrets scene-player-2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-commentary) + :cost 2 + :secret (game-secrets title-commentary) + :avail-after (game-task-node desert-final-boss-resolution) + :required-secrets (game-secrets scene-player-3) + :flags (secret-item-option-flags sf2 sf4) + ) + ) + ) diff --git a/goal_src/jak3/engine/common-obs/vent.gc b/goal_src/jak3/engine/common-obs/vent.gc index 0b1e7dd1b03..743cb5ef633 100644 --- a/goal_src/jak3/engine/common-obs/vent.gc +++ b/goal_src/jak3/engine/common-obs/vent.gc @@ -7,3 +7,726 @@ ;; DECOMP BEGINS +(deftype vent (process-drawable) + ((root collide-shape :override) + (show-particles symbol) + (collect-effect sparticle-launch-group) + (collect-effect2 sparticle-launch-group) + (collect-effect-time time-frame) + (blocker entity-actor) + (block-func (function vent symbol)) + (pickup-handle handle) + ) + (:methods + (init! (_type_ entity-actor int) object) + ) + (:states + vent-blocked + (vent-pickup handle) + vent-wait-for-touch + ) + ) + + +(defmethod init! ((this vent) (arg0 entity-actor) (arg1 int)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-6 local-sphere) 0.0 10240.0 0.0 12288.0) + (set! (-> s3-0 total-prims) (the-as uint 1)) + (set! (-> s3-0 root-prim) v1-6) + ) + (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) + (let ((v1-9 (-> s3-0 root-prim))) + (set! (-> s3-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s3-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s3-0) + ) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (update-transforms (-> this root)) + (set! (-> this root pause-adjust-distance) 409600.0) + (set! (-> this fact) (new 'process 'fact-info this (the-as pickup-type arg1) (-> *FACT-bank* eco-full-inc))) + (set! (-> this block-func) (the-as (function vent symbol) true-func)) + (case (-> this fact pickup-type) + (((pickup-type eco-blue)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 156) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 169)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 155)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-blue" (-> this root trans) 0.0)) + ) + (((pickup-type eco-red)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 160) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 171)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 159)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-red" (-> this root trans) 0.0)) + ) + (((pickup-type eco-green) (pickup-type health)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 148) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 141)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 124)) + (case (-> this fact pickup-type) + (((pickup-type eco-green)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-loop" (-> this root trans) 0.0)) + ) + (else + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-green" (-> this root trans) 0.0)) + ) + ) + ) + (((pickup-type eco-yellow)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 162) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 170)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 165)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-yellow" (-> this root trans) 0.0)) + ) + ) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (when (-> this blocker) + (logior! (-> this fact options) (actor-option blocked)) + (set! (-> this block-func) + (lambda ((arg0 vent)) + (not (logtest? (-> arg0 blocker extra perm status) (entity-perm-status subtask-complete))) + ) + ) + ) + (set! (-> this show-particles) #t) + (when (logtest? (-> this fact options) (actor-option blocked)) + (when (logtest? (-> this fact options) (actor-option draw-blocker)) + (case (-> this fact pickup-type) + (((pickup-type eco-blue)) + (set! (-> this block-func) + (lambda ((arg0 vent)) (not (task-complete? *game-info* (game-task eco-blue-button)))) + ) + ) + (((pickup-type eco-red)) + (set! (-> this block-func) + (lambda ((arg0 vent)) (not (task-complete? *game-info* (game-task eco-red-button)))) + ) + ) + (((pickup-type eco-yellow)) + (set! (-> this block-func) + (lambda ((arg0 vent)) (not (task-complete? *game-info* (game-task eco-yellow-button)))) + ) + ) + ) + ) + (if ((-> this block-func) this) + (go vent-blocked) + ) + ) + (go vent-wait-for-touch) + ) + +(defbehavior vent-standard-event-handler vent ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('show-particles) + (let ((v0-0 (the-as object (-> arg3 param 0)))) + (set! (-> self show-particles) (the-as symbol v0-0)) + v0-0 + ) + ) + (('hide) + (set! (-> self block-func) (the-as (function vent symbol) true-func)) + (go vent-blocked) + ) + ) + ) + +(defstate vent-wait-for-touch (vent) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (or (= message 'touch) (= message 'attack)) + (or (!= (-> self fact pickup-type) 5) + (and *target* + (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> *target* game features) + ) + (-> *setting-control* user-current board-trail) + (focus-test? *target* board) + ) + ) + (= (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) #t) + ) + (go vent-pickup (process->handle proc)) + ) + (vent-standard-event-handler proc argc message block) + ) + :code (behavior () + (until #f + (let ((a0-0 (-> self part)) + (a1-0 (-> self root trans)) + (gp-0 (-> self sound)) + ) + (if (and (nonzero? a0-0) (-> self show-particles)) + (spawn a0-0 a1-0) + ) + (if (nonzero? gp-0) + (update! gp-0) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate vent-blocked (vent) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('show) + (go vent-wait-for-touch) + ) + ) + ) + :code (behavior () + (until #f + (if (not ((-> self block-func) self)) + (go vent-wait-for-touch) + ) + (suspend) + ) + #f + ) + ) + +(defstate vent-pickup (vent) + :event vent-standard-event-handler + :code (behavior ((arg0 handle)) + (when (-> self show-particles) + (when (nonzero? (-> self collect-effect)) + (when (time-elapsed? (-> self collect-effect-time) (seconds 1)) + (let* ((s5-0 (handle->process arg0)) + (gp-0 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (when gp-0 + (let* ((s5-1 (-> (the-as process-focusable gp-0) root)) + (v1-9 (if (type? s5-1 collide-shape) + s5-1 + ) + ) + ) + (when v1-9 + (cond + ((logtest? (-> self collect-effect flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-9 root-prim prim-core world-sphere quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-2 + (let ((t9-3 (method-of-type part-tracker-subsampler activate))) + (t9-3 (the-as part-tracker-subsampler s5-2) gp-0 "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-4 run-function-in-process) + (a0-13 s5-2) + (a1-10 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> self collect-effect)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) part-tracker-track-target) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-4) a0-13 a1-10 *part-tracker-subsampler-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-9 root-prim prim-core world-sphere quad)) + (let ((s5-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-3 + (let ((t9-6 (method-of-type part-tracker activate))) + (t9-6 (the-as part-tracker s5-3) gp-0 "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-7 run-function-in-process) + (a0-18 s5-3) + (a1-13 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> self collect-effect)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) part-tracker-track-target) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-7) a0-18 a1-13 *part-tracker-params-default*) + ) + (-> s5-3 ppointer) + ) + ) + ) + ) + (cond + ((logtest? (-> self collect-effect2 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-9 (method-of-type part-tracker-subsampler activate))) + (t9-9 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-10 run-function-in-process) + (a0-25 gp-1) + (a1-16 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> self collect-effect2)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) part-tracker-move-to-target) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-10) a0-25 a1-16 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-12 (method-of-type part-tracker activate))) + (t9-12 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-13 run-function-in-process) + (a0-32 gp-2) + (a1-19 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> self collect-effect2)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) part-tracker-move-to-target) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-13) a0-32 a1-19 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + (set-time! (-> self collect-effect-time)) + ) + ) + ) + ) + ) + ) + ) + (go vent-wait-for-touch) + ) + ) + +(deftype ecovent (vent) + () + ) + + +(defmethod init-from-entity! ((this ecovent) (arg0 entity-actor)) + (init! this arg0 5) + ) + +(deftype light-eco-vent (process-drawable) + ((part2 sparticle-launch-control) + (pickup-time time-frame) + (touch-time time-frame) + ) + (:state-methods + (open symbol) + (close symbol) + ) + ) + + +;; WARN: Return type mismatch process-drawable vs light-eco-vent. +(defmethod relocate ((this light-eco-vent) (offset int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) offset) + ) + (the-as light-eco-vent ((method-of-type process-drawable relocate) this offset)) + ) + +(defmethod deactivate ((this light-eco-vent)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part2)) + (kill-particles (-> this part2)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +(defskelgroup skel-light-eco-vent light-eco-vent light-eco-vent-lod0-jg light-eco-vent-close-open-ja + ((light-eco-vent-lod0-mg (meters 20)) + (light-eco-vent-lod1-mg (meters 40)) + (light-eco-vent-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate open (light-eco-vent) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape (-> self root)) + (the-as uint 2) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape (-> (the-as process-drawable proc) root)) + (collide-action solid) + (collide-action) + ) + (begin + (if (time-elapsed? (-> self touch-time) (seconds 0.1)) + (sound-play "light-charge") + ) + (set-time! (-> self touch-time)) + (time-elapsed? (-> self pickup-time) (seconds 0.015)) + ) + (= (send-event proc 'get-pickup (-> self fact pickup-type) 100.0) #t) + ) + ) + (if (and (time-elapsed? (-> self pickup-time) (seconds 0.1)) + (not (logtest? (-> self fact options) (actor-option no-reaction))) + ) + (send-event proc 'powerup) + ) + (set-time! (-> self pickup-time)) + #f + ) + ) + :trans (behavior () + (if (not (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + ) + (go-virtual close #f) + ) + ) + :code (behavior ((arg0 symbol)) + (when (not arg0) + (while (not (ja-max? 0)) + (ja :num! (seek!)) + (transform-post) + (suspend) + ) + ) + (ja :num-func num-func-identity :frame-num max) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + :post (behavior () + (let ((a0-0 (-> self part)) + (v1-0 (-> self part2)) + (a1-1 (-> self root trans)) + (gp-0 (-> self sound)) + ) + (cond + ((time-elapsed? (-> self touch-time) (seconds 0.1)) + (if (nonzero? a0-0) + (spawn a0-0 a1-1) + ) + ) + (else + (if (nonzero? v1-0) + (spawn v1-0 a1-1) + ) + ) + ) + (if (nonzero? gp-0) + (update! gp-0) + ) + ) + ) + ) + +(defstate close (light-eco-vent) + :virtual #t + :trans (behavior () + (if (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + (go-virtual open #f) + ) + ) + :code (behavior ((arg0 symbol)) + (stop! (-> self sound)) + (when (not arg0) + (while (not (ja-min? 0)) + (ja :num! (seek! 0.0)) + (transform-post) + (suspend) + ) + ) + (ja :num-func num-func-identity :frame-num 0.0) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + ) + +(defmethod init-from-entity! ((this light-eco-vent) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec collectable)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> s3-0 local-sphere) 0.0 4096.0 0.0 12288.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 3) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 6144.0 0.0 2457.6) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 10240.0 0.0 2457.6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-light) (-> *FACT-bank* eco-full-inc)) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-light-eco-vent" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 144) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 145) this)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-light" (-> this root trans) 0.0)) + (set-falloff-far! (-> this sound) 81920.0) + (set-falloff-mode! (-> this sound) 9) + (if (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + (go (method-of-object this open) #t) + (go (method-of-object this close) #t) + ) + ) + +(deftype dark-eco-vent (process-drawable) + ((part2 sparticle-launch-control) + (pickup-time time-frame) + (touch-time time-frame) + ) + (:state-methods + (open symbol) + (close symbol) + ) + ) + + +;; WARN: Return type mismatch process-drawable vs dark-eco-vent. +(defmethod relocate ((this dark-eco-vent) (offset int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) offset) + ) + (the-as dark-eco-vent ((method-of-type process-drawable relocate) this offset)) + ) + +(defmethod deactivate ((this dark-eco-vent)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part2)) + (kill-particles (-> this part2)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +(defskelgroup skel-dark-eco-vent dark-eco-vent dark-eco-vent-lod0-jg dark-eco-vent-close-open-ja + ((dark-eco-vent-lod0-mg (meters 20)) + (dark-eco-vent-lod1-mg (meters 40)) + (dark-eco-vent-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate open (dark-eco-vent) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape (-> self root)) + (the-as uint 2) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape (-> (the-as process-drawable proc) root)) + (collide-action solid) + (collide-action) + ) + (begin + (if (time-elapsed? (-> self touch-time) (seconds 0.1)) + (sound-play "dark-charge") + ) + (set-time! (-> self touch-time)) + (time-elapsed? (-> self pickup-time) (seconds 0.015)) + ) + (= (send-event proc 'get-pickup (-> self fact pickup-type) 100.0) #t) + ) + ) + (if (and (time-elapsed? (-> self pickup-time) (seconds 0.1)) + (not (logtest? (-> self fact options) (actor-option no-reaction))) + ) + (send-event proc 'powerup) + ) + (set-time! (-> self pickup-time)) + #f + ) + ) + :trans (behavior () + (if (not (logtest? (the-as game-feature (logand (game-feature feature58) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + ) + (go-virtual close #f) + ) + ) + :code (behavior ((arg0 symbol)) + (when (not arg0) + (while (not (ja-max? 0)) + (ja :num! (seek!)) + (transform-post) + (suspend) + ) + ) + (ja :num-func num-func-identity :frame-num max) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + :post (behavior () + (let ((a0-0 (-> self part)) + (v1-0 (-> self part2)) + (a1-1 (-> self root trans)) + (gp-0 (-> self sound)) + ) + (cond + ((time-elapsed? (-> self touch-time) (seconds 0.1)) + (if (nonzero? a0-0) + (spawn a0-0 a1-1) + ) + ) + (else + (if (nonzero? v1-0) + (spawn v1-0 a1-1) + ) + ) + ) + (if (nonzero? gp-0) + (update! gp-0) + ) + ) + ) + ) + +(defstate close (dark-eco-vent) + :virtual #t + :trans (behavior () + (if (logtest? (the-as game-feature (logand (game-feature feature58) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + (go-virtual open #f) + ) + ) + :code (behavior ((arg0 symbol)) + (stop! (-> self sound)) + (when (not arg0) + (while (not (ja-min? 0)) + (ja :num! (seek! 0.0)) + (transform-post) + (suspend) + ) + ) + (if (nonzero? (-> self part)) + (kill-particles (-> self part)) + ) + (ja :num-func num-func-identity :frame-num 0.0) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + ) + +(defmethod init-from-entity! ((this dark-eco-vent) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec collectable)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> s3-0 local-sphere) 0.0 4096.0 0.0 12288.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 3) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 6144.0 0.0 2457.6) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 10240.0 0.0 2457.6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type eco-pill-dark) (-> *FACT-bank* eco-full-inc))) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-vent" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 146) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 147) this)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-dark" (-> this root trans) 0.0)) + (set-falloff-far! (-> this sound) 81920.0) + (set-falloff-mode! (-> this sound) 9) + (go (method-of-object this open) #t) + ) diff --git a/goal_src/jak3/engine/common-obs/voicebox.gc b/goal_src/jak3/engine/common-obs/voicebox.gc index f2f52b38cec..585d7db9014 100644 --- a/goal_src/jak3/engine/common-obs/voicebox.gc +++ b/goal_src/jak3/engine/common-obs/voicebox.gc @@ -5,5 +5,598 @@ ;; name in dgo: voicebox ;; dgos: GAME +(define-extern *particle-vel* vector) + ;; DECOMP BEGINS +(defpartgroup group-talkbox-speak + :id 122 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 90) (degrees 0) (degrees 0)) + :parts ((sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 0.435) :length (seconds 0.1)) + (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 0.5) :length (seconds 0.117) :offset 5) + (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 1.1) :length (seconds 0.085) :offset 35) + (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 0.835) :length (seconds 0.2) :offset 15) + (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 1.55) :length (seconds 0.25) :offset 60) + ) + ) + +(defpart 407 + :init-specs ((:texture (new 'static 'texture-id :index #x7a :page #x4)) + (:birth-func 'birth-func-set-vel) + (:num 0.0 0.3) + (:y (meters 0.15)) + (:z (meters 0.4)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 408) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 408 + :init-specs ((:fade-a -0.64)) + ) + +(deftype camera-remote (camera-slave) + () + ) + + +(deftype remote (process-drawable) + ((parent (pointer camera-slave) :override) + (base-trans vector :inline) + (focus focus :inline) + (seeker cam-float-seeker :inline) + (start-time time-frame) + (blend float) + (twist float) + (speak-effect? symbol) + ) + (:state-methods + enter + idle + exit + ) + (:methods + (init (_type_) none) + (get-track-pt-and-scale (_type_ vector) float) + (post-common (_type_) none) + ) + ) + + +(defskelgroup skel-voicebox talk-box talk-box-lod0-jg talk-box-idle-ja + ((talk-box-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 10 + :light-index 1 + ) + +(defmethod get-track-pt-and-scale ((this remote) (arg0 vector)) + (let ((s4-0 (handle->process (-> this focus handle)))) + (when s4-0 + (set! (-> arg0 quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + (let ((a0-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s4-0) 0)))) + (vector+float*! arg0 arg0 a0-7 (* -16384.0 (- 1.0 (-> this blend)))) + ) + ) + ) + (lerp-scale 1.0 0.0 (-> this blend) 0.8 1.0) + ) + +(defmethod post-common ((this remote)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (ja-post) + (if (type? (-> this root) collide-shape) + (update-transforms (the-as collide-shape (-> this root))) + ) + (when (and (nonzero? (-> this part)) (and (or (and (-> this next-state) (= (-> this next-state name) 'idle)) + (and (-> this next-state) (= (-> this next-state name) 'enter)) + ) + (-> this speak-effect?) + ) + ) + (let ((v1-15 + (vector-float*! (new 'stack-no-clear 'vector) (-> this parent 0 velocity) (-> pp clock frames-per-second)) + ) + (a0-8 *particle-vel*) + ) + (let ((a1-4 (-> this node-list data 3 bone transform fvec))) + (let ((a2-1 20480.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-4 quad)) + ) + (.lvf vf4 (&-> v1-15 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-8 quad) vf6) + ) + (let ((v1-16 *particle-vel*) + (a0-9 *particle-vel*) + (f0-2 300.0) + ) + (vector-float*! v1-16 a0-9 (/ 1.0 f0-2)) + ) + (sparticle-launch-control-method-18 (-> this part) (-> this node-list data 3)) + ) + 0 + (none) + ) + ) + ) + +(defbehavior remote-track remote () + (let ((gp-0 (handle->process (-> self focus handle))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self parent 0 trans quad)) + (let ((f30-0 (get-track-pt-and-scale self s5-0))) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> self parent 0 trans quad)) + (vector-lerp! (-> self root trans) a1-2 s5-0 (-> self blend)) + ) + (+! (-> self root trans y) (* 1638.4 (sin (* 54.613335 (the float (mod (current-time) 1200)))))) + (let ((s5-1 (new 'stack-no-clear 'quaternion))) + (forward-up->quaternion + s5-1 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (target-pos 8) (-> self root trans)) 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (rotate-toward-orientation! (-> self root) s5-1 65536.0 5461.3335 150 150 0.0) + ) + (when gp-0 + (let* ((gp-1 (-> (the-as process-focusable gp-0) root)) + (s4-1 (-> self root trans)) + (f0-6 + (deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-1 (-> gp-1 trans)))) + ) + ) + (if (< 0.0 f0-6) + (seek! (-> self twist) -0.4 (* 0.3 (seconds-per-frame))) + (seek! (-> self twist) 0.4 (* 0.3 (seconds-per-frame))) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer self)) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'blocked-side?) + (case (send-event-function (ppointer->process (-> self parent)) a1-9) + ((1) + (set! (-> self twist) 0.5) + ) + ((2) + (set! (-> self twist) -0.5) + ) + ((3) + (set! (-> self twist) 0.0) + ) + ) + ) + (send-event (ppointer->process (-> self parent)) 'joystick (-> self twist) -1.0) + ) + (set! (-> self root scale x) f30-0) + (set! (-> self root scale y) f30-0) + (set! (-> self root scale z) f30-0) + ) + ) + 0 + (none) + ) + +(defstate enter (remote) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual exit) + ) + (('speak-effect) + (let ((v0-0 (the-as object (-> block param 0)))) + (set! (-> self speak-effect?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (set! (-> self start-time) (-> *display* game-clock frame-counter)) + (let* ((gp-0 (ppointer->process (-> self parent 0 parent))) + (a1-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (if a1-1 + (try-update-focus (-> self focus) (the-as process-focusable a1-1)) + ) + ) + ) + :trans (behavior () + (remote-track) + (let ((a0-1 (handle->process (-> self focus handle)))) + (if (and a0-1 (< 0.1 (-> self blend))) + (point-toward-point-clear-roll-pitch! (-> self root) (get-trans (the-as process-focusable a0-1) 0)) + ) + ) + ) + :code (behavior () + (let* ((gp-0 (ppointer->process (-> self parent 0 parent))) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (if (and a0-1 (focus-test? (the-as process-focusable a0-1) pilot)) + (send-event + (ppointer->process (-> self parent)) + 'set-dist + (new 'static 'vector :z 8192.0 :w 1.0) + (new 'static 'vector :y 20480.0 :z 12288.0 :w 1.0) + ) + (send-event + (ppointer->process (-> self parent)) + 'set-dist + (new 'static 'vector :z 16384.0 :w 1.0) + (new 'static 'vector :y 20480.0 :z 40960.0 :w 1.0) + ) + ) + ) + (init (-> self seeker) 1.0 0.01 0.022222223 0.1) + (set! (-> self seeker target) 0.0) + (while (< 0.0001 (-> self blend)) + (update! (-> self seeker) 0.0) + (set! (-> self blend) (-> self seeker value)) + (suspend) + ) + (set! (-> self blend) 0.0) + (go-virtual idle) + ) + :post (behavior () + (post-common self) + ) + ) + +(defstate idle (remote) + :virtual #t + :event (-> (method-of-type remote enter) event) + :trans remote-track + :code (behavior () + (while (handle->process (-> self focus handle)) + (suspend) + (ja :num! (loop!)) + ) + (go-virtual exit) + ) + :post (-> (method-of-type remote enter) post) + ) + +(defstate exit (remote) + :virtual #t + :trans remote-track + :code (behavior () + (set! (-> self blend) 1.0) + (send-event (ppointer->process (-> self parent)) 'change-state empty-state) + (suspend) + 0 + ) + :post (-> (method-of-type remote enter) post) + ) + +;; WARN: Return type mismatch remote vs none. +(defmethod init ((this remote)) + (reset-to-collide-spec (-> this focus) (collide-spec jak player-list)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-voicebox" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this blend) 1.0) + (set! (-> this draw light-index) (the-as uint 30)) + (set! (-> this speak-effect?) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 122) this)) + (none) + ) + +(defstate cam-remote (camera-slave) + :event (-> cam-string event) + :enter (-> cam-string enter) + :trans (behavior () + (if (or (not *camera*) + (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) + (not (-> self child)) + ) + (deactivate self) + ) + ) + :code (-> cam-string code) + ) + +(deftype voicebox (remote) + ((hint handle) + ) + ) + + +(defstate exit (voicebox) + :virtual #t + :code (behavior () + (remove-setting! 'sound-flava) + (set-time! (-> self state-time)) + (set! (-> self seeker target) 1.0) + (while (and (< (-> self blend) 0.9999) (not (and (not (handle->process (-> self hint))) + (time-elapsed? (-> self state-time) (seconds 0.05)) + (-> *setting-control* user-current hint) + ) + ) + ) + (update! (-> self seeker) 0.0) + (set! (-> self blend) (-> self seeker value)) + (suspend) + ) + (set! (-> self blend) 1.0) + (send-event (ppointer->process (-> self parent)) 'change-state empty-state) + (suspend) + (cleanup-for-death self) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior voicebox-init-by-other voicebox ((arg0 vector) (arg1 handle)) + (set! (-> self hint) arg1) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self base-trans quad) (-> arg0 quad)) + (init self) + (set! (-> self event-hook) (-> (method-of-object self enter) event)) + (go-virtual enter) + (none) + ) + +(defun voicebox-spawn ((arg0 process-drawable) (arg1 vector)) + (with-pp + (when *camera* + (let ((s4-0 (process-spawn + camera-remote + :init cam-slave-init + cam-remote + #f + :name "camera-remote" + :from *camera-dead-pool* + :to arg0 + ) + ) + ) + (if s4-0 + (process-spawn voicebox arg1 (process->handle pp) :name "voicebox" :to (ppointer->process s4-0)) + ) + ) + ) + ) + ) + +(deftype judge (remote) + ((root collide-shape :override) + (total-time time-frame) + (beep-time time-frame) + (hud-timer handle) + (score uint8) + (timer? symbol) + ) + (:state-methods + wait + ) + (:methods + (setup-collision! (_type_) none) + ) + ) + + +(defmethod get-track-pt-and-scale ((this judge) (arg0 vector)) + (set! (-> arg0 quad) (-> this base-trans quad)) + 1.0 + ) + +(defmethod post-common ((this judge)) + (ja-post) + (if (type? (-> this root) collide-shape) + (update-transforms (-> this root)) + ) + (when (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'idle) (= v1-6 'enter)) + ) + ) + (if *target* + (set! (-> *game-info* score) (-> *target* fact trick-point)) + ) + (when (-> this timer?) + (let ((v1-17 (the-as int (- (-> this total-time) (- (-> *display* game-clock frame-counter) (-> this start-time))))) + ) + (if (< (the-as time-frame v1-17) 0) + (set! v1-17 0) + ) + (set! (-> *game-info* timer) (the-as time-frame v1-17)) + ) + ) + ) + 0 + (none) + ) + +(defstate wait (judge) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (sound-play "judge-stop") + (go-virtual exit) + ) + (('touch 'attack) + (when *camera* + (let ((s4-0 (process-spawn + camera-remote + :init cam-slave-init + cam-remote + #f + :name "camera-remote" + :from *camera-dead-pool* + :to proc + ) + ) + (s5-2 (if (type? proc process-focusable) + proc + ) + ) + ) + (when s4-0 + (change-parent self (ppointer->process s4-0)) + (try-update-focus (-> self focus) (the-as process-focusable s5-2)) + (go-virtual enter) + ) + ) + ) + ) + (('waiting) + #t + ) + ) + ) + :code (behavior () + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + ) + ) + +(defstate enter (judge) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual exit) + ) + (('speak-effect) + (let ((v0-0 (the-as object (-> block param 0)))) + (set! (-> self speak-effect?) (the-as symbol v0-0)) + v0-0 + ) + ) + (('judging) + #t + ) + ) + ) + :enter (behavior () + (set! (-> self start-time) (-> *display* game-clock frame-counter)) + (send-event *target* 'get-pickup (pickup-type trick-judge) (if (-> self timer?) + (the float (-> self total-time)) + #x4d2d08e0 + ) + ) + (sound-play "judge-start") + (if (-> self timer?) + (set! (-> self hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) + ) + ) + ) + ) + +(defstate idle (judge) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (sound-play "judge-stop") + (go-virtual exit) + ) + (('judging) + #t + ) + ) + ) + :code (behavior () + (while (let ((a0-2 (handle->process (-> self focus handle)))) + (and a0-2 (!= (send-event a0-2 'test-pickup (pickup-type trick-judge)) 0.0)) + ) + (suspend) + (ja :num! (loop!)) + ) + (if (-> self timer?) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + ) + (go-virtual exit) + ) + ) + +(defmethod setup-collision! ((this judge)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 16384.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this judge) (arg0 entity-actor)) + (setup-collision! this) + (init this) + (process-drawable-from-entity! this arg0) + (+! (-> this root trans y) 4096.0) + (set! (-> this base-trans quad) (-> this root trans quad)) + (set! (-> this total-time) (seconds 90)) + (go (method-of-object this wait)) + ) + +(defbehavior judge-init-by-other judge ((arg0 vector) (arg1 uint) (arg2 symbol)) + (process-entity-set! self (the-as entity #f)) + (set! (-> self score) arg1) + (setup-collision! self) + (init self) + (vector-identity! (-> self root scale)) + (quaternion-identity! (-> self root quat)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self base-trans quad) (-> self root trans quad)) + (set! (-> self total-time) (seconds 90)) + (set! (-> self timer?) arg2) + (go-virtual wait) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer judge). +(defun judge-spawn ((arg0 process-tree) (arg1 vector) (arg2 uint) (arg3 object)) + (process-spawn judge arg1 arg2 arg3 :name "judge" :to arg0) + ) diff --git a/goal_src/jak3/engine/common-obs/water-h.gc b/goal_src/jak3/engine/common-obs/water-h.gc index 13245234311..04b5e9cca25 100644 --- a/goal_src/jak3/engine/common-obs/water-h.gc +++ b/goal_src/jak3/engine/common-obs/water-h.gc @@ -7,3 +7,95 @@ ;; DECOMP BEGINS +(deftype water-control (basic) + ((flags water-flag) + (process target) + (joint-index int32) + (top-y-offset float) + (attack-id uint32) + (enter-water-time time-frame) + (wade-time time-frame) + (on-water-time time-frame) + (enter-swim-time time-frame) + (swim-time time-frame) + (base-height meters) + (wade-height meters) + (swim-height meters) + (surface-height meters) + (bottom-height meters) + (collide-height meters) + (height meters) + (height-offset float 4) + (base-ocean-offset meters :overlay-at (-> height-offset 0)) + (real-ocean-offset meters :overlay-at (-> height-offset 0)) + (ocean-offset meters :overlay-at (-> height-offset 1)) + (bob-offset meters :overlay-at (-> height-offset 2)) + (align-offset meters :overlay-at (-> height-offset 3)) + (swim-depth meters :offset 108) + (bob smush-control :inline) + (ripple handle) + (ripple-size meters) + (wake-size meters) + (bottom vector 2 :inline) + (top vector 2 :inline) + (enter-water-pos vector :inline) + (drip-old-pos vector :inline) + (drip-joint-index int32) + (drip-wetness float) + (drip-time time-frame) + (drip-speed float) + (drip-height meters) + (drip-mult float) + (distort-time time-frame) + (enter-water-sound sound-name) + (normal vector :inline) + ) + (:methods + (new (symbol type process int float float float) _type_) + (water-control-method-9 () none) + (water-control-method-10 () none) + (start-bobbing! (_type_ float int int) none) + (distance-from-surface (_type_) float) + (spawn-ripples (_type_ float vector int vector symbol) none) + (display-water-marks? (_type_) symbol) + (water-control-method-15 () none) + (water-control-method-16 () none) + (water-control-method-17 () none) + ) + ) + + +(defmethod display-water-marks? ((this water-control)) + *display-water-marks* + ) + +(defmethod new water-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 int) (arg2 float) (arg3 float) (arg4 float)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 process) (the-as target arg0)) + (set! (-> v0-0 joint-index) arg1) + (set! (-> v0-0 wade-height) arg4) + (set! (-> v0-0 swim-height) arg3) + (set! (-> v0-0 bottom-height) 32768.0) + (set! (-> v0-0 ripple-size) 1638.4) + (set! (-> v0-0 wake-size) 3072.0) + (set! (-> v0-0 ripple) (the-as handle #f)) + (set! (-> v0-0 drip-mult) 1.0) + (set! (-> v0-0 top-y-offset) arg2) + (let* ((v1-6 *game-info*) + (a0-2 (+ (-> v1-6 attack-id) 1)) + ) + (set! (-> v1-6 attack-id) a0-2) + (set! (-> v0-0 attack-id) a0-2) + ) + (set! (-> v0-0 enter-water-sound) (static-sound-name "swim-enter")) + v0-0 + ) + ) + +(defmethod distance-from-surface ((this water-control)) + (- (-> this top 0 y) (-> this height)) + ) + +(deftype water-vol (process-hidden) + () + ) diff --git a/goal_src/jak3/engine/data/art-elts.gc b/goal_src/jak3/engine/data/art-elts.gc index 4fc23d13396..989052e245f 100644 --- a/goal_src/jak3/engine/data/art-elts.gc +++ b/goal_src/jak3/engine/data/art-elts.gc @@ -610,13 +610,6 @@ (def-art-elt minertall-ag minertall-lod0-mg 1) (def-art-elt minertall-ag minertall-lod0-jg 0) -(def-art-elt king-rider-ag king-rider-pilot-car-up-down-ja 5) -(def-art-elt king-rider-ag king-rider-pilot-car-turn-back-ja 4) -(def-art-elt king-rider-ag king-rider-pilot-car-turn-front-ja 3) -(def-art-elt king-rider-ag king-rider-idle-ja 2) -(def-art-elt king-rider-ag king-rider-lod0-mg 1) -(def-art-elt king-rider-ag king-rider-lod0-jg 0) - (def-art-elt purple-two-ag purple-two-idle-ja 2) (def-art-elt purple-two-ag purple-two-lod0-mg 1) (def-art-elt purple-two-ag purple-two-lod0-jg 0) @@ -886,7 +879,6 @@ (def-art-elt dm-tentacle-ag dm-tentacle-lod0-mg 1) (def-art-elt dm-tentacle-ag dm-tentacle-lod0-jg 0) -(def-art-elt kanga-lizard-ag kanga-lizard-flut-kanga-catch-ja 11) (def-art-elt kanga-lizard-ag kanga-lizard-run-squash-ja 10) (def-art-elt kanga-lizard-ag kanga-lizard-jump-land-ja 9) (def-art-elt kanga-lizard-ag kanga-lizard-jump-ja 8) @@ -898,6 +890,7 @@ (def-art-elt kanga-lizard-ag kanga-lizard-shadow-mg 2) (def-art-elt kanga-lizard-ag kanga-lizard-lod0-mg 1) (def-art-elt kanga-lizard-ag kanga-lizard-lod0-jg 0) +(def-art-elt kanga-lizard-ag kanga-lizard-flut-kanga-catch-ja 11) (def-art-elt sew-jump-pad-ag sew-jump-pad-idle-ja 3) (def-art-elt sew-jump-pad-ag sew-jump-pad-lod1-mg 2) @@ -1276,26 +1269,6 @@ (def-art-elt egg-spider-ag egg-spider-attack-jump-ja 11) (def-art-elt egg-spider-ag egg-spider-knocked-red-ja 12) -(def-art-elt mhcity-grunt-egg-b-ag mhcity-grunt-egg-b-idle2-ja 4) -(def-art-elt mhcity-grunt-egg-b-ag mhcity-grunt-egg-b-idle-ja 3) -(def-art-elt mhcity-grunt-egg-b-ag mhcity-grunt-egg-b-lod1-mg 2) -(def-art-elt mhcity-grunt-egg-b-ag mhcity-grunt-egg-b-lod0-mg 1) -(def-art-elt mhcity-grunt-egg-b-ag mhcity-grunt-egg-b-lod0-jg 0) - -(def-art-elt dm-urchin-ag dm-urchin-explode-idle-ja 7) -(def-art-elt dm-urchin-ag dm-urchin-explode-lod0-mg 6) -(def-art-elt dm-urchin-ag dm-urchin-explode-lod0-jg 5) -(def-art-elt dm-urchin-ag dm-urchin-shudder-ja 4) -(def-art-elt dm-urchin-ag dm-urchin-pulse-ja 3) -(def-art-elt dm-urchin-ag dm-urchin-idle-ja 2) -(def-art-elt dm-urchin-ag dm-urchin-lod0-mg 1) -(def-art-elt dm-urchin-ag dm-urchin-lod0-jg 0) - -(def-art-elt wascity-flag-c-ag wascity-flag-c-flap-ja 3) -(def-art-elt wascity-flag-c-ag wascity-flag-c-idle-ja 2) -(def-art-elt wascity-flag-c-ag wascity-flag-c-lod0-mg 1) -(def-art-elt wascity-flag-c-ag wascity-flag-c-lod0-jg 0) - (def-art-elt com-airlock-outer-ag com-airlock-outer-idle-ja 2) (def-art-elt com-airlock-outer-ag com-airlock-outer-lod0-mg 1) (def-art-elt com-airlock-outer-ag com-airlock-outer-lod0-jg 0) @@ -1320,6 +1293,45 @@ (def-art-elt rail-warp-gate-ag rail-warp-gate-lod0-mg 1) (def-art-elt rail-warp-gate-ag rail-warp-gate-lod0-jg 0) +(def-art-elt onin-simple-ag onin-simple-idle-ja 2) +(def-art-elt onin-simple-ag onin-simple-lod0-mg 1) +(def-art-elt onin-simple-ag onin-simple-lod0-jg 0) + +(def-art-elt tizard-ag tizard-turn-right0-ja 6) +(def-art-elt tizard-ag tizard-turn-left0-ja 5) +(def-art-elt tizard-ag tizard-walk0-ja 4) +(def-art-elt tizard-ag tizard-idle-ja 3) +(def-art-elt tizard-ag tizard-shadow-mg 2) +(def-art-elt tizard-ag tizard-lod0-mg 1) +(def-art-elt tizard-ag tizard-lod0-jg 0) + +(def-art-elt daxter-highres-ag daxter-highres-daxter-walk-ja 3) +(def-art-elt daxter-highres-ag daxter-highres-shadow-mg 2) +(def-art-elt daxter-highres-ag daxter-highres-lod0-mg 1) +(def-art-elt daxter-highres-ag daxter-highres-lod0-jg 0) + +(def-art-elt neo-satellite-shield-ag neo-satellite-shield-end-ja 5) +(def-art-elt neo-satellite-shield-ag neo-satellite-shield-hit-ja 4) +(def-art-elt neo-satellite-shield-ag neo-satellite-shield-start-ja 3) +(def-art-elt neo-satellite-shield-ag neo-satellite-shield-idle-ja 2) +(def-art-elt neo-satellite-shield-ag neo-satellite-shield-lod0-mg 1) +(def-art-elt neo-satellite-shield-ag neo-satellite-shield-lod0-jg 0) + +(def-art-elt robo-hover-ag robo-hover-base-ja 9) +(def-art-elt robo-hover-ag robo-hover-ragdoll-ja 8) +(def-art-elt robo-hover-ag robo-hover-shoot0-ja 7) +(def-art-elt robo-hover-ag robo-hover-fly-right-ja 6) +(def-art-elt robo-hover-ag robo-hover-fly-left-ja 5) +(def-art-elt robo-hover-ag robo-hover-fly-back-ja 4) +(def-art-elt robo-hover-ag robo-hover-fly-forward-ja 3) +(def-art-elt robo-hover-ag robo-hover-idle-ja 2) +(def-art-elt robo-hover-ag robo-hover-lod0-mg 1) +(def-art-elt robo-hover-ag robo-hover-lod0-jg 0) + +(def-art-elt for-telescope-fma-ag for-telescope-fma-idle-ja 2) +(def-art-elt for-telescope-fma-ag for-telescope-fma-lod0-mg 1) +(def-art-elt for-telescope-fma-ag for-telescope-fma-lod0-jg 0) + (def-art-elt tow-spawner-ag tow-spawner-spawn-end-ja 5) (def-art-elt tow-spawner-ag tow-spawner-spawn-middle-ja 4) (def-art-elt tow-spawner-ag tow-spawner-spawn-start-ja 3) @@ -1349,44 +1361,6 @@ (def-art-elt cty-sniper-turret-reticle-ag cty-sniper-turret-reticle-lod0-mg 1) (def-art-elt cty-sniper-turret-reticle-ag cty-sniper-turret-reticle-lod0-jg 0) -(def-art-elt precur-generator-c-ag precur-generator-c-explode-idle-ja 5) -(def-art-elt precur-generator-c-ag precur-generator-c-explode-lod0-mg 4) -(def-art-elt precur-generator-c-ag precur-generator-c-explode-lod0-jg 3) -(def-art-elt precur-generator-c-ag precur-generator-c-idle-ja 2) -(def-art-elt precur-generator-c-ag precur-generator-c-lod0-mg 1) -(def-art-elt precur-generator-c-ag precur-generator-c-lod0-jg 0) - -(def-art-elt tpl-glider-ag tpl-glider-idle-ja 2) -(def-art-elt tpl-glider-ag tpl-glider-lod0-mg 1) -(def-art-elt tpl-glider-ag tpl-glider-lod0-jg 0) - -(def-art-elt pre-sled-ag pre-sled-idle-ja 3) -(def-art-elt pre-sled-ag pre-sled-shadow-mg 2) -(def-art-elt pre-sled-ag pre-sled-lod0-mg 1) -(def-art-elt pre-sled-ag pre-sled-lod0-jg 0) - -(def-art-elt cty-sniper-battery-ag cty-sniper-battery-explode-idle-ja 5) -(def-art-elt cty-sniper-battery-ag cty-sniper-battery-explode-lod0-mg 4) -(def-art-elt cty-sniper-battery-ag cty-sniper-battery-explode-lod0-jg 3) -(def-art-elt cty-sniper-battery-ag cty-sniper-battery-idle-ja 2) -(def-art-elt cty-sniper-battery-ag cty-sniper-battery-lod0-mg 1) -(def-art-elt cty-sniper-battery-ag cty-sniper-battery-lod0-jg 0) - -(def-art-elt flyingsaw-ag flyingsaw-idle-ja 2) -(def-art-elt flyingsaw-ag flyingsaw-lod0-mg 1) -(def-art-elt flyingsaw-ag flyingsaw-lod0-jg 0) - -(def-art-elt red-gun-mod-three-ag red-gun-mod-three-idle-ja 2) -(def-art-elt red-gun-mod-three-ag red-gun-mod-three-lod0-mg 1) -(def-art-elt red-gun-mod-three-ag red-gun-mod-three-lod0-jg 0) - -(def-art-elt fac-elevator-a-ag fac-elevator-a-gate_down-ja 5) -(def-art-elt fac-elevator-a-ag fac-elevator-a-gate_up-ja 4) -(def-art-elt fac-elevator-a-ag fac-elevator-a-idle-ja 3) -(def-art-elt fac-elevator-a-ag fac-elevator-a-lod1-mg 2) -(def-art-elt fac-elevator-a-ag fac-elevator-a-lod0-mg 1) -(def-art-elt fac-elevator-a-ag fac-elevator-a-lod0-jg 0) - (def-art-elt gun-kg-target-d-ag gun-kg-target-d-explode-idle-ja 5) (def-art-elt gun-kg-target-d-ag gun-kg-target-d-explode-lod0-mg 4) (def-art-elt gun-kg-target-d-ag gun-kg-target-d-explode-lod0-jg 3) @@ -1394,68 +1368,6 @@ (def-art-elt gun-kg-target-d-ag gun-kg-target-d-lod0-mg 1) (def-art-elt gun-kg-target-d-ag gun-kg-target-d-lod0-jg 0) -(def-art-elt precur-door-b-ag precur-door-b-idle-ja 2) -(def-art-elt precur-door-b-ag precur-door-b-lod0-mg 1) -(def-art-elt precur-door-b-ag precur-door-b-lod0-jg 0) - -(def-art-elt wascity-airlock-small-ag wascity-airlock-small-idle-ja 2) -(def-art-elt wascity-airlock-small-ag wascity-airlock-small-lod0-mg 1) -(def-art-elt wascity-airlock-small-ag wascity-airlock-small-lod0-jg 0) - -(def-art-elt youngsamos-highres-ag youngsamos-highres-youngsamos-idle-ja 2) -(def-art-elt youngsamos-highres-ag youngsamos-highres-lod0-mg 1) -(def-art-elt youngsamos-highres-ag youngsamos-highres-lod0-jg 0) - -(def-art-elt dp-bipedal-ag dp-bipedal-turret-jump-off-end-ja 41) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-jump-off-jump-ja 40) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-jump-off-start-ja 39) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-jump-on-end-ja 38) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-jump-on-start-ja 37) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-knocked-right0-ja 36) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-knocked-left0-ja 35) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-shoot0-ja 34) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-idle-right-ja 33) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-idle-left-ja 32) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-idle-down-ja 31) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-idle-up-ja 30) -(def-art-elt dp-bipedal-ag dp-bipedal-turret-idle-middle-ja 29) -(def-art-elt dp-bipedal-ag dp-bipedal-shield-out-ja 12) -(def-art-elt dp-bipedal-ag dp-bipedal-attack-throw0-end-ja 11) -(def-art-elt dp-bipedal-ag dp-bipedal-attack-throw0-middle-ja 10) -(def-art-elt dp-bipedal-ag dp-bipedal-attack-throw0-start-ja 9) -(def-art-elt dp-bipedal-ag dp-bipedal-attack-close0-end-ja 8) -(def-art-elt dp-bipedal-ag dp-bipedal-attack-close0-middle-ja 7) -(def-art-elt dp-bipedal-ag dp-bipedal-attack-close0-start-ja 6) -(def-art-elt dp-bipedal-ag dp-bipedal-walk0-ja 5) -(def-art-elt dp-bipedal-ag dp-bipedal-run0-ja 4) -(def-art-elt dp-bipedal-ag dp-bipedal-idle0-ja 3) -(def-art-elt dp-bipedal-ag dp-bipedal-shadow-mg 2) -(def-art-elt dp-bipedal-ag dp-bipedal-lod0-mg 1) -(def-art-elt dp-bipedal-ag dp-bipedal-lod0-jg 0) -(def-art-elt dp-bipedal-ag dp-bipedal-shield-out-idle-ja 13) -(def-art-elt dp-bipedal-ag dp-bipedal-shield-in-ja 14) -(def-art-elt dp-bipedal-ag dp-bipedal-shield-up-recoil0-ja 15) -(def-art-elt dp-bipedal-ag dp-bipedal-getup0-start-ja 16) -(def-art-elt dp-bipedal-ag dp-bipedal-getup0-end-ja 17) -(def-art-elt dp-bipedal-ag dp-bipedal-warp-in0-ja 18) -(def-art-elt dp-bipedal-ag dp-bipedal-warp-in1-ja 19) -(def-art-elt dp-bipedal-ag dp-bipedal-jump0-start-ja 20) -(def-art-elt dp-bipedal-ag dp-bipedal-jump0-fall-ja 21) -(def-art-elt dp-bipedal-ag dp-bipedal-jump0-land-ja 22) -(def-art-elt dp-bipedal-ag dp-bipedal-knocked-yellow-right-ja 23) -(def-art-elt dp-bipedal-ag dp-bipedal-knocked-yellow-right-land-ja 24) -(def-art-elt dp-bipedal-ag dp-bipedal-knocked-yellow-left-ja 25) -(def-art-elt dp-bipedal-ag dp-bipedal-knocked-yellow-left-land-ja 26) -(def-art-elt dp-bipedal-ag dp-bipedal-knocked-blue0-ja 27) -(def-art-elt dp-bipedal-ag dp-bipedal-ragdoll-ja 28) - -(def-art-elt des-terraformer-break-ag des-terraformer-break-a-idle-ja 6) -(def-art-elt des-terraformer-break-ag des-terraformer-break-a-lod0-mg 5) -(def-art-elt des-terraformer-break-ag des-terraformer-break-a-lod0-jg 4) -(def-art-elt des-terraformer-break-ag des-terraformer-break-idle-ja 2) -(def-art-elt des-terraformer-break-ag des-terraformer-break-lod0-mg 1) -(def-art-elt des-terraformer-break-ag des-terraformer-break-lod0-jg 0) - (def-art-elt precur-box-ag precur-box-explode-idle-ja 5) (def-art-elt precur-box-ag precur-box-explode-lod0-mg 4) (def-art-elt precur-box-ag precur-box-explode-lod0-jg 3) @@ -1486,35 +1398,6 @@ (def-art-elt errol-ag errol-lod0-mg 1) (def-art-elt errol-ag errol-lod0-jg 0) -(def-art-elt predator-ag predator-blue-hit-land-ja 23) -(def-art-elt predator-ag predator-blue-hit-back-ja 22) -(def-art-elt predator-ag predator-blue-hit-front-ja 21) -(def-art-elt predator-ag predator-knocked-big-death-ja 20) -(def-art-elt predator-ag predator-knocked-big-land-ja 19) -(def-art-elt predator-ag predator-knocked-big-ja 18) -(def-art-elt predator-ag predator-jump-attack-land-ja 17) -(def-art-elt predator-ag predator-jump-attack-ja 16) -(def-art-elt predator-ag predator-knocked-death-land-ja 15) -(def-art-elt predator-ag predator-knocked-death-ja 14) -(def-art-elt predator-ag predator-knocked-land-ja 13) -(def-art-elt predator-ag predator-lod0-jg 0) -(def-art-elt predator-ag predator-lod0-mg 1) -(def-art-elt predator-ag predator-lod1-mg 2) -(def-art-elt predator-ag predator-lod2-mg 3) -(def-art-elt predator-ag predator-shadow-mg 4) -(def-art-elt predator-ag predator-idle-ja 5) -(def-art-elt predator-ag predator-walk0-ja 6) -(def-art-elt predator-ag predator-run0-ja 7) -(def-art-elt predator-ag predator-close-attack-ja 8) -(def-art-elt predator-ag predator-close-attack-recover-ja 9) -(def-art-elt predator-ag predator-shoot-guns0-ja 10) -(def-art-elt predator-ag predator-death-standing-ja 11) -(def-art-elt predator-ag predator-knocked-ja 12) - -(def-art-elt kidmedallion-ag kidmedallion-idle-ja 2) -(def-art-elt kidmedallion-ag kidmedallion-lod0-mg 1) -(def-art-elt kidmedallion-ag kidmedallion-lod0-jg 0) - (def-art-elt red-gun-mod-two-ag red-gun-mod-two-idle-ja 2) (def-art-elt red-gun-mod-two-ag red-gun-mod-two-lod0-mg 1) (def-art-elt red-gun-mod-two-ag red-gun-mod-two-lod0-jg 0) @@ -1618,169 +1501,99 @@ (def-art-elt bikeb-ag bikeb-lod0-mg 1) (def-art-elt bikeb-ag bikeb-lod0-jg 0) -(def-art-elt pecker-highres-ag pecker-highres-pecker-fly-ja 5) -(def-art-elt pecker-highres-ag pecker-highres-idle-ja 3) -(def-art-elt pecker-highres-ag pecker-highres-shadow-mg 2) -(def-art-elt pecker-highres-ag pecker-highres-lod0-mg 1) -(def-art-elt pecker-highres-ag pecker-highres-lod0-jg 0) - -(def-art-elt ctywide-arrow-ag ctywide-arrow-idle-ja 2) -(def-art-elt ctywide-arrow-ag ctywide-arrow-lod0-mg 1) -(def-art-elt ctywide-arrow-ag ctywide-arrow-lod0-jg 0) +(def-art-elt predator-ag predator-blue-hit-land-ja 23) +(def-art-elt predator-ag predator-blue-hit-back-ja 22) +(def-art-elt predator-ag predator-blue-hit-front-ja 21) +(def-art-elt predator-ag predator-knocked-big-death-ja 20) +(def-art-elt predator-ag predator-knocked-big-land-ja 19) +(def-art-elt predator-ag predator-knocked-big-ja 18) +(def-art-elt predator-ag predator-jump-attack-land-ja 17) +(def-art-elt predator-ag predator-jump-attack-ja 16) +(def-art-elt predator-ag predator-knocked-death-land-ja 15) +(def-art-elt predator-ag predator-knocked-death-ja 14) +(def-art-elt predator-ag predator-knocked-land-ja 13) +(def-art-elt predator-ag predator-lod0-jg 0) +(def-art-elt predator-ag predator-lod0-mg 1) +(def-art-elt predator-ag predator-lod1-mg 2) +(def-art-elt predator-ag predator-lod2-mg 3) +(def-art-elt predator-ag predator-shadow-mg 4) +(def-art-elt predator-ag predator-idle-ja 5) +(def-art-elt predator-ag predator-walk0-ja 6) +(def-art-elt predator-ag predator-run0-ja 7) +(def-art-elt predator-ag predator-close-attack-ja 8) +(def-art-elt predator-ag predator-close-attack-recover-ja 9) +(def-art-elt predator-ag predator-shoot-guns0-ja 10) +(def-art-elt predator-ag predator-death-standing-ja 11) +(def-art-elt predator-ag predator-knocked-ja 12) -(def-art-elt spydroid-ag spydroid-knocked1-land-ja 13) -(def-art-elt spydroid-ag spydroid-lod0-jg 0) -(def-art-elt spydroid-ag spydroid-lod0-mg 1) -(def-art-elt spydroid-ag spydroid-shadow-mg 2) -(def-art-elt spydroid-ag spydroid-idle-ja 3) -(def-art-elt spydroid-ag spydroid-walk-ja 4) -(def-art-elt spydroid-ag spydroid-run-ja 5) -(def-art-elt spydroid-ag spydroid-attack-jump-ja 6) -(def-art-elt spydroid-ag spydroid-attack-land-ja 7) -(def-art-elt spydroid-ag spydroid-jump-wind-up-ja 8) -(def-art-elt spydroid-ag spydroid-knocked0-ja 9) -(def-art-elt spydroid-ag spydroid-knocked0-land-ja 10) -(def-art-elt spydroid-ag spydroid-knocked1-ja 11) -(def-art-elt spydroid-ag spydroid-turn-180-ja 12) +(def-art-elt kidmedallion-ag kidmedallion-idle-ja 2) +(def-art-elt kidmedallion-ag kidmedallion-lod0-mg 1) +(def-art-elt kidmedallion-ag kidmedallion-lod0-jg 0) -(def-art-elt min-rotating-plat-ag min-rotating-plat-idle-ja 2) -(def-art-elt min-rotating-plat-ag min-rotating-plat-lod0-mg 1) -(def-art-elt min-rotating-plat-ag min-rotating-plat-lod0-jg 0) +(def-art-elt precur-generator-c-ag precur-generator-c-explode-idle-ja 5) +(def-art-elt precur-generator-c-ag precur-generator-c-explode-lod0-mg 4) +(def-art-elt precur-generator-c-ag precur-generator-c-explode-lod0-jg 3) +(def-art-elt precur-generator-c-ag precur-generator-c-idle-ja 2) +(def-art-elt precur-generator-c-ag precur-generator-c-lod0-mg 1) +(def-art-elt precur-generator-c-ag precur-generator-c-lod0-jg 0) -(def-art-elt min-airlock-door-ag min-airlock-door-idle-ja 2) -(def-art-elt min-airlock-door-ag min-airlock-door-lod0-mg 1) -(def-art-elt min-airlock-door-ag min-airlock-door-lod0-jg 0) - -(def-art-elt mhcity-vein-writhing-large-ag mhcity-vein-writhing-large-idle-ja 2) -(def-art-elt mhcity-vein-writhing-large-ag mhcity-vein-writhing-large-lod0-mg 1) -(def-art-elt mhcity-vein-writhing-large-ag mhcity-vein-writhing-large-lod0-jg 0) - -(def-art-elt citizen-chick-ag citizen-chick-riding-stance-ja 27) -(def-art-elt citizen-chick-ag citizen-chick-shuffle-ja 26) -(def-art-elt citizen-chick-ag citizen-chick-get-up-from-back-ja 25) -(def-art-elt citizen-chick-ag citizen-chick-get-up-from-front-ja 24) -(def-art-elt citizen-chick-ag citizen-chick-knocked-back-land-ja 23) -(def-art-elt citizen-chick-ag citizen-chick-knocked-back-ja 22) -(def-art-elt citizen-chick-ag citizen-chick-knocked-front-land-ja 21) -(def-art-elt citizen-chick-ag citizen-chick-knocked-front-ja 20) -(def-art-elt citizen-chick-ag citizen-chick-blue-hit-back-ja 19) -(def-art-elt citizen-chick-ag citizen-chick-blue-hit-front-ja 18) -(def-art-elt citizen-chick-ag citizen-chick-dive-forward-ja 17) -(def-art-elt citizen-chick-ag citizen-chick-cover-head-end-ja 16) -(def-art-elt citizen-chick-ag citizen-chick-cover-head-loop-ja 15) -(def-art-elt citizen-chick-ag citizen-chick-cover-head-start-ja 14) -(def-art-elt citizen-chick-ag citizen-chick-hit-the-deck-ja 13) -(def-art-elt citizen-chick-ag citizen-chick-lod0-jg 0) -(def-art-elt citizen-chick-ag citizen-chick-lod0-mg 1) -(def-art-elt citizen-chick-ag citizen-chick-lod2-mg 2) -(def-art-elt citizen-chick-ag citizen-chick-shadow-mg 3) -(def-art-elt citizen-chick-ag citizen-chick-walk-ja 4) -(def-art-elt citizen-chick-ag citizen-chick-walk2-ja 5) -(def-art-elt citizen-chick-ag citizen-chick-walk3-ja 6) -(def-art-elt citizen-chick-ag citizen-chick-run-ja 7) -(def-art-elt citizen-chick-ag citizen-chick-run2-ja 8) -(def-art-elt citizen-chick-ag citizen-chick-run3-ja 9) -(def-art-elt citizen-chick-ag citizen-chick-idle-ja 10) -(def-art-elt citizen-chick-ag citizen-chick-panic-run-ja 11) -(def-art-elt citizen-chick-ag citizen-chick-tread-water-ja 12) - -(def-art-elt faccar-ag faccar-idle-ja 11) -(def-art-elt faccar-ag faccar-shadow-mg 10) -(def-art-elt faccar-ag faccar-lod0-mg 9) -(def-art-elt faccar-ag faccar-lod0-jg 8) -(def-art-elt faccar-ag faccar-wheel-blur-idle-ja 7) -(def-art-elt faccar-ag faccar-wheel-blur-shadow-mg 6) -(def-art-elt faccar-ag faccar-wheel-blur-lod0-mg 5) -(def-art-elt faccar-ag faccar-wheel-blur-lod0-jg 4) -(def-art-elt faccar-ag faccar-wheel-idle-ja 3) -(def-art-elt faccar-ag faccar-wheel-shadow-mg 2) -(def-art-elt faccar-ag faccar-wheel-lod0-mg 1) -(def-art-elt faccar-ag faccar-wheel-lod0-jg 0) +(def-art-elt tpl-glider-ag tpl-glider-idle-ja 2) +(def-art-elt tpl-glider-ag tpl-glider-lod0-mg 1) +(def-art-elt tpl-glider-ag tpl-glider-lod0-jg 0) -(def-art-elt nst-metalhead-eggs-b-ag nst-metalhead-eggs-b-idle-ja 4) -(def-art-elt nst-metalhead-eggs-b-ag nst-metalhead-eggs-b-lod2-mg 3) -(def-art-elt nst-metalhead-eggs-b-ag nst-metalhead-eggs-b-lod1-mg 2) -(def-art-elt nst-metalhead-eggs-b-ag nst-metalhead-eggs-b-lod0-mg 1) -(def-art-elt nst-metalhead-eggs-b-ag nst-metalhead-eggs-b-lod0-jg 0) +(def-art-elt pre-sled-ag pre-sled-idle-ja 3) +(def-art-elt pre-sled-ag pre-sled-shadow-mg 2) +(def-art-elt pre-sled-ag pre-sled-lod0-mg 1) +(def-art-elt pre-sled-ag pre-sled-lod0-jg 0) -(def-art-elt manta-ag manta-glide-end-ja 22) -(def-art-elt manta-ag manta-attack-end-ja 21) -(def-art-elt manta-ag manta-attack-start-ja 20) -(def-art-elt manta-ag manta-falling-death-land-phase-out-ja 19) -(def-art-elt manta-ag manta-falling-death-land-ja 18) -(def-art-elt manta-ag manta-falling-death-fade-ja 17) -(def-art-elt manta-ag manta-falling-death-ja 16) -(def-art-elt manta-ag manta-knocked-blue-recover-ja 15) -(def-art-elt manta-ag manta-knocked-blue-ja 14) -(def-art-elt manta-ag manta-knocked0-ja 13) -(def-art-elt manta-ag manta-lod0-jg 0) -(def-art-elt manta-ag manta-lod0-mg 1) -(def-art-elt manta-ag manta-shadow-mg 2) -(def-art-elt manta-ag manta-idle0-ja 3) -(def-art-elt manta-ag manta-idle1-ja 4) -(def-art-elt manta-ag manta-go-alert-ja 5) -(def-art-elt manta-ag manta-alert-idle-ja 6) -(def-art-elt manta-ag manta-alert-to-fly-ja 7) -(def-art-elt manta-ag manta-flap-ja 8) -(def-art-elt manta-ag manta-flap1-ja 9) -(def-art-elt manta-ag manta-flap-fast-ja 10) -(def-art-elt manta-ag manta-flap-back-ja 11) -(def-art-elt manta-ag manta-land-ja 12) +(def-art-elt cty-sniper-battery-ag cty-sniper-battery-explode-idle-ja 5) +(def-art-elt cty-sniper-battery-ag cty-sniper-battery-explode-lod0-mg 4) +(def-art-elt cty-sniper-battery-ag cty-sniper-battery-explode-lod0-jg 3) +(def-art-elt cty-sniper-battery-ag cty-sniper-battery-idle-ja 2) +(def-art-elt cty-sniper-battery-ag cty-sniper-battery-lod0-mg 1) +(def-art-elt cty-sniper-battery-ag cty-sniper-battery-lod0-jg 0) -(def-art-elt wstd-flag-ag wstd-flag-idle-ja 2) -(def-art-elt wstd-flag-ag wstd-flag-lod0-mg 1) -(def-art-elt wstd-flag-ag wstd-flag-lod0-jg 0) +(def-art-elt flyingsaw-ag flyingsaw-idle-ja 2) +(def-art-elt flyingsaw-ag flyingsaw-lod0-mg 1) +(def-art-elt flyingsaw-ag flyingsaw-lod0-jg 0) -(def-art-elt for-telescope-ag for-telescope-idle-ja 2) -(def-art-elt for-telescope-ag for-telescope-lod0-mg 1) -(def-art-elt for-telescope-ag for-telescope-lod0-jg 0) +(def-art-elt red-gun-mod-three-ag red-gun-mod-three-idle-ja 2) +(def-art-elt red-gun-mod-three-ag red-gun-mod-three-lod0-mg 1) +(def-art-elt red-gun-mod-three-ag red-gun-mod-three-lod0-jg 0) -(def-art-elt cav-pillar-ag cav-pillar-debris-d-idle-ja 23) -(def-art-elt cav-pillar-ag cav-pillar-debris-d-lod0-mg 22) -(def-art-elt cav-pillar-ag cav-pillar-debris-d-lod0-jg 21) -(def-art-elt cav-pillar-ag cav-pillar-debris-c-idle-ja 20) -(def-art-elt cav-pillar-ag cav-pillar-debris-c-lod0-mg 19) -(def-art-elt cav-pillar-ag cav-pillar-debris-c-lod0-jg 18) -(def-art-elt cav-pillar-ag cav-pillar-debris-b-idle-ja 17) -(def-art-elt cav-pillar-ag cav-pillar-debris-b-lod0-mg 16) -(def-art-elt cav-pillar-ag cav-pillar-debris-b-lod0-jg 15) -(def-art-elt cav-pillar-ag cav-pillar-debris-a-idle-ja 14) -(def-art-elt cav-pillar-ag cav-pillar-debris-a-lod0-mg 13) -(def-art-elt cav-pillar-ag cav-pillar-lod0-jg 0) -(def-art-elt cav-pillar-ag cav-pillar-lod0-mg 1) -(def-art-elt cav-pillar-ag cav-pillar-idle-ja 2) -(def-art-elt cav-pillar-ag cav-pillar-b-lod0-jg 3) -(def-art-elt cav-pillar-ag cav-pillar-b-lod0-mg 4) -(def-art-elt cav-pillar-ag cav-pillar-b-idle-ja 5) -(def-art-elt cav-pillar-ag cav-pillar-c-lod0-jg 6) -(def-art-elt cav-pillar-ag cav-pillar-c-lod0-mg 7) -(def-art-elt cav-pillar-ag cav-pillar-c-idle-ja 8) -(def-art-elt cav-pillar-ag cav-pillar-d-lod0-jg 9) -(def-art-elt cav-pillar-ag cav-pillar-d-lod0-mg 10) -(def-art-elt cav-pillar-ag cav-pillar-d-idle-ja 11) -(def-art-elt cav-pillar-ag cav-pillar-debris-a-lod0-jg 12) +(def-art-elt fac-elevator-a-ag fac-elevator-a-gate_down-ja 5) +(def-art-elt fac-elevator-a-ag fac-elevator-a-gate_up-ja 4) +(def-art-elt fac-elevator-a-ag fac-elevator-a-idle-ja 3) +(def-art-elt fac-elevator-a-ag fac-elevator-a-lod1-mg 2) +(def-art-elt fac-elevator-a-ag fac-elevator-a-lod0-mg 1) +(def-art-elt fac-elevator-a-ag fac-elevator-a-lod0-jg 0) -(def-art-elt tpl-spike-trap-ag tpl-spike-trap-down-ja 4) -(def-art-elt tpl-spike-trap-ag tpl-spike-trap-up-ja 3) -(def-art-elt tpl-spike-trap-ag tpl-spike-trap-idle-ja 2) -(def-art-elt tpl-spike-trap-ag tpl-spike-trap-lod0-mg 1) -(def-art-elt tpl-spike-trap-ag tpl-spike-trap-lod0-jg 0) +(def-art-elt errol-lowres-ag errol-lowres-run-to-idle-ja 15) +(def-art-elt errol-lowres-ag errol-lowres-run-ccw-ja 14) +(def-art-elt errol-lowres-ag errol-lowres-run-cw-ja 13) +(def-art-elt errol-lowres-ag errol-lowres-lod0-jg 0) +(def-art-elt errol-lowres-ag errol-lowres-lod0-mg 1) +(def-art-elt errol-lowres-ag errol-lowres-lod1-mg 2) +(def-art-elt errol-lowres-ag errol-lowres-idle30-ja 3) +(def-art-elt errol-lowres-ag errol-lowres-idle60-ja 4) +(def-art-elt errol-lowres-ag errol-lowres-idle-hit-console-ja 5) +(def-art-elt errol-lowres-ag errol-lowres-idle-hit-console-2-ja 6) +(def-art-elt errol-lowres-ag errol-lowres-idle-throw-ja 7) +(def-art-elt errol-lowres-ag errol-lowres-idle-yell-ja 8) +(def-art-elt errol-lowres-ag errol-lowres-idle-yell-1-ja 9) +(def-art-elt errol-lowres-ag errol-lowres-idle-knocked-ja 10) +(def-art-elt errol-lowres-ag errol-lowres-idle-to-run-cw-ja 11) +(def-art-elt errol-lowres-ag errol-lowres-idle-to-run-ccw-ja 12) -(def-art-elt water-anim-waspala-ag water-anim-waspala-idle-ja 8) -(def-art-elt water-anim-waspala-ag water-anim-waspala-frontwindowwall-lod0-mg 7) -(def-art-elt water-anim-waspala-ag water-anim-waspala-frontwindowwall-lod0-jg 6) -(def-art-elt water-anim-waspala-ag water-anim-waspala-frontthrone-lod0-mg 5) -(def-art-elt water-anim-waspala-ag water-anim-waspala-frontthrone-lod0-jg 4) -(def-art-elt water-anim-waspala-ag water-anim-waspala-windowwall-lod0-mg 3) -(def-art-elt water-anim-waspala-ag water-anim-waspala-windowwall-lod0-jg 2) -(def-art-elt water-anim-waspala-ag water-anim-waspala-thronesec-lod0-mg 1) -(def-art-elt water-anim-waspala-ag water-anim-waspala-thronesec-lod0-jg 0) +(def-art-elt pecker-ingame-ag pecker-ingame-fly-ja 4) +(def-art-elt pecker-ingame-ag pecker-ingame-idle-ja 3) +(def-art-elt pecker-ingame-ag pecker-ingame-shadow-mg 2) +(def-art-elt pecker-ingame-ag pecker-ingame-lod0-mg 1) +(def-art-elt pecker-ingame-ag pecker-ingame-lod0-jg 0) -(def-art-elt cty-missile-launcher-ag cty-missile-launcher-recoil-ja 4) -(def-art-elt cty-missile-launcher-ag cty-missile-launcher-idle-ja 3) -(def-art-elt cty-missile-launcher-ag cty-missile-launcher-lod1-mg 2) -(def-art-elt cty-missile-launcher-ag cty-missile-launcher-lod0-mg 1) -(def-art-elt cty-missile-launcher-ag cty-missile-launcher-lod0-jg 0) +(def-art-elt purple-one-ag purple-one-idle-ja 2) +(def-art-elt purple-one-ag purple-one-lod0-mg 1) +(def-art-elt purple-one-ag purple-one-lod0-jg 0) (def-art-elt barge-ag barge-idle-ja 2) (def-art-elt barge-ag barge-lod0-mg 1) @@ -1867,11 +1680,6 @@ (def-art-elt kg-hopper-ag kg-hopper-knocked1-ja 27) (def-art-elt kg-hopper-ag kg-hopper-knocked1-land-ja 28) -(def-art-elt daxter-highres-ag daxter-highres-daxter-walk-ja 3) -(def-art-elt daxter-highres-ag daxter-highres-shadow-mg 2) -(def-art-elt daxter-highres-ag daxter-highres-lod0-mg 1) -(def-art-elt daxter-highres-ag daxter-highres-lod0-jg 0) - (def-art-elt precur-generator-b-ag precur-generator-b-explode-idle-ja 5) (def-art-elt precur-generator-b-ag precur-generator-b-explode-lod0-mg 4) (def-art-elt precur-generator-b-ag precur-generator-b-explode-lod0-jg 3) @@ -1963,6 +1771,18 @@ (def-art-elt cty-sniper-turret-ag cty-sniper-turret-lod0-mg 1) (def-art-elt cty-sniper-turret-ag cty-sniper-turret-lod0-jg 0) +(def-art-elt tpl-outer-airlock-door-ag tpl-outer-airlock-door-idle-ja 2) +(def-art-elt tpl-outer-airlock-door-ag tpl-outer-airlock-door-lod0-mg 1) +(def-art-elt tpl-outer-airlock-door-ag tpl-outer-airlock-door-lod0-jg 0) + +(def-art-elt cty-port-mine-ag cty-port-mine-explode-idle-ja 6) +(def-art-elt cty-port-mine-ag cty-port-mine-explode-lod0-mg 5) +(def-art-elt cty-port-mine-ag cty-port-mine-explode-lod0-jg 4) +(def-art-elt cty-port-mine-ag cty-port-mine-idle-ja 3) +(def-art-elt cty-port-mine-ag cty-port-mine-lod1-mg 2) +(def-art-elt cty-port-mine-ag cty-port-mine-lod0-mg 1) +(def-art-elt cty-port-mine-ag cty-port-mine-lod0-jg 0) + (def-art-elt blocking-plane-ag blocking-plane-idle-ja 2) (def-art-elt blocking-plane-ag blocking-plane-lod0-mg 1) (def-art-elt blocking-plane-ag blocking-plane-lod0-jg 0) @@ -1985,44 +1805,171 @@ (def-art-elt shield-sphere-distort-ag shield-sphere-distort-lod0-mg 1) (def-art-elt shield-sphere-distort-ag shield-sphere-distort-lod0-jg 0) -(def-art-elt scenecamera-ag scenecamera-idle-ja 2) -(def-art-elt scenecamera-ag scenecamera-lod0-mg 1) -(def-art-elt scenecamera-ag scenecamera-lod0-jg 0) - -(def-art-elt bt-jinx-ag bt-jinx-ride-ja 4) -(def-art-elt bt-jinx-ag bt-jinx-idle-ja 3) -(def-art-elt bt-jinx-ag bt-jinx-shadow-mg 2) -(def-art-elt bt-jinx-ag bt-jinx-lod0-mg 1) -(def-art-elt bt-jinx-ag bt-jinx-lod0-jg 0) +(def-art-elt kg-pickup-ag kg-pickup-idle-ja 3) +(def-art-elt kg-pickup-ag kg-pickup-shadow-mg 2) +(def-art-elt kg-pickup-ag kg-pickup-lod0-mg 1) +(def-art-elt kg-pickup-ag kg-pickup-lod0-jg 0) -(def-art-elt wascity-burning-bush-ag wascity-burning-bush-idle-ja 2) -(def-art-elt wascity-burning-bush-ag wascity-burning-bush-lod0-mg 1) -(def-art-elt wascity-burning-bush-ag wascity-burning-bush-lod0-jg 0) +(def-art-elt kg-robot-transport-ag kg-robot-transport-idle-ja 3) +(def-art-elt kg-robot-transport-ag kg-robot-transport-shadow-mg 2) +(def-art-elt kg-robot-transport-ag kg-robot-transport-lod0-mg 1) +(def-art-elt kg-robot-transport-ag kg-robot-transport-lod0-jg 0) -(def-art-elt kg-debris-ag kg-debris-d-lod0-mg 7) -(def-art-elt kg-debris-ag kg-debris-d-lod0-jg 6) -(def-art-elt kg-debris-ag kg-debris-c-lod0-mg 5) -(def-art-elt kg-debris-ag kg-debris-c-lod0-jg 4) -(def-art-elt kg-debris-ag kg-debris-b-lod0-mg 3) -(def-art-elt kg-debris-ag kg-debris-b-lod0-jg 2) -(def-art-elt kg-debris-ag kg-debris-a-lod0-mg 1) -(def-art-elt kg-debris-ag kg-debris-a-lod0-jg 0) +(def-art-elt mhcity-vine-wriggler-ag mhcity-vine-wriggler-idle-ja 2) +(def-art-elt mhcity-vine-wriggler-ag mhcity-vine-wriggler-lod0-mg 1) +(def-art-elt mhcity-vine-wriggler-ag mhcity-vine-wriggler-lod0-jg 0) -(def-art-elt kor-highres-ag kor-highres-kor-idle-ja 3) -(def-art-elt kor-highres-ag kor-highres-idle-ja 2) -(def-art-elt kor-highres-ag kor-highres-lod0-mg 1) -(def-art-elt kor-highres-ag kor-highres-lod0-jg 0) +(def-art-elt torn-highres-ag torn-highres-torn-walk-ja 7) +(def-art-elt torn-highres-ag torn-highres-idle-bar-ja 6) +(def-art-elt torn-highres-ag torn-highres-idle-booth-ja 5) +(def-art-elt torn-highres-ag torn-highres-idle-table-ja 4) +(def-art-elt torn-highres-ag torn-highres-idle-ja 3) +(def-art-elt torn-highres-ag torn-highres-shadow-mg 2) +(def-art-elt torn-highres-ag torn-highres-lod0-mg 1) +(def-art-elt torn-highres-ag torn-highres-lod0-jg 0) -(def-art-elt precur-bridge-a-path-break-ag precur-bridge-a-path-break-idle2-ja 3) -(def-art-elt precur-bridge-a-path-break-ag precur-bridge-a-path-break-idle-ja 2) -(def-art-elt precur-bridge-a-path-break-ag precur-bridge-a-path-break-lod0-mg 1) -(def-art-elt precur-bridge-a-path-break-ag precur-bridge-a-path-break-lod0-jg 0) +(def-art-elt mhcity-grunt-egg-b-ag mhcity-grunt-egg-b-idle2-ja 4) +(def-art-elt mhcity-grunt-egg-b-ag mhcity-grunt-egg-b-idle-ja 3) +(def-art-elt mhcity-grunt-egg-b-ag mhcity-grunt-egg-b-lod1-mg 2) +(def-art-elt mhcity-grunt-egg-b-ag mhcity-grunt-egg-b-lod0-mg 1) +(def-art-elt mhcity-grunt-egg-b-ag mhcity-grunt-egg-b-lod0-jg 0) -(def-art-elt farm-sprinkler-barrels-ag farm-sprinkler-barrels-idle-ja 2) -(def-art-elt farm-sprinkler-barrels-ag farm-sprinkler-barrels-lod0-mg 1) -(def-art-elt farm-sprinkler-barrels-ag farm-sprinkler-barrels-lod0-jg 0) +(def-art-elt dm-urchin-ag dm-urchin-explode-idle-ja 7) +(def-art-elt dm-urchin-ag dm-urchin-explode-lod0-mg 6) +(def-art-elt dm-urchin-ag dm-urchin-explode-lod0-jg 5) +(def-art-elt dm-urchin-ag dm-urchin-shudder-ja 4) +(def-art-elt dm-urchin-ag dm-urchin-pulse-ja 3) +(def-art-elt dm-urchin-ag dm-urchin-idle-ja 2) +(def-art-elt dm-urchin-ag dm-urchin-lod0-mg 1) +(def-art-elt dm-urchin-ag dm-urchin-lod0-jg 0) -(def-art-elt sew-slide-step-ag sew-slide-step-idle-ja 2) +(def-art-elt wascity-flag-c-ag wascity-flag-c-flap-ja 3) +(def-art-elt wascity-flag-c-ag wascity-flag-c-idle-ja 2) +(def-art-elt wascity-flag-c-ag wascity-flag-c-lod0-mg 1) +(def-art-elt wascity-flag-c-ag wascity-flag-c-lod0-jg 0) + +(def-art-elt farm-cabbage-ag farm-cabbage-explode-idle-ja 5) +(def-art-elt farm-cabbage-ag farm-cabbage-explode-lod0-mg 4) +(def-art-elt farm-cabbage-ag farm-cabbage-explode-lod0-jg 3) +(def-art-elt farm-cabbage-ag farm-cabbage-idle-ja 2) +(def-art-elt farm-cabbage-ag farm-cabbage-lod0-mg 1) +(def-art-elt farm-cabbage-ag farm-cabbage-lod0-jg 0) + +(def-art-elt cty-fruit-stand-ag cty-fruit-stand-idle-ja 2) +(def-art-elt cty-fruit-stand-ag cty-fruit-stand-lod0-mg 1) +(def-art-elt cty-fruit-stand-ag cty-fruit-stand-lod0-jg 0) + +(def-art-elt red-crimson-guard-highres-ag red-crimson-guard-highres-red-crimson-guard-walk-ja 2) +(def-art-elt red-crimson-guard-highres-ag red-crimson-guard-highres-lod0-mg 1) +(def-art-elt red-crimson-guard-highres-ag red-crimson-guard-highres-lod0-jg 0) + +(def-art-elt ottsel-tess-ag ottsel-tess-idle-ja 3) +(def-art-elt ottsel-tess-ag ottsel-tess-shadow-mg 2) +(def-art-elt ottsel-tess-ag ottsel-tess-lod0-mg 1) +(def-art-elt ottsel-tess-ag ottsel-tess-lod0-jg 0) +(def-art-elt ottsel-tess-ag ottsel-tess-ottess-idle-ja 4) + +(def-art-elt ashelin-highres-ag ashelin-highres-ashelin-walk-ja 5) +(def-art-elt ashelin-highres-ag ashelin-highres-idle-stand-ja 4) +(def-art-elt ashelin-highres-ag ashelin-highres-idle-ja 3) +(def-art-elt ashelin-highres-ag ashelin-highres-shadow-mg 2) +(def-art-elt ashelin-highres-ag ashelin-highres-lod0-mg 1) +(def-art-elt ashelin-highres-ag ashelin-highres-lod0-jg 0) + +(def-art-elt citizen-fat-ag citizen-fat-tread-water-ja 32) +(def-art-elt citizen-fat-ag citizen-fat-riding-stance-ja 31) +(def-art-elt citizen-fat-ag citizen-fat-cover-head-end-ja 30) +(def-art-elt citizen-fat-ag citizen-fat-cover-head-loop-ja 29) +(def-art-elt citizen-fat-ag citizen-fat-shuffle-ja 12) +(def-art-elt citizen-fat-ag citizen-fat-walk-ja 11) +(def-art-elt citizen-fat-ag citizen-fat-out-of-breath-ja 10) +(def-art-elt citizen-fat-ag citizen-fat-idle-to-out-of-breath-ja 9) +(def-art-elt citizen-fat-ag citizen-fat-arms-crossed-ja 8) +(def-art-elt citizen-fat-ag citizen-fat-idle-to-arms-crossed-ja 7) +(def-art-elt citizen-fat-ag citizen-fat-arms-hips-ja 6) +(def-art-elt citizen-fat-ag citizen-fat-idle-to-arms-hips-ja 5) +(def-art-elt citizen-fat-ag citizen-fat-idle-ja 4) +(def-art-elt citizen-fat-ag citizen-fat-shadow-mg 3) +(def-art-elt citizen-fat-ag citizen-fat-lod2-mg 2) +(def-art-elt citizen-fat-ag citizen-fat-lod0-mg 1) +(def-art-elt citizen-fat-ag citizen-fat-lod0-jg 0) +(def-art-elt citizen-fat-ag citizen-fat-walk2-ja 13) +(def-art-elt citizen-fat-ag citizen-fat-walk3-ja 14) +(def-art-elt citizen-fat-ag citizen-fat-run-ja 15) +(def-art-elt citizen-fat-ag citizen-fat-run2-ja 16) +(def-art-elt citizen-fat-ag citizen-fat-panic-run-ja 17) +(def-art-elt citizen-fat-ag citizen-fat-dive-forward-ja 18) +(def-art-elt citizen-fat-ag citizen-fat-hit-the-deck-ja 19) +(def-art-elt citizen-fat-ag citizen-fat-knocked-front-ja 20) +(def-art-elt citizen-fat-ag citizen-fat-knocked-front-land-ja 21) +(def-art-elt citizen-fat-ag citizen-fat-knocked-back-ja 22) +(def-art-elt citizen-fat-ag citizen-fat-knocked-back-land-ja 23) +(def-art-elt citizen-fat-ag citizen-fat-get-up-from-front-ja 24) +(def-art-elt citizen-fat-ag citizen-fat-get-up-from-back-ja 25) +(def-art-elt citizen-fat-ag citizen-fat-blue-hit-front-ja 26) +(def-art-elt citizen-fat-ag citizen-fat-blue-hit-back-ja 27) +(def-art-elt citizen-fat-ag citizen-fat-cover-head-start-ja 28) + +(def-art-elt scorpion-gun-ag scorpion-gun-idle-ja 2) +(def-art-elt scorpion-gun-ag scorpion-gun-lod0-mg 1) +(def-art-elt scorpion-gun-ag scorpion-gun-lod0-jg 0) + +(def-art-elt vol-collapsing-rock-ag vol-collapsing-rock-falling-ja 3) +(def-art-elt vol-collapsing-rock-ag vol-collapsing-rock-idle-ja 2) +(def-art-elt vol-collapsing-rock-ag vol-collapsing-rock-lod0-mg 1) +(def-art-elt vol-collapsing-rock-ag vol-collapsing-rock-lod0-jg 0) + +(def-art-elt rub-electric-gate-switch-ag rub-electric-gate-switch-idle-ja 2) +(def-art-elt rub-electric-gate-switch-ag rub-electric-gate-switch-lod0-mg 1) +(def-art-elt rub-electric-gate-switch-ag rub-electric-gate-switch-lod0-jg 0) + +(def-art-elt des-rally-bollard-ag des-rally-bollard-idle-ja 3) +(def-art-elt des-rally-bollard-ag des-rally-bollard-lod1-mg 2) +(def-art-elt des-rally-bollard-ag des-rally-bollard-lod0-mg 1) +(def-art-elt des-rally-bollard-ag des-rally-bollard-lod0-jg 0) + +(def-art-elt dm-ship-break-ag dm-ship-break-idle-ja 2) +(def-art-elt dm-ship-break-ag dm-ship-break-lod0-mg 1) +(def-art-elt dm-ship-break-ag dm-ship-break-lod0-jg 0) + +(def-art-elt scenecamera-ag scenecamera-idle-ja 2) +(def-art-elt scenecamera-ag scenecamera-lod0-mg 1) +(def-art-elt scenecamera-ag scenecamera-lod0-jg 0) + +(def-art-elt bt-jinx-ag bt-jinx-ride-ja 4) +(def-art-elt bt-jinx-ag bt-jinx-idle-ja 3) +(def-art-elt bt-jinx-ag bt-jinx-shadow-mg 2) +(def-art-elt bt-jinx-ag bt-jinx-lod0-mg 1) +(def-art-elt bt-jinx-ag bt-jinx-lod0-jg 0) + +(def-art-elt wascity-burning-bush-ag wascity-burning-bush-idle-ja 2) +(def-art-elt wascity-burning-bush-ag wascity-burning-bush-lod0-mg 1) +(def-art-elt wascity-burning-bush-ag wascity-burning-bush-lod0-jg 0) + +(def-art-elt kg-debris-ag kg-debris-d-lod0-mg 7) +(def-art-elt kg-debris-ag kg-debris-d-lod0-jg 6) +(def-art-elt kg-debris-ag kg-debris-c-lod0-mg 5) +(def-art-elt kg-debris-ag kg-debris-c-lod0-jg 4) +(def-art-elt kg-debris-ag kg-debris-b-lod0-mg 3) +(def-art-elt kg-debris-ag kg-debris-b-lod0-jg 2) +(def-art-elt kg-debris-ag kg-debris-a-lod0-mg 1) +(def-art-elt kg-debris-ag kg-debris-a-lod0-jg 0) + +(def-art-elt kor-highres-ag kor-highres-kor-idle-ja 3) +(def-art-elt kor-highres-ag kor-highres-idle-ja 2) +(def-art-elt kor-highres-ag kor-highres-lod0-mg 1) +(def-art-elt kor-highres-ag kor-highres-lod0-jg 0) + +(def-art-elt precur-bridge-a-path-break-ag precur-bridge-a-path-break-idle2-ja 3) +(def-art-elt precur-bridge-a-path-break-ag precur-bridge-a-path-break-idle-ja 2) +(def-art-elt precur-bridge-a-path-break-ag precur-bridge-a-path-break-lod0-mg 1) +(def-art-elt precur-bridge-a-path-break-ag precur-bridge-a-path-break-lod0-jg 0) + +(def-art-elt farm-sprinkler-barrels-ag farm-sprinkler-barrels-idle-ja 2) +(def-art-elt farm-sprinkler-barrels-ag farm-sprinkler-barrels-lod0-mg 1) +(def-art-elt farm-sprinkler-barrels-ag farm-sprinkler-barrels-lod0-jg 0) + +(def-art-elt sew-slide-step-ag sew-slide-step-idle-ja 2) (def-art-elt sew-slide-step-ag sew-slide-step-lod0-mg 1) (def-art-elt sew-slide-step-ag sew-slide-step-lod0-jg 0) @@ -2042,19 +1989,29 @@ (def-art-elt mech-ag mech-lod0-mg 1) (def-art-elt mech-ag mech-lod0-jg 0) (def-art-elt mech-ag mech-mech-punch-u-ja 33) -(def-art-elt mech-ag mech-mech-carry-pickup-low-ja 16) -(def-art-elt mech-ag mech-mech-punch-b-ja 15) -(def-art-elt mech-ag mech-mech-punch-r-ja 14) -(def-art-elt mech-ag mech-mech-punch-l-ja 13) -(def-art-elt mech-ag mech-mech-turn20-ja 12) -(def-art-elt mech-ag mech-mech-jump-land-ja 11) -(def-art-elt mech-ag mech-mech-jump-loop-ja 10) -(def-art-elt mech-ag mech-mech-jump-thrust-ja 9) -(def-art-elt mech-ag mech-mech-jump-ja 8) +(def-art-elt mech-ag mech-mech-death-b-ja 32) +(def-art-elt mech-ag mech-mech-death-a-ja 31) +(def-art-elt mech-ag mech-mech-get-on-ja 30) +(def-art-elt mech-ag mech-mech-get-off-ja 29) +(def-art-elt mech-ag mech-mech-hit-front-ja 28) (def-art-elt mech-ag mech-mech-turn90-ja 7) +(def-art-elt mech-ag mech-mech-dummy5-ja 36) (def-art-elt mech-ag mech-mech-walk-ja 6) +(def-art-elt mech-ag mech-mech-dummy4-ja 35) (def-art-elt mech-ag mech-mech-run-ja 5) +(def-art-elt mech-ag mech-mech-dummy3-ja 34) (def-art-elt mech-ag mech-mech-stance-ja 4) +(def-art-elt mech-ag mech-mech-dummy7-ja 38) +(def-art-elt mech-ag mech-mech-jump-thrust-ja 9) +(def-art-elt mech-ag mech-mech-jump-land-ja 11) +(def-art-elt mech-ag mech-mech-dummy6-ja 37) +(def-art-elt mech-ag mech-mech-jump-ja 8) +(def-art-elt mech-ag mech-mech-jump-loop-ja 10) +(def-art-elt mech-ag mech-mech-turn20-ja 12) +(def-art-elt mech-ag mech-mech-punch-l-ja 13) +(def-art-elt mech-ag mech-mech-punch-r-ja 14) +(def-art-elt mech-ag mech-mech-punch-b-ja 15) +(def-art-elt mech-ag mech-mech-carry-pickup-low-ja 16) (def-art-elt mech-ag mech-mech-carry-pickup-high-ja 17) (def-art-elt mech-ag mech-mech-carry-stance-ja 18) (def-art-elt mech-ag mech-mech-carry-walk-ja 19) @@ -2066,11 +2023,6 @@ (def-art-elt mech-ag mech-mech-push-ja 25) (def-art-elt mech-ag mech-mech-pull-ja 26) (def-art-elt mech-ag mech-mech-drag-pickup-ja 27) -(def-art-elt mech-ag mech-mech-hit-front-ja 28) -(def-art-elt mech-ag mech-mech-get-off-ja 29) -(def-art-elt mech-ag mech-mech-get-on-ja 30) -(def-art-elt mech-ag mech-mech-death-a-ja 31) -(def-art-elt mech-ag mech-mech-death-b-ja 32) (def-art-elt tpl-mardoor-ag tpl-mardoor-idle-ja 2) (def-art-elt tpl-mardoor-ag tpl-mardoor-lod0-mg 1) @@ -2142,55 +2094,6 @@ (def-art-elt min-bridge-ag min-bridge-lod0-mg 1) (def-art-elt min-bridge-ag min-bridge-lod0-jg 0) -(def-art-elt neo-spawner-ag neo-spawner-explode-outer-idle-ja 15) -(def-art-elt neo-spawner-ag neo-spawner-explode-outer-lod0-mg 14) -(def-art-elt neo-spawner-ag neo-spawner-explode-outer-lod0-jg 13) -(def-art-elt neo-spawner-ag neo-spawner-lod0-jg 0) -(def-art-elt neo-spawner-ag neo-spawner-lod0-mg 1) -(def-art-elt neo-spawner-ag neo-spawner-lod1-mg 2) -(def-art-elt neo-spawner-ag neo-spawner-idle-ja 3) -(def-art-elt neo-spawner-ag neo-spawner-open-idle-ja 4) -(def-art-elt neo-spawner-ag neo-spawner-closed-idle-ja 5) -(def-art-elt neo-spawner-ag neo-spawner-open-ja 6) -(def-art-elt neo-spawner-ag neo-spawner-open-angry-ja 7) -(def-art-elt neo-spawner-ag neo-spawner-spit-start-ja 8) -(def-art-elt neo-spawner-ag neo-spawner-spit-end-ja 9) -(def-art-elt neo-spawner-ag neo-spawner-explode-inner-lod0-jg 10) -(def-art-elt neo-spawner-ag neo-spawner-explode-inner-lod0-mg 11) -(def-art-elt neo-spawner-ag neo-spawner-explode-inner-idle-ja 12) - -(def-art-elt desert-transport-ag desert-transport-close-ja 5) -(def-art-elt desert-transport-ag desert-transport-open-ja 4) -(def-art-elt desert-transport-ag desert-transport-idle-ja 3) -(def-art-elt desert-transport-ag desert-transport-shadow-mg 2) -(def-art-elt desert-transport-ag desert-transport-lod0-mg 1) -(def-art-elt desert-transport-ag desert-transport-lod0-jg 0) - -(def-art-elt flamer-lava-ag flamer-lava-explode-idle-ja 23) -(def-art-elt flamer-lava-ag flamer-lava-explode-lod0-mg 22) -(def-art-elt flamer-lava-ag flamer-lava-explode-lod0-jg 21) -(def-art-elt flamer-lava-ag flamer-lava-blue-hit2-ja 20) -(def-art-elt flamer-lava-ag flamer-lava-blue-hit1-ja 19) -(def-art-elt flamer-lava-ag flamer-lava-blue-hit0-ja 18) -(def-art-elt flamer-lava-ag flamer-lava-die-in-place-ja 17) -(def-art-elt flamer-lava-ag flamer-lava-knock-back-land-ja 16) -(def-art-elt flamer-lava-ag flamer-lava-die-ja 15) -(def-art-elt flamer-lava-ag flamer-lava-knock-back-fall-ja 14) -(def-art-elt flamer-lava-ag flamer-lava-knock-back-ja 13) -(def-art-elt flamer-lava-ag flamer-lava-lod0-jg 0) -(def-art-elt flamer-lava-ag flamer-lava-lod0-mg 1) -(def-art-elt flamer-lava-ag flamer-lava-lod1-mg 2) -(def-art-elt flamer-lava-ag flamer-lava-lod2-mg 3) -(def-art-elt flamer-lava-ag flamer-lava-shadow-mg 4) -(def-art-elt flamer-lava-ag flamer-lava-idle-ja 5) -(def-art-elt flamer-lava-ag flamer-lava-fly-right-ja 6) -(def-art-elt flamer-lava-ag flamer-lava-fly-left-ja 7) -(def-art-elt flamer-lava-ag flamer-lava-fly-forward-ja 8) -(def-art-elt flamer-lava-ag flamer-lava-fly-back-ja 9) -(def-art-elt flamer-lava-ag flamer-lava-fly-straight-ja 10) -(def-art-elt flamer-lava-ag flamer-lava-shoot-ja 11) -(def-art-elt flamer-lava-ag flamer-lava-shoot1-ja 12) - (def-art-elt gun-cit-d-ag gun-cit-d-explode-idle-ja 5) (def-art-elt gun-cit-d-ag gun-cit-d-explode-lod0-mg 4) (def-art-elt gun-cit-d-ag gun-cit-d-explode-lod0-jg 3) @@ -2216,45 +2119,208 @@ (def-art-elt shield-sphere-explode-ag shield-sphere-explode-lod0-mg 1) (def-art-elt shield-sphere-explode-ag shield-sphere-explode-lod0-jg 0) -(def-art-elt kg-pickup-ag kg-pickup-idle-ja 3) -(def-art-elt kg-pickup-ag kg-pickup-shadow-mg 2) -(def-art-elt kg-pickup-ag kg-pickup-lod0-mg 1) -(def-art-elt kg-pickup-ag kg-pickup-lod0-jg 0) +(def-art-elt fac-rotfan-ag fac-rotfan-spin-ja 4) +(def-art-elt fac-rotfan-ag fac-rotfan-idle-ja 3) +(def-art-elt fac-rotfan-ag fac-rotfan-lod1-mg 2) +(def-art-elt fac-rotfan-ag fac-rotfan-lod0-mg 1) +(def-art-elt fac-rotfan-ag fac-rotfan-lod0-jg 0) -(def-art-elt kg-robot-transport-ag kg-robot-transport-idle-ja 3) -(def-art-elt kg-robot-transport-ag kg-robot-transport-shadow-mg 2) -(def-art-elt kg-robot-transport-ag kg-robot-transport-lod0-mg 1) -(def-art-elt kg-robot-transport-ag kg-robot-transport-lod0-jg 0) +(def-art-elt desw-snake-stump-ag desw-snake-stump-idle-ja 2) +(def-art-elt desw-snake-stump-ag desw-snake-stump-lod0-mg 1) +(def-art-elt desw-snake-stump-ag desw-snake-stump-lod0-jg 0) -(def-art-elt mhcity-vine-wriggler-ag mhcity-vine-wriggler-idle-ja 2) -(def-art-elt mhcity-vine-wriggler-ag mhcity-vine-wriggler-lod0-mg 1) -(def-art-elt mhcity-vine-wriggler-ag mhcity-vine-wriggler-lod0-jg 0) +(def-art-elt sew-fence-gate-ag sew-fence-gate-close-ja 4) +(def-art-elt sew-fence-gate-ag sew-fence-gate-idle-ja 3) +(def-art-elt sew-fence-gate-ag sew-fence-gate-lod1-mg 2) +(def-art-elt sew-fence-gate-ag sew-fence-gate-lod0-mg 1) +(def-art-elt sew-fence-gate-ag sew-fence-gate-lod0-jg 0) -(def-art-elt torn-highres-ag torn-highres-torn-walk-ja 7) -(def-art-elt torn-highres-ag torn-highres-idle-bar-ja 6) -(def-art-elt torn-highres-ag torn-highres-idle-booth-ja 5) -(def-art-elt torn-highres-ag torn-highres-idle-table-ja 4) -(def-art-elt torn-highres-ag torn-highres-idle-ja 3) -(def-art-elt torn-highres-ag torn-highres-shadow-mg 2) -(def-art-elt torn-highres-ag torn-highres-lod0-mg 1) -(def-art-elt torn-highres-ag torn-highres-lod0-jg 0) +(def-art-elt sew-wall-switch-ag sew-wall-switch-push-ja 3) +(def-art-elt sew-wall-switch-ag sew-wall-switch-idle-ja 2) +(def-art-elt sew-wall-switch-ag sew-wall-switch-lod0-mg 1) +(def-art-elt sew-wall-switch-ag sew-wall-switch-lod0-jg 0) -(def-art-elt krimson-wall-break-ag krimson-wall-break-b-idle-3-ja 28) -(def-art-elt krimson-wall-break-ag krimson-wall-break-b-end-2-ja 26) -(def-art-elt krimson-wall-break-ag krimson-wall-break-b-idle-2-ja 25) -(def-art-elt krimson-wall-break-ag krimson-wall-break-b-end-ja 23) -(def-art-elt krimson-wall-break-ag krimson-wall-break-b-idle-ja 22) -(def-art-elt krimson-wall-break-ag krimson-wall-break-a-end-3-ja 19) -(def-art-elt krimson-wall-break-ag krimson-wall-break-b-end-3-ja 29) -(def-art-elt krimson-wall-break-ag krimson-wall-break-lod0-jg 0) -(def-art-elt krimson-wall-break-ag krimson-wall-break-a-end-ja 13) -(def-art-elt krimson-wall-break-ag krimson-wall-break-lod0-mg 1) -(def-art-elt krimson-wall-break-ag krimson-wall-break-idle-ja 2) -(def-art-elt krimson-wall-break-ag krimson-wall-break-a-idle-2-ja 15) -(def-art-elt krimson-wall-break-ag krimson-wall-break-end-ja 3) -(def-art-elt krimson-wall-break-ag krimson-wall-break-a-end-2-ja 16) -(def-art-elt krimson-wall-break-ag krimson-wall-break-idle-2-ja 5) -(def-art-elt krimson-wall-break-ag krimson-wall-break-a-idle-3-ja 18) +(def-art-elt fac-punch-wall-ag fac-punch-wall-drop-ja 4) +(def-art-elt fac-punch-wall-ag fac-punch-wall-idle-ja 3) +(def-art-elt fac-punch-wall-ag fac-punch-wall-lod1-mg 2) +(def-art-elt fac-punch-wall-ag fac-punch-wall-lod0-mg 1) +(def-art-elt fac-punch-wall-ag fac-punch-wall-lod0-jg 0) + +(def-art-elt for-break-bridge-ag for-break-bridge-board-explode-idle-ja 14) +(def-art-elt for-break-bridge-ag for-break-bridge-board-explode-lod0-mg 13) +(def-art-elt for-break-bridge-ag for-break-bridge-board-a-lod0-jg 0) +(def-art-elt for-break-bridge-ag for-break-bridge-board-a-lod0-mg 1) +(def-art-elt for-break-bridge-ag for-break-bridge-board-a-idle-ja 2) +(def-art-elt for-break-bridge-ag for-break-bridge-board-b-lod0-jg 3) +(def-art-elt for-break-bridge-ag for-break-bridge-board-b-lod0-mg 4) +(def-art-elt for-break-bridge-ag for-break-bridge-board-b-idle-ja 5) +(def-art-elt for-break-bridge-ag for-break-bridge-board-c-lod0-jg 6) +(def-art-elt for-break-bridge-ag for-break-bridge-board-c-lod0-mg 7) +(def-art-elt for-break-bridge-ag for-break-bridge-board-c-idle-ja 8) +(def-art-elt for-break-bridge-ag for-break-bridge-board-d-lod0-jg 9) +(def-art-elt for-break-bridge-ag for-break-bridge-board-d-lod0-mg 10) +(def-art-elt for-break-bridge-ag for-break-bridge-board-d-idle-ja 11) +(def-art-elt for-break-bridge-ag for-break-bridge-board-explode-lod0-jg 12) + +(def-art-elt ctyslumc-flag-ag ctyslumc-flag-idle-ja 2) +(def-art-elt ctyslumc-flag-ag ctyslumc-flag-lod0-mg 1) +(def-art-elt ctyslumc-flag-ag ctyslumc-flag-lod0-jg 0) + +(def-art-elt gun-ag gun-gun-gun-dummy4-ja 54) +(def-art-elt gun-ag gun-gun-gun-dummy3-ja 53) +(def-art-elt gun-ag gun-gun-dark-fire-3-ja 52) +(def-art-elt gun-ag gun-gun-dark-fire-2-ja 51) +(def-art-elt gun-ag gun-gun-dark2-dark3-ja 50) +(def-art-elt gun-ag gun-gun-dark1-dark2-ja 49) +(def-art-elt gun-ag gun-gun-blue1-blue2-ja 48) +(def-art-elt gun-ag gun-gun-yellow2-yellow3-ja 47) +(def-art-elt gun-ag gun-gun-red-fire-3-ja 46) +(def-art-elt gun-ag gun-gun-blue-fire-3-single-ja 45) +(def-art-elt gun-ag gun-gun-red1-red2-ja 44) +(def-art-elt gun-ag gun-gun-blue-red-ja 43) +(def-art-elt gun-ag gun-gun-yellow-fire-2-ja 42) +(def-art-elt gun-ag gun-gun-blue-fire-3-ja 41) +(def-art-elt gun-ag gun-gun-blue-dark-ja 40) +(def-art-elt gun-ag gun-gun-yellow-red-ja 39) +(def-art-elt gun-ag gun-gun-yellow-blue-ja 38) +(def-art-elt gun-ag gun-gun-dark-yellow-ja 37) +(def-art-elt gun-ag gun-gun-red-blue-ja 36) +(def-art-elt gun-ag gun-gun-red-yellow-ja 35) +(def-art-elt gun-ag gun-gun-red-dark-ja 34) +(def-art-elt gun-ag gun-gun-blue-fire-2-ja 33) +(def-art-elt gun-ag gun-gun-yellow-fire-3-ja 32) +(def-art-elt gun-ag gun-gun-red-fire-2-ja 31) +(def-art-elt gun-ag gun-gun-yellow-fire-ja 30) +(def-art-elt gun-ag gun-gun-dark-fire-ja 29) +(def-art-elt gun-ag gun-gun-blue-fire-single-ja 28) +(def-art-elt gun-ag gun-gun-blue-fire-ja 27) +(def-art-elt gun-ag gun-idle-blue3-ja 24) +(def-art-elt gun-ag gun-nuke-lod0-jg 83) +(def-art-elt gun-ag gun-idle-blue2-ja 23) +(def-art-elt gun-ag gun-nuke-sphere-fade-ja 82) +(def-art-elt gun-ag gun-idle-blue-ja 22) +(def-art-elt gun-ag gun-nuke-sphere-idle-ja 81) +(def-art-elt gun-ag gun-idle-yellow3-ja 21) +(def-art-elt gun-ag gun-nuke-sphere-lod0-mg 80) +(def-art-elt gun-ag gun-idle-yellow2-ja 20) +(def-art-elt gun-ag gun-nuke-sphere-lod0-jg 79) +(def-art-elt gun-ag gun-idle-yellow-ja 19) +(def-art-elt gun-ag gun-red-sphere-fade-ja 78) +(def-art-elt gun-ag gun-idle-dark3-ja 18) +(def-art-elt gun-ag gun-red-sphere-burst-ja 77) +(def-art-elt gun-ag gun-idle-dark2-ja 17) +(def-art-elt gun-ag gun-red-sphere-idle-ja 76) +(def-art-elt gun-ag gun-idle-dark-ja 16) +(def-art-elt gun-ag gun-red-sphere-lod0-mg 75) +(def-art-elt gun-ag gun-idle-red3-ja 15) +(def-art-elt gun-ag gun-red-sphere-lod0-jg 74) +(def-art-elt gun-ag gun-idle-red2-ja 14) +(def-art-elt gun-ag gun-grenade-idle-ja 73) +(def-art-elt gun-ag gun-idle-red-ja 13) +(def-art-elt gun-ag gun-grenade-lod1-mg 72) +(def-art-elt gun-ag gun-ammo-yellow-lod0-jg 0) +(def-art-elt gun-ag gun-ammo-yellow-lod0-mg 1) +(def-art-elt gun-ag gun-ammo-red-lod0-jg 2) +(def-art-elt gun-ag gun-red-cone-lod0-jg 61) +(def-art-elt gun-ag gun-ammo-red-lod0-mg 3) +(def-art-elt gun-ag gun-red-cone-lod0-mg 62) +(def-art-elt gun-ag gun-ammo-blue-lod0-jg 4) +(def-art-elt gun-ag gun-red-cone-idle-ja 63) +(def-art-elt gun-ag gun-ammo-blue-lod0-mg 5) +(def-art-elt gun-ag gun-red-burst-lod0-jg 64) +(def-art-elt gun-ag gun-ammo-dark-lod0-jg 6) +(def-art-elt gun-ag gun-red-burst-lod0-mg 65) +(def-art-elt gun-ag gun-ammo-dark-lod0-mg 7) +(def-art-elt gun-ag gun-red-burst-idle-ja 66) +(def-art-elt gun-ag gun-ammo-idle-ja 8) +(def-art-elt gun-ag gun-saucer-lod0-jg 67) +(def-art-elt gun-ag gun-lod0-jg 9) +(def-art-elt gun-ag gun-saucer-lod0-mg 68) +(def-art-elt gun-ag gun-lod0-mg 10) +(def-art-elt gun-ag gun-saucer-idle-ja 69) +(def-art-elt gun-ag gun-shadow-mg 11) +(def-art-elt gun-ag gun-grenade-lod0-jg 70) +(def-art-elt gun-ag gun-idle-ja 12) +(def-art-elt gun-ag gun-grenade-lod0-mg 71) +(def-art-elt gun-ag gun-nuke-lod0-mg 84) +(def-art-elt gun-ag gun-gun-yellow-fire-low-ja 25) +(def-art-elt gun-ag gun-nuke-idle-ja 85) +(def-art-elt gun-ag gun-gun-red-fire-ja 26) +(def-art-elt gun-ag gun-suck-lod0-jg 86) +(def-art-elt gun-ag gun-suck-lod0-mg 87) +(def-art-elt gun-ag gun-suck-idle-ja 88) +(def-art-elt gun-ag gun-dark-2-ring-lod0-jg 89) +(def-art-elt gun-ag gun-dark-2-ring-lod0-mg 90) +(def-art-elt gun-ag gun-dark-2-ring-shadow-mg 91) +(def-art-elt gun-ag gun-dark-2-ring-idle-ja 92) + +(def-art-elt neo-satellite-game-ring-ag neo-satellite-game-ring-attack-ja 3) +(def-art-elt neo-satellite-game-ring-ag neo-satellite-game-ring-idle-ja 2) +(def-art-elt neo-satellite-game-ring-ag neo-satellite-game-ring-lod0-mg 1) +(def-art-elt neo-satellite-game-ring-ag neo-satellite-game-ring-lod0-jg 0) + +(def-art-elt pecker-highres-ag pecker-highres-pecker-fly-ja 5) +(def-art-elt pecker-highres-ag pecker-highres-idle-ja 3) +(def-art-elt pecker-highres-ag pecker-highres-shadow-mg 2) +(def-art-elt pecker-highres-ag pecker-highres-lod0-mg 1) +(def-art-elt pecker-highres-ag pecker-highres-lod0-jg 0) + +(def-art-elt ctywide-arrow-ag ctywide-arrow-idle-ja 2) +(def-art-elt ctywide-arrow-ag ctywide-arrow-lod0-mg 1) +(def-art-elt ctywide-arrow-ag ctywide-arrow-lod0-jg 0) + +(def-art-elt spydroid-ag spydroid-knocked1-land-ja 13) +(def-art-elt spydroid-ag spydroid-lod0-jg 0) +(def-art-elt spydroid-ag spydroid-lod0-mg 1) +(def-art-elt spydroid-ag spydroid-shadow-mg 2) +(def-art-elt spydroid-ag spydroid-idle-ja 3) +(def-art-elt spydroid-ag spydroid-walk-ja 4) +(def-art-elt spydroid-ag spydroid-run-ja 5) +(def-art-elt spydroid-ag spydroid-attack-jump-ja 6) +(def-art-elt spydroid-ag spydroid-attack-land-ja 7) +(def-art-elt spydroid-ag spydroid-jump-wind-up-ja 8) +(def-art-elt spydroid-ag spydroid-knocked0-ja 9) +(def-art-elt spydroid-ag spydroid-knocked0-land-ja 10) +(def-art-elt spydroid-ag spydroid-knocked1-ja 11) +(def-art-elt spydroid-ag spydroid-turn-180-ja 12) + +(def-art-elt min-rotating-plat-ag min-rotating-plat-idle-ja 2) +(def-art-elt min-rotating-plat-ag min-rotating-plat-lod0-mg 1) +(def-art-elt min-rotating-plat-ag min-rotating-plat-lod0-jg 0) + +(def-art-elt min-airlock-door-ag min-airlock-door-idle-ja 2) +(def-art-elt min-airlock-door-ag min-airlock-door-lod0-mg 1) +(def-art-elt min-airlock-door-ag min-airlock-door-lod0-jg 0) + +(def-art-elt mhcity-vein-writhing-large-ag mhcity-vein-writhing-large-idle-ja 2) +(def-art-elt mhcity-vein-writhing-large-ag mhcity-vein-writhing-large-lod0-mg 1) +(def-art-elt mhcity-vein-writhing-large-ag mhcity-vein-writhing-large-lod0-jg 0) + +(def-art-elt mh-bat-ag mh-bat-attack0-ja 7) +(def-art-elt mh-bat-ag mh-bat-attack0-windup-ja 6) +(def-art-elt mh-bat-ag mh-bat-fly-glide0-ja 5) +(def-art-elt mh-bat-ag mh-bat-fly-fast0-ja 4) +(def-art-elt mh-bat-ag mh-bat-ragdoll-ja 3) +(def-art-elt mh-bat-ag mh-bat-shadow-mg 2) +(def-art-elt mh-bat-ag mh-bat-lod0-mg 1) +(def-art-elt mh-bat-ag mh-bat-lod0-jg 0) + +(def-art-elt krimson-wall-break-ag krimson-wall-break-b-idle-3-ja 28) +(def-art-elt krimson-wall-break-ag krimson-wall-break-b-end-2-ja 26) +(def-art-elt krimson-wall-break-ag krimson-wall-break-b-idle-2-ja 25) +(def-art-elt krimson-wall-break-ag krimson-wall-break-b-end-ja 23) +(def-art-elt krimson-wall-break-ag krimson-wall-break-b-idle-ja 22) +(def-art-elt krimson-wall-break-ag krimson-wall-break-a-end-3-ja 19) +(def-art-elt krimson-wall-break-ag krimson-wall-break-b-end-3-ja 29) +(def-art-elt krimson-wall-break-ag krimson-wall-break-lod0-jg 0) +(def-art-elt krimson-wall-break-ag krimson-wall-break-a-end-ja 13) +(def-art-elt krimson-wall-break-ag krimson-wall-break-lod0-mg 1) +(def-art-elt krimson-wall-break-ag krimson-wall-break-idle-ja 2) +(def-art-elt krimson-wall-break-ag krimson-wall-break-a-idle-2-ja 15) +(def-art-elt krimson-wall-break-ag krimson-wall-break-end-ja 3) +(def-art-elt krimson-wall-break-ag krimson-wall-break-a-end-2-ja 16) +(def-art-elt krimson-wall-break-ag krimson-wall-break-idle-2-ja 5) +(def-art-elt krimson-wall-break-ag krimson-wall-break-a-idle-3-ja 18) (def-art-elt krimson-wall-break-ag krimson-wall-break-end-2-ja 6) (def-art-elt krimson-wall-break-ag krimson-wall-break-idle-3-ja 8) (def-art-elt krimson-wall-break-ag krimson-wall-break-end-3-ja 9) @@ -2272,28 +2338,132 @@ (def-art-elt com-power-box-ag com-power-box-lod0-mg 1) (def-art-elt com-power-box-ag com-power-box-lod0-jg 0) -(def-art-elt mh-bat-ag mh-bat-attack0-ja 7) -(def-art-elt mh-bat-ag mh-bat-attack0-windup-ja 6) -(def-art-elt mh-bat-ag mh-bat-fly-glide0-ja 5) -(def-art-elt mh-bat-ag mh-bat-fly-fast0-ja 4) -(def-art-elt mh-bat-ag mh-bat-ragdoll-ja 3) -(def-art-elt mh-bat-ag mh-bat-shadow-mg 2) -(def-art-elt mh-bat-ag mh-bat-lod0-mg 1) -(def-art-elt mh-bat-ag mh-bat-lod0-jg 0) +(def-art-elt citizen-chick-ag citizen-chick-riding-stance-ja 27) +(def-art-elt citizen-chick-ag citizen-chick-shuffle-ja 26) +(def-art-elt citizen-chick-ag citizen-chick-get-up-from-back-ja 25) +(def-art-elt citizen-chick-ag citizen-chick-get-up-from-front-ja 24) +(def-art-elt citizen-chick-ag citizen-chick-knocked-back-land-ja 23) +(def-art-elt citizen-chick-ag citizen-chick-knocked-back-ja 22) +(def-art-elt citizen-chick-ag citizen-chick-knocked-front-land-ja 21) +(def-art-elt citizen-chick-ag citizen-chick-knocked-front-ja 20) +(def-art-elt citizen-chick-ag citizen-chick-blue-hit-back-ja 19) +(def-art-elt citizen-chick-ag citizen-chick-blue-hit-front-ja 18) +(def-art-elt citizen-chick-ag citizen-chick-dive-forward-ja 17) +(def-art-elt citizen-chick-ag citizen-chick-cover-head-end-ja 16) +(def-art-elt citizen-chick-ag citizen-chick-cover-head-loop-ja 15) +(def-art-elt citizen-chick-ag citizen-chick-cover-head-start-ja 14) +(def-art-elt citizen-chick-ag citizen-chick-hit-the-deck-ja 13) +(def-art-elt citizen-chick-ag citizen-chick-lod0-jg 0) +(def-art-elt citizen-chick-ag citizen-chick-lod0-mg 1) +(def-art-elt citizen-chick-ag citizen-chick-lod2-mg 2) +(def-art-elt citizen-chick-ag citizen-chick-shadow-mg 3) +(def-art-elt citizen-chick-ag citizen-chick-walk-ja 4) +(def-art-elt citizen-chick-ag citizen-chick-walk2-ja 5) +(def-art-elt citizen-chick-ag citizen-chick-walk3-ja 6) +(def-art-elt citizen-chick-ag citizen-chick-run-ja 7) +(def-art-elt citizen-chick-ag citizen-chick-run2-ja 8) +(def-art-elt citizen-chick-ag citizen-chick-run3-ja 9) +(def-art-elt citizen-chick-ag citizen-chick-idle-ja 10) +(def-art-elt citizen-chick-ag citizen-chick-panic-run-ja 11) +(def-art-elt citizen-chick-ag citizen-chick-tread-water-ja 12) -(def-art-elt fac-rotfan-ag fac-rotfan-spin-ja 4) -(def-art-elt fac-rotfan-ag fac-rotfan-idle-ja 3) -(def-art-elt fac-rotfan-ag fac-rotfan-lod1-mg 2) -(def-art-elt fac-rotfan-ag fac-rotfan-lod0-mg 1) -(def-art-elt fac-rotfan-ag fac-rotfan-lod0-jg 0) +(def-art-elt faccar-ag faccar-idle-ja 11) +(def-art-elt faccar-ag faccar-shadow-mg 10) +(def-art-elt faccar-ag faccar-lod0-mg 9) +(def-art-elt faccar-ag faccar-lod0-jg 8) +(def-art-elt faccar-ag faccar-wheel-blur-idle-ja 7) +(def-art-elt faccar-ag faccar-wheel-blur-shadow-mg 6) +(def-art-elt faccar-ag faccar-wheel-blur-lod0-mg 5) +(def-art-elt faccar-ag faccar-wheel-blur-lod0-jg 4) +(def-art-elt faccar-ag faccar-wheel-idle-ja 3) +(def-art-elt faccar-ag faccar-wheel-shadow-mg 2) +(def-art-elt faccar-ag faccar-wheel-lod0-mg 1) +(def-art-elt faccar-ag faccar-wheel-lod0-jg 0) -(def-art-elt wascity-skeet-b-ag wascity-skeet-b-explode-idle-ja 6) -(def-art-elt wascity-skeet-b-ag wascity-skeet-b-explode-lod0-mg 5) -(def-art-elt wascity-skeet-b-ag wascity-skeet-b-explode-lod0-jg 4) -(def-art-elt wascity-skeet-b-ag wascity-skeet-b-idle-ja 3) -(def-art-elt wascity-skeet-b-ag wascity-skeet-b-shadow-mg 2) -(def-art-elt wascity-skeet-b-ag wascity-skeet-b-lod0-mg 1) -(def-art-elt wascity-skeet-b-ag wascity-skeet-b-lod0-jg 0) +(def-art-elt nst-metalhead-eggs-b-ag nst-metalhead-eggs-b-idle-ja 4) +(def-art-elt nst-metalhead-eggs-b-ag nst-metalhead-eggs-b-lod2-mg 3) +(def-art-elt nst-metalhead-eggs-b-ag nst-metalhead-eggs-b-lod1-mg 2) +(def-art-elt nst-metalhead-eggs-b-ag nst-metalhead-eggs-b-lod0-mg 1) +(def-art-elt nst-metalhead-eggs-b-ag nst-metalhead-eggs-b-lod0-jg 0) + +(def-art-elt manta-ag manta-glide-end-ja 22) +(def-art-elt manta-ag manta-attack-end-ja 21) +(def-art-elt manta-ag manta-attack-start-ja 20) +(def-art-elt manta-ag manta-falling-death-land-phase-out-ja 19) +(def-art-elt manta-ag manta-falling-death-land-ja 18) +(def-art-elt manta-ag manta-falling-death-fade-ja 17) +(def-art-elt manta-ag manta-falling-death-ja 16) +(def-art-elt manta-ag manta-knocked-blue-recover-ja 15) +(def-art-elt manta-ag manta-knocked-blue-ja 14) +(def-art-elt manta-ag manta-knocked0-ja 13) +(def-art-elt manta-ag manta-lod0-jg 0) +(def-art-elt manta-ag manta-lod0-mg 1) +(def-art-elt manta-ag manta-shadow-mg 2) +(def-art-elt manta-ag manta-idle0-ja 3) +(def-art-elt manta-ag manta-idle1-ja 4) +(def-art-elt manta-ag manta-go-alert-ja 5) +(def-art-elt manta-ag manta-alert-idle-ja 6) +(def-art-elt manta-ag manta-alert-to-fly-ja 7) +(def-art-elt manta-ag manta-flap-ja 8) +(def-art-elt manta-ag manta-flap1-ja 9) +(def-art-elt manta-ag manta-flap-fast-ja 10) +(def-art-elt manta-ag manta-flap-back-ja 11) +(def-art-elt manta-ag manta-land-ja 12) + +(def-art-elt wstd-flag-ag wstd-flag-idle-ja 2) +(def-art-elt wstd-flag-ag wstd-flag-lod0-mg 1) +(def-art-elt wstd-flag-ag wstd-flag-lod0-jg 0) + +(def-art-elt for-telescope-ag for-telescope-idle-ja 2) +(def-art-elt for-telescope-ag for-telescope-lod0-mg 1) +(def-art-elt for-telescope-ag for-telescope-lod0-jg 0) + +(def-art-elt cav-pillar-ag cav-pillar-debris-d-idle-ja 23) +(def-art-elt cav-pillar-ag cav-pillar-debris-d-lod0-mg 22) +(def-art-elt cav-pillar-ag cav-pillar-debris-d-lod0-jg 21) +(def-art-elt cav-pillar-ag cav-pillar-debris-c-idle-ja 20) +(def-art-elt cav-pillar-ag cav-pillar-debris-c-lod0-mg 19) +(def-art-elt cav-pillar-ag cav-pillar-debris-c-lod0-jg 18) +(def-art-elt cav-pillar-ag cav-pillar-debris-b-idle-ja 17) +(def-art-elt cav-pillar-ag cav-pillar-debris-b-lod0-mg 16) +(def-art-elt cav-pillar-ag cav-pillar-debris-b-lod0-jg 15) +(def-art-elt cav-pillar-ag cav-pillar-debris-a-idle-ja 14) +(def-art-elt cav-pillar-ag cav-pillar-debris-a-lod0-mg 13) +(def-art-elt cav-pillar-ag cav-pillar-lod0-jg 0) +(def-art-elt cav-pillar-ag cav-pillar-lod0-mg 1) +(def-art-elt cav-pillar-ag cav-pillar-idle-ja 2) +(def-art-elt cav-pillar-ag cav-pillar-b-lod0-jg 3) +(def-art-elt cav-pillar-ag cav-pillar-b-lod0-mg 4) +(def-art-elt cav-pillar-ag cav-pillar-b-idle-ja 5) +(def-art-elt cav-pillar-ag cav-pillar-c-lod0-jg 6) +(def-art-elt cav-pillar-ag cav-pillar-c-lod0-mg 7) +(def-art-elt cav-pillar-ag cav-pillar-c-idle-ja 8) +(def-art-elt cav-pillar-ag cav-pillar-d-lod0-jg 9) +(def-art-elt cav-pillar-ag cav-pillar-d-lod0-mg 10) +(def-art-elt cav-pillar-ag cav-pillar-d-idle-ja 11) +(def-art-elt cav-pillar-ag cav-pillar-debris-a-lod0-jg 12) + +(def-art-elt tpl-spike-trap-ag tpl-spike-trap-down-ja 4) +(def-art-elt tpl-spike-trap-ag tpl-spike-trap-up-ja 3) +(def-art-elt tpl-spike-trap-ag tpl-spike-trap-idle-ja 2) +(def-art-elt tpl-spike-trap-ag tpl-spike-trap-lod0-mg 1) +(def-art-elt tpl-spike-trap-ag tpl-spike-trap-lod0-jg 0) + +(def-art-elt water-anim-waspala-ag water-anim-waspala-idle-ja 8) +(def-art-elt water-anim-waspala-ag water-anim-waspala-frontwindowwall-lod0-mg 7) +(def-art-elt water-anim-waspala-ag water-anim-waspala-frontwindowwall-lod0-jg 6) +(def-art-elt water-anim-waspala-ag water-anim-waspala-frontthrone-lod0-mg 5) +(def-art-elt water-anim-waspala-ag water-anim-waspala-frontthrone-lod0-jg 4) +(def-art-elt water-anim-waspala-ag water-anim-waspala-windowwall-lod0-mg 3) +(def-art-elt water-anim-waspala-ag water-anim-waspala-windowwall-lod0-jg 2) +(def-art-elt water-anim-waspala-ag water-anim-waspala-thronesec-lod0-mg 1) +(def-art-elt water-anim-waspala-ag water-anim-waspala-thronesec-lod0-jg 0) + +(def-art-elt cty-missile-launcher-ag cty-missile-launcher-recoil-ja 4) +(def-art-elt cty-missile-launcher-ag cty-missile-launcher-idle-ja 3) +(def-art-elt cty-missile-launcher-ag cty-missile-launcher-lod1-mg 2) +(def-art-elt cty-missile-launcher-ag cty-missile-launcher-lod0-mg 1) +(def-art-elt cty-missile-launcher-ag cty-missile-launcher-lod0-jg 0) (def-art-elt sew-elevator-ag sew-elevator-idle-ja 3) (def-art-elt sew-elevator-ag sew-elevator-lod1-mg 2) @@ -2317,166 +2487,68 @@ (def-art-elt evilsis-ag evilsis-lod0-mg 1) (def-art-elt evilsis-ag evilsis-lod0-jg 0) -(def-art-elt fac-move-plat-b-ag fac-move-plat-b-idle-ja 2) -(def-art-elt fac-move-plat-b-ag fac-move-plat-b-lod0-mg 1) -(def-art-elt fac-move-plat-b-ag fac-move-plat-b-lod0-jg 0) - -(def-art-elt onin-highres-ag onin-highres-onin-idle-ja 6) -(def-art-elt onin-highres-ag onin-highres-idle-wakeup-ja 5) -(def-art-elt onin-highres-ag onin-highres-idle-sleep-ja 4) -(def-art-elt onin-highres-ag onin-highres-idle-ja 3) -(def-art-elt onin-highres-ag onin-highres-shadow-mg 2) -(def-art-elt onin-highres-ag onin-highres-lod0-mg 1) -(def-art-elt onin-highres-ag onin-highres-lod0-jg 0) - -(def-art-elt gun-kg-target-ag gun-kg-target-explode-idle-ja 6) -(def-art-elt gun-kg-target-ag gun-kg-target-explode-lod0-mg 5) -(def-art-elt gun-kg-target-ag gun-kg-target-explode-lod0-jg 4) -(def-art-elt gun-kg-target-ag gun-kg-target-recoil-ja 3) -(def-art-elt gun-kg-target-ag gun-kg-target-idle-ja 2) -(def-art-elt gun-kg-target-ag gun-kg-target-lod0-mg 1) -(def-art-elt gun-kg-target-ag gun-kg-target-lod0-jg 0) - -(def-art-elt monster-frog-ag monster-frog-knocked1-land-ja 33) -(def-art-elt monster-frog-ag monster-frog-knocked1-ja 32) -(def-art-elt monster-frog-ag monster-frog-knocked0-land-ja 31) -(def-art-elt monster-frog-ag monster-frog-knocked0-ja 30) -(def-art-elt monster-frog-ag monster-frog-knocked-yellow-right-land-ja 29) -(def-art-elt monster-frog-ag monster-frog-rotate-right-start-ja 12) -(def-art-elt monster-frog-ag monster-frog-rotate-left-start-ja 11) -(def-art-elt monster-frog-ag monster-frog-notice0-land-ja 10) -(def-art-elt monster-frog-ag monster-frog-notice0-jump-ja 9) -(def-art-elt monster-frog-ag monster-frog-notice0-ja 8) -(def-art-elt monster-frog-ag monster-frog-submerge0-ja 7) -(def-art-elt monster-frog-ag monster-frog-popup0-ja 6) -(def-art-elt monster-frog-ag monster-frog-idle1-ja 5) -(def-art-elt monster-frog-ag monster-frog-idle0-ja 4) -(def-art-elt monster-frog-ag monster-frog-shadow-mg 3) -(def-art-elt monster-frog-ag monster-frog-lod1-mg 2) -(def-art-elt monster-frog-ag monster-frog-lod0-mg 1) -(def-art-elt monster-frog-ag monster-frog-lod0-jg 0) -(def-art-elt monster-frog-ag monster-frog-rotate-left-end-ja 13) -(def-art-elt monster-frog-ag monster-frog-hop-small-start-ja 14) -(def-art-elt monster-frog-ag monster-frog-hop-small-end-ja 15) -(def-art-elt monster-frog-ag monster-frog-hop-slow-start-ja 16) -(def-art-elt monster-frog-ag monster-frog-hop-slow-end-ja 17) -(def-art-elt monster-frog-ag monster-frog-hop-fast-start-ja 18) -(def-art-elt monster-frog-ag monster-frog-hop-fast-end-ja 19) -(def-art-elt monster-frog-ag monster-frog-attack0-start-ja 20) -(def-art-elt monster-frog-ag monster-frog-attack0-end-ja 21) -(def-art-elt monster-frog-ag monster-frog-blue-hit0-ja 22) -(def-art-elt monster-frog-ag monster-frog-blue-hit0-land-ja 23) -(def-art-elt monster-frog-ag monster-frog-blue-hit1-ja 24) -(def-art-elt monster-frog-ag monster-frog-blue-hit1-land-ja 25) -(def-art-elt monster-frog-ag monster-frog-knocked-yellow-left-ja 26) -(def-art-elt monster-frog-ag monster-frog-knocked-yellow-left-land-ja 27) -(def-art-elt monster-frog-ag monster-frog-knocked-yellow-right-ja 28) - -(def-art-elt robo-hover-ag robo-hover-base-ja 9) -(def-art-elt robo-hover-ag robo-hover-ragdoll-ja 8) -(def-art-elt robo-hover-ag robo-hover-shoot0-ja 7) -(def-art-elt robo-hover-ag robo-hover-fly-right-ja 6) -(def-art-elt robo-hover-ag robo-hover-fly-left-ja 5) -(def-art-elt robo-hover-ag robo-hover-fly-back-ja 4) -(def-art-elt robo-hover-ag robo-hover-fly-forward-ja 3) -(def-art-elt robo-hover-ag robo-hover-idle-ja 2) -(def-art-elt robo-hover-ag robo-hover-lod0-mg 1) -(def-art-elt robo-hover-ag robo-hover-lod0-jg 0) - -(def-art-elt neo-satellite-shield-ag neo-satellite-shield-end-ja 5) -(def-art-elt neo-satellite-shield-ag neo-satellite-shield-hit-ja 4) -(def-art-elt neo-satellite-shield-ag neo-satellite-shield-start-ja 3) -(def-art-elt neo-satellite-shield-ag neo-satellite-shield-idle-ja 2) -(def-art-elt neo-satellite-shield-ag neo-satellite-shield-lod0-mg 1) -(def-art-elt neo-satellite-shield-ag neo-satellite-shield-lod0-jg 0) - -(def-art-elt for-telescope-fma-ag for-telescope-fma-idle-ja 2) -(def-art-elt for-telescope-fma-ag for-telescope-fma-lod0-mg 1) -(def-art-elt for-telescope-fma-ag for-telescope-fma-lod0-jg 0) - -(def-art-elt ottsel-tess-ag ottsel-tess-idle-ja 3) -(def-art-elt ottsel-tess-ag ottsel-tess-shadow-mg 2) -(def-art-elt ottsel-tess-ag ottsel-tess-lod0-mg 1) -(def-art-elt ottsel-tess-ag ottsel-tess-lod0-jg 0) -(def-art-elt ottsel-tess-ag ottsel-tess-ottess-idle-ja 4) - -(def-art-elt red-crimson-guard-highres-ag red-crimson-guard-highres-red-crimson-guard-walk-ja 2) -(def-art-elt red-crimson-guard-highres-ag red-crimson-guard-highres-lod0-mg 1) -(def-art-elt red-crimson-guard-highres-ag red-crimson-guard-highres-lod0-jg 0) - -(def-art-elt ashelin-highres-ag ashelin-highres-ashelin-walk-ja 5) -(def-art-elt ashelin-highres-ag ashelin-highres-idle-stand-ja 4) -(def-art-elt ashelin-highres-ag ashelin-highres-idle-ja 3) -(def-art-elt ashelin-highres-ag ashelin-highres-shadow-mg 2) -(def-art-elt ashelin-highres-ag ashelin-highres-lod0-mg 1) -(def-art-elt ashelin-highres-ag ashelin-highres-lod0-jg 0) - -(def-art-elt citizen-fat-ag citizen-fat-tread-water-ja 32) -(def-art-elt citizen-fat-ag citizen-fat-riding-stance-ja 31) -(def-art-elt citizen-fat-ag citizen-fat-cover-head-end-ja 30) -(def-art-elt citizen-fat-ag citizen-fat-cover-head-loop-ja 29) -(def-art-elt citizen-fat-ag citizen-fat-shuffle-ja 12) -(def-art-elt citizen-fat-ag citizen-fat-walk-ja 11) -(def-art-elt citizen-fat-ag citizen-fat-out-of-breath-ja 10) -(def-art-elt citizen-fat-ag citizen-fat-idle-to-out-of-breath-ja 9) -(def-art-elt citizen-fat-ag citizen-fat-arms-crossed-ja 8) -(def-art-elt citizen-fat-ag citizen-fat-idle-to-arms-crossed-ja 7) -(def-art-elt citizen-fat-ag citizen-fat-arms-hips-ja 6) -(def-art-elt citizen-fat-ag citizen-fat-idle-to-arms-hips-ja 5) -(def-art-elt citizen-fat-ag citizen-fat-idle-ja 4) -(def-art-elt citizen-fat-ag citizen-fat-shadow-mg 3) -(def-art-elt citizen-fat-ag citizen-fat-lod2-mg 2) -(def-art-elt citizen-fat-ag citizen-fat-lod0-mg 1) -(def-art-elt citizen-fat-ag citizen-fat-lod0-jg 0) -(def-art-elt citizen-fat-ag citizen-fat-walk2-ja 13) -(def-art-elt citizen-fat-ag citizen-fat-walk3-ja 14) -(def-art-elt citizen-fat-ag citizen-fat-run-ja 15) -(def-art-elt citizen-fat-ag citizen-fat-run2-ja 16) -(def-art-elt citizen-fat-ag citizen-fat-panic-run-ja 17) -(def-art-elt citizen-fat-ag citizen-fat-dive-forward-ja 18) -(def-art-elt citizen-fat-ag citizen-fat-hit-the-deck-ja 19) -(def-art-elt citizen-fat-ag citizen-fat-knocked-front-ja 20) -(def-art-elt citizen-fat-ag citizen-fat-knocked-front-land-ja 21) -(def-art-elt citizen-fat-ag citizen-fat-knocked-back-ja 22) -(def-art-elt citizen-fat-ag citizen-fat-knocked-back-land-ja 23) -(def-art-elt citizen-fat-ag citizen-fat-get-up-from-front-ja 24) -(def-art-elt citizen-fat-ag citizen-fat-get-up-from-back-ja 25) -(def-art-elt citizen-fat-ag citizen-fat-blue-hit-front-ja 26) -(def-art-elt citizen-fat-ag citizen-fat-blue-hit-back-ja 27) -(def-art-elt citizen-fat-ag citizen-fat-cover-head-start-ja 28) - -(def-art-elt scorpion-gun-ag scorpion-gun-idle-ja 2) -(def-art-elt scorpion-gun-ag scorpion-gun-lod0-mg 1) -(def-art-elt scorpion-gun-ag scorpion-gun-lod0-jg 0) - -(def-art-elt vol-collapsing-rock-ag vol-collapsing-rock-falling-ja 3) -(def-art-elt vol-collapsing-rock-ag vol-collapsing-rock-idle-ja 2) -(def-art-elt vol-collapsing-rock-ag vol-collapsing-rock-lod0-mg 1) -(def-art-elt vol-collapsing-rock-ag vol-collapsing-rock-lod0-jg 0) - -(def-art-elt rub-electric-gate-switch-ag rub-electric-gate-switch-idle-ja 2) -(def-art-elt rub-electric-gate-switch-ag rub-electric-gate-switch-lod0-mg 1) -(def-art-elt rub-electric-gate-switch-ag rub-electric-gate-switch-lod0-jg 0) +(def-art-elt wascity-skeet-b-ag wascity-skeet-b-explode-idle-ja 6) +(def-art-elt wascity-skeet-b-ag wascity-skeet-b-explode-lod0-mg 5) +(def-art-elt wascity-skeet-b-ag wascity-skeet-b-explode-lod0-jg 4) +(def-art-elt wascity-skeet-b-ag wascity-skeet-b-idle-ja 3) +(def-art-elt wascity-skeet-b-ag wascity-skeet-b-shadow-mg 2) +(def-art-elt wascity-skeet-b-ag wascity-skeet-b-lod0-mg 1) +(def-art-elt wascity-skeet-b-ag wascity-skeet-b-lod0-jg 0) -(def-art-elt des-rally-bollard-ag des-rally-bollard-idle-ja 3) -(def-art-elt des-rally-bollard-ag des-rally-bollard-lod1-mg 2) -(def-art-elt des-rally-bollard-ag des-rally-bollard-lod0-mg 1) -(def-art-elt des-rally-bollard-ag des-rally-bollard-lod0-jg 0) +(def-art-elt fac-move-plat-b-ag fac-move-plat-b-idle-ja 2) +(def-art-elt fac-move-plat-b-ag fac-move-plat-b-lod0-mg 1) +(def-art-elt fac-move-plat-b-ag fac-move-plat-b-lod0-jg 0) -(def-art-elt dm-ship-break-ag dm-ship-break-idle-ja 2) -(def-art-elt dm-ship-break-ag dm-ship-break-lod0-mg 1) -(def-art-elt dm-ship-break-ag dm-ship-break-lod0-jg 0) +(def-art-elt onin-highres-ag onin-highres-onin-idle-ja 6) +(def-art-elt onin-highres-ag onin-highres-idle-wakeup-ja 5) +(def-art-elt onin-highres-ag onin-highres-idle-sleep-ja 4) +(def-art-elt onin-highres-ag onin-highres-idle-ja 3) +(def-art-elt onin-highres-ag onin-highres-shadow-mg 2) +(def-art-elt onin-highres-ag onin-highres-lod0-mg 1) +(def-art-elt onin-highres-ag onin-highres-lod0-jg 0) -(def-art-elt farm-cabbage-ag farm-cabbage-explode-idle-ja 5) -(def-art-elt farm-cabbage-ag farm-cabbage-explode-lod0-mg 4) -(def-art-elt farm-cabbage-ag farm-cabbage-explode-lod0-jg 3) -(def-art-elt farm-cabbage-ag farm-cabbage-idle-ja 2) -(def-art-elt farm-cabbage-ag farm-cabbage-lod0-mg 1) -(def-art-elt farm-cabbage-ag farm-cabbage-lod0-jg 0) +(def-art-elt gun-kg-target-ag gun-kg-target-explode-idle-ja 6) +(def-art-elt gun-kg-target-ag gun-kg-target-explode-lod0-mg 5) +(def-art-elt gun-kg-target-ag gun-kg-target-explode-lod0-jg 4) +(def-art-elt gun-kg-target-ag gun-kg-target-recoil-ja 3) +(def-art-elt gun-kg-target-ag gun-kg-target-idle-ja 2) +(def-art-elt gun-kg-target-ag gun-kg-target-lod0-mg 1) +(def-art-elt gun-kg-target-ag gun-kg-target-lod0-jg 0) -(def-art-elt cty-fruit-stand-ag cty-fruit-stand-idle-ja 2) -(def-art-elt cty-fruit-stand-ag cty-fruit-stand-lod0-mg 1) -(def-art-elt cty-fruit-stand-ag cty-fruit-stand-lod0-jg 0) +(def-art-elt monster-frog-ag monster-frog-knocked1-land-ja 33) +(def-art-elt monster-frog-ag monster-frog-knocked1-ja 32) +(def-art-elt monster-frog-ag monster-frog-knocked0-land-ja 31) +(def-art-elt monster-frog-ag monster-frog-knocked0-ja 30) +(def-art-elt monster-frog-ag monster-frog-knocked-yellow-right-land-ja 29) +(def-art-elt monster-frog-ag monster-frog-rotate-right-start-ja 12) +(def-art-elt monster-frog-ag monster-frog-rotate-left-start-ja 11) +(def-art-elt monster-frog-ag monster-frog-notice0-land-ja 10) +(def-art-elt monster-frog-ag monster-frog-notice0-jump-ja 9) +(def-art-elt monster-frog-ag monster-frog-notice0-ja 8) +(def-art-elt monster-frog-ag monster-frog-submerge0-ja 7) +(def-art-elt monster-frog-ag monster-frog-popup0-ja 6) +(def-art-elt monster-frog-ag monster-frog-idle1-ja 5) +(def-art-elt monster-frog-ag monster-frog-idle0-ja 4) +(def-art-elt monster-frog-ag monster-frog-shadow-mg 3) +(def-art-elt monster-frog-ag monster-frog-lod1-mg 2) +(def-art-elt monster-frog-ag monster-frog-lod0-mg 1) +(def-art-elt monster-frog-ag monster-frog-lod0-jg 0) +(def-art-elt monster-frog-ag monster-frog-rotate-left-end-ja 13) +(def-art-elt monster-frog-ag monster-frog-hop-small-start-ja 14) +(def-art-elt monster-frog-ag monster-frog-hop-small-end-ja 15) +(def-art-elt monster-frog-ag monster-frog-hop-slow-start-ja 16) +(def-art-elt monster-frog-ag monster-frog-hop-slow-end-ja 17) +(def-art-elt monster-frog-ag monster-frog-hop-fast-start-ja 18) +(def-art-elt monster-frog-ag monster-frog-hop-fast-end-ja 19) +(def-art-elt monster-frog-ag monster-frog-attack0-start-ja 20) +(def-art-elt monster-frog-ag monster-frog-attack0-end-ja 21) +(def-art-elt monster-frog-ag monster-frog-blue-hit0-ja 22) +(def-art-elt monster-frog-ag monster-frog-blue-hit0-land-ja 23) +(def-art-elt monster-frog-ag monster-frog-blue-hit1-ja 24) +(def-art-elt monster-frog-ag monster-frog-blue-hit1-land-ja 25) +(def-art-elt monster-frog-ag monster-frog-knocked-yellow-left-ja 26) +(def-art-elt monster-frog-ag monster-frog-knocked-yellow-left-land-ja 27) +(def-art-elt monster-frog-ag monster-frog-knocked-yellow-right-ja 28) (def-art-elt cty-homing-missile-ag cty-homing-missile-idle-ja 2) (def-art-elt cty-homing-missile-ag cty-homing-missile-lod0-mg 1) @@ -2508,148 +2580,6 @@ (def-art-elt fac-gun-tower-turret-ag fac-gun-tower-turret-lod0-mg 1) (def-art-elt fac-gun-tower-turret-ag fac-gun-tower-turret-lod0-jg 0) -(def-art-elt desw-snake-stump-ag desw-snake-stump-idle-ja 2) -(def-art-elt desw-snake-stump-ag desw-snake-stump-lod0-mg 1) -(def-art-elt desw-snake-stump-ag desw-snake-stump-lod0-jg 0) - -(def-art-elt sew-fence-gate-ag sew-fence-gate-close-ja 4) -(def-art-elt sew-fence-gate-ag sew-fence-gate-idle-ja 3) -(def-art-elt sew-fence-gate-ag sew-fence-gate-lod1-mg 2) -(def-art-elt sew-fence-gate-ag sew-fence-gate-lod0-mg 1) -(def-art-elt sew-fence-gate-ag sew-fence-gate-lod0-jg 0) - -(def-art-elt sew-wall-switch-ag sew-wall-switch-push-ja 3) -(def-art-elt sew-wall-switch-ag sew-wall-switch-idle-ja 2) -(def-art-elt sew-wall-switch-ag sew-wall-switch-lod0-mg 1) -(def-art-elt sew-wall-switch-ag sew-wall-switch-lod0-jg 0) - -(def-art-elt fac-punch-wall-ag fac-punch-wall-drop-ja 4) -(def-art-elt fac-punch-wall-ag fac-punch-wall-idle-ja 3) -(def-art-elt fac-punch-wall-ag fac-punch-wall-lod1-mg 2) -(def-art-elt fac-punch-wall-ag fac-punch-wall-lod0-mg 1) -(def-art-elt fac-punch-wall-ag fac-punch-wall-lod0-jg 0) - -(def-art-elt for-break-bridge-ag for-break-bridge-board-explode-idle-ja 14) -(def-art-elt for-break-bridge-ag for-break-bridge-board-explode-lod0-mg 13) -(def-art-elt for-break-bridge-ag for-break-bridge-board-a-lod0-jg 0) -(def-art-elt for-break-bridge-ag for-break-bridge-board-a-lod0-mg 1) -(def-art-elt for-break-bridge-ag for-break-bridge-board-a-idle-ja 2) -(def-art-elt for-break-bridge-ag for-break-bridge-board-b-lod0-jg 3) -(def-art-elt for-break-bridge-ag for-break-bridge-board-b-lod0-mg 4) -(def-art-elt for-break-bridge-ag for-break-bridge-board-b-idle-ja 5) -(def-art-elt for-break-bridge-ag for-break-bridge-board-c-lod0-jg 6) -(def-art-elt for-break-bridge-ag for-break-bridge-board-c-lod0-mg 7) -(def-art-elt for-break-bridge-ag for-break-bridge-board-c-idle-ja 8) -(def-art-elt for-break-bridge-ag for-break-bridge-board-d-lod0-jg 9) -(def-art-elt for-break-bridge-ag for-break-bridge-board-d-lod0-mg 10) -(def-art-elt for-break-bridge-ag for-break-bridge-board-d-idle-ja 11) -(def-art-elt for-break-bridge-ag for-break-bridge-board-explode-lod0-jg 12) - -(def-art-elt ctyslumc-flag-ag ctyslumc-flag-idle-ja 2) -(def-art-elt ctyslumc-flag-ag ctyslumc-flag-lod0-mg 1) -(def-art-elt ctyslumc-flag-ag ctyslumc-flag-lod0-jg 0) - -(def-art-elt purple-one-ag purple-one-idle-ja 2) -(def-art-elt purple-one-ag purple-one-lod0-mg 1) -(def-art-elt purple-one-ag purple-one-lod0-jg 0) - -(def-art-elt pecker-ingame-ag pecker-ingame-fly-ja 4) -(def-art-elt pecker-ingame-ag pecker-ingame-idle-ja 3) -(def-art-elt pecker-ingame-ag pecker-ingame-shadow-mg 2) -(def-art-elt pecker-ingame-ag pecker-ingame-lod0-mg 1) -(def-art-elt pecker-ingame-ag pecker-ingame-lod0-jg 0) - -(def-art-elt gun-ag gun-gun-dark-fire-3-ja 52) -(def-art-elt gun-ag gun-gun-dark-fire-2-ja 51) -(def-art-elt gun-ag gun-gun-dark2-dark3-ja 50) -(def-art-elt gun-ag gun-gun-dark1-dark2-ja 49) -(def-art-elt gun-ag gun-gun-blue1-blue2-ja 48) -(def-art-elt gun-ag gun-gun-yellow2-yellow3-ja 47) -(def-art-elt gun-ag gun-gun-red-fire-3-ja 46) -(def-art-elt gun-ag gun-gun-blue-fire-3-single-ja 45) -(def-art-elt gun-ag gun-gun-red1-red2-ja 44) -(def-art-elt gun-ag gun-gun-blue-red-ja 43) -(def-art-elt gun-ag gun-gun-yellow-fire-2-ja 42) -(def-art-elt gun-ag gun-gun-blue-fire-3-ja 41) -(def-art-elt gun-ag gun-gun-blue-dark-ja 40) -(def-art-elt gun-ag gun-gun-yellow-red-ja 39) -(def-art-elt gun-ag gun-gun-yellow-blue-ja 38) -(def-art-elt gun-ag gun-gun-dark-yellow-ja 37) -(def-art-elt gun-ag gun-gun-red-blue-ja 36) -(def-art-elt gun-ag gun-gun-red-yellow-ja 35) -(def-art-elt gun-ag gun-gun-red-dark-ja 34) -(def-art-elt gun-ag gun-gun-blue-fire-2-ja 33) -(def-art-elt gun-ag gun-gun-yellow-fire-3-ja 32) -(def-art-elt gun-ag gun-gun-red-fire-2-ja 31) -(def-art-elt gun-ag gun-gun-yellow-fire-ja 30) -(def-art-elt gun-ag gun-gun-dark-fire-ja 29) -(def-art-elt gun-ag gun-gun-blue-fire-single-ja 28) -(def-art-elt gun-ag gun-gun-blue-fire-ja 27) -(def-art-elt gun-ag gun-idle-blue3-ja 24) -(def-art-elt gun-ag gun-nuke-lod0-jg 83) -(def-art-elt gun-ag gun-idle-blue2-ja 23) -(def-art-elt gun-ag gun-nuke-sphere-fade-ja 82) -(def-art-elt gun-ag gun-idle-blue-ja 22) -(def-art-elt gun-ag gun-nuke-sphere-idle-ja 81) -(def-art-elt gun-ag gun-idle-yellow3-ja 21) -(def-art-elt gun-ag gun-nuke-sphere-lod0-mg 80) -(def-art-elt gun-ag gun-idle-yellow2-ja 20) -(def-art-elt gun-ag gun-nuke-sphere-lod0-jg 79) -(def-art-elt gun-ag gun-idle-yellow-ja 19) -(def-art-elt gun-ag gun-red-sphere-fade-ja 78) -(def-art-elt gun-ag gun-idle-dark3-ja 18) -(def-art-elt gun-ag gun-red-sphere-burst-ja 77) -(def-art-elt gun-ag gun-idle-dark2-ja 17) -(def-art-elt gun-ag gun-red-sphere-idle-ja 76) -(def-art-elt gun-ag gun-idle-dark-ja 16) -(def-art-elt gun-ag gun-red-sphere-lod0-mg 75) -(def-art-elt gun-ag gun-idle-red3-ja 15) -(def-art-elt gun-ag gun-red-sphere-lod0-jg 74) -(def-art-elt gun-ag gun-idle-red2-ja 14) -(def-art-elt gun-ag gun-grenade-idle-ja 73) -(def-art-elt gun-ag gun-idle-red-ja 13) -(def-art-elt gun-ag gun-grenade-lod1-mg 72) -(def-art-elt gun-ag gun-ammo-yellow-lod0-jg 0) -(def-art-elt gun-ag gun-ammo-yellow-lod0-mg 1) -(def-art-elt gun-ag gun-ammo-red-lod0-jg 2) -(def-art-elt gun-ag gun-red-cone-lod0-jg 61) -(def-art-elt gun-ag gun-ammo-red-lod0-mg 3) -(def-art-elt gun-ag gun-red-cone-lod0-mg 62) -(def-art-elt gun-ag gun-ammo-blue-lod0-jg 4) -(def-art-elt gun-ag gun-red-cone-idle-ja 63) -(def-art-elt gun-ag gun-ammo-blue-lod0-mg 5) -(def-art-elt gun-ag gun-red-burst-lod0-jg 64) -(def-art-elt gun-ag gun-ammo-dark-lod0-jg 6) -(def-art-elt gun-ag gun-red-burst-lod0-mg 65) -(def-art-elt gun-ag gun-ammo-dark-lod0-mg 7) -(def-art-elt gun-ag gun-red-burst-idle-ja 66) -(def-art-elt gun-ag gun-ammo-idle-ja 8) -(def-art-elt gun-ag gun-saucer-lod0-jg 67) -(def-art-elt gun-ag gun-lod0-jg 9) -(def-art-elt gun-ag gun-saucer-lod0-mg 68) -(def-art-elt gun-ag gun-lod0-mg 10) -(def-art-elt gun-ag gun-saucer-idle-ja 69) -(def-art-elt gun-ag gun-shadow-mg 11) -(def-art-elt gun-ag gun-grenade-lod0-jg 70) -(def-art-elt gun-ag gun-idle-ja 12) -(def-art-elt gun-ag gun-grenade-lod0-mg 71) -(def-art-elt gun-ag gun-nuke-lod0-mg 84) -(def-art-elt gun-ag gun-gun-yellow-fire-low-ja 25) -(def-art-elt gun-ag gun-nuke-idle-ja 85) -(def-art-elt gun-ag gun-gun-red-fire-ja 26) -(def-art-elt gun-ag gun-suck-lod0-jg 86) -(def-art-elt gun-ag gun-suck-lod0-mg 87) -(def-art-elt gun-ag gun-suck-idle-ja 88) -(def-art-elt gun-ag gun-dark-2-ring-lod0-jg 89) -(def-art-elt gun-ag gun-dark-2-ring-lod0-mg 90) -(def-art-elt gun-ag gun-dark-2-ring-shadow-mg 91) -(def-art-elt gun-ag gun-dark-2-ring-idle-ja 92) - -(def-art-elt neo-satellite-game-ring-ag neo-satellite-game-ring-attack-ja 3) -(def-art-elt neo-satellite-game-ring-ag neo-satellite-game-ring-idle-ja 2) -(def-art-elt neo-satellite-game-ring-ag neo-satellite-game-ring-lod0-mg 1) -(def-art-elt neo-satellite-game-ring-ag neo-satellite-game-ring-lod0-jg 0) - (def-art-elt board-ag board-board-idle-ja 5) (def-art-elt board-ag board-close-ja 4) (def-art-elt board-ag board-open-ja 3) @@ -2869,38 +2799,120 @@ (def-art-elt jinx-ag jinx-get-out-car-jump-ja 27) (def-art-elt jinx-ag jinx-get-out-car-land-ja 28) -(def-art-elt cty-port-mine-ag cty-port-mine-explode-idle-ja 6) -(def-art-elt cty-port-mine-ag cty-port-mine-explode-lod0-mg 5) -(def-art-elt cty-port-mine-ag cty-port-mine-explode-lod0-jg 4) -(def-art-elt cty-port-mine-ag cty-port-mine-idle-ja 3) -(def-art-elt cty-port-mine-ag cty-port-mine-lod1-mg 2) -(def-art-elt cty-port-mine-ag cty-port-mine-lod0-mg 1) -(def-art-elt cty-port-mine-ag cty-port-mine-lod0-jg 0) +(def-art-elt precur-planet-ag precur-planet-idle-ja 2) +(def-art-elt precur-planet-ag precur-planet-lod0-mg 1) +(def-art-elt precur-planet-ag precur-planet-lod0-jg 0) + +(def-art-elt precur-door-b-ag precur-door-b-idle-ja 2) +(def-art-elt precur-door-b-ag precur-door-b-lod0-mg 1) +(def-art-elt precur-door-b-ag precur-door-b-lod0-jg 0) + +(def-art-elt wascity-airlock-small-ag wascity-airlock-small-idle-ja 2) +(def-art-elt wascity-airlock-small-ag wascity-airlock-small-lod0-mg 1) +(def-art-elt wascity-airlock-small-ag wascity-airlock-small-lod0-jg 0) + +(def-art-elt youngsamos-highres-ag youngsamos-highres-youngsamos-idle-ja 2) +(def-art-elt youngsamos-highres-ag youngsamos-highres-lod0-mg 1) +(def-art-elt youngsamos-highres-ag youngsamos-highres-lod0-jg 0) + +(def-art-elt dp-bipedal-ag dp-bipedal-turret-jump-off-end-ja 41) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-jump-off-jump-ja 40) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-jump-off-start-ja 39) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-jump-on-end-ja 38) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-jump-on-start-ja 37) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-knocked-right0-ja 36) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-knocked-left0-ja 35) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-shoot0-ja 34) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-idle-right-ja 33) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-idle-left-ja 32) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-idle-down-ja 31) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-idle-up-ja 30) +(def-art-elt dp-bipedal-ag dp-bipedal-turret-idle-middle-ja 29) +(def-art-elt dp-bipedal-ag dp-bipedal-shield-out-ja 12) +(def-art-elt dp-bipedal-ag dp-bipedal-attack-throw0-end-ja 11) +(def-art-elt dp-bipedal-ag dp-bipedal-attack-throw0-middle-ja 10) +(def-art-elt dp-bipedal-ag dp-bipedal-attack-throw0-start-ja 9) +(def-art-elt dp-bipedal-ag dp-bipedal-attack-close0-end-ja 8) +(def-art-elt dp-bipedal-ag dp-bipedal-attack-close0-middle-ja 7) +(def-art-elt dp-bipedal-ag dp-bipedal-attack-close0-start-ja 6) +(def-art-elt dp-bipedal-ag dp-bipedal-walk0-ja 5) +(def-art-elt dp-bipedal-ag dp-bipedal-run0-ja 4) +(def-art-elt dp-bipedal-ag dp-bipedal-idle0-ja 3) +(def-art-elt dp-bipedal-ag dp-bipedal-shadow-mg 2) +(def-art-elt dp-bipedal-ag dp-bipedal-lod0-mg 1) +(def-art-elt dp-bipedal-ag dp-bipedal-lod0-jg 0) +(def-art-elt dp-bipedal-ag dp-bipedal-shield-out-idle-ja 13) +(def-art-elt dp-bipedal-ag dp-bipedal-shield-in-ja 14) +(def-art-elt dp-bipedal-ag dp-bipedal-shield-up-recoil0-ja 15) +(def-art-elt dp-bipedal-ag dp-bipedal-getup0-start-ja 16) +(def-art-elt dp-bipedal-ag dp-bipedal-getup0-end-ja 17) +(def-art-elt dp-bipedal-ag dp-bipedal-warp-in0-ja 18) +(def-art-elt dp-bipedal-ag dp-bipedal-warp-in1-ja 19) +(def-art-elt dp-bipedal-ag dp-bipedal-jump0-start-ja 20) +(def-art-elt dp-bipedal-ag dp-bipedal-jump0-fall-ja 21) +(def-art-elt dp-bipedal-ag dp-bipedal-jump0-land-ja 22) +(def-art-elt dp-bipedal-ag dp-bipedal-knocked-yellow-right-ja 23) +(def-art-elt dp-bipedal-ag dp-bipedal-knocked-yellow-right-land-ja 24) +(def-art-elt dp-bipedal-ag dp-bipedal-knocked-yellow-left-ja 25) +(def-art-elt dp-bipedal-ag dp-bipedal-knocked-yellow-left-land-ja 26) +(def-art-elt dp-bipedal-ag dp-bipedal-knocked-blue0-ja 27) +(def-art-elt dp-bipedal-ag dp-bipedal-ragdoll-ja 28) + +(def-art-elt des-terraformer-break-ag des-terraformer-break-a-idle-ja 6) +(def-art-elt des-terraformer-break-ag des-terraformer-break-a-lod0-mg 5) +(def-art-elt des-terraformer-break-ag des-terraformer-break-a-lod0-jg 4) +(def-art-elt des-terraformer-break-ag des-terraformer-break-idle-ja 2) +(def-art-elt des-terraformer-break-ag des-terraformer-break-lod0-mg 1) +(def-art-elt des-terraformer-break-ag des-terraformer-break-lod0-jg 0) -(def-art-elt tpl-outer-airlock-door-ag tpl-outer-airlock-door-idle-ja 2) -(def-art-elt tpl-outer-airlock-door-ag tpl-outer-airlock-door-lod0-mg 1) -(def-art-elt tpl-outer-airlock-door-ag tpl-outer-airlock-door-lod0-jg 0) +(def-art-elt neo-spawner-ag neo-spawner-explode-outer-idle-ja 15) +(def-art-elt neo-spawner-ag neo-spawner-explode-outer-lod0-mg 14) +(def-art-elt neo-spawner-ag neo-spawner-explode-outer-lod0-jg 13) +(def-art-elt neo-spawner-ag neo-spawner-lod0-jg 0) +(def-art-elt neo-spawner-ag neo-spawner-lod0-mg 1) +(def-art-elt neo-spawner-ag neo-spawner-lod1-mg 2) +(def-art-elt neo-spawner-ag neo-spawner-idle-ja 3) +(def-art-elt neo-spawner-ag neo-spawner-open-idle-ja 4) +(def-art-elt neo-spawner-ag neo-spawner-closed-idle-ja 5) +(def-art-elt neo-spawner-ag neo-spawner-open-ja 6) +(def-art-elt neo-spawner-ag neo-spawner-open-angry-ja 7) +(def-art-elt neo-spawner-ag neo-spawner-spit-start-ja 8) +(def-art-elt neo-spawner-ag neo-spawner-spit-end-ja 9) +(def-art-elt neo-spawner-ag neo-spawner-explode-inner-lod0-jg 10) +(def-art-elt neo-spawner-ag neo-spawner-explode-inner-lod0-mg 11) +(def-art-elt neo-spawner-ag neo-spawner-explode-inner-idle-ja 12) -(def-art-elt errol-lowres-ag errol-lowres-run-to-idle-ja 15) -(def-art-elt errol-lowres-ag errol-lowres-run-ccw-ja 14) -(def-art-elt errol-lowres-ag errol-lowres-run-cw-ja 13) -(def-art-elt errol-lowres-ag errol-lowres-lod0-jg 0) -(def-art-elt errol-lowres-ag errol-lowres-lod0-mg 1) -(def-art-elt errol-lowres-ag errol-lowres-lod1-mg 2) -(def-art-elt errol-lowres-ag errol-lowres-idle30-ja 3) -(def-art-elt errol-lowres-ag errol-lowres-idle60-ja 4) -(def-art-elt errol-lowres-ag errol-lowres-idle-hit-console-ja 5) -(def-art-elt errol-lowres-ag errol-lowres-idle-hit-console-2-ja 6) -(def-art-elt errol-lowres-ag errol-lowres-idle-throw-ja 7) -(def-art-elt errol-lowres-ag errol-lowres-idle-yell-ja 8) -(def-art-elt errol-lowres-ag errol-lowres-idle-yell-1-ja 9) -(def-art-elt errol-lowres-ag errol-lowres-idle-knocked-ja 10) -(def-art-elt errol-lowres-ag errol-lowres-idle-to-run-cw-ja 11) -(def-art-elt errol-lowres-ag errol-lowres-idle-to-run-ccw-ja 12) +(def-art-elt desert-transport-ag desert-transport-close-ja 5) +(def-art-elt desert-transport-ag desert-transport-open-ja 4) +(def-art-elt desert-transport-ag desert-transport-idle-ja 3) +(def-art-elt desert-transport-ag desert-transport-shadow-mg 2) +(def-art-elt desert-transport-ag desert-transport-lod0-mg 1) +(def-art-elt desert-transport-ag desert-transport-lod0-jg 0) -(def-art-elt precur-planet-ag precur-planet-idle-ja 2) -(def-art-elt precur-planet-ag precur-planet-lod0-mg 1) -(def-art-elt precur-planet-ag precur-planet-lod0-jg 0) +(def-art-elt flamer-lava-ag flamer-lava-explode-idle-ja 23) +(def-art-elt flamer-lava-ag flamer-lava-explode-lod0-mg 22) +(def-art-elt flamer-lava-ag flamer-lava-explode-lod0-jg 21) +(def-art-elt flamer-lava-ag flamer-lava-blue-hit2-ja 20) +(def-art-elt flamer-lava-ag flamer-lava-blue-hit1-ja 19) +(def-art-elt flamer-lava-ag flamer-lava-blue-hit0-ja 18) +(def-art-elt flamer-lava-ag flamer-lava-die-in-place-ja 17) +(def-art-elt flamer-lava-ag flamer-lava-knock-back-land-ja 16) +(def-art-elt flamer-lava-ag flamer-lava-die-ja 15) +(def-art-elt flamer-lava-ag flamer-lava-knock-back-fall-ja 14) +(def-art-elt flamer-lava-ag flamer-lava-knock-back-ja 13) +(def-art-elt flamer-lava-ag flamer-lava-lod0-jg 0) +(def-art-elt flamer-lava-ag flamer-lava-lod0-mg 1) +(def-art-elt flamer-lava-ag flamer-lava-lod1-mg 2) +(def-art-elt flamer-lava-ag flamer-lava-lod2-mg 3) +(def-art-elt flamer-lava-ag flamer-lava-shadow-mg 4) +(def-art-elt flamer-lava-ag flamer-lava-idle-ja 5) +(def-art-elt flamer-lava-ag flamer-lava-fly-right-ja 6) +(def-art-elt flamer-lava-ag flamer-lava-fly-left-ja 7) +(def-art-elt flamer-lava-ag flamer-lava-fly-forward-ja 8) +(def-art-elt flamer-lava-ag flamer-lava-fly-back-ja 9) +(def-art-elt flamer-lava-ag flamer-lava-fly-straight-ja 10) +(def-art-elt flamer-lava-ag flamer-lava-shoot-ja 11) +(def-art-elt flamer-lava-ag flamer-lava-shoot1-ja 12) (def-art-elt crate-ag crate-idle-ja 3) (def-art-elt crate-ag crate-krimson-lod1-mg 2) @@ -3307,18 +3319,6 @@ (def-art-elt ladder-ag ladder-lod0-mg 1) (def-art-elt ladder-ag ladder-lod0-jg 0) -(def-art-elt tizard-ag tizard-turn-right0-ja 6) -(def-art-elt tizard-ag tizard-turn-left0-ja 5) -(def-art-elt tizard-ag tizard-walk0-ja 4) -(def-art-elt tizard-ag tizard-idle-ja 3) -(def-art-elt tizard-ag tizard-shadow-mg 2) -(def-art-elt tizard-ag tizard-lod0-mg 1) -(def-art-elt tizard-ag tizard-lod0-jg 0) - -(def-art-elt onin-simple-ag onin-simple-idle-ja 2) -(def-art-elt onin-simple-ag onin-simple-lod0-mg 1) -(def-art-elt onin-simple-ag onin-simple-lod0-jg 0) - (def-art-elt market-basket-a-ag market-basket-a-idle-ja 2) (def-art-elt market-basket-a-ag market-basket-a-lod0-mg 1) (def-art-elt market-basket-a-ag market-basket-a-lod0-jg 0) @@ -3426,6 +3426,13 @@ (def-art-elt eco-crystal-dark-ag eco-crystal-dark-lod0-mg 1) (def-art-elt eco-crystal-dark-ag eco-crystal-dark-lod0-jg 0) +(def-art-elt king-rider-ag king-rider-pilot-car-up-down-ja 5) +(def-art-elt king-rider-ag king-rider-pilot-car-turn-back-ja 4) +(def-art-elt king-rider-ag king-rider-pilot-car-turn-front-ja 3) +(def-art-elt king-rider-ag king-rider-idle-ja 2) +(def-art-elt king-rider-ag king-rider-lod0-mg 1) +(def-art-elt king-rider-ag king-rider-lod0-jg 0) + (def-art-elt beast-rider-ag beast-rider-death0-ja 14) (def-art-elt beast-rider-ag beast-rider-run-limp0-ja 13) (def-art-elt beast-rider-ag beast-rider-lod0-jg 0) @@ -4230,10 +4237,6 @@ (def-art-elt brutter-highres-ag brutter-highres-lod0-mg 1) (def-art-elt brutter-highres-ag brutter-highres-lod0-jg 0) -(def-art-elt cty-explode-barrel-ag cty-explode-barrel-idle-ja 2) -(def-art-elt cty-explode-barrel-ag cty-explode-barrel-lod0-mg 1) -(def-art-elt cty-explode-barrel-ag cty-explode-barrel-lod0-jg 0) - (def-art-elt min-falling-step-ag min-falling-step-unstable-ja 9) (def-art-elt min-falling-step-ag min-falling-step-return-ja 8) (def-art-elt min-falling-step-ag min-falling-step-hold-b-ja 7) @@ -4245,6 +4248,10 @@ (def-art-elt min-falling-step-ag min-falling-step-lod0-mg 1) (def-art-elt min-falling-step-ag min-falling-step-lod0-jg 0) +(def-art-elt cty-explode-barrel-ag cty-explode-barrel-idle-ja 2) +(def-art-elt cty-explode-barrel-ag cty-explode-barrel-lod0-mg 1) +(def-art-elt cty-explode-barrel-ag cty-explode-barrel-lod0-jg 0) + (def-art-elt min-moving-plat-ag min-moving-plat-idle-ja 3) (def-art-elt min-moving-plat-ag min-moving-plat-lod1-mg 2) (def-art-elt min-moving-plat-ag min-moving-plat-lod0-mg 1) @@ -4624,32 +4631,222 @@ (def-art-elt tow-break-base-ag tow-break-base-lod0-mg 1) (def-art-elt tow-break-base-ag tow-break-base-lod0-jg 0) +(def-art-elt flut-saddle-ag flut-saddle-flut-idle-ja 3) +(def-art-elt flut-saddle-ag flut-saddle-shadow-mg 2) +(def-art-elt flut-saddle-ag flut-saddle-lod0-mg 1) +(def-art-elt flut-saddle-ag flut-saddle-lod0-jg 0) +(def-art-elt flut-saddle-ag flut-saddle-flut-kanga-catch-ja 27) +(def-art-elt flut-saddle-ag flut-saddle-flut-death-drown-ja 29) +(def-art-elt flut-saddle-ag flut-saddle-flut-deathb-ja 28) +(def-art-elt flut-saddle-ag flut-saddle-flut-run-squash-ja 26) +(def-art-elt flut-saddle-ag flut-saddle-flut-deatha-ja 25) +(def-art-elt flut-saddle-ag flut-saddle-flut-smack-surface-end-ja 24) +(def-art-elt flut-saddle-ag flut-saddle-flut-smack-surface-ja 23) +(def-art-elt flut-saddle-ag flut-saddle-flut-hit-back-end-ja 22) +(def-art-elt flut-saddle-ag flut-saddle-flut-hit-back-ja 21) +(def-art-elt flut-saddle-ag flut-saddle-flut-get-off-ja 20) +(def-art-elt flut-saddle-ag flut-saddle-flut-get-on-ja 19) +(def-art-elt flut-saddle-ag flut-saddle-flut-air-attack-land-ja 18) +(def-art-elt flut-saddle-ag flut-saddle-flut-air-attack-loop-ja 17) +(def-art-elt flut-saddle-ag flut-saddle-flut-air-attack-ja 16) +(def-art-elt flut-saddle-ag flut-saddle-flut-running-attack-end-ja 15) +(def-art-elt flut-saddle-ag flut-saddle-flut-running-attack-ja 14) +(def-art-elt flut-saddle-ag flut-saddle-flut-double-jump-ja 13) +(def-art-elt flut-saddle-ag flut-saddle-flut-jump-forward-land-ja 12) +(def-art-elt flut-saddle-ag flut-saddle-flut-jump-forward-loop-ja 11) +(def-art-elt flut-saddle-ag flut-saddle-flut-jump-forward-ja 10) +(def-art-elt flut-saddle-ag flut-saddle-flut-jump-land-ja 9) +(def-art-elt flut-saddle-ag flut-saddle-flut-jump-loop-ja 8) +(def-art-elt flut-saddle-ag flut-saddle-fldax-smack-surface-ja 38) +(def-art-elt flut-saddle-ag flut-saddle-fldax-wild-run-ja 37) +(def-art-elt flut-saddle-ag flut-saddle-fldax-dummy8-ja 54) +(def-art-elt flut-saddle-ag flut-saddle-fldax-dummy7-ja 53) +(def-art-elt flut-saddle-ag flut-saddle-fldax-smack-surface-end-ja 39) +(def-art-elt flut-saddle-ag flut-saddle-fldax-dummy6-ja 52) +(def-art-elt flut-saddle-ag flut-saddle-flut-dummy8-ja 36) +(def-art-elt flut-saddle-ag flut-saddle-flut-jump-ja 7) +(def-art-elt flut-saddle-ag flut-saddle-flut-dummy7-ja 35) +(def-art-elt flut-saddle-ag flut-saddle-flut-run-ja 6) +(def-art-elt flut-saddle-ag flut-saddle-flut-dummy6-ja 34) +(def-art-elt flut-saddle-ag flut-saddle-flut-jog-ja 5) +(def-art-elt flut-saddle-ag flut-saddle-flut-dummy5-ja 33) +(def-art-elt flut-saddle-ag flut-saddle-flut-walk-ja 4) +(def-art-elt flut-saddle-ag flut-saddle-flut-dummy4-ja 32) +(def-art-elt flut-saddle-ag flut-saddle-flut-dummy3-ja 31) +(def-art-elt flut-saddle-ag flut-saddle-flut-dummy2-ja 30) +(def-art-elt flut-saddle-ag flut-saddle-fldax-deatha-ja 40) +(def-art-elt flut-saddle-ag flut-saddle-fldax-jump-forward-ja 41) +(def-art-elt flut-saddle-ag flut-saddle-fldax-jump-forward-loop-ja 42) +(def-art-elt flut-saddle-ag flut-saddle-fldax-get-on-ja 43) +(def-art-elt flut-saddle-ag flut-saddle-fldax-idle-ja 44) +(def-art-elt flut-saddle-ag flut-saddle-fldax-get-off-ja 45) +(def-art-elt flut-saddle-ag flut-saddle-fldax-wild-run-left-ja 46) +(def-art-elt flut-saddle-ag flut-saddle-fldax-wild-run-right-ja 47) +(def-art-elt flut-saddle-ag flut-saddle-fldax-walk-ja 48) +(def-art-elt flut-saddle-ag flut-saddle-fldax-run-squash-ja 49) +(def-art-elt flut-saddle-ag flut-saddle-fldax-finish-ja 50) +(def-art-elt flut-saddle-ag flut-saddle-fldax-death-cactus-ja 51) + +(def-art-elt precur-bridge-e-path-break-ag precur-bridge-e-path-break-idle2-ja 3) +(def-art-elt precur-bridge-e-path-break-ag precur-bridge-e-path-break-idle-ja 2) +(def-art-elt precur-bridge-e-path-break-ag precur-bridge-e-path-break-lod0-mg 1) +(def-art-elt precur-bridge-e-path-break-ag precur-bridge-e-path-break-lod0-jg 0) + (def-art-elt tow-warp-effect-ag tow-warp-effect-idle-ja 2) (def-art-elt tow-warp-effect-ag tow-warp-effect-lod0-mg 1) (def-art-elt tow-warp-effect-ag tow-warp-effect-lod0-jg 0) -(def-art-elt daxter-ag daxter-tentacle-attack-ja 91) -(def-art-elt daxter-ag daxter-fldax-death-cactus-ja 398) -(def-art-elt daxter-ag daxter-fldax-finish-ja 397) -(def-art-elt daxter-ag daxter-fldax-run-squash-ja 396) -(def-art-elt daxter-ag daxter-fldax-walk-ja 395) -(def-art-elt daxter-ag daxter-fldax-wild-run-right-ja 394) -(def-art-elt daxter-ag daxter-fldax-wild-run-left-ja 393) -(def-art-elt daxter-ag daxter-fldax-get-off-ja 392) -(def-art-elt daxter-ag daxter-fldax-idle-ja 391) -(def-art-elt daxter-ag daxter-fldax-get-on-ja 390) -(def-art-elt daxter-ag daxter-fldax-jump-forward-loop-ja 389) -(def-art-elt daxter-ag daxter-fldax-jump-forward-ja 388) -(def-art-elt daxter-ag daxter-fldax-deatha-ja 387) -(def-art-elt daxter-ag daxter-fldax-smack-surface-end-ja 386) -(def-art-elt daxter-ag daxter-fldax-smack-surface-ja 385) -(def-art-elt daxter-ag daxter-fldax-wild-run-ja 384) -(def-art-elt daxter-ag daxter-pilot-wcar-snake-jump-ja 334) -(def-art-elt daxter-ag daxter-pilot-wcar-snake-out-ja 333) -(def-art-elt daxter-ag daxter-pilot-wcar-snake-loop-ja 332) -(def-art-elt daxter-ag daxter-pilot-wcar-snake-in-ja 331) +(def-art-elt daxter-ag daxter-turret-for-fire-ja 349) +(def-art-elt daxter-ag daxter-turret-for-stance-right-ja 348) +(def-art-elt daxter-ag daxter-turret-for-stance-left-ja 347) +(def-art-elt daxter-ag daxter-turret-for-get-on-ja 346) +(def-art-elt daxter-ag daxter-turret-for-get-off-ja 345) +(def-art-elt daxter-ag daxter-turret-for-stance-ja 344) +(def-art-elt daxter-ag daxter-turret-get-on-ja 343) +(def-art-elt daxter-ag daxter-turret-get-off-ja 342) +(def-art-elt daxter-ag daxter-turret-stance-ja 341) (def-art-elt daxter-ag daxter-tube-jump-land-ja 119) (def-art-elt daxter-ag daxter-tube-turn-ja 118) +(def-art-elt daxter-ag daxter-tentacle-attack-ja 91) +(def-art-elt daxter-ag daxter-racer-death-explode-ja 146) +(def-art-elt daxter-ag daxter-racer-get-on-ja 145) +(def-art-elt daxter-ag daxter-racer-get-off-ja 144) +(def-art-elt daxter-ag daxter-racer-smack-ja 143) +(def-art-elt daxter-ag daxter-racer-jump-high-land-ja 142) +(def-art-elt daxter-ag daxter-racer-jump-high-loop-ja 141) +(def-art-elt daxter-ag daxter-racer-stance-ja 140) +(def-art-elt daxter-ag daxter-racer-jump-small-land-ja 139) +(def-art-elt daxter-ag daxter-racer-jump-small-loop-ja 138) +(def-art-elt daxter-ag daxter-racer-jump-small-ja 137) +(def-art-elt daxter-ag daxter-racer-jump-land-ja 136) +(def-art-elt daxter-ag daxter-racer-jump-loop-ja 135) +(def-art-elt daxter-ag daxter-racer-jump-ja 134) +(def-art-elt daxter-ag daxter-racer-dig2-ja 133) +(def-art-elt daxter-ag daxter-racer-dig-ja 132) +(def-art-elt daxter-ag daxter-racer-turn2-ja 131) +(def-art-elt daxter-ag daxter-racer-turn-ja 130) +(def-art-elt daxter-ag daxter-racer-idle-ja 129) +(def-art-elt daxter-ag daxter-pole-jump-loop-ja 114) +(def-art-elt daxter-ag daxter-pole-flip-forward-ja 113) +(def-art-elt daxter-ag daxter-pole-flip-up-ja 112) +(def-art-elt daxter-ag daxter-pole-cycle2-ja 111) +(def-art-elt daxter-ag daxter-pole-cycle-ja 110) +(def-art-elt daxter-ag daxter-pilot-wcar-turn-back-ja 328) +(def-art-elt daxter-ag daxter-pilot-wcar-turn-front-ja 327) +(def-art-elt daxter-ag daxter-pilot-bike-smack-right-ja 324) +(def-art-elt daxter-ag daxter-pilot-bike-smack-left-ja 323) +(def-art-elt daxter-ag daxter-pilot-bike-get-off-ja 306) +(def-art-elt daxter-ag daxter-pilot-bike-smack-shock-ja 305) +(def-art-elt daxter-ag daxter-pilot-bike-up-down-ja 304) +(def-art-elt daxter-ag daxter-pilot-bike-smack-back-ja 302) +(def-art-elt daxter-ag daxter-pilot-bike-smack-front-ja 301) +(def-art-elt daxter-ag daxter-pilot-bike-turn-back-ja 300) +(def-art-elt daxter-ag daxter-pilot-bike-turn-front-ja 299) +(def-art-elt daxter-ag daxter-pilot-car-turn-back-ja 293) +(def-art-elt daxter-ag daxter-pilot-car-turn-front-ja 292) +(def-art-elt daxter-ag daxter-pilot-bike-get-on-ja 291) +(def-art-elt daxter-ag daxter-pilot-gun-dark-takeout-ja 322) +(def-art-elt daxter-ag daxter-pilot-gun-blue-takeout-ja 321) +(def-art-elt daxter-ag daxter-pilot-gun-yellow-takeout-ja 320) +(def-art-elt daxter-ag daxter-pilot-gun-blue-blue-ja 319) +(def-art-elt daxter-ag daxter-pilot-gun-yellow-blue-ja 318) +(def-art-elt daxter-ag daxter-pilot-gun-red-blue-ja 317) +(def-art-elt daxter-ag daxter-pilot-gun-red-yellow-ja 316) +(def-art-elt daxter-ag daxter-pilot-gun-red-dark-ja 315) +(def-art-elt daxter-ag daxter-pilot-gun-dark-fire-ja 314) +(def-art-elt daxter-ag daxter-pilot-gun-yellow-fire-ja 313) +(def-art-elt daxter-ag daxter-pilot-gun-red-fire-ja 312) +(def-art-elt daxter-ag daxter-pilot-gun-blue-idle-ja 311) +(def-art-elt daxter-ag daxter-pilot-gun-yellow-idle-ja 310) +(def-art-elt daxter-ag daxter-pilot-gun-dark-idle-ja 309) +(def-art-elt daxter-ag daxter-pilot-gun-red-idle-ja 308) +(def-art-elt daxter-ag daxter-pilot-gun-blue-fire-single-ja 297) +(def-art-elt daxter-ag daxter-pilot-gun-blue-fire-ja 296) +(def-art-elt daxter-ag daxter-pilot-gun-red-takeout-ja 288) +(def-art-elt daxter-ag daxter-pilot-glider-turn-back-ja 330) +(def-art-elt daxter-ag daxter-pilot-glider-turn-front-ja 329) +(def-art-elt daxter-ag daxter-pilot-car-smack-right-ja 326) +(def-art-elt daxter-ag daxter-pilot-car-smack-left-ja 325) +(def-art-elt daxter-ag daxter-pilot-eject-loop-ja 307) +(def-art-elt daxter-ag daxter-pilot-car-up-down-ja 303) +(def-art-elt daxter-ag daxter-pilot-car-smack-shock-ja 298) +(def-art-elt daxter-ag daxter-pilot-car-smack-back-ja 295) +(def-art-elt daxter-ag daxter-pilot-car-smack-front-ja 294) +(def-art-elt daxter-ag daxter-pilot-car-get-on-ja 290) +(def-art-elt daxter-ag daxter-pilot-car-get-off-ja 289) +(def-art-elt daxter-ag daxter-pidax-car-crash-right-ja 540) +(def-art-elt daxter-ag daxter-pidax-car-crash-left-ja 539) +(def-art-elt daxter-ag daxter-pidax-car-crash-back-ja 538) +(def-art-elt daxter-ag daxter-pidax-car-crash-front-ja 537) +(def-art-elt daxter-ag daxter-pidax-car-up-down-ja 536) +(def-art-elt daxter-ag daxter-pidax-car-turn-back-ja 535) +(def-art-elt daxter-ag daxter-pidax-car-turn-front-ja 534) +(def-art-elt daxter-ag daxter-board-attack-pegasus-ja 191) +(def-art-elt daxter-ag daxter-flut-kanga-catch-ja 374) +(def-art-elt daxter-ag daxter-indax-hang-dummy9-ja 533) +(def-art-elt daxter-ag daxter-indax-hang-dummy8-ja 532) +(def-art-elt daxter-ag daxter-indax-hang-dummy7-ja 531) +(def-art-elt daxter-ag daxter-indax-hang-dummy6-ja 530) +(def-art-elt daxter-ag daxter-indax-hang-dummy5-ja 529) +(def-art-elt daxter-ag daxter-indax-hang-get-on-ja 528) +(def-art-elt daxter-ag daxter-indax-hang-walk-to-stance-ja 527) +(def-art-elt daxter-ag daxter-indax-hang-attack-ja 526) +(def-art-elt daxter-ag daxter-indax-hang-dodge-off-ja 525) +(def-art-elt daxter-ag daxter-indax-hang-dodge-loop-ja 524) +(def-art-elt daxter-ag daxter-indax-hang-dodge-on-ja 523) +(def-art-elt daxter-ag daxter-indax-hang-turn-around-ja 522) +(def-art-elt daxter-ag daxter-indax-hang-walk-start-ja 521) +(def-art-elt daxter-ag daxter-indax-hang-walk-ja 520) +(def-art-elt daxter-ag daxter-indax-hang-stance-ja 519) +(def-art-elt daxter-ag daxter-indax-dummy7-ja 518) +(def-art-elt daxter-ag daxter-indax-dummy6-ja 517) +(def-art-elt daxter-ag daxter-indax-dummy5-ja 516) +(def-art-elt daxter-ag daxter-indax-dummy4-ja 515) +(def-art-elt daxter-ag daxter-indax-dummy3-ja 514) +(def-art-elt daxter-ag daxter-indax-dummy2-ja 513) +(def-art-elt daxter-ag daxter-indax-dummy1-ja 512) +(def-art-elt daxter-ag daxter-indax-dummy0-ja 511) +(def-art-elt daxter-ag daxter-indax-run-right-ja 510) +(def-art-elt daxter-ag daxter-indax-run-left-ja 509) +(def-art-elt daxter-ag daxter-indax-run-down-ja 508) +(def-art-elt daxter-ag daxter-indax-run-up-ja 507) +(def-art-elt daxter-ag daxter-indax-tube-jump-land-ja 506) +(def-art-elt daxter-ag daxter-indax-tube-turn-ja 505) +(def-art-elt daxter-ag daxter-indax-death-shock-ja 504) +(def-art-elt daxter-ag daxter-indax-death-freeze-ja 503) +(def-art-elt daxter-ag daxter-indax-trip-land-ja 502) +(def-art-elt daxter-ag daxter-indax-trip-ja 501) +(def-art-elt daxter-ag daxter-indax-running-attack-end-ja 500) +(def-art-elt daxter-ag daxter-indax-run-squash-hands-ja 499) +(def-art-elt daxter-ag daxter-indax-jump-forward-hands-land-ja 498) +(def-art-elt daxter-ag daxter-indax-jump-forward-hands-loop-ja 497) +(def-art-elt daxter-ag daxter-indax-jump-forward-hands-ja 496) +(def-art-elt daxter-ag daxter-indax-running-attack-ja 495) +(def-art-elt daxter-ag daxter-indax-death-eaten-ja 494) +(def-art-elt daxter-ag daxter-indax-death-kill-ja 493) +(def-art-elt daxter-ag daxter-indax-death-fall-ja 492) +(def-art-elt daxter-ag daxter-indax-death-squashed-ja 491) +(def-art-elt daxter-ag daxter-indax-hit-roll-ja 490) +(def-art-elt daxter-ag daxter-indax-hit-back-ja 489) +(def-art-elt daxter-ag daxter-indax-hit-front-ja 488) +(def-art-elt daxter-ag daxter-indax-run-to-stance-ja 487) +(def-art-elt daxter-ag daxter-indax-attack-spin-air-ja 486) +(def-art-elt daxter-ag daxter-indax-run-squash-ja 485) +(def-art-elt daxter-ag daxter-indax-jump-forward-land-ja 484) +(def-art-elt daxter-ag daxter-indax-jump-forward-loop-ja 483) +(def-art-elt daxter-ag daxter-indax-jump-forward-ja 482) +(def-art-elt daxter-ag daxter-indax-run-look-back-ja 481) +(def-art-elt daxter-ag daxter-indax-attack-spin-end-ja 480) +(def-art-elt daxter-ag daxter-indax-attack-spin-ja 479) +(def-art-elt daxter-ag daxter-indax-jump-land-ja 478) +(def-art-elt daxter-ag daxter-indax-jump-loop-ja 477) +(def-art-elt daxter-ag daxter-indax-jump-ja 476) +(def-art-elt daxter-ag daxter-indax-run-ja 475) +(def-art-elt daxter-ag daxter-indax-walk-ja 474) +(def-art-elt daxter-ag daxter-indax-stance-ja 473) +(def-art-elt daxter-ag daxter-ice-stance-ja 117) +(def-art-elt daxter-ag daxter-ice-slide-ja 116) +(def-art-elt daxter-ag daxter-ice-skate-ja 115) (def-art-elt daxter-ag daxter-flut-death-drown-ja 376) (def-art-elt daxter-ag daxter-flut-deathb-ja 375) (def-art-elt daxter-ag daxter-flut-run-squash-ja 373) @@ -4675,250 +4872,249 @@ (def-art-elt daxter-ag daxter-flut-run-ja 353) (def-art-elt daxter-ag daxter-flut-jog-ja 352) (def-art-elt daxter-ag daxter-flut-walk-ja 351) -(def-art-elt daxter-ag daxter-ladder-switch-ja 574) -(def-art-elt daxter-ag daxter-ladder-fall-ja 572) -(def-art-elt daxter-ag daxter-ladder-slide-start-ja 568) -(def-art-elt daxter-ag daxter-flut-kanga-catch-ja 374) -(def-art-elt daxter-ag daxter-pilot-bike-smack-right-ja 324) -(def-art-elt daxter-ag daxter-pilot-bike-smack-left-ja 323) -(def-art-elt daxter-ag daxter-pilot-bike-get-off-ja 306) -(def-art-elt daxter-ag daxter-pilot-bike-smack-shock-ja 305) -(def-art-elt daxter-ag daxter-pilot-bike-up-down-ja 304) -(def-art-elt daxter-ag daxter-pilot-bike-smack-back-ja 302) -(def-art-elt daxter-ag daxter-pilot-bike-smack-front-ja 301) -(def-art-elt daxter-ag daxter-pilot-bike-turn-back-ja 300) -(def-art-elt daxter-ag daxter-pilot-bike-turn-front-ja 299) -(def-art-elt daxter-ag daxter-pilot-car-turn-back-ja 293) -(def-art-elt daxter-ag daxter-pilot-car-turn-front-ja 292) -(def-art-elt daxter-ag daxter-pilot-bike-get-on-ja 291) -(def-art-elt daxter-ag daxter-pilot-wcar-turn-back-ja 328) -(def-art-elt daxter-ag daxter-pilot-wcar-turn-front-ja 327) -(def-art-elt daxter-ag daxter-pilot-car-smack-right-ja 326) -(def-art-elt daxter-ag daxter-pilot-car-smack-left-ja 325) -(def-art-elt daxter-ag daxter-pilot-eject-loop-ja 307) -(def-art-elt daxter-ag daxter-pilot-car-up-down-ja 303) -(def-art-elt daxter-ag daxter-pilot-car-smack-shock-ja 298) -(def-art-elt daxter-ag daxter-pilot-car-smack-back-ja 295) -(def-art-elt daxter-ag daxter-pilot-car-smack-front-ja 294) -(def-art-elt daxter-ag daxter-pilot-car-get-on-ja 290) -(def-art-elt daxter-ag daxter-pilot-car-get-off-ja 289) -(def-art-elt daxter-ag daxter-pilot-gun-dark-takeout-ja 322) -(def-art-elt daxter-ag daxter-pilot-gun-blue-takeout-ja 321) -(def-art-elt daxter-ag daxter-pilot-gun-yellow-takeout-ja 320) -(def-art-elt daxter-ag daxter-pilot-gun-blue-blue-ja 319) -(def-art-elt daxter-ag daxter-pilot-gun-yellow-blue-ja 318) -(def-art-elt daxter-ag daxter-pilot-gun-red-blue-ja 317) -(def-art-elt daxter-ag daxter-pilot-gun-red-yellow-ja 316) -(def-art-elt daxter-ag daxter-pilot-gun-red-dark-ja 315) -(def-art-elt daxter-ag daxter-pilot-gun-dark-fire-ja 314) -(def-art-elt daxter-ag daxter-pilot-gun-yellow-fire-ja 313) -(def-art-elt daxter-ag daxter-pilot-gun-red-fire-ja 312) -(def-art-elt daxter-ag daxter-pilot-gun-blue-idle-ja 311) -(def-art-elt daxter-ag daxter-pilot-gun-yellow-idle-ja 310) -(def-art-elt daxter-ag daxter-pilot-gun-dark-idle-ja 309) +(def-art-elt daxter-ag daxter-fldax-death-cactus-ja 398) +(def-art-elt daxter-ag daxter-fldax-finish-ja 397) +(def-art-elt daxter-ag daxter-fldax-run-squash-ja 396) +(def-art-elt daxter-ag daxter-fldax-walk-ja 395) +(def-art-elt daxter-ag daxter-fldax-wild-run-right-ja 394) +(def-art-elt daxter-ag daxter-fldax-wild-run-left-ja 393) +(def-art-elt daxter-ag daxter-fldax-get-off-ja 392) +(def-art-elt daxter-ag daxter-fldax-idle-ja 391) +(def-art-elt daxter-ag daxter-fldax-get-on-ja 390) +(def-art-elt daxter-ag daxter-fldax-jump-forward-loop-ja 389) +(def-art-elt daxter-ag daxter-fldax-jump-forward-ja 388) +(def-art-elt daxter-ag daxter-fldax-deatha-ja 387) +(def-art-elt daxter-ag daxter-fldax-smack-surface-end-ja 386) +(def-art-elt daxter-ag daxter-fldax-smack-surface-ja 385) +(def-art-elt daxter-ag daxter-fldax-wild-run-ja 384) +(def-art-elt daxter-ag daxter-pilot-wcar-snake-jump-ja 334) +(def-art-elt daxter-ag daxter-pilot-wcar-snake-out-ja 333) +(def-art-elt daxter-ag daxter-pilot-wcar-snake-loop-ja 332) +(def-art-elt daxter-ag daxter-pilot-wcar-snake-in-ja 331) +(def-art-elt daxter-ag daxter-gun-side-to-side-hop-2-ja 285) +(def-art-elt daxter-ag daxter-gun-duck-walk-ja 272) +(def-art-elt daxter-ag daxter-gun-yellow-fire-twirl-ja 266) +(def-art-elt daxter-ag daxter-gun-red-from-sideways-ja 265) +(def-art-elt daxter-ag daxter-gun-stance-red-sideways-ja 264) +(def-art-elt daxter-ag daxter-gun-dark-fire-twirl-ja 263) +(def-art-elt daxter-ag daxter-gun-red-fire-from-sideways-ja 262) +(def-art-elt daxter-ag daxter-gun-red-fire-to-sideways-ja 261) +(def-art-elt daxter-ag daxter-death-lava-ja 90) +(def-art-elt daxter-ag daxter-invisible-to-stance-ja 89) +(def-art-elt daxter-ag daxter-invisible-loop-ja 88) +(def-art-elt daxter-ag daxter-stance-to-invisible-ja 87) +(def-art-elt daxter-ag daxter-blast-recover-end-ja 86) +(def-art-elt daxter-ag daxter-blast-recover-loop-ja 85) +(def-art-elt daxter-ag daxter-blast-recover-ja 84) +(def-art-elt daxter-ag daxter-wall-hide-body-ja 83) +(def-art-elt daxter-ag daxter-wall-hide-head-right-ja 82) +(def-art-elt daxter-ag daxter-wall-hide-head-left-ja 81) +(def-art-elt daxter-ag daxter-wall-hide-head-ja 80) +(def-art-elt daxter-ag daxter-wall-hide-scared-return-ja 79) +(def-art-elt daxter-ag daxter-wall-hide-scared-loop-ja 78) +(def-art-elt daxter-ag daxter-wall-hide-scared-ja 77) +(def-art-elt daxter-ag daxter-wall-hide-ja 76) +(def-art-elt daxter-ag daxter-powerup-ja 73) +(def-art-elt daxter-ag daxter-attack-punch-alt-end-ja 47) +(def-art-elt daxter-ag daxter-attack-from-stance-run-alt-end-ja 41) +(def-art-elt daxter-ag daxter-attack-from-stance-alt-end-ja 39) +(def-art-elt daxter-ag daxter-stance-to-duck-ja 15) +(def-art-elt daxter-ag daxter-lightjak-shield-end-ja 467) +(def-art-elt daxter-ag daxter-lightjak-heal-end-ja 466) +(def-art-elt daxter-ag daxter-lightjak-heal-loop-ja 465) +(def-art-elt daxter-ag daxter-lightjak-heal-ja 464) +(def-art-elt daxter-ag daxter-lightjak-freeze-land-ja 462) +(def-art-elt daxter-ag daxter-lightjak-freeze-ja 461) +(def-art-elt daxter-ag daxter-lightjak-shield-ja 460) +(def-art-elt daxter-ag daxter-lightjak-swoop-land-ja 459) +(def-art-elt daxter-ag daxter-lightjak-swoop-fall-loop-ja 458) +(def-art-elt daxter-ag daxter-lightjak-swoop-fall-ja 457) +(def-art-elt daxter-ag daxter-lightjak-swoop2-ja 456) +(def-art-elt daxter-ag daxter-lightjak-swoop1-ja 455) +(def-art-elt daxter-ag daxter-lightjak-stance-ja 454) +(def-art-elt daxter-ag daxter-lightjak-stance-to-stance-ja 448) +(def-art-elt daxter-ag daxter-lightjak-get-on-out-ja 447) +(def-art-elt daxter-ag daxter-lightjak-get-on-land-ja 445) +(def-art-elt daxter-ag daxter-board-spin-ccw-ja 213) +(def-art-elt daxter-ag daxter-board-spin-cw-ja 212) +(def-art-elt daxter-ag daxter-board-kickspin-c-ja 204) +(def-art-elt daxter-ag daxter-board-kickspin-b-ja 203) +(def-art-elt daxter-ag daxter-board-airwalk-end-ja 202) +(def-art-elt daxter-ag daxter-board-airwalk-loop-ja 201) +(def-art-elt daxter-ag daxter-board-airwalk-ja 200) +(def-art-elt daxter-ag daxter-board-backgrab-end-ja 199) +(def-art-elt daxter-ag daxter-board-backgrab-loop-ja 198) +(def-art-elt daxter-ag daxter-board-backgrab-ja 197) +(def-art-elt daxter-ag daxter-board-method-cross-end-ja 196) +(def-art-elt daxter-ag daxter-board-method-cross-loop-ja 195) +(def-art-elt daxter-ag daxter-board-method-cross-ja 194) +(def-art-elt daxter-ag daxter-board-kickspin-a-ja 193) +(def-art-elt daxter-ag daxter-board-jump-high-ja 192) +(def-art-elt daxter-ag daxter-board-kickflip-c-ja 189) +(def-art-elt daxter-ag daxter-board-kickflip-b-ja 188) +(def-art-elt daxter-ag daxter-board-jump-kickoff-ja 184) +(def-art-elt daxter-ag daxter-board-noseflip-ja 183) (def-art-elt daxter-ag daxter-gun-attack-butt-end-alt1-ja 287) (def-art-elt daxter-ag daxter-ladder-jump-ja 571) (def-art-elt daxter-ag daxter-edge-grab-stance1-ja 30) (def-art-elt daxter-ag daxter-board-hit-ja 154) (def-art-elt daxter-ag daxter-gun-yellow-fire-3-ja 281) -(def-art-elt daxter-ag daxter-jump-short-land-ja 24) -(def-art-elt daxter-ag daxter-pidax-car-crash-back-ja 538) (def-art-elt daxter-ag daxter-gun-red-fire-2-ja 280) (def-art-elt daxter-ag daxter-ladder-stance-ja 564) (def-art-elt daxter-ag daxter-jump-loop-ja 23) -(def-art-elt daxter-ag daxter-pidax-car-crash-front-ja 537) (def-art-elt daxter-ag daxter-gun-front-jump-land-ja 271) (def-art-elt daxter-ag daxter-run-squash-weak-ja 14) -(def-art-elt daxter-ag daxter-indax-hang-get-on-ja 528) (def-art-elt daxter-ag daxter-gun-front-jump-ja 270) (def-art-elt daxter-ag daxter-run-squash-ja 13) -(def-art-elt daxter-ag daxter-indax-hang-walk-to-stance-ja 527) (def-art-elt daxter-ag daxter-gun-front-run-ja 269) -(def-art-elt daxter-ag daxter-walk-down-ja 12) -(def-art-elt daxter-ag daxter-indax-hang-attack-ja 526) (def-art-elt daxter-ag daxter-gun-duck-roll-end-ja 253) -(def-art-elt daxter-ag daxter-indax-run-right-ja 510) (def-art-elt daxter-ag daxter-gun-duck-roll-ja 252) -(def-art-elt daxter-ag daxter-indax-run-left-ja 509) (def-art-elt daxter-ag daxter-gun-edge-grab-to-jump-ja 251) -(def-art-elt daxter-ag daxter-indax-run-down-ja 508) (def-art-elt daxter-ag daxter-gun-edge-grab-off-ja 250) -(def-art-elt daxter-ag daxter-indax-run-up-ja 507) (def-art-elt daxter-ag daxter-gun-attack-upperbutt-blue-ja 249) -(def-art-elt daxter-ag daxter-indax-tube-jump-land-ja 506) (def-art-elt daxter-ag daxter-gun-jump-land-side-ja 248) -(def-art-elt daxter-ag daxter-indax-tube-turn-ja 505) (def-art-elt daxter-ag daxter-gun-jump-land-ja 247) -(def-art-elt daxter-ag daxter-indax-death-shock-ja 504) (def-art-elt daxter-ag daxter-gun-attack-butt-blue-end-ja 246) -(def-art-elt daxter-ag daxter-indax-death-freeze-ja 503) (def-art-elt daxter-ag daxter-gun-attack-butt-blue-ja 245) -(def-art-elt daxter-ag daxter-indax-trip-land-ja 502) (def-art-elt daxter-ag daxter-gun-attack-butt-end-ja 244) -(def-art-elt daxter-ag daxter-indax-trip-ja 501) (def-art-elt daxter-ag daxter-gun-attack-butt-ja 243) -(def-art-elt daxter-ag daxter-indax-running-attack-end-ja 500) (def-art-elt daxter-ag daxter-gun-blue-to-front-hop-ja 242) -(def-art-elt daxter-ag daxter-indax-run-squash-hands-ja 499) (def-art-elt daxter-ag daxter-gun-front-to-blue-hop-ja 241) -(def-art-elt daxter-ag daxter-indax-jump-forward-hands-land-ja 498) (def-art-elt daxter-ag daxter-gun-front-to-side-hop-ja 240) -(def-art-elt daxter-ag daxter-indax-jump-forward-hands-loop-ja 497) (def-art-elt daxter-ag daxter-gun-transformation-twirl-ja 239) -(def-art-elt daxter-ag daxter-indax-jump-forward-hands-ja 496) (def-art-elt daxter-ag daxter-gun-side-to-front-hop-ja 238) -(def-art-elt daxter-ag daxter-indax-running-attack-ja 495) (def-art-elt daxter-ag daxter-gun-attack-upperbutt-ja 237) -(def-art-elt daxter-ag daxter-indax-death-eaten-ja 494) (def-art-elt daxter-ag daxter-gun-blue-takeout-ja 236) -(def-art-elt daxter-ag daxter-indax-death-kill-ja 493) (def-art-elt daxter-ag daxter-gun-yellow-takeout-ja 235) -(def-art-elt daxter-ag daxter-indax-death-fall-ja 492) (def-art-elt daxter-ag daxter-gun-dark-takeout-ja 234) -(def-art-elt daxter-ag daxter-indax-death-squashed-ja 491) (def-art-elt daxter-ag daxter-gun-red-takeout-ja 233) -(def-art-elt daxter-ag daxter-indax-hit-roll-ja 490) (def-art-elt daxter-ag daxter-gun-run-blue-ja 232) -(def-art-elt daxter-ag daxter-indax-hit-back-ja 489) (def-art-elt daxter-ag daxter-gun-walk-side-ja 231) -(def-art-elt daxter-ag daxter-indax-hit-front-ja 488) (def-art-elt daxter-ag daxter-gun-yellow-fire-ja 230) -(def-art-elt daxter-ag daxter-indax-run-to-stance-ja 487) (def-art-elt daxter-ag daxter-gun-dark-fire-ja 229) -(def-art-elt daxter-ag daxter-indax-attack-spin-air-ja 486) (def-art-elt daxter-ag daxter-gun-blue-fire-single-ja 228) -(def-art-elt daxter-ag daxter-indax-run-squash-ja 485) (def-art-elt daxter-ag daxter-gun-blue-fire-ja 227) -(def-art-elt daxter-ag daxter-indax-jump-forward-land-ja 484) (def-art-elt daxter-ag daxter-gun-red-fire-ja 226) -(def-art-elt daxter-ag daxter-indax-jump-forward-loop-ja 483) (def-art-elt daxter-ag daxter-gun-stance-blue-ja 225) -(def-art-elt daxter-ag daxter-indax-jump-forward-ja 482) (def-art-elt daxter-ag daxter-gun-stance-yellow-ja 224) -(def-art-elt daxter-ag daxter-indax-run-look-back-ja 481) (def-art-elt daxter-ag daxter-gun-blue-to-yellow-ja 222) -(def-art-elt daxter-ag daxter-indax-attack-spin-ja 479) (def-art-elt daxter-ag daxter-gun-attack-from-stance-blue-end-ja 221) -(def-art-elt daxter-ag daxter-indax-jump-land-ja 478) (def-art-elt daxter-ag daxter-gun-attack-from-stance-blue-ja 220) -(def-art-elt daxter-ag daxter-indax-jump-loop-ja 477) (def-art-elt daxter-ag daxter-gun-attack-from-stance-end-ja 219) -(def-art-elt daxter-ag daxter-indax-jump-ja 476) (def-art-elt daxter-ag daxter-gun-attack-from-stance-ja 218) -(def-art-elt daxter-ag daxter-indax-run-ja 475) (def-art-elt daxter-ag daxter-gun-yellow-highlow-ja 217) -(def-art-elt daxter-ag daxter-indax-walk-ja 474) (def-art-elt daxter-ag daxter-gun-yellow-fire-low-ja 216) -(def-art-elt daxter-ag daxter-indax-stance-ja 473) (def-art-elt daxter-ag daxter-gun-stance-yellow-low-ja 215) +(def-art-elt daxter-ag daxter-lightjak-dummy25-ja 472) (def-art-elt daxter-ag daxter-gun-blue-fire-2-ja 282) (def-art-elt daxter-ag daxter-ladder-down-ja 566) (def-art-elt daxter-ag daxter-jump-forward-ja 25) -(def-art-elt daxter-ag daxter-pidax-car-crash-left-ja 539) (def-art-elt daxter-ag daxter-ladder-slide-loop-ja 569) (def-art-elt daxter-ag daxter-launch-jump-loop-ja 28) (def-art-elt daxter-ag daxter-board-jump-loop-ja 152) +(def-art-elt daxter-ag daxter-darkjak-hit-ja 409) (def-art-elt daxter-ag daxter-gun-red-fire-fast-ja 279) -(def-art-elt daxter-ag daxter-painful-land-end-ja 22) -(def-art-elt daxter-ag daxter-pidax-car-up-down-ja 536) (def-art-elt daxter-ag daxter-board-jump-ja 151) (def-art-elt daxter-ag daxter-board-turn-ja 149) (def-art-elt daxter-ag daxter-board-duck-turn-ja 148) (def-art-elt daxter-ag daxter-gun-side-jump-land-ja 275) -(def-art-elt daxter-ag daxter-indax-hang-dummy8-ja 532) (def-art-elt daxter-ag daxter-ladder-up-ja 562) (def-art-elt daxter-ag daxter-painful-land-ja 21) -(def-art-elt daxter-ag daxter-pidax-car-turn-back-ja 535) +(def-art-elt daxter-ag daxter-gun-red-reload-ja 278) (def-art-elt daxter-ag daxter-board-stance-ja 147) (def-art-elt daxter-ag daxter-gun-side-jump-ja 274) -(def-art-elt daxter-ag daxter-indax-hang-dummy7-ja 531) -(def-art-elt daxter-ag daxter-jump-land-ja 20) -(def-art-elt daxter-ag daxter-pidax-car-turn-front-ja 534) +(def-art-elt daxter-ag daxter-gun-wall-hide-loop-ja 277) (def-art-elt daxter-ag daxter-gun-walk-blue-ja 273) -(def-art-elt daxter-ag daxter-indax-hang-dummy6-ja 530) (def-art-elt daxter-ag daxter-ladder-get-on-ja 560) (def-art-elt daxter-ag daxter-jump-ja 19) -(def-art-elt daxter-ag daxter-indax-hang-dummy9-ja 533) +(def-art-elt daxter-ag daxter-gun-wall-hide-ja 276) (def-art-elt daxter-ag daxter-gun-front-walk-ja 268) -(def-art-elt daxter-ag daxter-walk-up-ja 11) -(def-art-elt daxter-ag daxter-indax-hang-dodge-off-ja 525) (def-art-elt daxter-ag daxter-gun-hit-elec-ja 267) -(def-art-elt daxter-ag daxter-walk-ja 10) -(def-art-elt daxter-ag daxter-indax-hang-dodge-loop-ja 524) (def-art-elt daxter-ag daxter-gun-blue-stance-2-ja 283) -(def-art-elt daxter-ag daxter-pidax-car-crash-right-ja 540) (def-art-elt daxter-ag daxter-ladder-slide-stop-ja 570) (def-art-elt daxter-ag daxter-edge-grab-stance0-ja 29) (def-art-elt daxter-ag daxter-gun-attack-from-stance-end-alt1-ja 286) (def-art-elt daxter-ag daxter-gun-roll-flip-ja 254) -(def-art-elt daxter-ag daxter-indax-dummy0-ja 511) +(def-art-elt daxter-ag daxter-pidax-missile-turn-front-ja 541) +(def-art-elt daxter-ag daxter-lod0-jg 0) (def-art-elt daxter-ag daxter-gun-flop-down-loop-ja 257) -(def-art-elt daxter-ag daxter-indax-dummy3-ja 514) (def-art-elt daxter-ag daxter-roll-flip-land-ja 59) (def-art-elt daxter-ag daxter-gun-side-to-side-hop-1-ja 284) -(def-art-elt daxter-ag daxter-lod0-jg 0) -(def-art-elt daxter-ag daxter-pidax-missile-turn-front-ja 541) +(def-art-elt daxter-ag daxter-ladder-slide-start-ja 568) +(def-art-elt daxter-ag daxter-launch-jump-ja 27) (def-art-elt daxter-ag daxter-gun-roll-flip-land-ja 255) -(def-art-elt daxter-ag daxter-indax-dummy1-ja 512) (def-art-elt daxter-ag daxter-pidax-missile-turn-back-ja 542) (def-art-elt daxter-ag daxter-lod0-mg 1) (def-art-elt daxter-ag daxter-gun-flop-down-land-ja 258) -(def-art-elt daxter-ag daxter-indax-dummy4-ja 515) (def-art-elt daxter-ag daxter-trip-ja 60) (def-art-elt daxter-ag daxter-gun-flop-down-ja 256) -(def-art-elt daxter-ag daxter-indax-dummy2-ja 513) (def-art-elt daxter-ag daxter-pidax-missile-jump-ja 543) (def-art-elt daxter-ag daxter-shadow-mg 2) (def-art-elt daxter-ag daxter-gun-hit-from-front-ja 259) -(def-art-elt daxter-ag daxter-indax-dummy5-ja 516) (def-art-elt daxter-ag daxter-hit-elec-ja 61) (def-art-elt daxter-ag daxter-ladder-jump-on-ja 573) (def-art-elt daxter-ag daxter-falling-to-edge-grab-ja 32) (def-art-elt daxter-ag daxter-pidax-missile-jump-loop-ja 544) (def-art-elt daxter-ag daxter-run-to-stance-ja 3) (def-art-elt daxter-ag daxter-gun-hit-from-back-ja 260) -(def-art-elt daxter-ag daxter-indax-dummy6-ja 517) (def-art-elt daxter-ag daxter-hit-from-front-ja 62) -(def-art-elt daxter-ag daxter-indax-dummy7-ja 518) +(def-art-elt daxter-ag daxter-pidax-missile-get-off-prep-ja 545) +(def-art-elt daxter-ag daxter-run-to-stance-loop-ja 4) (def-art-elt daxter-ag daxter-hit-from-back-ja 63) (def-art-elt daxter-ag daxter-pidax-missile-up-down-ja 546) (def-art-elt daxter-ag daxter-stance-loop-ja 5) -(def-art-elt daxter-ag daxter-indax-hang-stance-ja 519) (def-art-elt daxter-ag daxter-hit-up-ja 64) (def-art-elt daxter-ag daxter-edge-grab-to-jump-ja 35) -(def-art-elt daxter-ag daxter-indax-hang-walk-ja 520) +(def-art-elt daxter-ag daxter-pidax-missile-crash-left-ja 547) +(def-art-elt daxter-ag daxter-run-to-stance-fast-ja 6) (def-art-elt daxter-ag daxter-deatha-ja 65) (def-art-elt daxter-ag daxter-edge-grab-off-ja 36) -(def-art-elt daxter-ag daxter-indax-hang-walk-start-ja 521) +(def-art-elt daxter-ag daxter-pidax-missile-crash-right-ja 548) +(def-art-elt daxter-ag daxter-run-ja 7) (def-art-elt daxter-ag daxter-death-painful-land-ja 66) (def-art-elt daxter-ag daxter-attack-from-stance-ja 37) +(def-art-elt daxter-ag daxter-walk-ja 10) +(def-art-elt daxter-ag daxter-jak-death-3-ja 551) (def-art-elt daxter-ag daxter-gun-stance-ja 214) +(def-art-elt daxter-ag daxter-lightjak-dummy24-ja 471) +(def-art-elt daxter-ag daxter-jak-death-1-ja 549) (def-art-elt daxter-ag daxter-run-up-ja 8) -(def-art-elt daxter-ag daxter-indax-hang-turn-around-ja 522) (def-art-elt daxter-ag daxter-smack-surface-ja 67) +(def-art-elt daxter-ag daxter-jak-death-2-ja 550) (def-art-elt daxter-ag daxter-run-down-ja 9) -(def-art-elt daxter-ag daxter-indax-hang-dodge-on-ja 523) (def-art-elt daxter-ag daxter-smack-surface-end-ja 68) (def-art-elt daxter-ag daxter-shocked-ja 69) (def-art-elt daxter-ag daxter-attack-from-stance-end-ja 38) +(def-art-elt daxter-ag daxter-walk-up-ja 11) +(def-art-elt daxter-ag daxter-jak-death-4-ja 552) (def-art-elt daxter-ag daxter-attack-from-stance-run-end-ja 40) -(def-art-elt daxter-ag daxter-pilot-gun-blue-fire-single-ja 297) (def-art-elt daxter-ag daxter-attack-from-jump-ja 42) (def-art-elt daxter-ag daxter-attack-from-jump-loop-ja 43) +(def-art-elt daxter-ag daxter-duck-stance-ja 16) +(def-art-elt daxter-ag daxter-dummy-57-ja 557) (def-art-elt daxter-ag daxter-attack-from-jump-end-ja 44) +(def-art-elt daxter-ag daxter-duck-walk-ja 17) +(def-art-elt daxter-ag daxter-dummy-58-ja 558) (def-art-elt daxter-ag daxter-attack-punch-ja 45) +(def-art-elt daxter-ag daxter-turn-around-ja 18) +(def-art-elt daxter-ag daxter-dummy-59-ja 559) (def-art-elt daxter-ag daxter-attack-punch-end-ja 46) (def-art-elt daxter-ag daxter-attack-uppercut-ja 48) (def-art-elt daxter-ag daxter-flop-down-ja 49) +(def-art-elt daxter-ag daxter-painful-land-end-ja 22) +(def-art-elt daxter-ag daxter-ladder-up-to-stance-ja 563) (def-art-elt daxter-ag daxter-flop-down-loop-ja 50) (def-art-elt daxter-ag daxter-flop-down-land-ja 51) -(def-art-elt daxter-ag daxter-pilot-gun-red-idle-ja 308) +(def-art-elt daxter-ag daxter-jump-short-land-ja 24) +(def-art-elt daxter-ag daxter-ladder-stance-to-down-ja 565) (def-art-elt daxter-ag daxter-moving-flop-down-ja 52) (def-art-elt daxter-ag daxter-moving-flop-down-loop-ja 53) +(def-art-elt daxter-ag daxter-duck-high-jump-ja 26) +(def-art-elt daxter-ag daxter-ladder-get-off-ja 567) (def-art-elt daxter-ag daxter-flop-jump-ja 55) (def-art-elt daxter-ag daxter-gun-stance-dark-ja 223) -(def-art-elt daxter-ag daxter-indax-attack-spin-end-ja 480) (def-art-elt daxter-ag daxter-flut-idle-ja 350) +(def-art-elt daxter-ag daxter-dummy56-ja 93) (def-art-elt daxter-ag daxter-duck-roll-ja 56) (def-art-elt daxter-ag daxter-duck-roll-end-ja 57) (def-art-elt daxter-ag daxter-roll-flip-ja 58) @@ -4927,6 +5123,7 @@ (def-art-elt daxter-ag daxter-board-turn-up-ja 159) (def-art-elt daxter-ag daxter-board-turn-down-ja 160) (def-art-elt daxter-ag daxter-board-hit-forward-ja 161) +(def-art-elt daxter-ag daxter-darkjak-attack-combo3-ja 418) (def-art-elt daxter-ag daxter-board-get-on-ja 166) (def-art-elt daxter-ag daxter-board-get-off-ja 167) (def-art-elt daxter-ag daxter-darkjak-get-on-fast-ja 424) @@ -4939,8 +5136,11 @@ (def-art-elt daxter-ag daxter-lightjak-get-off-ja 444) (def-art-elt daxter-ag daxter-board-hit-get-off-ja 190) (def-art-elt daxter-ag daxter-darkjak-get-off-ja 420) +(def-art-elt daxter-ag daxter-board-ride-turn-front-ja 163) (def-art-elt daxter-ag daxter-darkjak-get-off-end-ja 427) +(def-art-elt daxter-ag daxter-board-method-ja 170) (def-art-elt daxter-ag daxter-darkjak-get-on-fast-loop-ja 434) +(def-art-elt daxter-ag daxter-board-flip-forward-loop-ja 177) (def-art-elt daxter-ag daxter-powerjak-get-on-ja 441) (def-art-elt daxter-ag daxter-lightjak-get-on-loop-ja 446) (def-art-elt daxter-ag daxter-wade-shallow-walk-ja 97) @@ -4956,87 +5156,89 @@ (def-art-elt daxter-ag daxter-death-swim-ja 107) (def-art-elt daxter-ag daxter-death-swim-loop-ja 108) (def-art-elt daxter-ag daxter-death-swim-end-ja 109) -(def-art-elt daxter-ag daxter-pole-cycle-ja 110) -(def-art-elt daxter-ag daxter-pole-cycle2-ja 111) -(def-art-elt daxter-ag daxter-pole-flip-up-ja 112) -(def-art-elt daxter-ag daxter-pole-flip-forward-ja 113) -(def-art-elt daxter-ag daxter-pole-jump-loop-ja 114) -(def-art-elt daxter-ag daxter-run-to-stance-loop-ja 4) -(def-art-elt daxter-ag daxter-pidax-missile-get-off-prep-ja 545) -(def-art-elt daxter-ag daxter-pilot-gun-red-takeout-ja 288) -(def-art-elt daxter-ag daxter-run-to-stance-fast-ja 6) -(def-art-elt daxter-ag daxter-pidax-missile-crash-left-ja 547) -(def-art-elt daxter-ag daxter-run-ja 7) -(def-art-elt daxter-ag daxter-pidax-missile-crash-right-ja 548) -(def-art-elt daxter-ag daxter-turret-stance-ja 341) -(def-art-elt daxter-ag daxter-turret-get-off-ja 342) -(def-art-elt daxter-ag daxter-turret-get-on-ja 343) -(def-art-elt daxter-ag daxter-turret-for-stance-ja 344) -(def-art-elt daxter-ag daxter-turret-for-get-off-ja 345) -(def-art-elt daxter-ag daxter-turret-for-get-on-ja 346) -(def-art-elt daxter-ag daxter-turret-for-stance-left-ja 347) -(def-art-elt daxter-ag daxter-turret-for-stance-right-ja 348) -(def-art-elt daxter-ag daxter-turret-for-fire-ja 349) -(def-art-elt daxter-ag daxter-indax-hang-dummy5-ja 529) -(def-art-elt daxter-ag daxter-pilot-glider-turn-front-ja 329) -(def-art-elt daxter-ag daxter-pilot-glider-turn-back-ja 330) -(def-art-elt daxter-ag daxter-pilot-gun-blue-fire-ja 296) - -(def-art-elt scorpion-wheel-fma-ag scorpion-wheel-fma-idle-ja 3) -(def-art-elt scorpion-wheel-fma-ag scorpion-wheel-fma-shadow-mg 2) -(def-art-elt scorpion-wheel-fma-ag scorpion-wheel-fma-lod0-mg 1) -(def-art-elt scorpion-wheel-fma-ag scorpion-wheel-fma-lod0-jg 0) - -(def-art-elt precur-bridge-e-path-break-ag precur-bridge-e-path-break-idle2-ja 3) -(def-art-elt precur-bridge-e-path-break-ag precur-bridge-e-path-break-idle-ja 2) -(def-art-elt precur-bridge-e-path-break-ag precur-bridge-e-path-break-lod0-mg 1) -(def-art-elt precur-bridge-e-path-break-ag precur-bridge-e-path-break-lod0-jg 0) +(def-art-elt daxter-ag daxter-darkjak-get-on-ja 402) +(def-art-elt daxter-ag daxter-walk-down-ja 12) +(def-art-elt daxter-ag daxter-jak-death-5-ja 553) +(def-art-elt daxter-ag daxter-ladder-fall-ja 572) +(def-art-elt daxter-ag daxter-edge-grab-stance1-alt-ja 31) +(def-art-elt daxter-ag daxter-ladder-switch-ja 574) +(def-art-elt daxter-ag daxter-edge-grab-swing-left-ja 33) +(def-art-elt daxter-ag daxter-edge-grab-swing-right-ja 34) +(def-art-elt daxter-ag daxter-moving-flop-down-land-ja 54) +(def-art-elt daxter-ag daxter-yellow-running-blast-ja 70) +(def-art-elt daxter-ag daxter-yellow-running-blast-end-ja 71) +(def-art-elt daxter-ag daxter-yellow-jumping-blast-ja 72) +(def-art-elt daxter-ag daxter-slide-right-ja 74) +(def-art-elt daxter-ag daxter-slide-left-ja 75) +(def-art-elt daxter-ag daxter-dummy55-ja 92) +(def-art-elt daxter-ag daxter-dummy57-ja 94) +(def-art-elt daxter-ag daxter-dummy58-ja 95) +(def-art-elt daxter-ag daxter-dummy59-ja 96) +(def-art-elt daxter-ag daxter-tube-dummy2-ja 120) +(def-art-elt daxter-ag daxter-flut-dummy2-ja 377) +(def-art-elt daxter-ag daxter-tube-dummy3-ja 121) +(def-art-elt daxter-ag daxter-flut-dummy3-ja 378) +(def-art-elt daxter-ag daxter-tube-dummy4-ja 122) +(def-art-elt daxter-ag daxter-flut-dummy4-ja 379) +(def-art-elt daxter-ag daxter-tube-dummy5-ja 123) +(def-art-elt daxter-ag daxter-flut-dummy5-ja 380) +(def-art-elt daxter-ag daxter-tube-dummy6-ja 124) +(def-art-elt daxter-ag daxter-flut-dummy6-ja 381) +(def-art-elt daxter-ag daxter-board-flip-forward-land-ja 156) +(def-art-elt daxter-ag daxter-board-flip-backward-land-ja 175) +(def-art-elt daxter-ag daxter-board-kickflip-land-ja 176) +(def-art-elt daxter-ag daxter-board-dummy3-ja 205) +(def-art-elt daxter-ag daxter-board-dummy4-ja 206) +(def-art-elt daxter-ag daxter-lightjak-dummy26-ja 463) +(def-art-elt daxter-ag daxter-board-dummy5-ja 207) +(def-art-elt daxter-ag daxter-board-dummy6-ja 208) +(def-art-elt daxter-ag daxter-board-dummy7-ja 209) +(def-art-elt daxter-ag daxter-board-dummy8-ja 210) +(def-art-elt daxter-ag daxter-board-dummy9-ja 211) +(def-art-elt daxter-ag daxter-lightjak-dummy21-ja 468) +(def-art-elt daxter-ag daxter-pilot-gun-dummy0-ja 335) +(def-art-elt daxter-ag daxter-pilot-gun-dummy1-ja 336) +(def-art-elt daxter-ag daxter-pilot-gun-dummy2-ja 337) +(def-art-elt daxter-ag daxter-pilot-gun-dummy3-ja 338) +(def-art-elt daxter-ag daxter-pilot-gun-dummy4-ja 339) +(def-art-elt daxter-ag daxter-pilot-gun-dummy5-ja 340) +(def-art-elt daxter-ag daxter-flut-dummy7-ja 382) +(def-art-elt daxter-ag daxter-flut-dummy8-ja 383) +(def-art-elt daxter-ag daxter-fldax-dummy6-ja 399) +(def-art-elt daxter-ag daxter-fldax-dummy7-ja 400) +(def-art-elt daxter-ag daxter-fldax-dummy8-ja 401) +(def-art-elt daxter-ag daxter-darkjak-hit-land-ja 410) +(def-art-elt daxter-ag daxter-board-turn-around-ja 153) +(def-art-elt daxter-ag daxter-darkjak-attack-combo3-end-ja 419) +(def-art-elt daxter-ag daxter-board-ride-turn-back-ja 162) +(def-art-elt daxter-ag daxter-lightjak-dummy10-ja 449) +(def-art-elt daxter-ag daxter-lightjak-dummy11-ja 450) +(def-art-elt daxter-ag daxter-lightjak-dummy12-ja 451) +(def-art-elt daxter-ag daxter-lightjak-dummy13-ja 452) +(def-art-elt daxter-ag daxter-lightjak-dummy14-ja 453) +(def-art-elt daxter-ag daxter-lightjak-dummy22-ja 469) +(def-art-elt daxter-ag daxter-lightjak-dummy23-ja 470) +(def-art-elt daxter-ag daxter-jump-land-ja 20) +(def-art-elt daxter-ag daxter-ladder-stance-to-up-ja 561) +(def-art-elt daxter-ag daxter-board-jump-kick-ja 150) +(def-art-elt daxter-ag daxter-board-flip-forward-ja 155) +(def-art-elt daxter-ag daxter-board-ride-turn-right-ja 164) +(def-art-elt daxter-ag daxter-board-ride-turn-left-ja 165) +(def-art-elt daxter-ag daxter-board-grenade-ja 168) +(def-art-elt daxter-ag daxter-board-nosegrab-ja 169) +(def-art-elt daxter-ag daxter-board-kickflip-a-ja 171) +(def-art-elt daxter-ag daxter-board-spin-ja 172) +(def-art-elt daxter-ag daxter-board-flip-backward-ja 174) +(def-art-elt daxter-ag daxter-board-flip-backward-loop-ja 178) +(def-art-elt daxter-ag daxter-board-method-loop-ja 179) +(def-art-elt daxter-ag daxter-board-method-end-ja 180) +(def-art-elt daxter-ag daxter-board-nosegrab-loop-ja 181) +(def-art-elt daxter-ag daxter-board-nosegrab-end-ja 182) -(def-art-elt flut-saddle-ag flut-saddle-fldax-death-cactus-ja 51) -(def-art-elt flut-saddle-ag flut-saddle-fldax-finish-ja 50) -(def-art-elt flut-saddle-ag flut-saddle-fldax-run-squash-ja 49) -(def-art-elt flut-saddle-ag flut-saddle-fldax-walk-ja 48) -(def-art-elt flut-saddle-ag flut-saddle-fldax-wild-run-right-ja 47) -(def-art-elt flut-saddle-ag flut-saddle-fldax-wild-run-left-ja 46) -(def-art-elt flut-saddle-ag flut-saddle-fldax-get-off-ja 45) -(def-art-elt flut-saddle-ag flut-saddle-fldax-idle-ja 44) -(def-art-elt flut-saddle-ag flut-saddle-fldax-get-on-ja 43) -(def-art-elt flut-saddle-ag flut-saddle-fldax-jump-forward-loop-ja 42) -(def-art-elt flut-saddle-ag flut-saddle-fldax-jump-forward-ja 41) -(def-art-elt flut-saddle-ag flut-saddle-fldax-deatha-ja 40) -(def-art-elt flut-saddle-ag flut-saddle-fldax-smack-surface-end-ja 39) -(def-art-elt flut-saddle-ag flut-saddle-fldax-smack-surface-ja 38) -(def-art-elt flut-saddle-ag flut-saddle-fldax-wild-run-ja 37) -(def-art-elt flut-saddle-ag flut-saddle-flut-idle-ja 3) -(def-art-elt flut-saddle-ag flut-saddle-flut-running-attack-end-ja 15) -(def-art-elt flut-saddle-ag flut-saddle-flut-double-jump-ja 13) -(def-art-elt flut-saddle-ag flut-saddle-flut-jump-forward-land-ja 12) -(def-art-elt flut-saddle-ag flut-saddle-flut-jump-forward-loop-ja 11) -(def-art-elt flut-saddle-ag flut-saddle-flut-jump-forward-ja 10) -(def-art-elt flut-saddle-ag flut-saddle-flut-jump-land-ja 9) -(def-art-elt flut-saddle-ag flut-saddle-flut-jump-loop-ja 8) -(def-art-elt flut-saddle-ag flut-saddle-flut-jump-ja 7) -(def-art-elt flut-saddle-ag flut-saddle-flut-run-ja 6) -(def-art-elt flut-saddle-ag flut-saddle-flut-jog-ja 5) -(def-art-elt flut-saddle-ag flut-saddle-flut-walk-ja 4) -(def-art-elt flut-saddle-ag flut-saddle-flut-running-attack-ja 14) -(def-art-elt flut-saddle-ag flut-saddle-flut-kanga-catch-ja 27) -(def-art-elt flut-saddle-ag flut-saddle-flut-air-attack-ja 16) -(def-art-elt flut-saddle-ag flut-saddle-flut-air-attack-loop-ja 17) -(def-art-elt flut-saddle-ag flut-saddle-flut-air-attack-land-ja 18) -(def-art-elt flut-saddle-ag flut-saddle-flut-get-on-ja 19) -(def-art-elt flut-saddle-ag flut-saddle-flut-get-off-ja 20) -(def-art-elt flut-saddle-ag flut-saddle-flut-hit-back-ja 21) -(def-art-elt flut-saddle-ag flut-saddle-flut-hit-back-end-ja 22) -(def-art-elt flut-saddle-ag flut-saddle-flut-smack-surface-ja 23) -(def-art-elt flut-saddle-ag flut-saddle-flut-smack-surface-end-ja 24) -(def-art-elt flut-saddle-ag flut-saddle-flut-deatha-ja 25) -(def-art-elt flut-saddle-ag flut-saddle-flut-run-squash-ja 26) -(def-art-elt flut-saddle-ag flut-saddle-flut-deathb-ja 28) -(def-art-elt flut-saddle-ag flut-saddle-flut-death-drown-ja 29) -(def-art-elt flut-saddle-ag flut-saddle-lod0-jg 0) -(def-art-elt flut-saddle-ag flut-saddle-lod0-mg 1) -(def-art-elt flut-saddle-ag flut-saddle-shadow-mg 2) +(def-art-elt scorpion-wheel-fma-ag scorpion-wheel-fma-idle-ja 3) +(def-art-elt scorpion-wheel-fma-ag scorpion-wheel-fma-shadow-mg 2) +(def-art-elt scorpion-wheel-fma-ag scorpion-wheel-fma-lod0-mg 1) +(def-art-elt scorpion-wheel-fma-ag scorpion-wheel-fma-lod0-jg 0) (def-art-elt ottsel-daxpants-ag ottsel-daxpants-idle-ja 3) (def-art-elt ottsel-daxpants-ag ottsel-daxpants-shadow-mg 2) @@ -5090,13 +5292,129 @@ (def-art-elt sew-pipe-ag sew-pipe-lod0-mg 1) (def-art-elt sew-pipe-ag sew-pipe-lod0-jg 0) -(def-art-elt jakb-ag jakb-tentacle-attack-ja 109) -(def-art-elt jakb-ag jakb-pilot-wcar-snake-jump-ja 275) -(def-art-elt jakb-ag jakb-pilot-wcar-snake-out-ja 274) -(def-art-elt jakb-ag jakb-pilot-wcar-snake-loop-ja 273) -(def-art-elt jakb-ag jakb-pilot-wcar-snake-in-ja 272) +(def-art-elt jakb-ag jakb-turret-for-fire-ja 405) +(def-art-elt jakb-ag jakb-turret-for-stance-right-ja 404) +(def-art-elt jakb-ag jakb-turret-for-stance-left-ja 403) +(def-art-elt jakb-ag jakb-turret-for-get-on-ja 402) +(def-art-elt jakb-ag jakb-turret-for-get-off-ja 401) +(def-art-elt jakb-ag jakb-turret-for-stance-ja 400) +(def-art-elt jakb-ag jakb-turret-get-on-ja 399) +(def-art-elt jakb-ag jakb-turret-get-off-ja 398) +(def-art-elt jakb-ag jakb-turret-stance-ja 397) (def-art-elt jakb-ag jakb-tube-jump-land-ja 136) (def-art-elt jakb-ag jakb-tube-turn-ja 135) +(def-art-elt jakb-ag jakb-tentacle-attack-ja 109) +(def-art-elt jakb-ag jakb-racer-death-explode-ja 163) +(def-art-elt jakb-ag jakb-racer-get-on-ja 162) +(def-art-elt jakb-ag jakb-racer-get-off-ja 161) +(def-art-elt jakb-ag jakb-racer-smack-ja 160) +(def-art-elt jakb-ag jakb-racer-jump-high-land-ja 159) +(def-art-elt jakb-ag jakb-racer-jump-high-loop-ja 158) +(def-art-elt jakb-ag jakb-racer-stance-ja 157) +(def-art-elt jakb-ag jakb-racer-jump-small-land-ja 156) +(def-art-elt jakb-ag jakb-racer-jump-small-loop-ja 155) +(def-art-elt jakb-ag jakb-racer-jump-small-ja 154) +(def-art-elt jakb-ag jakb-racer-jump-land-ja 153) +(def-art-elt jakb-ag jakb-racer-jump-loop-ja 152) +(def-art-elt jakb-ag jakb-racer-jump-ja 151) +(def-art-elt jakb-ag jakb-racer-dig2-ja 150) +(def-art-elt jakb-ag jakb-racer-dig-ja 149) +(def-art-elt jakb-ag jakb-racer-turn2-ja 148) +(def-art-elt jakb-ag jakb-racer-turn-ja 147) +(def-art-elt jakb-ag jakb-racer-idle-ja 146) +(def-art-elt jakb-ag jakb-pole-jump-loop-ja 131) +(def-art-elt jakb-ag jakb-pole-flip-forward-ja 130) +(def-art-elt jakb-ag jakb-pole-flip-up-ja 129) +(def-art-elt jakb-ag jakb-pole-cycle-ja 128) +(def-art-elt jakb-ag jakb-pilot-wcar-turn-back-ja 269) +(def-art-elt jakb-ag jakb-pilot-wcar-turn-front-ja 268) +(def-art-elt jakb-ag jakb-pilot-bike-smack-right-ja 265) +(def-art-elt jakb-ag jakb-pilot-bike-smack-left-ja 264) +(def-art-elt jakb-ag jakb-pilot-bike-get-off-ja 247) +(def-art-elt jakb-ag jakb-pilot-bike-smack-shock-ja 246) +(def-art-elt jakb-ag jakb-pilot-bike-up-down-ja 245) +(def-art-elt jakb-ag jakb-pilot-bike-smack-back-ja 243) +(def-art-elt jakb-ag jakb-pilot-bike-smack-front-ja 242) +(def-art-elt jakb-ag jakb-pilot-bike-turn-back-ja 241) +(def-art-elt jakb-ag jakb-pilot-bike-turn-front-ja 240) +(def-art-elt jakb-ag jakb-pilot-car-turn-back-ja 234) +(def-art-elt jakb-ag jakb-pilot-car-turn-front-ja 233) +(def-art-elt jakb-ag jakb-pilot-bike-get-on-ja 232) +(def-art-elt jakb-ag jakb-pilot-gun-dark-takeout-ja 263) +(def-art-elt jakb-ag jakb-pilot-gun-blue-takeout-ja 262) +(def-art-elt jakb-ag jakb-pilot-gun-yellow-takeout-ja 261) +(def-art-elt jakb-ag jakb-pilot-gun-blue-blue-ja 260) +(def-art-elt jakb-ag jakb-pilot-gun-yellow-blue-ja 259) +(def-art-elt jakb-ag jakb-pilot-gun-red-blue-ja 258) +(def-art-elt jakb-ag jakb-pilot-gun-red-yellow-ja 257) +(def-art-elt jakb-ag jakb-pilot-gun-red-dark-ja 256) +(def-art-elt jakb-ag jakb-pilot-gun-dark-fire-ja 255) +(def-art-elt jakb-ag jakb-pilot-gun-yellow-fire-ja 254) +(def-art-elt jakb-ag jakb-pilot-gun-red-fire-ja 253) +(def-art-elt jakb-ag jakb-pilot-gun-blue-idle-ja 252) +(def-art-elt jakb-ag jakb-pilot-gun-yellow-idle-ja 251) +(def-art-elt jakb-ag jakb-pilot-gun-dark-idle-ja 250) +(def-art-elt jakb-ag jakb-pilot-gun-red-idle-ja 249) +(def-art-elt jakb-ag jakb-pilot-gun-blue-fire-single-ja 238) +(def-art-elt jakb-ag jakb-pilot-gun-blue-fire-ja 237) +(def-art-elt jakb-ag jakb-pilot-gun-red-takeout-ja 229) +(def-art-elt jakb-ag jakb-pilot-glider-turn-back-ja 271) +(def-art-elt jakb-ag jakb-pilot-glider-turn-front-ja 270) +(def-art-elt jakb-ag jakb-pilot-car-smack-right-ja 267) +(def-art-elt jakb-ag jakb-pilot-car-smack-left-ja 266) +(def-art-elt jakb-ag jakb-pilot-eject-loop-ja 248) +(def-art-elt jakb-ag jakb-pilot-car-up-down-ja 244) +(def-art-elt jakb-ag jakb-pilot-car-smack-shock-ja 239) +(def-art-elt jakb-ag jakb-pilot-car-smack-back-ja 236) +(def-art-elt jakb-ag jakb-pilot-car-smack-front-ja 235) +(def-art-elt jakb-ag jakb-pilot-car-get-on-ja 231) +(def-art-elt jakb-ag jakb-pilot-car-get-off-ja 230) +(def-art-elt jakb-ag jakb-board-attack-pegasus-ja 208) +(def-art-elt jakb-ag jakb-mech-punch-u-ja 391) +(def-art-elt jakb-ag jakb-mech-death-b-ja 390) +(def-art-elt jakb-ag jakb-mech-death-a-ja 389) +(def-art-elt jakb-ag jakb-mech-get-on-ja 388) +(def-art-elt jakb-ag jakb-mech-get-off-ja 387) +(def-art-elt jakb-ag jakb-mech-hit-front-ja 386) +(def-art-elt jakb-ag jakb-mech-drag-pickup-ja 385) +(def-art-elt jakb-ag jakb-mech-pull-ja 384) +(def-art-elt jakb-ag jakb-mech-push-ja 383) +(def-art-elt jakb-ag jakb-mech-carry-turn45-ja 382) +(def-art-elt jakb-ag jakb-mech-carry-throw-ja 381) +(def-art-elt jakb-ag jakb-mech-carry-jump-land-ja 380) +(def-art-elt jakb-ag jakb-mech-carry-jump-loop-ja 379) +(def-art-elt jakb-ag jakb-mech-carry-jump-ja 378) +(def-art-elt jakb-ag jakb-mech-carry-walk-ja 377) +(def-art-elt jakb-ag jakb-mech-carry-stance-ja 376) +(def-art-elt jakb-ag jakb-mech-carry-pickup-high-ja 375) +(def-art-elt jakb-ag jakb-mech-carry-pickup-low-ja 374) +(def-art-elt jakb-ag jakb-mech-punch-b-ja 373) +(def-art-elt jakb-ag jakb-mech-punch-r-ja 372) +(def-art-elt jakb-ag jakb-mech-punch-l-ja 371) +(def-art-elt jakb-ag jakb-mech-turn20-ja 370) +(def-art-elt jakb-ag jakb-mech-jump-land-ja 369) +(def-art-elt jakb-ag jakb-mech-jump-loop-ja 368) +(def-art-elt jakb-ag jakb-mech-jump-thrust-ja 367) +(def-art-elt jakb-ag jakb-mech-jump-ja 366) +(def-art-elt jakb-ag jakb-mech-turn90-ja 365) +(def-art-elt jakb-ag jakb-mech-walk-ja 364) +(def-art-elt jakb-ag jakb-mech-run-ja 363) +(def-art-elt jakb-ag jakb-mech-stance-ja 362) +(def-art-elt jakb-ag jakb-ladder-switch-ja 536) +(def-art-elt jakb-ag jakb-ladder-jump-on-ja 535) +(def-art-elt jakb-ag jakb-ladder-fall-ja 534) +(def-art-elt jakb-ag jakb-ladder-jump-ja 533) +(def-art-elt jakb-ag jakb-ladder-slide-stop-ja 532) +(def-art-elt jakb-ag jakb-ladder-slide-loop-ja 531) +(def-art-elt jakb-ag jakb-ladder-slide-start-ja 530) +(def-art-elt jakb-ag jakb-ladder-down-ja 528) +(def-art-elt jakb-ag jakb-ladder-stance-ja 526) +(def-art-elt jakb-ag jakb-ladder-up-ja 524) +(def-art-elt jakb-ag jakb-ladder-get-on-ja 522) +(def-art-elt jakb-ag jakb-flut-kanga-catch-ja 430) +(def-art-elt jakb-ag jakb-ice-stance-ja 134) +(def-art-elt jakb-ag jakb-ice-slide-ja 133) +(def-art-elt jakb-ag jakb-ice-skate-ja 132) (def-art-elt jakb-ag jakb-flut-death-drown-ja 432) (def-art-elt jakb-ag jakb-flut-deathb-ja 431) (def-art-elt jakb-ag jakb-flut-run-squash-ja 429) @@ -5122,20 +5440,121 @@ (def-art-elt jakb-ag jakb-flut-run-ja 409) (def-art-elt jakb-ag jakb-flut-jog-ja 408) (def-art-elt jakb-ag jakb-flut-walk-ja 407) -(def-art-elt jakb-ag jakb-ladder-switch-ja 536) -(def-art-elt jakb-ag jakb-ladder-jump-on-ja 535) -(def-art-elt jakb-ag jakb-ladder-fall-ja 534) -(def-art-elt jakb-ag jakb-ladder-jump-ja 533) -(def-art-elt jakb-ag jakb-ladder-slide-stop-ja 532) -(def-art-elt jakb-ag jakb-ladder-slide-loop-ja 531) -(def-art-elt jakb-ag jakb-ladder-slide-start-ja 530) -(def-art-elt jakb-ag jakb-ladder-down-ja 528) +(def-art-elt jakb-ag jakb-pilot-wcar-snake-jump-ja 275) +(def-art-elt jakb-ag jakb-pilot-wcar-snake-out-ja 274) +(def-art-elt jakb-ag jakb-pilot-wcar-snake-loop-ja 273) +(def-art-elt jakb-ag jakb-pilot-wcar-snake-in-ja 272) +(def-art-elt jakb-ag jakb-gun-side-to-side-hop-2-ja 353) +(def-art-elt jakb-ag jakb-gun-duck-walk-ja 340) +(def-art-elt jakb-ag jakb-gun-yellow-fire-twirl-ja 334) +(def-art-elt jakb-ag jakb-gun-red-from-sideways-ja 333) +(def-art-elt jakb-ag jakb-gun-stance-red-sideways-ja 332) +(def-art-elt jakb-ag jakb-gun-dark-fire-twirl-ja 331) +(def-art-elt jakb-ag jakb-gun-red-fire-from-sideways-ja 330) +(def-art-elt jakb-ag jakb-gun-red-fire-to-sideways-ja 329) +(def-art-elt jakb-ag jakb-death-lava-ja 108) +(def-art-elt jakb-ag jakb-invisible-to-stance-ja 107) +(def-art-elt jakb-ag jakb-invisible-loop-ja 106) +(def-art-elt jakb-ag jakb-stance-to-invisible-ja 105) +(def-art-elt jakb-ag jakb-blast-recover-end-ja 104) +(def-art-elt jakb-ag jakb-blast-recover-loop-ja 103) +(def-art-elt jakb-ag jakb-blast-recover-ja 102) +(def-art-elt jakb-ag jakb-wall-hide-body-ja 101) +(def-art-elt jakb-ag jakb-wall-hide-head-right-ja 100) +(def-art-elt jakb-ag jakb-wall-hide-head-left-ja 99) +(def-art-elt jakb-ag jakb-wall-hide-head-ja 98) +(def-art-elt jakb-ag jakb-wall-hide-scared-return-ja 97) +(def-art-elt jakb-ag jakb-wall-hide-scared-loop-ja 96) +(def-art-elt jakb-ag jakb-wall-hide-scared-ja 95) +(def-art-elt jakb-ag jakb-wall-hide-ja 94) +(def-art-elt jakb-ag jakb-powerup-ja 91) +(def-art-elt jakb-ag jakb-attack-punch-alt-end-ja 63) +(def-art-elt jakb-ag jakb-attack-from-stance-run-alt-end-ja 57) +(def-art-elt jakb-ag jakb-attack-from-stance-alt-end-ja 55) +(def-art-elt jakb-ag jakb-duck-high-jump-ja 43) +(def-art-elt jakb-ag jakb-turn-around-ja 35) +(def-art-elt jakb-ag jakb-duck-walk-ja 34) +(def-art-elt jakb-ag jakb-duck-stance-ja 33) +(def-art-elt jakb-ag jakb-stance-to-duck-ja 32) +(def-art-elt jakb-ag jakb-shield-hit-ja 552) +(def-art-elt jakb-ag jakb-shield-idle-ja 551) +(def-art-elt jakb-ag jakb-lightjak-shield-end-ja 505) +(def-art-elt jakb-ag jakb-lightjak-heal-end-ja 504) +(def-art-elt jakb-ag jakb-lightjak-heal-loop-ja 503) +(def-art-elt jakb-ag jakb-lightjak-heal-ja 502) +(def-art-elt jakb-ag jakb-lightjak-freeze-land-ja 500) +(def-art-elt jakb-ag jakb-lightjak-freeze-ja 499) +(def-art-elt jakb-ag jakb-lightjak-shield-ja 498) +(def-art-elt jakb-ag jakb-lightjak-swoop-land-ja 497) +(def-art-elt jakb-ag jakb-lightjak-swoop-fall-loop-ja 496) +(def-art-elt jakb-ag jakb-lightjak-swoop-fall-ja 495) +(def-art-elt jakb-ag jakb-lightjak-swoop2-ja 494) +(def-art-elt jakb-ag jakb-lightjak-swoop1-ja 493) +(def-art-elt jakb-ag jakb-lightjak-stance-ja 492) +(def-art-elt jakb-ag jakb-lightjak-stance-to-stance-ja 486) +(def-art-elt jakb-ag jakb-lightjak-get-on-out-ja 485) +(def-art-elt jakb-ag jakb-lightjak-get-on-land-ja 483) +(def-art-elt jakb-ag jakb-wings-wings-shadow-mg 539) +(def-art-elt jakb-ag jakb-wings-wings-lod0-mg 538) +(def-art-elt jakb-ag jakb-wings-wings-lod0-jg 537) +(def-art-elt jakb-ag jakb-wings-lightjak-swoop-land-ja 547) +(def-art-elt jakb-ag jakb-old-lod0-mg 6) +(def-art-elt jakb-ag jakb-wings-lightjak-swoop1-ja 543) +(def-art-elt jakb-ag jakb-normal-lod0-jg 2) +(def-art-elt jakb-ag jakb-wings-lightjak-swoop-fall-loop-ja 546) +(def-art-elt jakb-ag jak-ext-geo-c+0-jakclod0-scarf-cg 5) +(def-art-elt jakb-ag jakb-wings-lightjak-swoop-fall-ja 545) +(def-art-elt jakb-ag jak-ext-geo-c+0-jakclod0-sash-cg 4) +(def-art-elt jakb-ag jakb-wings-lightjak-swoop2-ja 544) +(def-art-elt jakb-ag jak-ext-geo-c+0-jakclod0-skirt-cg 3) +(def-art-elt jakb-ag jakb-shield-start-ja 550) +(def-art-elt jakb-ag jakb-c-shadow-mg 9) +(def-art-elt jakb-ag jakb-shield-shield-lod0-mg 549) +(def-art-elt jakb-ag jakb-c-lod0-mg 8) +(def-art-elt jakb-ag jakb-shield-shield-lod0-jg 548) +(def-art-elt jakb-ag jakb-c-lod0-jg 7) +(def-art-elt jakb-ag jakb-board-kickspin-c-ja 221) +(def-art-elt jakb-ag jakb-board-kickspin-b-ja 220) +(def-art-elt jakb-ag jakb-board-airwalk-end-ja 219) +(def-art-elt jakb-ag jakb-board-airwalk-loop-ja 218) +(def-art-elt jakb-ag jakb-board-airwalk-ja 217) +(def-art-elt jakb-ag jakb-board-backgrab-end-ja 216) +(def-art-elt jakb-ag jakb-board-backgrab-loop-ja 215) +(def-art-elt jakb-ag jakb-board-backgrab-ja 214) +(def-art-elt jakb-ag jakb-board-method-cross-end-ja 213) +(def-art-elt jakb-ag jakb-board-method-cross-loop-ja 212) +(def-art-elt jakb-ag jakb-board-method-cross-ja 211) +(def-art-elt jakb-ag jakb-board-kickspin-a-ja 210) +(def-art-elt jakb-ag jakb-board-jump-high-ja 209) +(def-art-elt jakb-ag jakb-board-kickflip-c-ja 206) +(def-art-elt jakb-ag jakb-board-kickflip-b-ja 205) +(def-art-elt jakb-ag jakb-board-jump-kickoff-ja 201) +(def-art-elt jakb-ag jakb-board-noseflip-ja 200) +(def-art-elt jakb-ag jakb-board-nosegrab-end-ja 199) +(def-art-elt jakb-ag jakb-board-nosegrab-loop-ja 198) +(def-art-elt jakb-ag jakb-board-method-end-ja 197) +(def-art-elt jakb-ag jakb-board-method-loop-ja 196) +(def-art-elt jakb-ag jakb-board-flip-backward-loop-ja 195) +(def-art-elt jakb-ag jakb-board-flip-forward-loop-ja 194) +(def-art-elt jakb-ag jakb-board-flip-backward-ja 191) +(def-art-elt jakb-ag jakb-board-spin-ja 189) +(def-art-elt jakb-ag jakb-board-kickflip-a-ja 188) +(def-art-elt jakb-ag jakb-board-method-ja 187) +(def-art-elt jakb-ag jakb-board-nosegrab-ja 186) +(def-art-elt jakb-ag jakb-board-grenade-ja 185) +(def-art-elt jakb-ag jakb-board-ride-turn-left-ja 182) +(def-art-elt jakb-ag jakb-board-ride-turn-right-ja 181) +(def-art-elt jakb-ag jakb-board-ride-turn-front-ja 180) +(def-art-elt jakb-ag jakb-board-ride-turn-back-ja 179) (def-art-elt jakb-ag jakb-gun-side-to-side-hop-1-ja 352) (def-art-elt jakb-ag jakb-gun-blue-stance-2-ja 351) (def-art-elt jakb-ag jakb-gun-blue-fire-2-ja 350) +(def-art-elt jakb-ag jakb-slide-left-ja 93) (def-art-elt jakb-ag jakb-gun-yellow-fire-3-ja 349) +(def-art-elt jakb-ag jakb-slide-right-ja 92) (def-art-elt jakb-ag jakb-gun-red-fire-2-ja 348) (def-art-elt jakb-ag jakb-gun-red-fire-fast-ja 347) +(def-art-elt jakb-ag jakb-yellow-jumping-blast-ja 90) (def-art-elt jakb-ag jakb-gun-side-jump-land-ja 343) (def-art-elt jakb-ag jakb-shocked-ja 86) (def-art-elt jakb-ag jakb-gun-side-jump-ja 342) @@ -5197,8 +5616,10 @@ (def-art-elt jakb-ag jakb-wings-lightjak-get-off-ja 540) (def-art-elt jakb-ag jakb-flut-idle-ja 406) (def-art-elt jakb-ag jakb-run-left-ja 24) +(def-art-elt jakb-ag jakb-pilot-gun-dummy5-ja 281) +(def-art-elt jakb-ag jakb-wings-lightjak-get-on-land-ja 541) (def-art-elt jakb-ag jakb-lod0-jg 0) -(def-art-elt jakb-ag jakb-pilot-gun-red-yellow-ja 257) +(def-art-elt jakb-ag jakb-jak-death-4-ja 514) (def-art-elt jakb-ag jakb-gun-attack-butt-blue-ja 313) (def-art-elt jakb-ag jakb-attack-from-stance-run-end-ja 56) (def-art-elt jakb-ag jakb-attack-from-jump-loop-ja 59) @@ -5206,18 +5627,20 @@ (def-art-elt jakb-ag jakb-jump-forward-ja 42) (def-art-elt jakb-ag jakb-gun-walk-side-ja 299) (def-art-elt jakb-ag jakb-dummy107-ja 13) -(def-art-elt jakb-ag jakb-pilot-glider-turn-front-ja 270) +(def-art-elt jakb-ag jakb-ladder-stance-to-down-ja 527) (def-art-elt jakb-ag jakb-gun-flop-down-land-ja 326) (def-art-elt jakb-ag jakb-moving-flop-down-loop-ja 69) (def-art-elt jakb-ag jakb-duck-roll-ja 72) +(def-art-elt jakb-ag jakb-wings-lightjak-stance-ja 542) (def-art-elt jakb-ag jakb-lod0-mg 1) -(def-art-elt jakb-ag jakb-pilot-gun-red-blue-ja 258) +(def-art-elt jakb-ag jakb-jak-death-5-ja 515) (def-art-elt jakb-ag jakb-gun-attack-butt-blue-end-ja 314) (def-art-elt jakb-ag jakb-dummy108-ja 14) -(def-art-elt jakb-ag jakb-pilot-glider-turn-back-ja 271) (def-art-elt jakb-ag jakb-gun-hit-from-front-ja 327) +(def-art-elt jakb-ag jakb-moving-flop-down-land-ja 70) (def-art-elt jakb-ag jakb-duck-roll-end-ja 73) (def-art-elt jakb-ag jakb-dummy109-ja 15) +(def-art-elt jakb-ag jakb-ladder-get-off-ja 529) (def-art-elt jakb-ag jakb-gun-hit-from-back-ja 328) (def-art-elt jakb-ag jakb-flop-jump-ja 71) (def-art-elt jakb-ag jakb-roll-flip-ja 74) @@ -5230,20 +5653,28 @@ (def-art-elt jakb-ag jakb-stance-loop-ja 18) (def-art-elt jakb-ag jakb-hit-elec-ja 77) (def-art-elt jakb-ag jakb-run-to-stance-fast-ja 19) +(def-art-elt jakb-ag jakb-pilot-gun-dummy0-ja 276) (def-art-elt jakb-ag jakb-hit-from-front-alt1-ja 78) (def-art-elt jakb-ag jakb-gun-hit-elec-ja 335) (def-art-elt jakb-ag jakb-run-ja 20) +(def-art-elt jakb-ag jakb-pilot-gun-dummy1-ja 277) (def-art-elt jakb-ag jakb-run-up-ja 21) +(def-art-elt jakb-ag jakb-pilot-gun-dummy2-ja 278) (def-art-elt jakb-ag jakb-run-down-ja 22) +(def-art-elt jakb-ag jakb-pilot-gun-dummy3-ja 279) (def-art-elt jakb-ag jakb-run-right-ja 23) +(def-art-elt jakb-ag jakb-pilot-gun-dummy4-ja 280) (def-art-elt jakb-ag jakb-gun-run-blue-ja 300) (def-art-elt jakb-ag jakb-gun-red-takeout-ja 301) +(def-art-elt jakb-ag jakb-launch-jump-ja 44) (def-art-elt jakb-ag jakb-falling-to-edge-grab-ja 48) (def-art-elt jakb-ag jakb-gun-attack-upperbutt-ja 305) (def-art-elt jakb-ag jakb-edge-grab-to-jump-ja 51) (def-art-elt jakb-ag jakb-gun-front-to-side-hop-ja 308) (def-art-elt jakb-ag jakb-gun-side-to-front-hop-ja 306) +(def-art-elt jakb-ag jakb-edge-grab-swing-left-ja 49) (def-art-elt jakb-ag jakb-gun-transformation-twirl-ja 307) +(def-art-elt jakb-ag jakb-edge-grab-swing-right-ja 50) (def-art-elt jakb-ag jakb-attack-from-stance-ja 53) (def-art-elt jakb-ag jakb-gun-blue-to-front-hop-ja 310) (def-art-elt jakb-ag jakb-gun-attack-butt-end-ja 312) @@ -5270,11 +5701,16 @@ (def-art-elt jakb-ag jakb-board-turn-left-ja 174) (def-art-elt jakb-ag jakb-board-turn-right-ja 175) (def-art-elt jakb-ag jakb-board-turn-up-ja 176) +(def-art-elt jakb-ag jakb-flut-dummy2-ja 433) (def-art-elt jakb-ag jakb-board-turn-down-ja 177) +(def-art-elt jakb-ag jakb-flut-dummy3-ja 434) (def-art-elt jakb-ag jakb-board-hit-forward-ja 178) +(def-art-elt jakb-ag jakb-flut-dummy4-ja 435) (def-art-elt jakb-ag jakb-board-get-on-ja 183) +(def-art-elt jakb-ag jakb-darkjak-get-on-ja 440) (def-art-elt jakb-ag jakb-board-get-off-ja 184) (def-art-elt jakb-ag jakb-board-air-turn-ja 190) +(def-art-elt jakb-ag jakb-darkjak-hit-ja 447) (def-art-elt jakb-ag jakb-board-hit-elec-ja 202) (def-art-elt jakb-ag jakb-board-get-on-land-ja 203) (def-art-elt jakb-ag jakb-board-get-off-pre-ja 204) @@ -5284,109 +5720,91 @@ (def-art-elt jakb-ag jakb-darkjak-get-off-end-ja 465) (def-art-elt jakb-ag jakb-darkjak-get-on-fast-loop-ja 472) (def-art-elt jakb-ag jakb-powerjak-get-on-ja 479) +(def-art-elt jakb-ag jakb-board-dummy3-ja 222) (def-art-elt jakb-ag jakb-powerjak-get-on-loop-ja 480) +(def-art-elt jakb-ag jakb-board-dummy4-ja 223) (def-art-elt jakb-ag jakb-lightjak-get-on-ja 481) +(def-art-elt jakb-ag jakb-board-dummy5-ja 224) (def-art-elt jakb-ag jakb-lightjak-get-off-ja 482) +(def-art-elt jakb-ag jakb-board-dummy6-ja 225) (def-art-elt jakb-ag jakb-lightjak-get-on-loop-ja 484) +(def-art-elt jakb-ag jakb-board-dummy8-ja 227) (def-art-elt jakb-ag jakb-wade-shallow-walk-ja 115) -(def-art-elt jakb-ag jakb-mech-punch-r-ja 372) (def-art-elt jakb-ag jakb-wade-deep-walk-ja 116) -(def-art-elt jakb-ag jakb-mech-punch-b-ja 373) (def-art-elt jakb-ag jakb-swim-stance-ja 117) -(def-art-elt jakb-ag jakb-mech-carry-pickup-low-ja 374) (def-art-elt jakb-ag jakb-swim-walk-ja 118) -(def-art-elt jakb-ag jakb-mech-carry-pickup-high-ja 375) (def-art-elt jakb-ag jakb-swim-walk-to-down-ja 119) -(def-art-elt jakb-ag jakb-mech-carry-stance-ja 376) (def-art-elt jakb-ag jakb-swim-down-ja 120) -(def-art-elt jakb-ag jakb-mech-carry-walk-ja 377) (def-art-elt jakb-ag jakb-swim-down-to-up-ja 121) -(def-art-elt jakb-ag jakb-mech-carry-jump-ja 378) (def-art-elt jakb-ag jakb-swim-up-ja 122) -(def-art-elt jakb-ag jakb-mech-carry-jump-loop-ja 379) (def-art-elt jakb-ag jakb-swim-up-to-stance-ja 123) -(def-art-elt jakb-ag jakb-mech-carry-jump-land-ja 380) (def-art-elt jakb-ag jakb-swim-jump-ja 124) -(def-art-elt jakb-ag jakb-mech-carry-throw-ja 381) (def-art-elt jakb-ag jakb-death-swim-ja 125) -(def-art-elt jakb-ag jakb-mech-carry-turn45-ja 382) (def-art-elt jakb-ag jakb-death-swim-loop-ja 126) -(def-art-elt jakb-ag jakb-mech-push-ja 383) (def-art-elt jakb-ag jakb-death-swim-end-ja 127) -(def-art-elt jakb-ag jakb-mech-pull-ja 384) -(def-art-elt jakb-ag jakb-pole-cycle-ja 128) -(def-art-elt jakb-ag jakb-mech-drag-pickup-ja 385) -(def-art-elt jakb-ag jakb-pole-flip-up-ja 129) -(def-art-elt jakb-ag jakb-mech-hit-front-ja 386) -(def-art-elt jakb-ag jakb-pole-flip-forward-ja 130) -(def-art-elt jakb-ag jakb-mech-get-off-ja 387) -(def-art-elt jakb-ag jakb-pole-jump-loop-ja 131) -(def-art-elt jakb-ag jakb-mech-get-on-ja 388) -(def-art-elt jakb-ag jakb-turret-stance-ja 397) -(def-art-elt jakb-ag jakb-turret-get-off-ja 398) -(def-art-elt jakb-ag jakb-turret-get-on-ja 399) -(def-art-elt jakb-ag jakb-turret-for-stance-ja 400) -(def-art-elt jakb-ag jakb-turret-for-get-off-ja 401) -(def-art-elt jakb-ag jakb-turret-for-get-on-ja 402) -(def-art-elt jakb-ag jakb-turret-for-stance-left-ja 403) -(def-art-elt jakb-ag jakb-turret-for-stance-right-ja 404) -(def-art-elt jakb-ag jakb-turret-for-fire-ja 405) -(def-art-elt jakb-ag jakb-mech-stance-ja 362) -(def-art-elt jakb-ag jakb-mech-run-ja 363) -(def-art-elt jakb-ag jakb-mech-walk-ja 364) -(def-art-elt jakb-ag jakb-mech-turn90-ja 365) -(def-art-elt jakb-ag jakb-mech-jump-ja 366) -(def-art-elt jakb-ag jakb-mech-jump-thrust-ja 367) -(def-art-elt jakb-ag jakb-mech-jump-loop-ja 368) -(def-art-elt jakb-ag jakb-mech-jump-land-ja 369) -(def-art-elt jakb-ag jakb-mech-turn20-ja 370) -(def-art-elt jakb-ag jakb-mech-punch-l-ja 371) -(def-art-elt jakb-ag jakb-mech-death-a-ja 389) -(def-art-elt jakb-ag jakb-mech-death-b-ja 390) -(def-art-elt jakb-ag jakb-mech-punch-u-ja 391) -(def-art-elt jakb-ag jakb-pilot-gun-red-takeout-ja 229) -(def-art-elt jakb-ag jakb-pilot-gun-blue-fire-ja 237) -(def-art-elt jakb-ag jakb-pilot-gun-blue-fire-single-ja 238) -(def-art-elt jakb-ag jakb-pilot-gun-red-idle-ja 249) -(def-art-elt jakb-ag jakb-pilot-gun-dark-idle-ja 250) -(def-art-elt jakb-ag jakb-pilot-gun-yellow-idle-ja 251) -(def-art-elt jakb-ag jakb-pilot-gun-blue-idle-ja 252) -(def-art-elt jakb-ag jakb-pilot-gun-red-fire-ja 253) -(def-art-elt jakb-ag jakb-pilot-gun-yellow-fire-ja 254) -(def-art-elt jakb-ag jakb-pilot-gun-dark-fire-ja 255) -(def-art-elt jakb-ag jakb-pilot-gun-red-dark-ja 256) -(def-art-elt jakb-ag jakb-pilot-gun-yellow-blue-ja 259) -(def-art-elt jakb-ag jakb-pilot-gun-blue-blue-ja 260) -(def-art-elt jakb-ag jakb-pilot-gun-yellow-takeout-ja 261) -(def-art-elt jakb-ag jakb-pilot-gun-blue-takeout-ja 262) -(def-art-elt jakb-ag jakb-pilot-gun-dark-takeout-ja 263) -(def-art-elt jakb-ag jakb-pilot-car-get-off-ja 230) -(def-art-elt jakb-ag jakb-pilot-car-get-on-ja 231) -(def-art-elt jakb-ag jakb-pilot-car-smack-front-ja 235) -(def-art-elt jakb-ag jakb-pilot-car-smack-back-ja 236) -(def-art-elt jakb-ag jakb-pilot-car-smack-shock-ja 239) -(def-art-elt jakb-ag jakb-pilot-car-up-down-ja 244) -(def-art-elt jakb-ag jakb-pilot-eject-loop-ja 248) -(def-art-elt jakb-ag jakb-pilot-car-smack-left-ja 266) -(def-art-elt jakb-ag jakb-pilot-car-smack-right-ja 267) -(def-art-elt jakb-ag jakb-ladder-up-ja 524) -(def-art-elt jakb-ag jakb-pilot-wcar-turn-front-ja 268) -(def-art-elt jakb-ag jakb-pilot-wcar-turn-back-ja 269) -(def-art-elt jakb-ag jakb-ladder-stance-ja 526) -(def-art-elt jakb-ag jakb-pilot-bike-get-on-ja 232) -(def-art-elt jakb-ag jakb-pilot-car-turn-front-ja 233) -(def-art-elt jakb-ag jakb-pilot-car-turn-back-ja 234) -(def-art-elt jakb-ag jakb-pilot-bike-turn-front-ja 240) -(def-art-elt jakb-ag jakb-pilot-bike-turn-back-ja 241) -(def-art-elt jakb-ag jakb-pilot-bike-smack-front-ja 242) -(def-art-elt jakb-ag jakb-pilot-bike-smack-back-ja 243) -(def-art-elt jakb-ag jakb-pilot-bike-up-down-ja 245) -(def-art-elt jakb-ag jakb-pilot-bike-smack-shock-ja 246) -(def-art-elt jakb-ag jakb-pilot-bike-get-off-ja 247) -(def-art-elt jakb-ag jakb-pilot-bike-smack-left-ja 264) -(def-art-elt jakb-ag jakb-pilot-bike-smack-right-ja 265) -(def-art-elt jakb-ag jakb-ladder-get-on-ja 522) -(def-art-elt jakb-ag jakb-flut-kanga-catch-ja 430) +(def-art-elt jakb-ag jakb-carry-stance-ja 354) +(def-art-elt jakb-ag jakb-carry-walk-ja 355) +(def-art-elt jakb-ag jakb-carry-pickup-low-ja 356) +(def-art-elt jakb-ag jakb-carry-pickup-high-ja 357) +(def-art-elt jakb-ag jakb-carry-throw-ja 358) +(def-art-elt jakb-ag jakb-carry-jump-ja 359) +(def-art-elt jakb-ag jakb-carry-jump-loop-ja 360) +(def-art-elt jakb-ag jakb-carry-jump-land-ja 361) +(def-art-elt jakb-ag jakb-jak-death-1-ja 511) +(def-art-elt jakb-ag jakb-jak-death-2-ja 512) +(def-art-elt jakb-ag jakb-jak-death-3-ja 513) +(def-art-elt jakb-ag jakb-periscope-grab-ja 87) +(def-art-elt jakb-ag jakb-gun-wall-hide-ja 344) +(def-art-elt jakb-ag jakb-yellow-running-blast-ja 88) +(def-art-elt jakb-ag jakb-gun-wall-hide-loop-ja 345) +(def-art-elt jakb-ag jakb-yellow-running-blast-end-ja 89) +(def-art-elt jakb-ag jakb-gun-red-reload-ja 346) +(def-art-elt jakb-ag jakb-dummy55-ja 110) +(def-art-elt jakb-ag jakb-dummy56-ja 111) +(def-art-elt jakb-ag jakb-dummy57-ja 112) +(def-art-elt jakb-ag jakb-dummy58-ja 113) +(def-art-elt jakb-ag jakb-dummy59-ja 114) +(def-art-elt jakb-ag jakb-tube-dummy2-ja 137) +(def-art-elt jakb-ag jakb-mech-dummy5-ja 394) +(def-art-elt jakb-ag jakb-tube-dummy3-ja 138) +(def-art-elt jakb-ag jakb-mech-dummy6-ja 395) +(def-art-elt jakb-ag jakb-tube-dummy4-ja 139) +(def-art-elt jakb-ag jakb-mech-dummy7-ja 396) +(def-art-elt jakb-ag jakb-tube-dummy5-ja 140) +(def-art-elt jakb-ag jakb-tube-dummy6-ja 141) +(def-art-elt jakb-ag jakb-board-flip-forward-land-ja 173) +(def-art-elt jakb-ag jakb-board-flip-backward-land-ja 192) +(def-art-elt jakb-ag jakb-board-kickflip-land-ja 193) +(def-art-elt jakb-ag jakb-board-dummy7-ja 226) +(def-art-elt jakb-ag jakb-board-dummy9-ja 228) +(def-art-elt jakb-ag jakb-mech-dummy3-ja 392) +(def-art-elt jakb-ag jakb-mech-dummy4-ja 393) +(def-art-elt jakb-ag jakb-flut-dummy5-ja 436) +(def-art-elt jakb-ag jakb-flut-dummy6-ja 437) +(def-art-elt jakb-ag jakb-flut-dummy7-ja 438) +(def-art-elt jakb-ag jakb-flut-dummy8-ja 439) +(def-art-elt jakb-ag jakb-darkjak-hit-land-ja 448) +(def-art-elt jakb-ag jakb-darkjak-attack-combo3-ja 456) +(def-art-elt jakb-ag jakb-darkjak-attack-combo3-end-ja 457) +(def-art-elt jakb-ag jakb-lightjak-dummy10-ja 487) +(def-art-elt jakb-ag jakb-lightjak-dummy11-ja 488) +(def-art-elt jakb-ag jakb-lightjak-dummy12-ja 489) +(def-art-elt jakb-ag jakb-lightjak-dummy13-ja 490) +(def-art-elt jakb-ag jakb-lightjak-dummy14-ja 491) +(def-art-elt jakb-ag jakb-lightjak-dummy26-ja 501) +(def-art-elt jakb-ag jakb-lightjak-dummy21-ja 506) +(def-art-elt jakb-ag jakb-lightjak-dummy22-ja 507) +(def-art-elt jakb-ag jakb-lightjak-dummy23-ja 508) +(def-art-elt jakb-ag jakb-lightjak-dummy24-ja 509) +(def-art-elt jakb-ag jakb-lightjak-dummy25-ja 510) +(def-art-elt jakb-ag jakb-dummy-57-ja 519) +(def-art-elt jakb-ag jakb-dummy-58-ja 520) +(def-art-elt jakb-ag jakb-dummy-59-ja 521) +(def-art-elt jakb-ag jakb-ladder-stance-to-up-ja 523) +(def-art-elt jakb-ag jakb-ladder-up-to-stance-ja 525) +(def-art-elt jakb-ag jakb-board-jump-kick-ja 167) +(def-art-elt jakb-ag jakb-board-turn-around-ja 170) +(def-art-elt jakb-ag jakb-board-flip-forward-ja 172) (def-art-elt gun-kg-target-b-ag gun-kg-target-b-explode-idle-ja 5) (def-art-elt gun-kg-target-b-ag gun-kg-target-b-explode-lod0-mg 4) diff --git a/goal_src/jak3/engine/data/art-h.gc b/goal_src/jak3/engine/data/art-h.gc index 6e7011a6c9f..3846c5770dc 100644 --- a/goal_src/jak3/engine/data/art-h.gc +++ b/goal_src/jak3/engine/data/art-h.gc @@ -408,6 +408,23 @@ Each process-drawable has a draw-control." ) ) +(defmacro joint-node-index (jg-name name) + (let ((jg-info (hash-table-try-ref *jg-info* (symbol->string jg-name)))) + (if (not (car jg-info)) + -1 + (let ((joint-node (hash-table-try-ref (cdr jg-info) (if (integer? name) (int->string name) (symbol->string name))))) + (if (not (car joint-node)) + -1 + (cadr (cdr joint-node))) + ) + ) + ) + ) + +(defmacro joint-node (jg name) + `(-> self node-list data (joint-node-index ,jg ,name)) + ) + (defmacro defskelgroup (name ag-name joint-geom joint-anim lods &key (shadow 0) &key bounds @@ -444,7 +461,8 @@ Each process-drawable has a draw-control." ;; set cloth params array if present (when ,(neq? clothing '()) (set! (-> skel clothing) (new 'static 'boxed-array :type cloth-params :length 0 :allocated-length ,(length clothing))) - ,@(apply-i (lambda (x i) `(set! (-> skel clothing ,i) (static-cloth-params ,x))) clothing) + ,@(apply-i (lambda (x i) + `(set! (-> skel clothing ,i) (static-cloth-params ,(string->symbol-format "{}-ag" ag-name) ,x))) clothing) (set! (-> skel clothing length) ,(length clothing)) ) diff --git a/goal_src/jak3/engine/debug/debug-h.gc b/goal_src/jak3/engine/debug/debug-h.gc index 55ecd5711ab..fdcc4c358aa 100644 --- a/goal_src/jak3/engine/debug/debug-h.gc +++ b/goal_src/jak3/engine/debug/debug-h.gc @@ -5,7 +5,9 @@ ;; name in dgo: debug-h ;; dgos: GAME +(define-extern add-debug-line (function symbol bucket-id vector vector rgba symbol rgba symbol)) (define-extern add-debug-matrix (function symbol bucket-id matrix meters matrix)) +(define-extern add-debug-sphere (function symbol bucket-id vector meters rgba symbol)) (define-extern add-debug-text-sphere (function symbol bucket-id vector meters string rgba symbol)) (define-extern add-debug-vector (function symbol bucket-id vector vector meters rgba symbol)) (define-extern add-debug-quaternion (function symbol bucket-id vector quaternion none)) diff --git a/goal_src/jak3/engine/debug/history.gc b/goal_src/jak3/engine/debug/history.gc index 3d3ba280863..94e3ec8f01a 100644 --- a/goal_src/jak3/engine/debug/history.gc +++ b/goal_src/jak3/engine/debug/history.gc @@ -5,5 +5,516 @@ ;; name in dgo: history ;; dgos: GAME +;; +++history-channel +(defenum history-channel + :type uint8 + (trans 0) + (transv 1) + (transv-in 2) + (transv-out 3) + (intersect 4) + (local-normal 5) + (surface-normal 6) + (collide-status 7) + (pat 8) + (time 9) + (friction 10) + ) +;; ---history-channel + + ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(defun history-channel->string ((arg0 history-channel)) + (case arg0 + (((history-channel friction)) + "friction" + ) + (((history-channel transv-out)) + "transv-out" + ) + (((history-channel pat)) + "pat" + ) + (((history-channel transv-in)) + "transv-in" + ) + (((history-channel trans)) + "trans" + ) + (((history-channel local-normal)) + "local-normal" + ) + (((history-channel collide-status)) + "collide-status" + ) + (((history-channel time)) + "time" + ) + (((history-channel intersect)) + "intersect" + ) + (((history-channel surface-normal)) + "surface-normal" + ) + (((history-channel transv)) + "transv" + ) + (else + "*unknown*" + ) + ) + ) + +(deftype history-elt (structure) + ((record-tag-bytes uint8 4) + (record-tag uint32 :overlay-at (-> record-tag-bytes 0)) + (record-id uint16 :overlay-at (-> record-tag-bytes 0)) + (owner uint8 :overlay-at (-> record-tag-bytes 2)) + (channel history-channel :offset 4) + (timestamp time-frame) + (origin vector :inline) + (bytes uint8 16) + (vector vector :inline :overlay-at (-> bytes 0)) + (float float :overlay-at (-> bytes 0)) + (collide-status collide-status :overlay-at (-> bytes 0)) + (collide-reaction-flag uint32 :overlay-at (-> bytes 8)) + (pat pat-surface :overlay-at (-> bytes 0)) + ) + ) + + +(deftype history-iterator (basic) + ((max-age uint32) + (owner uint8) + (proc process) + (out object) + (channel-mask uint64) + (index int32) + (done? symbol) + ) + (:methods + (new (symbol type uint) _type_) + (frame-counter-delta (_type_ history-elt) time-frame) + (update-entries! (_type_) history-elt) + (get-age (_type_ history-elt) float) + ) + ) + + +(deftype history (basic) + ((alloc-index int32) + (allocated-length int32) + (elts history-elt :inline :dynamic) + ) + (:methods + (new (symbol type int) _type_) + (clear-record-tags! (_type_ history-channel uint uint) history-elt) + (clear-history-entries! (_type_) none) + ) + ) + + +(defmethod length ((this history)) + (-> this allocated-length) + ) + +;; WARN: Return type mismatch uint vs int. +(defmethod asize-of ((this history)) + (the-as int (+ (-> this type size) (* 48 (-> this allocated-length)))) + ) + +(defmethod new history ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* 48 arg0)))))) + (set! (-> v0-0 allocated-length) arg0) + v0-0 + ) + ) + +(defmethod clear-history-entries! ((this history)) + (set! (-> this alloc-index) 0) + (countdown (v1-0 (-> this allocated-length)) + (let ((a1-3 (-> this elts v1-0))) + (set! (-> a1-3 record-tag) (the-as uint 0)) + (set! (-> a1-3 timestamp) 0) + ) + 0 + ) + 0 + (none) + ) + +(define-perm *history* history (new 'debug 'history 4096)) + +(clear-history-entries! *history*) + +;; WARN: new jak 2 until loop case, check carefully +(defmethod clear-record-tags! ((this history) (arg0 history-channel) (arg1 uint) (arg2 uint)) + (let* ((t1-0 (-> this alloc-index)) + (v1-0 (-> this elts)) + (v0-0 (-> v1-0 t1-0)) + ) + (let ((t2-0 (-> v0-0 record-tag)) + (t0-2 (-> v0-0 timestamp)) + ) + (set! (-> v0-0 channel) arg0) + (set! (-> v0-0 record-id) arg1) + (set! (-> v0-0 owner) arg2) + (set! (-> v0-0 timestamp) (-> *display* base-clock frame-counter)) + (let* ((a1-4 (-> this allocated-length)) + (a2-2 (mod (+ t1-0 1) a1-4)) + ) + (set! (-> this alloc-index) a2-2) + (when (nonzero? t2-0) + (until #f + (let ((a0-4 (-> v1-0 a2-2))) + (if (!= t0-2 (-> a0-4 timestamp)) + (return v0-0) + ) + (set! (-> a0-4 record-tag) (the-as uint 0)) + ) + (set! a2-2 (mod (+ a2-2 1) a1-4)) + ) + #f + ) + ) + ) + v0-0 + ) + ) + +(defmethod new history-iterator ((allocation symbol) (type-to-make type) (arg0 uint)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 max-age) arg0) + (set! (-> v0-0 owner) (the-as uint 1)) + (set! (-> v0-0 proc) #f) + (set! (-> v0-0 out) *stdcon*) + (set! (-> v0-0 channel-mask) (the-as uint -1)) + (set! (-> v0-0 index) (-> *history* alloc-index)) + (set! (-> v0-0 done?) #f) + v0-0 + ) + ) + +(defmethod update-entries! ((this history-iterator)) + (let ((v1-0 *history*) + (a1-2 (-> *display* base-clock frame-counter)) + ) + (while (not (-> this done?)) + (let ((a2-1 (+ (-> this index) -1))) + (if (< a2-1 0) + (set! a2-1 (+ (-> v1-0 allocated-length) -1)) + ) + (set! (-> this index) a2-1) + (if (= a2-1 (-> v1-0 alloc-index)) + (set! (-> this done?) #t) + ) + (let ((a2-5 (-> v1-0 elts a2-1))) + (when (nonzero? (-> a2-5 record-tag)) + (when (< (the-as time-frame (-> this max-age)) (- a1-2 (-> a2-5 timestamp))) + (set! (-> this done?) #t) + (return (the-as history-elt #f)) + ) + (if (= (-> a2-5 owner) (-> this owner)) + (return a2-5) + ) + ) + ) + ) + ) + ) + (the-as history-elt #f) + ) + +(defmethod get-age ((this history-iterator) (arg0 history-elt)) + (- 1.0 (fmin 1.0 (/ (the float (+ (- 1 (-> arg0 timestamp)) (-> *display* base-clock frame-counter))) + (the float (+ (-> this max-age) 1)) + ) + ) + ) + ) + +(defmethod frame-counter-delta ((this history-iterator) (arg0 history-elt)) + (- (-> *display* base-clock frame-counter) (-> arg0 timestamp)) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defun history-print ((arg0 history-iterator)) + (local-vars + (sv-16 object) + (sv-24 int) + (sv-32 int) + (sv-40 history-elt) + (sv-48 time-frame) + (sv-56 uint) + (sv-64 collide-status) + (sv-72 float) + (sv-80 string) + (sv-96 string) + ) + (set! sv-16 (-> arg0 out)) + (set! sv-24 -1) + (set! sv-32 0) + (until #f + (set! sv-40 (update-entries! arg0)) + (if (not sv-40) + (goto cfg-71) + ) + (when (logtest? (-> arg0 channel-mask) (ash 1 (the-as int (-> sv-40 channel)))) + (set! sv-48 (frame-counter-delta arg0 sv-40)) + (set! sv-56 (-> sv-40 record-id)) + (cond + ((!= sv-24 sv-48) + (set! sv-24 (the-as int sv-48)) + (set! sv-32 (the-as int sv-56)) + (format sv-16 "~3D ~4X " sv-48 (-> sv-40 record-id)) + ) + ((!= sv-32 sv-56) + (set! sv-32 (the-as int sv-56)) + (format sv-16 " ~4X " (-> sv-40 record-id)) + ) + (else + (format sv-16 " ") + ) + ) + (let ((v1-22 (-> sv-40 channel))) + (cond + ((or (= v1-22 (history-channel trans)) + (or (= v1-22 (history-channel transv)) + (= v1-22 (history-channel transv-in)) + (= v1-22 (history-channel transv-out)) + (= v1-22 (history-channel intersect)) + ) + ) + (format + sv-16 + "~-15S: ~14Mm ~14Mm ~14Mm~%" + (history-channel->string (-> sv-40 channel)) + (-> sv-40 vector x) + (-> sv-40 vector y) + (-> sv-40 vector z) + ) + ) + ((or (= v1-22 (history-channel local-normal)) (= v1-22 (history-channel surface-normal))) + (format + sv-16 + "~-15S: ~14f ~14f ~14f~%" + (history-channel->string (-> sv-40 channel)) + (-> sv-40 vector x) + (-> sv-40 vector y) + (-> sv-40 vector z) + ) + ) + ((= v1-22 (history-channel pat)) + (let* ((s2-0 (-> sv-40 vector x)) + (s5-2 format) + (s4-2 sv-16) + (s3-2 "~-15S: #x~6X mode:~-8S material:~-10S event:~S~%") + (s1-0 (history-channel->string (-> sv-40 channel))) + (s0-0 s2-0) + ) + (set! sv-80 (pat-mode->string (the-as pat-surface s2-0))) + (set! sv-96 (pat-material->string (the-as pat-surface s2-0))) + (let ((t2-0 (pat-event->string (the-as pat-surface s2-0)))) + (s5-2 s4-2 s3-2 s1-0 s0-0 sv-80 sv-96 t2-0) + ) + ) + ) + ((= v1-22 (history-channel collide-status)) + (set! sv-64 (-> sv-40 collide-status)) + (set! sv-72 (-> sv-40 vector z)) + (format sv-16 "~-15S: #x~6X " (history-channel->string (-> sv-40 channel)) sv-64) + (let ((s5-4 sv-64)) + (if (= (logand s5-4 (collide-status touch-background)) (collide-status touch-background)) + (format sv-16 "touch-background ") + ) + (if (= (logand s5-4 (collide-status on-special-surface)) (collide-status on-special-surface)) + (format sv-16 "on-special-surface ") + ) + (if (= (logand s5-4 (collide-status touch-wall)) (collide-status touch-wall)) + (format sv-16 "touch-wall ") + ) + (if (= (logand s5-4 (collide-status on-surface)) (collide-status on-surface)) + (format sv-16 "on-surface ") + ) + (if (= (logand s5-4 (collide-status impact-surface)) (collide-status impact-surface)) + (format sv-16 "impact-surface ") + ) + (if (= (logand s5-4 (collide-status touch-ceiling)) (collide-status touch-ceiling)) + (format sv-16 "touch-ceiling ") + ) + (if (= (logand s5-4 (collide-status on-ground)) (collide-status on-ground)) + (format sv-16 "on-ground ") + ) + (if (= (logand s5-4 (collide-status glance)) (collide-status glance)) + (format sv-16 "glance ") + ) + (if (= (logand s5-4 (collide-status blocked)) (collide-status blocked)) + (format sv-16 "blocked ") + ) + (if (= (logand s5-4 (collide-status touch-edge)) (collide-status touch-edge)) + (format sv-16 "touch-edge ") + ) + (if (= (logand s5-4 (collide-status touch-ceiling-sticky)) (collide-status touch-ceiling-sticky)) + (format sv-16 "touch-ceiling-sticky ") + ) + (if (= (logand s5-4 (collide-status on-water)) (collide-status on-water)) + (format sv-16 "on-water ") + ) + (if (= (logand s5-4 (collide-status touch-actor)) (collide-status touch-actor)) + (format sv-16 "touch-actor ") + ) + (if (= (logand (collide-status probe-hit) s5-4) (collide-status probe-hit)) + (format sv-16 "probe-hit ") + ) + (if (= (logand s5-4 (collide-status stuck)) (collide-status stuck)) + (format sv-16 "stuck ") + ) + (if (= (logand s5-4 (collide-status no-touch)) (collide-status no-touch)) + (format sv-16 "no-touch ") + ) + (if (= (logand s5-4 (collide-status touch-surface)) (collide-status touch-surface)) + (format sv-16 "touch-surface ") + ) + ) + (format sv-16 " #x~6X~%" sv-72) + ) + ((= v1-22 (history-channel friction)) + (let ((f30-0 (-> sv-40 vector x))) + (format sv-16 "~-15S: ~f~%" (history-channel->string (-> sv-40 channel)) f30-0) + ) + ) + ) + ) + ) + ) + #f + (label cfg-71) + 0 + (none) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defun history-draw ((arg0 history-iterator)) + (local-vars (sv-16 vector) (sv-20 vector) (sv-24 number)) + (set! sv-16 (the-as vector #f)) + (set! sv-20 (the-as vector #f)) + (set! sv-24 0) + (until #f + (let ((s5-0 (update-entries! arg0))) + (if (not s5-0) + (goto cfg-34) + ) + (when (logtest? (-> arg0 channel-mask) (ash 1 (the-as int (-> s5-0 channel)))) + (let* ((f0-0 (get-age arg0 s5-0)) + (v1-8 (the int (lerp 4.0 128.0 f0-0))) + ) + (case (-> s5-0 channel) + (((history-channel trans)) + (if sv-16 + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + sv-16 + (-> s5-0 vector) + (the-as rgba (logior #xffff00 (shl v1-8 24))) + #f + (the-as rgba -1) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffff00 (shl v1-8 24)))) + ) + (set! sv-16 (-> s5-0 vector)) + ) + (((history-channel intersect)) + (if sv-20 + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + sv-20 + (-> s5-0 vector) + (the-as rgba (logior #xffffff (shl v1-8 24))) + #f + (the-as rgba -1) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffffff (shl v1-8 24)))) + ) + (set! sv-20 (-> s5-0 vector)) + ) + (((history-channel transv)) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 origin) + (-> s5-0 vector) + (meters 0.000024414063) + (the-as rgba (logior (shl v1-8 24) #xff00)) + ) + ) + (((history-channel transv-in)) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 origin) + (-> s5-0 vector) + (meters 0.000024414063) + (the-as rgba (logior #x408040 (shl v1-8 24))) + ) + ) + (((history-channel transv-out)) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 origin) + (-> s5-0 vector) + (meters 0.000024414063) + (the-as rgba (logior #x404080 (shl v1-8 24))) + ) + ) + (((history-channel local-normal) (history-channel surface-normal)) + (let ((t1-7 + (logand (the-as uint (-> *pat-mode-info* (shr (shl (the-as int sv-24) 54) 61) hilite-color)) + (the-as uint #xffffffff00ffffff) + ) + ) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 origin) + (-> s5-0 vector) + (meters 1) + (the-as rgba (logior t1-7 (shl v1-8 24))) + ) + ) + ) + (((history-channel pat)) + (set! sv-24 (-> s5-0 vector x)) + ) + (((history-channel friction)) + (let ((f0-3 (-> s5-0 vector x)) + (a3-10 (new 'stack-no-clear 'vector)) + ) + (set-vector! a3-10 0.0 (* -8192.0 f0-3) 0.0 1.0) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 origin) + a3-10 + (meters 0.00024414062) + (the-as rgba (logior #xffffff (shl v1-8 24))) + ) + ) + ) + ) + ) + ) + ) + ) + #f + (label cfg-34) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/debug/viewer.gc b/goal_src/jak3/engine/debug/viewer.gc index f1c553c0b31..64677fd32e6 100644 --- a/goal_src/jak3/engine/debug/viewer.gc +++ b/goal_src/jak3/engine/debug/viewer.gc @@ -5,5 +5,257 @@ ;; name in dgo: viewer ;; dgos: GAME +(declare-type viewer process-drawable) +(define-extern *viewer* viewer) + ;; DECOMP BEGINS +(define *viewer-sg* (new 'static 'skeleton-group + :bounds (new 'static 'vector :w 16384.0) + :lod-dist (new 'static 'array float 6 4095996000.0 0.0 0.0 0.0 0.0 0.0) + :clothing #f + ) + ) + +(deftype viewer (process-drawable) + ((janim art-joint-anim) + ) + (:states + viewer-process + ) + ) + + +(defstate viewer-process (viewer) + :code (behavior () + (until #f + (ja-no-eval :group! (-> self janim) + :num! (seek! (the float (+ (-> self janim frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel keep-other-velocities adjust-quat) + 1.0 + 1.0 + 1.0 + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(define viewer-string (new 'global 'string 64 (the-as string #f))) + +(define viewer-ja-name (new 'global 'string 64 (the-as string #f))) + +(define viewer-geo-name (new 'global 'string 64 (the-as string #f))) + +(defun actor-get-arg! ((arg0 string) (arg1 string) (arg2 string)) + (let ((s5-0 (-> arg2 data)) + (gp-0 (-> arg0 data)) + ) + (set! (-> gp-0 0) (the-as uint 0)) + (dotimes (s2-0 (- (length arg2) (+ (length arg1) 2))) + (when (= (-> s5-0 0) 45) + (let ((s1-0 #f)) + (dotimes (s0-0 (length arg1)) + (if (!= (-> s5-0 (+ s0-0 1)) (-> arg1 data s0-0)) + (goto cfg-10) + ) + ) + (if (= (-> s5-0 (+ (length arg1) 1)) 45) + (set! s1-0 #t) + ) + (label cfg-10) + (when s1-0 + (let ((v1-22 (&+ s5-0 (+ (length arg1) 2)))) + (while (and (!= (-> v1-22 0) 45) (nonzero? (-> v1-22 0))) + (set! (-> gp-0 0) (-> v1-22 0)) + (set! v1-22 (&-> v1-22 1)) + (set! gp-0 (&-> gp-0 1)) + ) + ) + (set! (-> gp-0 0) (the-as uint 0)) + (return #t) + ) + ) + ) + (set! s5-0 (&-> s5-0 1)) + ) + ) + #f + ) + +(defun art-part-name ((arg0 string)) + (let ((gp-0 (-> arg0 data))) + (while (nonzero? (-> gp-0 0)) + (when (= (-> gp-0 0) 45) + (copyn-string<-charp + viewer-string + (&-> gp-0 1) + (- (length arg0) (the-as int (+ (- -1 (the-as int (-> arg0 data))) (the-as int gp-0)))) + ) + (return viewer-string) + ) + (set! gp-0 (&-> gp-0 1)) + ) + ) + (clear viewer-string) + ) + +(defbehavior init-viewer viewer ((arg0 string) (arg1 string)) + (let* ((s5-0 *level*) + (s3-0 (method-of-object s5-0 art-group-get-by-name)) + ) + (format (clear *temp-string*) "skel-~S" arg0) + (let ((a1-3 (s3-0 s5-0 *temp-string* (the-as (pointer level) #f)))) + (cond + (a1-3 + (initialize-skeleton self (the-as skeleton-group a1-3) (the-as pair 0)) + (cond + ((>= (-> self skel active-channels) (the-as uint 1)) + (set! (-> self janim) (-> self skel channel 0 frame-group)) + ) + (else + (let ((v1-8 (-> self draw art-group))) + (dotimes (a0-5 (-> v1-8 length)) + (when (= (-> v1-8 data a0-5 type) art-joint-anim) + (set! (-> self janim) (the-as art-joint-anim (-> v1-8 data a0-5))) + (ja-channel-set! 1) + (goto cfg-10) + ) + ) + ) + (go process-drawable-art-error "anim") + ) + ) + (label cfg-10) + (set! (-> self align) (new 'process 'align-control self)) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + (go viewer-process) + ) + (else + (actor-get-arg! viewer-ja-name "ja" arg1) + (actor-get-arg! viewer-geo-name "geo" arg1) + (let ((s2-1 (load-to-heap-by-name (-> self level art-group) arg0 'load global 0)) + (s5-1 (the-as int #f)) + (s4-1 (the-as int #f)) + (s3-1 (the-as int #f)) + ) + (when s2-1 + (dotimes (s1-0 (-> s2-1 length)) + (cond + ((not (-> s2-1 data s1-0)) + ) + ((and (not s4-1) + (= (-> s2-1 data s1-0 type) merc-ctrl) + (or (zero? (length viewer-geo-name)) (string= (art-part-name (-> s2-1 data s1-0 name)) viewer-geo-name)) + ) + (set! s4-1 s1-0) + ) + ((= (-> s2-1 data s1-0 type) art-joint-geo) + (set! s3-1 s1-0) + ) + ((and (= (-> s2-1 data s1-0 type) art-joint-anim) + (or (zero? (length viewer-ja-name)) (string= (art-part-name (-> s2-1 data s1-0 name)) viewer-ja-name)) + ) + (set! s5-1 s1-0) + ) + ) + (if (and s4-1 s3-1 s5-1) + (goto cfg-44) + ) + ) + ) + (label cfg-44) + (cond + ((and s4-1 s3-1 s5-1) + (set! (-> self janim) (the-as art-joint-anim (-> s2-1 data s5-1))) + (let ((a1-13 *viewer-sg*)) + (set! (-> a1-13 art-group-name) arg0) + (set! (-> a1-13 jgeo) s3-1) + (set! (-> a1-13 janim) s5-1) + (set! (-> a1-13 mgeo 0) s4-1) + (initialize-skeleton self a1-13 (the-as pair 0)) + ) + (set! (-> self align) (new 'process 'align-control self)) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + (go viewer-process) + ) + (else + (go process-drawable-art-error arg0) + ) + ) + ) + ) + ) + ) + ) + ) + +(defmethod init-from-entity! ((this viewer) (arg0 entity-actor)) + (set! *viewer* this) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (let ((s4-0 (-> arg0 etype))) + (if (valid? s4-0 type (the-as string #f) #f 0) + (init-viewer (symbol->string (-> s4-0 symbol)) (res-lump-struct arg0 'name string)) + (go process-drawable-art-error "unknown") + ) + ) + ) + +(defbehavior init-viewer-for-other viewer ((arg0 string) (arg1 vector) (arg2 entity-actor)) + (set! *viewer* self) + (process-entity-set! self arg2) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg1 quad)) + (quaternion-identity! (-> self root quat)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (init-viewer arg0 arg0) + ) + +(defun add-a-bunch ((arg0 string) (arg1 int) (arg2 int) (arg3 float) (arg4 process-tree) (arg5 entity-actor)) + (local-vars (sv-32 int) (sv-48 process) (sv-64 vector)) + (dotimes (s0-0 arg1) + (set! sv-32 0) + (while (< sv-32 arg2) + (set! sv-64 (new 'stack-no-clear 'vector)) + (set! (-> sv-64 quad) (the-as uint128 0)) + (position-in-front-of-camera! sv-64 40960.0 4096.0) + (+! (-> sv-64 x) (the float (* (- s0-0 (/ arg1 2)) (the int arg3)))) + (+! (-> sv-64 z) (the float (* (- sv-32 (/ arg2 2)) (the int arg3)))) + (set! sv-48 (get-process *default-dead-pool* viewer #x4000 1)) + (when sv-48 + (let ((t9-2 (method-of-type viewer activate))) + (t9-2 (the-as viewer sv-48) arg4 "viewer" (the-as pointer #x70004000)) + ) + (let ((t9-3 run-function-in-process) + (a0-7 sv-48) + (a1-4 init-viewer-for-other) + (a2-4 arg0) + (t0-1 arg5) + ) + ((the-as (function object object object object object none) t9-3) a0-7 a1-4 a2-4 sv-64 t0-1) + ) + (-> sv-48 ppointer) + ) + (set! sv-32 (+ sv-32 1)) + ) + ) + #f + ) + +;; WARN: Return type mismatch symbol vs object. +(defun birth-viewer ((arg0 process) (arg1 entity-actor)) + (set! (-> arg0 type) viewer) + (init-entity arg0 arg1 viewer) + #t + ) diff --git a/goal_src/jak3/engine/draw/drawable-h.gc b/goal_src/jak3/engine/draw/drawable-h.gc index b361613d3de..b4846378d23 100644 --- a/goal_src/jak3/engine/draw/drawable-h.gc +++ b/goal_src/jak3/engine/draw/drawable-h.gc @@ -7,6 +7,9 @@ (declare-type region-prim-list structure) +(define-extern sphere-in-view-frustum? (function sphere symbol)) +(define-extern line-in-view-frustum? (function vector vector symbol)) + ;; DECOMP BEGINS (deftype drawable (basic) @@ -26,7 +29,7 @@ control over memory layout for use with DMA." (drawable-method-12 () none) (collect-stats (_type_) none) (debug-draw (_type_) none) - (drawable-method-15 () none) + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8)) (collect-regions (_type_ sphere int region-prim-list) none) ) ) diff --git a/goal_src/jak3/engine/engine/engines.gc b/goal_src/jak3/engine/engine/engines.gc index c431f000673..b66c4271560 100644 --- a/goal_src/jak3/engine/engine/engines.gc +++ b/goal_src/jak3/engine/engine/engines.gc @@ -9,6 +9,8 @@ (defenum part-local-space-flags :type uint32 :bitfield #t + (pls0 0) + (pls1 1) ) ;; ---part-local-space-flags diff --git a/goal_src/jak3/engine/entity/entity-h.gc b/goal_src/jak3/engine/entity/entity-h.gc index 4cc1eb189aa..4651cb79220 100644 --- a/goal_src/jak3/engine/entity/entity-h.gc +++ b/goal_src/jak3/engine/entity/entity-h.gc @@ -24,6 +24,7 @@ (bit-12 12) (bit-13 13) (bit-14 14) + (bit-15 15) ) ;; ---entity-perm-status @@ -35,6 +36,9 @@ (define-extern entity-by-aid (function uint entity)) (define-extern reset-actors (function symbol none)) (define-extern process-entity-status! (function process entity-perm-status symbol entity-perm-status)) +(define-extern process-drawable-from-entity! (function process-drawable entity-actor none)) +(define-extern init-entity (function process entity-actor type none)) + (define-extern *spawn-actors* symbol) ;; DECOMP BEGINS @@ -176,7 +180,7 @@ that gets accessed by the accompanying process." (deftype actor-group (inline-array-class) - ((data actor-reference :dynamic) + ((data actor-reference :inline :dynamic) ) ) diff --git a/goal_src/jak3/engine/game/effect-control-h.gc b/goal_src/jak3/engine/game/effect-control-h.gc index 8446acb4aae..3fed7b2913a 100644 --- a/goal_src/jak3/engine/game/effect-control-h.gc +++ b/goal_src/jak3/engine/game/effect-control-h.gc @@ -9,6 +9,22 @@ (defenum effect-control-flag :type uint32 :bitfield #t + (ecf0 0) + (ecf1 1) + (ecf2 2) + (ecf3 3) + (ecf4 4) + (ecf5 5) + (ecf6 6) + (ecf7 7) + (ecf8 8) + (ecf9 9) + (ecf10 10) + (ecf11 11) + (ecf12 12) + (ecf13 13) + (ecf14 14) + (ecf15 15) ) ;; ---effect-control-flag @@ -30,10 +46,10 @@ ) (:methods (new (symbol type process-drawable) _type_) - (effect-control-method-9 () none) - (effect-control-method-10 () none) + (effect-control-method-9 (_type_) none) + (do-effect (_type_ symbol float int) none) (effect-control-method-11 () none) - (effect-control-method-12 () none) + (play-effect-sound (_type_ symbol float int basic sound-name) int) (set-channel-offset! (_type_ int) none) (effect-control-method-14 () none) ) diff --git a/goal_src/jak3/engine/game/fact-h.gc b/goal_src/jak3/engine/game/fact-h.gc index 576713a28ea..95980f030a8 100644 --- a/goal_src/jak3/engine/game/fact-h.gc +++ b/goal_src/jak3/engine/game/fact-h.gc @@ -368,7 +368,7 @@ ) (:methods (new (symbol type process pickup-type float) _type_) - (fact-info-method-9 () none) + (drop-pickup (_type_ symbol process-tree fact-info int symbol) (pointer process)) (reset! (_type_ symbol) none) (pickup-collectable! (_type_ pickup-type float handle) float) ) diff --git a/goal_src/jak3/engine/game/game-h.gc b/goal_src/jak3/engine/game/game-h.gc index 927892ed50e..334f2478d7a 100644 --- a/goal_src/jak3/engine/game/game-h.gc +++ b/goal_src/jak3/engine/game/game-h.gc @@ -13,6 +13,7 @@ (declare-type water-control basic) (declare-type carry-info basic) (declare-type rigid-body-control basic) +(declare-type touching-shapes-entry structure) (defenum state-flags :bitfield #t @@ -81,6 +82,29 @@ (test 24) ) +(defmacro static-attack-info (&key (mask ()) args) + (let ((mask-actual mask)) + (dolist (it args) + (when (not (member (caar it) mask-actual)) + (cons! mask-actual (caar it)) + ) + ) + `(let ((atk (new 'static 'attack-info :mask (attack-mask ,@mask-actual)))) + ,@(apply (lambda (x) (if (or (eq? (car x) 'vector) + (eq? (car x) 'intersection) + (eq? (car x) 'attacker-velocity)) + `(vector-copy! (-> atk ,(car x)) ,(cadr x)) + `(set! (-> atk ,(car x)) ,(cadr x)) + )) args) + atk) + ) + ) + +(defmacro new-attack-id () + "generate a new attack-id. TODO remove this, it's meant to be an inlined method" + `(1+! (-> *game-info* attack-id)) + ) + ;; DECOMP BEGINS (deftype process-drawable (process) @@ -369,9 +393,9 @@ to have a type with a large number of slots which can be turned into real method (test symbol) ) (:methods - (attack-info-method-9 () none) - (attack-info-method-10 () none) - (attack-info-method-11 () none) + (attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none) + (compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info) + (combine! (_type_ attack-info process-drawable) attack-info) ) ) @@ -381,4 +405,5 @@ to have a type with a large number of slots which can be turned into real method (blend float 3) (group uint32 5) ) + :pack-me ) diff --git a/goal_src/jak3/engine/game/game-info-h.gc b/goal_src/jak3/engine/game/game-info-h.gc index 46155a1e12b..5a3e6044c0c 100644 --- a/goal_src/jak3/engine/game/game-info-h.gc +++ b/goal_src/jak3/engine/game/game-info-h.gc @@ -140,7 +140,7 @@ (title 12) (title-movie 13) (continue-flag-14 14) - (continue-flag-15 15) + (copy-entity-pos 15) (continue-flag-16 16) (test 17) (record-path 18) diff --git a/goal_src/jak3/engine/game/game-info.gc b/goal_src/jak3/engine/game/game-info.gc index 96c05a89594..a8e6e7bccf0 100644 --- a/goal_src/jak3/engine/game/game-info.gc +++ b/goal_src/jak3/engine/game/game-info.gc @@ -470,7 +470,7 @@ (('game 'boot) (+! (-> this task-counter) 1) (reset! (-> *display* total-game-clock)) - (set! (-> this features) (game-feature feature20 feature40 darkjak-bomb0 darkjak-bomb1)) + (set! (-> this features) (game-feature sidekick darkjak darkjak-bomb0 darkjak-bomb1)) (set! (-> this debug-features) (game-feature)) (set! (-> this old-features) (game-feature)) (set! (-> this items) (game-items)) @@ -929,7 +929,7 @@ (if (or (!= (handle->process pickup-handle) (handle->process (-> this eco-source))) (>= (- (-> *display* game-clock frame-counter) (-> this eco-source-time)) (seconds 0.5)) ) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-green-eco") ) (send-event (-> this process) 'color-effect 'health (seconds 0.2)) (when (handle->process pickup-handle) @@ -993,7 +993,7 @@ ((< 0.0 amount) (set! (-> this eco-green-pickup-time) (-> *display* game-clock frame-counter)) (seek! (-> this eco-green) (-> this eco-green-max) amount) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-green-eco") (send-event (-> this process) 'color-effect 'eco-green (seconds 0.2)) ) (else @@ -1005,7 +1005,7 @@ (((pickup-type eco-pill-dark)) (when (< 0.0 amount) (if (>= (- (-> *display* game-clock frame-counter) (-> this eco-pill-dark-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "get-dark-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-dark-eco") ) (send-event (-> this process) 'color-effect 'eco-pill-dark (seconds 0.2)) (cond @@ -1055,7 +1055,7 @@ ) ) ) - (sound-play-by-name (static-sound-name "get-light-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-light-eco") ) (if (< (-> this process game eco-pill-light) (* 0.95 (-> *FACT-bank* eco-pill-light-max-default))) (send-event (-> this process) 'color-effect 'eco-pill-light (seconds 0.2)) @@ -1079,7 +1079,7 @@ (fmax 0.0 (fmin (+ (-> this trick-point) amount) (-> *FACT-bank* trick-point-max))) ) (when (!= amount 0.0) - (sound-play-by-name (static-sound-name "get-trick-point") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-trick-point") (process-spawn-function process (lambda :behavior process @@ -1142,7 +1142,7 @@ (((pickup-type money)) (when (< 0.0 amount) (if (>= (- (-> *display* game-clock frame-counter) (-> this money-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "money-pickup") ) (set! (-> this money-pickup-time) (-> *display* game-clock frame-counter)) ) @@ -1151,7 +1151,7 @@ (((pickup-type gem)) (when (< 0.0 amount) (if (>= (- (-> *display* game-clock frame-counter) (-> this gem-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "gem-pickup") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "gem-pickup") ) (set! (-> this gem-pickup-time) (-> *display* game-clock frame-counter)) ) @@ -1161,7 +1161,7 @@ (((pickup-type skill)) (when (< 0.0 amount) (if (>= (- (-> *display* game-clock frame-counter) (-> this skill-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "skill-pickup") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "skill-pickup") ) (set! (-> this skill-pickup-time) (-> *display* game-clock frame-counter)) ) @@ -1337,16 +1337,16 @@ (let ((v1-285 pickup)) (cond ((= v1-285 (pickup-type eco-blue)) - (sound-play-by-name (static-sound-name "get-blue-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-blue-eco") ) ((or (= v1-285 (pickup-type eco-green)) (= v1-285 (pickup-type health))) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-green-eco") ) ((= v1-285 (pickup-type eco-yellow)) - (sound-play-by-name (static-sound-name "get-yellow-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-yellow-eco") ) ((= v1-285 (pickup-type eco-red)) - (sound-play-by-name (static-sound-name "get-red-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-red-eco") ) ) ) @@ -1900,7 +1900,7 @@ (if (and (not (paused?)) (zero? (-> this number)) (-> *setting-control* user-current player-control-override)) (override-player-controls) ) - (when (logtest? (-> *game-info* secrets) (game-secrets screen-flip)) + (when (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! (-> this leftx) (- 255 (the-as int (-> this leftx)))) (set! (-> this rightx) (- 255 (the-as int (-> this rightx)))) ) @@ -2124,7 +2124,7 @@ (set! (-> gp-0 pov-camera-handle) (the-as handle #f)) (set! (-> gp-0 other-camera-handle) (the-as handle #f)) (set! (-> gp-0 features) (game-feature - feature5 + gun gun-red-1 gun-red-2 gun-red-3 @@ -2138,16 +2138,16 @@ gun-dark-2 gun-dark-3 board - feature20 - feature37 + sidekick + board-launch feature39 - feature40 + darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 feature44 feature45 - feature46 + lightjak lightjak-regen lightjak-swoop lightjak-freeze diff --git a/goal_src/jak3/engine/game/game-save.gc b/goal_src/jak3/engine/game/game-save.gc index c7bb6379b96..f67ce0be090 100644 --- a/goal_src/jak3/engine/game/game-save.gc +++ b/goal_src/jak3/engine/game/game-save.gc @@ -672,37 +672,37 @@ (set! (-> save game-time) (+ -300000 (-> *display* total-game-clock frame-counter))) (set! (-> save info-int32 12) (the-as int (logand (game-secrets hero-mode - gs1 - gs2 - gs3 - gs4 - gs5 - gs6 - gs7 - gs8 - gs9 - gs10 - gs11 - gs12 - gs13 - gs14 - screen-flip - gs16 - gs17 - gs18 - gs19 + scene-player-1 + scene-player-2 + scene-player-3 + title-commentary + level-select-1 + level-select-2 + level-select-3 + scrap-book-1 + scrap-book-2 + scrap-book-3 + model-viewer-1 + model-viewer-2 + model-viewer-3 + toggle-beard + hflip-screen + endless-ammo + invulnerable + endless-dark + endless-light gs20 gs21 gungame-ratchet - gs23 - gs24 - gs25 - gs26 - gs27 - gs28 - gs29 - gs30 - gs31 + big-head + little-head + fast-movie + slow-movie + unlimited-turbos + vehicle-hit-points + board-fast + vehicle-fox + vehicle-mirage ) (-> this secrets) ) @@ -711,37 +711,37 @@ (set! (-> save info-int32 13) (the-as int (shr (the-as int (-> this secrets)) 32))) (set! (-> save info-int32 10) (the-as int (logand (game-secrets hero-mode - gs1 - gs2 - gs3 - gs4 - gs5 - gs6 - gs7 - gs8 - gs9 - gs10 - gs11 - gs12 - gs13 - gs14 - screen-flip - gs16 - gs17 - gs18 - gs19 + scene-player-1 + scene-player-2 + scene-player-3 + title-commentary + level-select-1 + level-select-2 + level-select-3 + scrap-book-1 + scrap-book-2 + scrap-book-3 + model-viewer-1 + model-viewer-2 + model-viewer-3 + toggle-beard + hflip-screen + endless-ammo + invulnerable + endless-dark + endless-light gs20 gs21 gungame-ratchet - gs23 - gs24 - gs25 - gs26 - gs27 - gs28 - gs29 - gs30 - gs31 + big-head + little-head + fast-movie + slow-movie + unlimited-turbos + vehicle-hit-points + board-fast + vehicle-fox + vehicle-mirage ) (-> this purchase-secrets) ) @@ -754,7 +754,7 @@ feature2 feature3 feature4 - feature5 + gun gun-red-1 gun-red-2 gun-red-3 @@ -769,7 +769,7 @@ gun-dark-3 board feature19 - feature20 + sidekick feature21 feature22 gun-upgrade-yellow-ammo-1 diff --git a/goal_src/jak3/engine/game/main-h.gc b/goal_src/jak3/engine/game/main-h.gc index 282b0cec489..a9c93165418 100644 --- a/goal_src/jak3/engine/game/main-h.gc +++ b/goal_src/jak3/engine/game/main-h.gc @@ -435,6 +435,7 @@ ) ) +(define-extern *screen-filter* screen-filter) (deftype col-rend (basic) ((draw? symbol) diff --git a/goal_src/jak3/engine/game/pilot-h.gc b/goal_src/jak3/engine/game/pilot-h.gc index a39541f36ab..ebfc9532b28 100644 --- a/goal_src/jak3/engine/game/pilot-h.gc +++ b/goal_src/jak3/engine/game/pilot-h.gc @@ -5,5 +5,67 @@ ;; name in dgo: pilot-h ;; dgos: GAME +;; +++vehicle-controls-flag +(defenum vehicle-controls-flag + :type uint8 + :bitfield #t + (vcf0 0) + (vcf1 1) + (vcf2 2) + (vcf3 3) + (vcf4 4) + (vcf5 5) + (vcf6 6) + (vcf7 7) + ) +;; ---vehicle-controls-flag + + ;; DECOMP BEGINS +(deftype vehicle-controls (structure) + ((steering float) + (throttle float) + (brake float) + (lean-z float) + (handbrake float) + (flags vehicle-controls-flag) + (prev-flags vehicle-controls-flag) + (pad0 uint8 2) + ) + :pack-me + ) + + +(deftype pilot-info (basic) + ((entity entity) + (vehicle handle) + (left-right-bias float) + (left-right-min float) + (left-right-max float) + (left-right-interp float) + (front-back-interp float) + (up-down-interp float) + (up-down-accel-factor float) + (front-back-accel-factor float) + (left-right-accel-factor float) + (stance uint8) + (seat-index int8) + (backup-nav-radius float) + (cam-side-shift float) + (enable-cam-side-shift symbol) + (gun? symbol) + (controls vehicle-controls :inline) + (accel-array vector 8 :inline) + (local-accel vector :inline) + (pilot-trans vector :inline) + (pilot-quat vector :inline) + (pilot-scale vector :inline) + (underwater-time time-frame) + (as-daxter? symbol) + (art-group-backup art-group) + (hud-health handle) + (hud-turbo handle) + (jumping? symbol) + ) + ) diff --git a/goal_src/jak3/engine/game/settings-h.gc b/goal_src/jak3/engine/game/settings-h.gc index 408c4dab235..45eae8dcb12 100644 --- a/goal_src/jak3/engine/game/settings-h.gc +++ b/goal_src/jak3/engine/game/settings-h.gc @@ -69,7 +69,7 @@ (feature2 2) (feature3 3) (feature4 4) - (feature5 5) + (gun 5) (gun-red-1 6) (gun-red-2 7) (gun-red-3 8) @@ -84,7 +84,7 @@ (gun-dark-3 17) (board 18) (feature19 19) - (feature20 20) + (sidekick 20) (feature21 21) (feature22 22) (gun-upgrade-yellow-ammo-1 23) @@ -101,16 +101,16 @@ (feature34 34) (feature35 35) (feature36 36) - (feature37 37) - (feature38 38) + (board-launch 37) + (board-trail 38) (feature39 39) - (feature40 40) + (darkjak 40) (darkjak-smack 41) (darkjak-bomb0 42) (darkjak-bomb1 43) (feature44 44) (feature45 45) - (feature46 46) + (lightjak 46) (lightjak-regen 47) (lightjak-swoop 48) (lightjak-freeze 49) @@ -137,59 +137,59 @@ :type uint64 :bitfield #t (hero-mode 0) - (gs1 1) - (gs2 2) - (gs3 3) - (gs4 4) - (gs5 5) - (gs6 6) - (gs7 7) - (gs8 8) - (gs9 9) - (gs10 10) - (gs11 11) - (gs12 12) - (gs13 13) - (gs14 14) - (screen-flip 15) - (gs16 16) - (gs17 17) - (gs18 18) - (gs19 19) + (scene-player-1 1) + (scene-player-2 2) + (scene-player-3 3) + (title-commentary 4) + (level-select-1 5) + (level-select-2 6) + (level-select-3 7) + (scrap-book-1 8) + (scrap-book-2 9) + (scrap-book-3 10) + (model-viewer-1 11) + (model-viewer-2 12) + (model-viewer-3 13) + (toggle-beard 14) + (hflip-screen 15) + (endless-ammo 16) + (invulnerable 17) + (endless-dark 18) + (endless-light 19) (gs20 20) (gs21 21) (gungame-ratchet 22) - (gs23 23) - (gs24 24) - (gs25 25) - (gs26 26) - (gs27 27) - (gs28 28) - (gs29 29) - (gs30 30) - (gs31 31) - (gs32 32) - (gs33 33) - (gs34 34) - (gs35 35) - (gs36 36) - (gs37 37) - (gs38 38) - (gs39 39) - (gs40 40) - (gs41 41) - (gs42 42) - (gs43 43) - (gs44 44) - (gs45 45) - (gs46 46) - (gs47 47) - (gs48 48) - (gs49 49) - (gs50 50) - (gs51 51) - (gs52 52) - (gs53 53) + (big-head 23) + (little-head 24) + (fast-movie 25) + (slow-movie 26) + (unlimited-turbos 27) + (vehicle-hit-points 28) + (board-fast 29) + (vehicle-fox 30) + (vehicle-mirage 31) + (vehicle-x-ride 32) + (kleever-diaper 33) + (bad-weather 34) + (fast-weather 35) + (daxter-pants 36) + (darkjak-tracking 37) + (commentary 38) + (jak-is-jak2 39) + (button-invis 40) + (statistics 41) + (gun-upgrade-red-1 42) + (gun-upgrade-red-2 43) + (gun-upgrade-red-3 44) + (gun-upgrade-yellow-1 45) + (gun-upgrade-yellow-2 46) + (gun-upgrade-yellow-3 47) + (gun-upgrade-blue-1 48) + (gun-upgrade-blue-2 49) + (gun-upgrade-blue-3 50) + (gun-upgrade-dark-1 51) + (gun-upgrade-dark-2 52) + (gun-upgrade-dark-3 53) (gun-upgrade-ammo-red 54) (gun-upgrade-ammo-yellow 55) (gun-upgrade-ammo-blue 56) diff --git a/goal_src/jak3/engine/game/settings.gc b/goal_src/jak3/engine/game/settings.gc index 48c4b4346d2..985b4256c47 100644 --- a/goal_src/jak3/engine/game/settings.gc +++ b/goal_src/jak3/engine/game/settings.gc @@ -1404,7 +1404,7 @@ (set! (-> s5-0 play-hints) (-> s4-0 play-hints)) (set! (-> s5-0 sound-bank-load) (-> s4-0 sound-bank-load)) (set! (-> s5-0 subtitle) (-> s4-0 subtitle)) - (set! (-> s5-0 beard) (if (logtest? (-> *game-info* secrets) (game-secrets gs14)) + (set! (-> s5-0 beard) (if (logtest? (-> *game-info* secrets) (game-secrets toggle-beard)) (not (-> s4-0 beard)) (-> s4-0 beard) ) @@ -1802,7 +1802,10 @@ (set! (-> s5-0 screeny) (-> s4-0 screeny)) (set! (-> *video-params* display-dy) (* (/ (-> s4-0 screeny) 2) 2)) ) - (set-horizontal-flip-flag *blit-displays-work* (logtest? (-> *game-info* secrets) (game-secrets screen-flip))) + (set-horizontal-flip-flag + *blit-displays-work* + (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) + ) (set! (-> s5-0 letterbox-speed) (-> s4-0 letterbox-speed)) (seek! (-> s5-0 letterbox) diff --git a/goal_src/jak3/engine/game/task/task-arrow.gc b/goal_src/jak3/engine/game/task/task-arrow.gc index 39dd5c61fbc..f5356c10e0a 100644 --- a/goal_src/jak3/engine/game/task/task-arrow.gc +++ b/goal_src/jak3/engine/game/task/task-arrow.gc @@ -5,5 +5,436 @@ ;; name in dgo: task-arrow ;; dgos: GAME +(deftype cquery-with-vec (structure) + "task-arrow::23" + ((cquery collide-query :inline) + (vec0 vector :inline) + (vec1 vector :inline) + ) + ) + ;; DECOMP BEGINS +(defskelgroup skel-rod-of-god com-rod-of-god com-rod-of-god-lod0-jg com-rod-of-god-idle-ja + ((com-rod-of-god-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 10 + ) + +(deftype task-arrow (process-drawable) + ((pos vector :inline) + (theta float) + (phi float) + (dist float) + (smoothed-dist float) + (max-dist float) + (flags task-arrow-flags) + (map-icon uint16) + (minimap connection-minimap) + (hud-dist handle) + (base-quat quaternion :inline) + (base-scale float) + (rod-of-god-scale float) + (moving symbol) + (death-pending? symbol) + (alpha float) + (choir-sound ambient-sound) + (draw-back basic) + ) + (:state-methods + idle + die + leave + ) + (:methods + (task-arrow-method-23 (_type_ vector) none) + (draw-arrow (_type_) none) + ) + ) + + +(defmethod deactivate ((this task-arrow)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (send-event (handle->process (-> this hud-dist)) 'hide-and-die) + (if (nonzero? (-> this choir-sound)) + (stop! (-> this choir-sound)) + ) + ((method-of-type process-drawable deactivate) this) + 0 + (none) + ) + +(defmethod task-arrow-method-23 ((this task-arrow) (arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'cquery-with-vec))) + (set! (-> s5-0 vec0 quad) (-> arg0 quad)) + (set! (-> s5-0 cquery start-pos quad) (-> s5-0 vec0 quad)) + (+! (-> s5-0 cquery start-pos y) 20480.0) + (set-vector! (-> s5-0 cquery move-dist) 0.0 -81920.0 0.0 1.0) + (let ((v1-4 (-> s5-0 cquery))) + (set! (-> v1-4 radius) 1024.0) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* (-> s5-0 cquery)))) + (if (>= f0-7 0.0) + (vector+float*! (-> s5-0 vec0) (-> s5-0 cquery start-pos) (-> s5-0 cquery move-dist) f0-7) + ) + ) + (set! (-> arg0 quad) (-> s5-0 vec0 quad)) + ) + 0 + (none) + ) + +(defmethod draw-arrow ((this task-arrow)) + (when (not (logtest? (-> this flags) (task-arrow-flags taf7))) + (if (or (-> this death-pending?) + (logtest? (-> this flags) (task-arrow-flags taf4)) + (= (the int (-> this rod-of-god-scale)) 0) + ) + (update-vol! (-> this choir-sound) (-> this rod-of-god-scale)) + (update-vol! (-> this choir-sound) 1.0) + ) + (update! (-> this choir-sound)) + ) + (cond + ((logtest? (-> this flags) (task-arrow-flags taf0)) + (if (and (not (handle->process (-> this hud-dist))) *target*) + (set! (-> this hud-dist) + (ppointer->handle (process-spawn hud-progress :init hud-init-by-other :name "hud-progress" :to *target*)) + ) + ) + (let ((s5-1 (get-trail-for-connection *minimap* (-> this minimap) #f))) + (if (and s5-1 (nonzero? (-> s5-1 last-updated))) + (set! (-> this dist) (get-distance-with-path s5-1 (target-pos 0) (-> this pos))) + ) + ) + (if (= (-> this max-dist) 0.0) + (set! (-> this max-dist) (-> this dist)) + ) + (let ((f0-7 (- (-> this dist) (-> this smoothed-dist)))) + (if (< (fabs f0-7) 40960.0) + (+! (-> this smoothed-dist) (* 10.0 (seconds-per-frame) f0-7)) + (set! (-> this smoothed-dist) (-> this dist)) + ) + ) + (let ((f1-5 (/ (-> this smoothed-dist) (-> this max-dist)))) + (set! (-> *game-info* distance) (- 1.0 (fmax 0.0 (fmin 1.0 f1-5)))) + ) + ) + (else + (let ((a0-20 (handle->process (-> this hud-dist)))) + (when a0-20 + (send-event a0-20 'hide-and-die) + (set! (-> this hud-dist) (the-as handle #f)) + ) + ) + ) + ) + (cond + ((logtest? (-> this flags) (task-arrow-flags taf2)) + ) + ((-> this moving) + (cond + ((logtest? (-> this flags) (task-arrow-flags taf6)) + (set! (-> this root trans quad) (-> this pos quad)) + (if (logtest? (-> this flags) (task-arrow-flags taf4)) + (seek! (-> this rod-of-god-scale) 0.0 (* 8.0 (seconds-per-frame))) + (seek! (-> this rod-of-god-scale) 1.0 (* 8.0 (seconds-per-frame))) + ) + ) + (else + (set! (-> this rod-of-god-scale) (- (-> this rod-of-god-scale) (* 8.0 (seconds-per-frame)))) + (when (< (-> this rod-of-god-scale) 0.0) + (set! (-> this rod-of-god-scale) 0.0) + (set! (-> this moving) #f) + (let ((f0-26 81920.0)) + (cond + ((< (* f0-26 f0-26) (vector-vector-xz-distance-squared (-> this pos) (-> this root trans))) + (kill-callback (-> *minimap* engine) (-> this minimap)) + (set! (-> this root trans quad) (-> this pos quad)) + (if (not (logtest? (-> this flags) (task-arrow-flags taf5))) + (set! (-> this minimap) (add-icon! *minimap* this (-> this map-icon) (the-as int #f) (the-as vector #t) 0)) + ) + ) + (else + (set! (-> this root trans quad) (-> this pos quad)) + ) + ) + ) + ) + ) + ) + ) + (else + (set! (-> this pos quad) (-> this root trans quad)) + (if (logtest? (-> this flags) (task-arrow-flags taf4)) + (seek! (-> this rod-of-god-scale) 0.0 (* 8.0 (seconds-per-frame))) + (seek! (-> this rod-of-god-scale) 1.0 (* 8.0 (seconds-per-frame))) + ) + (if (and (-> this death-pending?) + (and (logtest? (-> this flags) (task-arrow-flags taf4)) (= (the int (-> this rod-of-god-scale)) 0)) + ) + (go (method-of-object this die)) + ) + ) + ) + (cond + ((not (logtest? (-> this flags) (task-arrow-flags taf2))) + (let ((f0-39 (-> this base-scale)) + (f30-1 (-> this rod-of-god-scale)) + ) + (set-vector! (-> this root scale) (* f30-1 f0-39) 600.0 (* f30-1 f0-39) 1.0) + (set-vector! (-> this draw color-emissive) 0.5 0.5 0.3 1.0) + (vector-float*! + (the-as vector (-> this draw color-emissive)) + (the-as vector (-> this draw color-emissive)) + (* (-> this alpha) (rand-vu-float-range 0.55 0.7)) + ) + (set! (-> *part-id-table* 410 init-specs 9 initial-valuef) + (* (-> this alpha) (rand-vu-float-range 80.0 96.0)) + ) + (set! (-> *part-id-table* 411 init-specs 9 initial-valuef) + (* (-> this alpha) (rand-vu-float-range 80.0 96.0)) + ) + (let ((f1-18 (lerp-scale 18432.0 44236.8 (- (-> (math-camera-pos) y) (-> this root trans y)) 12288.0 49152.0)) + (f0-56 (* 0.16666667 (-> this base-scale) f30-1)) + ) + (set! (-> *part-id-table* 410 init-specs 3 initial-valuef) (* f1-18 f0-56)) + (set! (-> *part-id-table* 410 init-specs 5 initial-valuef) (* 73728.0 f0-56)) + (set! (-> *part-id-table* 411 init-specs 3 initial-valuef) (* 0.25 f0-56 f1-18)) + (set! (-> *part-id-table* 411 init-specs 5 initial-valuef) (* 18432.0 f0-56)) + (if (or (not (logtest? (-> this flags) (task-arrow-flags taf4))) (< 0.0 f0-56)) + (spawn (-> this part) (-> this root trans)) + ) + ) + ) + ) + (else + (+! (-> this theta) (* 32768.0 (seconds-per-frame))) + (+! (-> this phi) (* 9102.223 (seconds-per-frame))) + (set! (-> this root trans quad) (-> this pos quad)) + (set! (-> this root trans y) (+ 28672.0 (* 4096.0 (cos (-> this theta))) (-> this pos y))) + ) + ) + (when (logtest? (-> this flags) (task-arrow-flags taf1)) + (quaternion-axis-angle! (-> this root quat) 0.0 1.0 0.0 (-> this phi)) + (quaternion-normalize! (quaternion*! (-> this root quat) (-> this base-quat) (-> this root quat))) + ) + (transform-post) + 0 + (none) + ) + +(defstate idle (task-arrow) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-2 object)) + (case message + (('set-position) + (let ((a0-3 (the-as object (-> block param 0)))) + (set! (-> self pos quad) (-> (the-as vector a0-3) quad)) + ) + (if (logtest? (-> self flags) (task-arrow-flags taf3)) + (task-arrow-method-23 self (-> self pos)) + ) + (let ((f0-0 4096.0)) + (when (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> self pos) (-> self root trans))) + (set! v0-2 #t) + (set! (-> self moving) (the-as symbol v0-2)) + v0-2 + ) + ) + ) + (('leave) + (if (logtest? (-> self flags) (task-arrow-flags taf2)) + (go-virtual die) + (go-virtual leave) + ) + ) + (('set-scale) + (set! (-> self base-scale) (the-as float (-> block param 0))) + ) + (('set-alpha) + (set! (-> self alpha) (the-as float (-> block param 0))) + ) + (('hide-keep-minimap) + (set! v0-2 (logior (-> self flags) (task-arrow-flags taf4))) + (set! (-> self flags) (the-as task-arrow-flags v0-2)) + v0-2 + ) + (('hide 'die) + (if (= message 'die) + (set! (-> self death-pending?) #t) + ) + (when (-> self minimap) + (kill-callback (-> *minimap* engine) (-> self minimap)) + (set! (-> self minimap) #f) + ) + (set! v0-2 (logior (-> self flags) (task-arrow-flags taf4))) + (set! (-> self flags) (the-as task-arrow-flags v0-2)) + v0-2 + ) + (('show) + (logclear! (-> self flags) (task-arrow-flags taf4)) + (when (and (not (-> self minimap)) (not (logtest? (-> self flags) (task-arrow-flags taf5)))) + (set! v0-2 (add-icon! *minimap* self (-> self map-icon) (the-as int #f) (the-as vector #t) 0)) + (set! (-> self minimap) (the-as connection-minimap v0-2)) + v0-2 + ) + ) + (('modify-flags) + (let ((v1-35 (-> block param 0)) + (a1-6 (-> block param 1)) + ) + (set! v0-2 (logior (logclear (-> self flags) a1-6) v1-35)) + ) + (set! (-> self flags) (the-as task-arrow-flags v0-2)) + v0-2 + ) + (('map-icon) + (kill-callback (-> *minimap* engine) (-> self minimap)) + (let ((a2-2 (-> block param 0))) + (set! (-> self map-icon) a2-2) + (set! v0-2 (add-icon! *minimap* self a2-2 (the-as int #f) (the-as vector #t) 0)) + ) + (set! (-> self minimap) (the-as connection-minimap v0-2)) + v0-2 + ) + ) + ) + :code sleep-code + :post (behavior () + (when (logtest? (-> self flags) (task-arrow-flags taf8)) + (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> self root trans)))) + 0.0 + (set! (-> self alpha) (lerp-scale 0.0 1.0 f0-0 40960.0 122880.0)) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> (math-camera-matrix) fvec quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (math-camera-pos) (-> self root trans)))) + (set! (-> gp-1 y) 0.0) + (set! (-> s5-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-normalize! s5-1 1.0) + (vector-negate-in-place! gp-1) + (vector+! gp-1 gp-1 s5-1) + ) + (vector-normalize! gp-1 1.0) + (quaternion-look-at! (-> self root quat) gp-1 *up-vector*) + ) + (draw-arrow self) + ) + ) + +(defstate leave (task-arrow) + :virtual #t + :code (behavior () + (set! (-> self moving) #t) + (while (-> self moving) + (suspend) + ) + (cleanup-for-death self) + ) + :post (behavior () + (draw-arrow self) + ) + ) + +(defstate die (task-arrow) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (kill-callback (-> *minimap* engine) (-> self minimap)) + (set! (-> self minimap) #f) + ) + ) + :code (behavior () + (cleanup-for-death self) + ) + ) + +(defbehavior task-arrow-init-by-other task-arrow ((arg0 task-arrow-params)) + (set! (-> self death-pending?) #f) + (set! (-> self flags) (-> arg0 flags)) + (set! (-> self map-icon) (-> arg0 map-icon)) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec camera-blocker)) + (set! (-> v1-4 prim-core action) (collide-action solid)) + (set! (-> v1-4 transform-index) 3) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-4) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-7 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (set! (-> self pos quad) (-> arg0 pos quad)) + (if (logtest? (-> self flags) (task-arrow-flags taf3)) + (task-arrow-method-23 self (-> self pos)) + ) + (set! (-> self root trans quad) (-> self pos quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (quaternion-copy! (-> self base-quat) (-> arg0 quat)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (set! (-> self base-scale) 6.0) + (set! (-> self alpha) 1.0) + (set! (-> self hud-dist) (the-as handle #f)) + (set! (-> self max-dist) 0.0) + (set! (-> self theta) 0.0) + (set! (-> self phi) 0.0) + (set! (-> self minimap) #f) + (if (not (logtest? (-> self flags) (task-arrow-flags taf5))) + (set! (-> self minimap) (add-icon! *minimap* self (-> arg0 map-icon) (the-as int #f) (the-as vector #t) 0)) + ) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 123) self)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-rod-of-god" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self draw lod-set lod 0 dist) 4096000.0) + (set! (-> self draw bounds w) 1228800.0) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (when (not (logtest? (-> self flags) (task-arrow-flags taf7))) + (set! (-> self choir-sound) (new 'process 'ambient-sound "god-rod" (-> self root trans) 0.0)) + (set-falloff-far! (-> self choir-sound) 163840.0) + (update-vol! (-> self choir-sound) 1.0) + (update-pitch-mod! (-> self choir-sound) 0.0) + ) + (set! (-> self rod-of-god-scale) 0.0) + (set! (-> self moving) #f) + (logclear! (-> self mask) (process-mask actor-pause movie)) + (process-entity-status! self (entity-perm-status no-kill) #t) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + ) + +(defmethod relocate ((this task-arrow) (offset int)) + (if (nonzero? (-> this choir-sound)) + (&+! (-> this choir-sound) offset) + ) + (call-parent-method this offset) + ) + +(defun task-arrow-spawn ((arg0 task-arrow-params) (arg1 process-tree)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn task-arrow arg0 :name "task-arrow" :to arg1))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) diff --git a/goal_src/jak3/engine/geometry/path-h.gc b/goal_src/jak3/engine/geometry/path-h.gc index 4d6322f390c..beb7f580842 100644 --- a/goal_src/jak3/engine/geometry/path-h.gc +++ b/goal_src/jak3/engine/geometry/path-h.gc @@ -32,14 +32,14 @@ These path-controls are typically allocated on a process heap." ) (:methods (new (symbol type process symbol float entity symbol) _type_) - (path-control-method-9 () none) + (path-control-method-9 (_type_) none) (path-control-method-10 () none) (path-control-method-11 () none) (path-control-method-12 () none) (path-control-method-13 () none) - (path-control-method-14 () none) + (get-point-at-percent-along-path! (_type_ vector float symbol) vector) (path-control-method-15 () none) - (path-control-method-16 () none) + (displacement-between-points-at-percent-normalized! (_type_ vector float) vector) (get-num-segments (_type_) float) (path-control-method-18 () none) (get-num-verts (_type_) int) @@ -48,7 +48,7 @@ These path-controls are typically allocated on a process heap." (path-control-method-22 () none) (path-control-method-23 () none) (path-control-method-24 () none) - (path-control-method-25 () none) + (path-control-method-25 (_type_ vector) float) (path-control-method-26 () none) (path-control-method-27 () none) (path-control-method-28 () none) diff --git a/goal_src/jak3/engine/geometry/vol-h.gc b/goal_src/jak3/engine/geometry/vol-h.gc index a6715a33820..0200fb77630 100644 --- a/goal_src/jak3/engine/geometry/vol-h.gc +++ b/goal_src/jak3/engine/geometry/vol-h.gc @@ -5,5 +5,113 @@ ;; name in dgo: vol-h ;; dgos: GAME +;; +++vol-flags +(defenum vol-flags + :bitfield #t + :type uint32 + (display?) + (vol-flags-1) + ) +;; ---vol-flags + + ;; DECOMP BEGINS +(deftype plane-volume (structure) + ((volume-type symbol) + (point-count int16) + (normal-count int16) + (first-point (pointer vector)) + (first-normal (pointer vector)) + (num-planes int32) + (plane (inline-array plane)) + ) + :pack-me + (:methods + (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume) + (debug-draw (_type_) none) + (point-in-vol? (_type_ vector float) symbol) + ) + ) + + +(deftype vol-control (basic) + ((flags vol-flags) + (process process-drawable) + (pos-vol-count int32) + (pos-vol plane-volume 32 :inline) + (neg-vol-count int32) + (neg-vol plane-volume 32 :inline) + (debug-point vector-array) + (debug-normal vector-array) + ) + (:methods + (new (symbol type process-drawable) _type_) + (debug-draw (_type_) none) + (vol-control-method-10 (_type_ plane) symbol) + (should-display? (_type_) symbol) + ) + ) + + +;; WARN: Return type mismatch object vs vol-control. +(defmethod new vol-control ((allocation symbol) (type-to-make type) (arg0 process-drawable)) + (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as vol-control gp-0)) + (go process-drawable-art-error "memory") + (set! gp-0 0) + (goto cfg-13) + ) + (set! (-> (the-as vol-control gp-0) process) arg0) + (let* ((s5-1 (-> (the-as vol-control gp-0) process entity)) + (s4-0 (-> ((method-of-type res-lump lookup-tag-idx) s5-1 'vol 'base -1000000000.0) lo)) + ) + (when (>= (the-as int s4-0) 0) + (let ((s3-0 (the-as int s4-0)) + (s2-0 (-> s5-1 tag s4-0)) + ) + 0 + (while (= (-> s2-0 name) (-> s5-1 tag s4-0 name)) + (let ((v1-12 (make-property-data s5-1 0.0 (the-as res-tag-pair s3-0) (the-as pointer #f))) + (a0-8 (-> (the-as vol-control gp-0) pos-vol (-> (the-as vol-control gp-0) pos-vol-count))) + ) + (set! (-> a0-8 num-planes) (the-as int (-> s2-0 elt-count))) + (set! (-> a0-8 plane) (the-as (inline-array plane) v1-12)) + ) + (+! (-> (the-as vol-control gp-0) pos-vol-count) 1) + (+! s3-0 1) + (set! s2-0 (-> s5-1 tag s3-0)) + ) + ) + ) + ) + (let* ((s5-2 (-> (the-as vol-control gp-0) process entity)) + (s4-1 (-> ((method-of-type res-lump lookup-tag-idx) s5-2 'cutoutvol 'base -1000000000.0) lo)) + ) + (when (>= (the-as int s4-1) 0) + (let ((s3-1 (the-as int s4-1)) + (s2-1 (-> s5-2 tag s4-1)) + ) + 0 + (while (= (-> s2-1 name) (-> s5-2 tag s4-1 name)) + (let ((v1-31 (make-property-data s5-2 0.0 (the-as res-tag-pair s3-1) (the-as pointer #f))) + (a0-19 (-> (the-as vol-control gp-0) neg-vol (-> (the-as vol-control gp-0) neg-vol-count))) + ) + (set! (-> a0-19 num-planes) (the-as int (-> s2-1 elt-count))) + (set! (-> a0-19 plane) (the-as (inline-array plane) v1-31)) + ) + (+! (-> (the-as vol-control gp-0) neg-vol-count) 1) + (+! s3-1 1) + (set! s2-1 (-> s5-2 tag s3-1)) + ) + ) + ) + ) + (label cfg-13) + (the-as vol-control gp-0) + ) + ) + +(defmethod should-display? ((this vol-control)) + (and *display-vol-marks* (logtest? (-> this flags) (vol-flags display?))) + ) diff --git a/goal_src/jak3/engine/geometry/vol.gc b/goal_src/jak3/engine/geometry/vol.gc index f5cd79d2d43..0444dd36173 100644 --- a/goal_src/jak3/engine/geometry/vol.gc +++ b/goal_src/jak3/engine/geometry/vol.gc @@ -7,3 +7,253 @@ ;; DECOMP BEGINS +(defun plane-volume-intersect-dist ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((f0-1 (vector-dot arg1 arg0)) + (f1-1 (vector-dot arg2 arg0)) + ) + (if (< 0.00001 (fabs f1-1)) + (/ (- (-> arg0 w) f0-1) f1-1) + 409600000.0 + ) + ) + ) + +(defmethod plane-volume-method-9 ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) + (local-vars + (sv-144 vector) + (sv-148 float) + (sv-152 int) + (sv-160 vector) + (sv-176 vector) + (sv-192 vector) + (sv-208 vector) + (sv-224 vector) + (sv-240 int) + (sv-256 int) + ) + (set! (-> this volume-type) arg0) + (set! (-> this point-count) 0) + (set! (-> this first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) + (set! (-> this normal-count) 0) + (set! (-> this first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) + (dotimes (s3-0 (-> this num-planes)) + (set! sv-176 (new 'stack-no-clear 'vector)) + (set! (-> sv-176 quad) (the-as uint128 0)) + (set! sv-192 (new 'stack-no-clear 'vector)) + (set! (-> sv-192 quad) (the-as uint128 0)) + (set! sv-208 (new 'stack-no-clear 'vector)) + (set! (-> sv-208 quad) (the-as uint128 0)) + (set! sv-224 (new 'stack-no-clear 'vector)) + (set! (-> sv-224 quad) (the-as uint128 0)) + 0.0 + 0.0 + 0.0 + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((s1-0 (new-stack-vector0)) + (s0-0 0) + (s2-0 (-> this plane)) + ) + (set! sv-240 0) + (while (< sv-240 (-> this num-planes)) + (when (!= s3-0 sv-240) + (vector-float*! sv-176 (the-as vector (-> s2-0 sv-240)) (-> s2-0 sv-240 w)) + (vector-cross! sv-192 (the-as vector (-> s2-0 sv-240)) (the-as vector (-> s2-0 s3-0))) + (vector-normalize! sv-192 1.0) + (vector-cross! sv-208 sv-192 (the-as vector (-> s2-0 sv-240))) + (vector-normalize! sv-208 1.0) + (let ((f0-4 (plane-volume-intersect-dist (-> s2-0 s3-0) sv-176 sv-208))) + (when (!= f0-4 409600000.0) + (vector+float*! sv-224 sv-176 sv-208 f0-4) + (set! sv-144 (new-stack-vector0)) + (set! sv-148 (the-as float 0.0)) + (set! sv-152 0) + (set! sv-160 (new-stack-vector0)) + (set! (-> sv-144 quad) (-> sv-224 quad)) + (set! sv-256 0) + (while (< sv-256 (-> this num-planes)) + (when (and (!= sv-256 s3-0) (!= sv-256 sv-240)) + (let ((f0-6 (plane-volume-intersect-dist (-> s2-0 sv-256) sv-144 sv-192))) + (cond + ((= f0-6 409600000.0) + ) + ((zero? sv-152) + (vector+float*! sv-144 sv-144 sv-192 f0-6) + (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (set! sv-148 (the-as float 8192000.0)) + (set! sv-152 1) + ) + ((begin (vector-float*! sv-224 sv-192 f0-6) (>= (vector-dot sv-224 sv-160) 0.0)) + ) + ((>= (vector-dot sv-224 (the-as vector (-> s2-0 sv-256))) 0.0) + (when (< (fabs f0-6) (fabs sv-148)) + (set! sv-148 f0-6) + (set! sv-152 (+ sv-152 1)) + ) + ) + (else + (vector+float*! sv-144 sv-144 sv-192 f0-6) + (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (set! sv-152 (+ sv-152 1)) + (if (< (fabs f0-6) (fabs sv-148)) + (set! sv-148 (- sv-148 f0-6)) + (set! sv-148 (the-as float 0.0)) + ) + ) + ) + ) + ) + (set! sv-256 (+ sv-256 1)) + ) + (cond + ((zero? sv-152) + ) + ((= sv-148 0.0) + ) + (else + (dotimes (v1-75 (-> this num-planes)) + (when (and (!= v1-75 s3-0) (!= v1-75 sv-240)) + (if (< 4096.0 (- (vector-dot sv-144 (the-as vector (-> s2-0 v1-75))) (-> s2-0 v1-75 w))) + (goto cfg-42) + ) + ) + ) + (vector+float*! sv-224 sv-144 sv-192 sv-148) + (cond + ((< (-> arg1 allocated-length) (+ (-> arg1 length) 2)) + (format 0 "ERROR : vol-control #x~X out of volume points~%" this) + ) + (else + (set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad)) + (set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad)) + (+! (-> arg1 length) 2) + (+! (-> this point-count) 2) + ) + ) + (vector+! s1-0 s1-0 sv-144) + (vector+! s1-0 s1-0 sv-224) + (+! s0-0 2) + ) + ) + ) + ) + ) + (label cfg-42) + (set! sv-240 (+ sv-240 1)) + ) + (when (nonzero? s0-0) + (vector-float*! s1-0 s1-0 (/ 1.0 (the float s0-0))) + (cond + ((< (-> arg2 allocated-length) (+ (-> arg2 length) 2)) + (format 0 "ERROR : vol-control #x~X out of volume normals~%" this) + ) + (else + (set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad)) + (set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad)) + (+! (-> arg2 length) 2) + (set! (-> this normal-count) (+ (-> this normal-count) 2)) + ) + ) + ) + ) + ) + this + ) + +(defmethod debug-draw ((this plane-volume)) + (let* ((v1-0 (-> this volume-type)) + (s5-0 (cond + ((= v1-0 'vol) + (the-as uint #x8000c000) + ) + ((= v1-0 'pvol) + (the-as uint #x80808080) + ) + (else + (the-as uint #x800000c0) + ) + ) + ) + (s4-0 (-> this first-point)) + ) + (dotimes (s3-0 (/ (-> this point-count) 2)) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (the-as vector s4-0) + (the-as vector (&-> s4-0 4)) + (the-as rgba s5-0) + #f + (the-as rgba -1) + ) + (set! s4-0 (&-> s4-0 8)) + ) + ) + 0 + (none) + ) + +(defmethod point-in-vol? ((this plane-volume) (arg0 vector) (arg1 float)) + (dotimes (v1-0 (-> this num-planes)) + (if (< arg1 (- (vector-dot arg0 (the-as vector (-> this plane v1-0))) (-> this plane v1-0 w))) + (return #f) + ) + ) + #t + ) + +(defmethod debug-draw ((this vol-control)) + (with-pp + (let ((a0-1 this)) + (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) (vol-flags display?))) + (logtest? (-> this flags) (vol-flags vol-flags-1)) + ) + (when (zero? (-> this debug-point)) + (let ((s5-0 pp)) + (set! pp (-> this process)) + (let ((s4-0 0)) + (dotimes (v1-8 (-> this pos-vol-count)) + (+! s4-0 (-> this pos-vol v1-8 num-planes)) + ) + (dotimes (v1-11 (-> this neg-vol-count)) + (+! s4-0 (-> this neg-vol v1-11 num-planes)) + ) + (set! (-> this debug-point) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> this debug-normal) (new 'debug 'vector-array (* 10 s4-0))) + ) + (set! pp s5-0) + ) + (set! (-> this debug-point length) 0) + (set! (-> this debug-normal length) 0) + (dotimes (s5-1 (-> this pos-vol-count)) + (plane-volume-method-9 (-> this pos-vol s5-1) 'vol (-> this debug-point) (-> this debug-normal)) + ) + (dotimes (s5-2 (-> this neg-vol-count)) + (plane-volume-method-9 (-> this neg-vol s5-2) 'vol (-> this debug-point) (-> this debug-normal)) + ) + ) + (dotimes (s5-3 (-> this pos-vol-count)) + (debug-draw (-> this pos-vol s5-3)) + ) + (dotimes (s5-4 (-> this neg-vol-count)) + (debug-draw (-> this neg-vol s5-4)) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod vol-control-method-10 ((this vol-control) (arg0 plane)) + (dotimes (s4-0 (-> this neg-vol-count)) + (if (point-in-vol? (-> this neg-vol s4-0) arg0 0.0) + (return #f) + ) + ) + (dotimes (s4-1 (-> this pos-vol-count)) + (if (point-in-vol? (-> this pos-vol s4-1) arg0 0.0) + (return #t) + ) + ) + #f + ) diff --git a/goal_src/jak3/engine/gfx/background/subdivide-h.gc b/goal_src/jak3/engine/gfx/background/subdivide-h.gc index 70bbcfd182a..9c8a4997090 100644 --- a/goal_src/jak3/engine/gfx/background/subdivide-h.gc +++ b/goal_src/jak3/engine/gfx/background/subdivide-h.gc @@ -105,8 +105,10 @@ Interestingly, dma-area went from a union of all the -dma types to a plain array "Scratchpad memory layout for regions." ((region-prim-list region-prim-list :inline) (pos vector :inline) - (ray vector :inline :offset 1328) - (region-enter-count int32 :offset 1360) + (exit-pos vector :inline) + (ray vector :inline) + (exit-ray vector :inline) + (region-enter-count int32) (region-enter-list region 320) (region-enter-prim-list drawable-region-sphere 320) (region-exit-count int32) @@ -120,10 +122,10 @@ Interestingly, dma-area went from a union of all the -dma types to a plain array (region-start-prim-list drawable-region-sphere 320) ) (:methods - (region-prim-area-method-9 () none) - (region-prim-area-method-10 () none) - (region-prim-area-method-11 () none) - (region-prim-area-method-12 () none) + (track-entered-region! (_type_ drawable-region-sphere) int) + (track-exited-region! (_type_ drawable-region-sphere) int) + (track-inside-region! (_type_ drawable-region-sphere) int) + (track-start-region! (_type_ drawable-region-sphere) int) ) ) diff --git a/goal_src/jak3/engine/gfx/foreground/foreground-h.gc b/goal_src/jak3/engine/gfx/foreground/foreground-h.gc index 630b9907d5c..f6b2be81ea8 100644 --- a/goal_src/jak3/engine/gfx/foreground/foreground-h.gc +++ b/goal_src/jak3/engine/gfx/foreground/foreground-h.gc @@ -8,6 +8,7 @@ (declare-type merc-effect structure) (define-extern vu-lights<-light-group! (function vu-lights light-group none)) (define-extern *foreground-draw-engine* engine) +(define-extern *default-shadow-settings* shadow-settings) ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/gfx/foreground/shadow-cpu-h.gc b/goal_src/jak3/engine/gfx/foreground/shadow-cpu-h.gc index 5a3e81d4e12..dea5a0d219a 100644 --- a/goal_src/jak3/engine/gfx/foreground/shadow-cpu-h.gc +++ b/goal_src/jak3/engine/gfx/foreground/shadow-cpu-h.gc @@ -17,6 +17,7 @@ (disable-draw) (shdf06) (shdf07) + (shdf08) ) ;; ---shadow-flags diff --git a/goal_src/jak3/engine/gfx/generic/generic-vu1-h.gc b/goal_src/jak3/engine/gfx/generic/generic-vu1-h.gc index 946b1f1de1e..dfdfd100d24 100644 --- a/goal_src/jak3/engine/gfx/generic/generic-vu1-h.gc +++ b/goal_src/jak3/engine/gfx/generic/generic-vu1-h.gc @@ -65,7 +65,7 @@ This matrix is likely not used by generic VU1, but is used by the merc -> generi (num-strips uint32 :overlay-at (-> giftag data 3)) (num-dps uint32 :overlay-at (-> adnops 0 word 3)) (kick-offset uint32 :offset 108) - (shader gcf-shader :dynamic) + (shader gcf-shader :inline :dynamic) ) ) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-h.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-h.gc index c1406d218b3..185379b8aae 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-h.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-h.gc @@ -7,10 +7,36 @@ (declare-type sprite-vec-data-2d structure) +;; +++sp-cpuinfo-flag (defenum sp-cpuinfo-flag :bitfield #t :type uint32 + ;; todo copied from jak 2 + (sp-cpuinfo-flag-0 0) + (sp-cpuinfo-flag-1 1) + (sp-cpuinfo-flag-2 2) ;; cleared after an aux has its func set to add-to-sprite-aux-lst + (sp-cpuinfo-flag-3 3) + (sp-cpuinfo-flag-4 4) + (sp-cpuinfo-flag-5 5) + (ready-to-launch 6) ;; maybe just just death? + (distort 7) ;; distort sprite + (aux-list 8) ;; prevents relaunch, adds to aux + (sp-cpuinfo-flag-9 9) + (level0 10) + (level1 11) + (sp-cpuinfo-flag-12 12) ;; required to relaunch + (sp-cpuinfo-flag-13 13) + (sp-cpuinfo-flag-14 14) + (glow 15) ;; glow sprite + (use-global-acc 16) + (launch-along-z 17) + (left-multiply-quat 18) + (right-multiply-quat 19) + (set-conerot 20) + (sp-cpuinfo-flag-21 21) ) +;; ---sp-cpuinfo-flag + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc index 74c24e47f24..745fc32b51d 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc @@ -12,6 +12,85 @@ ;; +++sp-field-id (defenum sp-field-id :type uint16 + ;; todo copied from jak 2 + (misc-fields-start 0) + (spt-texture 1) + (spt-anim 2) + (spt-anim-speed 3) + (spt-birth-func 4) + (spt-joint/refpoint 5) + (spt-num 6) + (spt-sound 7) + (misc-fields-end 8) + + (sprite-fields-start 9) + (spt-x 10) + (spt-y 11) + (spt-z 12) + (spt-scale-x 13) + (spt-rot-x 14) + (spt-rot-y 15) + (spt-rot-z 16) + (spt-scale-y 17) + (spt-r 18) + (spt-g 19) + (spt-b 20) + (spt-a 21) + (sprite-fields-end 22) + + (cpu-fields-start 23) + (spt-omega 24) + (spt-vel-x 25) + (spt-vel-y 26) + (spt-vel-z 27) + (spt-scalevel-x 28) + (spt-rotvel-x 29) + (spt-rotvel-y 30) + (spt-rotvel-z 31) + (spt-scalevel-y 32) + (spt-fade-r 33) + (spt-fade-g 34) + (spt-fade-b 35) + (spt-fade-a 36) + (spt-accel-x 37) + (spt-accel-y 38) + (spt-accel-z 39) + (spt-dummy 40) + (spt-quat-x 41) + (spt-quat-y 42) + (spt-quat-z 43) + (spt-quad-w 44) + (spt-friction 45) + (spt-timer 46) + (spt-flags 47) + (spt-userdata 48) + (spt-func 49) + (spt-next-time 50) + (spt-next-launcher 51) + (cpu-fields-end 52) + + (launch-fields-start 53) + (spt-launchrot-x 54) + (spt-launchrot-y 55) + (spt-launchrot-z 56) + (spt-launchrot-w 57) + (spt-conerot-x 58) + (spt-conerot-y 59) + (spt-conerot-z 60) + (spt-conerot-w 61) + (spt-rotate-x 62) + (spt-rotate-y 63) + (spt-rotate-z 64) + + (spt-conerot-radius 65) + (spt-mat-scale-x 66) + (spt-mat-scale-y 67) + (spt-mat-scale-z 68) + (launch-fields-end 69) + + (spt-scale 70) + (spt-scalevel 71) + (spt-end 72) ) ;; ---sp-field-id @@ -19,6 +98,15 @@ ;; +++sp-flag (defenum sp-flag :type uint16 + ;; todo copied from jak 2 + (int 0) ;; int + (float 1) ;; float + (float-int-rand 2) ;; float with int rand + (copy-from-other 3) ;; copy + (object 4) ;; label + (symbol 5) ;; symbol + (launcher 6) ;; launcher from id + (float-store 7) ;; float and store result in *sp-temp* ) ;; ---sp-flag @@ -27,7 +115,7 @@ (defenum sp-group-item-flag :bitfield #t :type uint16 - (sp0) + (is-3d) (sp1) (sp2) (sp3) @@ -51,6 +139,9 @@ (defenum sp-launch-state-flags :bitfield #t :type uint16 + (sp0) + (sp1) + (sp2) ) ;; ---sp-launch-state-flags @@ -79,6 +170,231 @@ ;; ---sp-group-flag +(defmacro sp-item (launcher + &key (fade-after 0.0) + &key (falloff-to 0.0) + &key (flags ()) + &key (period 0) + &key (length 0) + &key (offset 0) + &key (hour-mask 0) + &key (binding 0) + ) + `(new 'static 'sparticle-group-item + :launcher ,launcher + :fade-after ,fade-after + :falloff-to ,falloff-to + :flags (sp-group-item-flag ,@flags) + :period ,period + :length ,length + :offset ,offset + :hour-mask ,hour-mask + :binding ,binding + ) + ) + +(defmacro defpartgroup (name &key id &key parts &key (duration 3000) &key (linger-duration 1500) &key (flags ()) &key bounds + &key (rotate (0.0 0.0 0.0)) &key (scale (1.0 1.0 1.0))) + "define a new part group. defines a constant with the name of the group with the ID as its value" + `(begin + (defconstant ,name ,id) + (set! (-> *part-group-id-table* ,id) + (new 'static 'sparticle-launch-group + :duration ,duration + :linger-duration ,linger-duration + :flags (sp-group-flag ,@flags) + :bounds ,bounds + :name ,(symbol->string name) + :length ,(length parts) + :launcher (new 'static 'inline-array sparticle-group-item ,(length parts) ,@parts) + :rotate-x ,(car rotate) + :rotate-y ,(cadr rotate) + :rotate-z ,(caddr rotate) + :scale-x ,(car scale) + :scale-y ,(cadr scale) + :scale-z ,(caddr scale) + ) + ) + ) + ) + +(desfun param-float? (p) + (or (float? p) (and (pair? p) (eq? 'meters (car p))) (and (pair? p) (eq? 'degrees (car p)))) + ) + +(desfun param-int? (p) + (or (integer? p) (and (pair? p) (eq? 'seconds (car p)))) + ) + +(desfun param-symbol? (p) + (and (pair? p) (eq? 'quote (car p))) + ) + +(seval (begin +(define *sparticle-fields* (make-string-hash-table)) +(doenum (name val 'sp-field-id) + (hash-table-set! + *sparticle-fields* + (if (string-starts-with? (symbol->string name) "spt-") + (string->symbol (string-substr (symbol->string name) 4 0)) + name) + (list + val name (member name '(spt-vel-x + spt-vel-y + spt-vel-z + spt-scalevel-x + spt-scalevel-y + spt-rotvel-x + spt-rotvel-y + spt-rotvel-z + spt-fade-r + spt-fade-g + spt-fade-b + spt-fade-a + spt-accel-x + spt-accel-y + spt-accel-z)) + ) + ) + ) +;; you cannot define these fields ever. +(define *sparticle-fields-banned* '(misc-fields-start + misc-fields-end + sprite-fields-start + sprite-fields-end + cpu-fields-start + cpu-fields-end + launch-fields-start + launch-fields-end + end + )) +)) + +;; the last field ID defined, to make sure that fields are defined in order. +(seval (define *last-field-id* -1)) + +(desfun process-init-spec (x) + (let* ((head (symbol->string (car x))) + (params (cdr x)) + (field-name (string->symbol (string-substr head 1 0))) + (field-lookup (hash-table-try-ref *sparticle-fields* field-name)) + (field (cdr field-lookup)) + (store? (member ':store params)) + (param-count (if store? (1- (length params)) (length params))) + ) + (when (not (car field-lookup)) + (fmt #t "unknown sparticle field {}\n" x)) + (when (neq? (string-ref head 0) #\:) + (fmt #t "invalid sparticle field {}\n" x)) + ; (when (member field-name *sparticle-fields-banned*) + ; (fmt #t "you cannot use sparticle field {}\n" field-name)) + (let ((field-id (car field)) + (field-enum-name (cadr field)) + (vel? (and #f (caddr field))) + (param0 (and (>= param-count 1) (first params))) + (param1 (and (>= param-count 2) (second params))) + (param2 (and (>= param-count 3) (third params)))) + (when (>= *last-field-id* field-id) + (fmt #t "field {} must come after field {}, not before\n" field-name (car (nth *last-field-id* *sparticle-fields*))) + ) + (set! *last-field-id* field-id) + (cond + ((eq? field-name 'flags) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :initial-value (sp-cpuinfo-flag ,@param0) :random-mult 1) + ) + ((eq? field-name 'texture) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :tex ,param0 :flags (sp-flag int)) + ) + ((eq? field-name 'next-launcher) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :initial-value ,param0 :flags (sp-flag launcher)) + ) + ((eq? field-name 'sound) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :sound ,param0 :flags (sp-flag object)) + ) + ((and (= 2 param-count) (symbol? param0) (eq? param0 ':copy)) + (let* ((other-field-lookup (hash-table-try-ref *sparticle-fields* (cadr (member ':copy params)))) + (other-field (cdr other-field-lookup)) + (other-field-id (car other-field))) + (when (>= other-field-id field-id) + (fmt #t "warning copying to sparticle field {} from {} - you can only copy from fields before this one!\n" field-name (cadr other-field)) ) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag copy-from-other) + :initial-value ,(- other-field-id field-id) :random-mult 1) + ) + ) + ((and (= 2 param-count) (symbol? param0) (eq? param0 ':data)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag object) + :object ,(cadr (member ':data params))) + ) + ((and (= 1 param-count) (param-symbol? param0)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag symbol) + :sym ,param0) + ) + ((and (= 1 param-count) (param-float? param0)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag ,(if store? 'float-store 'float)) + :initial-valuef ,(if vel? `(/ ,param0 60.0) param0) + :random-rangef 0.0 + :random-multf 1.0) + ) + ((and (= 2 param-count) (param-float? param0) (param-float? param1)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag ,(if store? 'float-store 'float)) + :initial-valuef ,(if vel? `(/ ,param0 60.0) param0) + :random-rangef ,(if vel? `(/ ,param1 60.0) param1) + :random-multf 1.0) + ) + ((and (= 3 param-count) (param-float? param0) (param-float? param1) (param-float? param2)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag ,(if store? 'float-store 'float)) + :initial-valuef ,(if vel? `(/ ,param0 60.0) param0) + :random-rangef ,param1 + :random-multf ,(if vel? `(/ ,param2 60.0) param2)) + ) + ((and (= 3 param-count) (param-float? param0) (param-int? param1) (param-float? param2)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag float-int-rand) + :initial-valuef ,(if vel? `(/ ,param0 60.0) param0) + :random-range ,param1 + :random-multf ,(if vel? `(/ ,param2 60.0) param2)) + ) + ((and (= 1 param-count) (param-int? param0)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag int) + :initial-value ,param0 + :random-range 0 + :random-mult 1) + ) + ((and (= 2 param-count) (param-int? param0) (param-int? param1)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag int) + :initial-value ,param0 + :random-range ,param1 + :random-mult 1) + ) + ((and (= 3 param-count) (param-int? param0) (param-int? param1) (param-int? param2)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag int) + :initial-value ,param0 + :random-range ,param1 + :random-mult ,param2) + ) + (#t + `(new 'static 'sp-field-init-spec :field (sp-field-id spt-end)) + ) + ) + ) + ) + ) + +(defmacro defpart (id &key (init-specs ())) + "define a new sparticle-launcher" + (begin + (set! *last-field-id* -1) + `(set! (-> *part-id-table* ,id) + (new 'static 'sparticle-launcher + :init-specs (new 'static 'inline-array sp-field-init-spec ,(1+ (length init-specs)) + ,@(apply process-init-spec init-specs) + (new 'static 'sp-field-init-spec :field (sp-field-id spt-end)) + ))) + ) + ) + +(define-extern local-space-proc-joint (function particle-local-space-info none)) +(define-extern *particle-quat* quaternion) + ;; DECOMP BEGINS (deftype sparticle-birthinfo (structure) @@ -211,11 +527,11 @@ particle system itself. This type just holds the launching-related state." (:methods (sparticle-launch-control-method-14 () none) (sparticle-launch-control-method-15 () none) - (sparticle-launch-control-method-16 () none) - (sparticle-launch-control-method-17 () none) - (sparticle-launch-control-method-18 () none) - (sparticle-launch-control-method-19 () none) - (sparticle-launch-control-method-20 () none) + (spawn (_type_ vector) object) + (sparticle-launch-control-method-17 (_type_ matrix) none) + (sparticle-launch-control-method-18 (_type_ cspace) none) + (kill-particles (_type_) none) + (sparticle-launch-control-method-20 (_type_ float) none) ) ) @@ -227,12 +543,12 @@ particle system itself. This type just holds the launching-related state." (sp-system sparticle-system) (sp-launcher sparticle-launcher) (spawn-mat matrix :inline) - (inited? basic) + (inited? symbol) ) (:methods (new (symbol type sparticle-system sparticle-launcher float) _type_) (sparticle-subsampler-method-9 () none) - (sparticle-subsampler-method-10 () none) + (sparticle-subsampler-method-10 (_type_ matrix) none) ) ) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc index 02ee39eba3e..b9f0f5b78a7 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc @@ -5,5 +5,33 @@ ;; name in dgo: sparticle-launcher ;; dgos: GAME +(defmacro launch-particles (&key (system *sp-particle-system-2d*) + particle + origin + &key (launch-state (the-as sparticle-launch-state #f)) + &key (launch-control (the-as sparticle-launch-control #f)) + &key (rate 1.0) + &key (origin-is-matrix #f)) + (if origin-is-matrix + `(sp-launch-particles-var + ,system + ,particle + (the matrix ,origin) + ,launch-state + ,launch-control + ,rate #|(if (= (get-video-mode) 'custom) (/ (-> *display* time-factor) 5.0) ,rate)|#) + `(begin + (vector-copy! (-> *launch-matrix* trans) (the vector ,origin)) + (sp-launch-particles-var + ,system + ,particle + *launch-matrix* + ,launch-state + ,launch-control + ,rate #|(if (= (get-video-mode) 'custom) (/ (-> *display* time-factor) 5.0) ,rate)|#) + ) + ) + ) + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/level/level-h.gc b/goal_src/jak3/engine/level/level-h.gc index 98bb207ae15..2757b3de141 100644 --- a/goal_src/jak3/engine/level/level-h.gc +++ b/goal_src/jak3/engine/level/level-h.gc @@ -170,7 +170,7 @@ (lf18 18) (lf19 19) (lf20 20) - (lf21 21) + (desert 21) (lf22 22) (lf23 23) (lf24 24) @@ -474,7 +474,7 @@ (level-group-method-19 () none) (level-get-target-inside (_type_) level) (level-group-method-21 () none) - (art-group-get-by-name (_type_ string (pointer uint32)) art-group) + (art-group-get-by-name (_type_ string (pointer level)) art-group) (level-group-method-23 () none) (level-group-method-24 () none) (level-group-method-25 () none) diff --git a/goal_src/jak3/engine/level/level-info.gc b/goal_src/jak3/engine/level/level-info.gc index 3724acb6548..4cf36ead217 100644 --- a/goal_src/jak3/engine/level/level-info.gc +++ b/goal_src/jak3/engine/level/level-info.gc @@ -11772,7 +11772,7 @@ :index #xc8 :task-level #x6 :master-level 'wasall - :level-flags (level-flags lf9 lf12 lf13 lf21) + :level-flags (level-flags lf9 lf12 lf13 desert) :packages '("dust-stormp" "desert") :run-packages '("common") :memory-mode (level-memory-mode tiny-center-small) @@ -13270,7 +13270,7 @@ :index #xca :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13379,7 +13379,7 @@ :index #xcd :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13628,7 +13628,7 @@ :index #xce :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13677,7 +13677,7 @@ :index #xcf :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13726,7 +13726,7 @@ :index #xd0 :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13779,7 +13779,7 @@ :index #xd1 :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13888,7 +13888,7 @@ :index #xd2 :task-level #x6 :master-level 'desert - :level-flags (level-flags lf9 lf12 lf21) + :level-flags (level-flags lf9 lf12 desert) :packages '("elecgate" "desertg") :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -14087,7 +14087,7 @@ :index #xd4 :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -15694,7 +15694,7 @@ (new 'static 'continue-point :name "nstb-crystal" :level 'nstb - :flags (continue-flags no-auto continue-flag-15 record-path) + :flags (continue-flags no-auto copy-entity-pos record-path) :trans (new 'static 'vector :x 6744972.5 :y -392779.78 :z 2620850.2 :w 1.0) :camera-trans (new 'static 'vector :x 6772533.0 :y -371657.94 :z 2664031.0 :w 1.0) :quat (new 'static 'vector4h :data (new 'static 'array int16 4 0 #x7a77 0 -9518)) diff --git a/goal_src/jak3/engine/nav/nav-mesh-h.gc b/goal_src/jak3/engine/nav/nav-mesh-h.gc index 12298962013..fa343c5604d 100644 --- a/goal_src/jak3/engine/nav/nav-mesh-h.gc +++ b/goal_src/jak3/engine/nav/nav-mesh-h.gc @@ -15,6 +15,8 @@ (dummy 1) ) +(define-extern nav-mesh-connect-from-ent (function process-drawable symbol)) + ;; DECOMP BEGINS (deftype nav-mesh-work-debug (structure) diff --git a/goal_src/jak3/engine/physics/ragdoll-edit.gc b/goal_src/jak3/engine/physics/ragdoll-edit.gc index a766cf4ee18..5001a96827e 100644 --- a/goal_src/jak3/engine/physics/ragdoll-edit.gc +++ b/goal_src/jak3/engine/physics/ragdoll-edit.gc @@ -7,3 +7,1221 @@ ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(defun matrix->axis-angle ((arg0 vector) (arg1 matrix)) + (let ((s5-0 (matrix->quaternion (new 'stack-no-clear 'quaternion) arg1))) + (vector-normalize-copy! arg0 (the-as vector s5-0) 1.0) + (set! (-> arg0 w) (* 2.0 (acos (-> s5-0 w)))) + ) + ) + +(defmethod has-joint? ((this ragdoll-edit-info) (arg0 ragdoll-joint)) + (dotimes (v1-0 (-> this child-stack-num)) + (if (= (-> this child-stack v1-0) arg0) + (return #t) + ) + ) + #f + ) + +(defmethod ragdoll-edit-info-method-10 ((this ragdoll-edit-info) (arg0 object) (arg1 ragdoll-joint)) + (dotimes (v1-0 (-> this child-stack-num)) + (if (= (-> this child-stack v1-0 joint-index) arg1) + (return #t) + ) + ) + #f + ) + +(defmethod fill-child-stack! ((this ragdoll-edit-info) (arg0 ragdoll)) + "Fill the `child-stack` with the joints of the given ragdoll." + (let ((v1-0 (-> this affect))) + (cond + ((zero? v1-0) + (set! (-> this child-stack-num) 1) + (set! (-> this child-stack 0) (-> arg0 ragdoll-joints (-> this current-joint))) + ) + ((= v1-0 1) + (set! (-> this child-stack-num) 1) + (set! (-> this child-stack 0) (-> arg0 ragdoll-joints (-> this current-joint))) + (let ((s4-0 (+ (-> this current-joint) 1)) + (a0-6 #t) + ) + (while (< s4-0 (the-as int (-> arg0 num-joints))) + (let ((v1-15 (-> arg0 ragdoll-joints s4-0))) + (set! a0-6 (and (< (-> v1-15 parent-joint) 0) a0-6)) + (cond + ((or a0-6 (and (>= (-> v1-15 parent-joint) 0) + (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> v1-15 parent-joint))) + ) + ) + (set! (-> this child-stack (-> this child-stack-num)) (-> arg0 ragdoll-joints s4-0)) + (set! (-> this child-stack-num) (min 60 (+ (-> this child-stack-num) 1))) + (set! a0-6 #t) + ) + (else + (set! a0-6 #f) + ) + ) + ) + (+! s4-0 1) + ) + ) + ) + ((= v1-0 2) + (dotimes (v1-29 (the-as int (-> arg0 num-joints))) + (set! (-> this child-stack v1-29) (-> arg0 ragdoll-joints v1-29)) + ) + (set! (-> this child-stack-num) (the-as int (-> arg0 num-joints))) + ) + ) + ) + 0 + (none) + ) + +(defmethod ragdoll-edit-info-method-12 ((this ragdoll-edit-info)) + (if (cpad-pressed? 0 up) + (+! (-> this current-func) -1) + ) + (if (cpad-pressed? 0 left) + (+! (-> this current-func) -4) + ) + (if (cpad-pressed? 0 down) + (+! (-> this current-func) 1) + ) + (if (cpad-pressed? 0 right) + (+! (-> this current-func) 4) + ) + (cond + ((< (the-as int (-> this current-func)) 0) + (set! (-> this current-func) (the-as uint 9)) + ) + ((>= (the-as int (-> this current-func)) 10) + (set! (-> this current-func) (the-as uint 0)) + 0 + ) + ) + (none) + ) + +(defmethod cycle-joints! ((this ragdoll-edit-info) (arg0 ragdoll)) + "Cycle through joints based on controller input." + (when (cpad-pressed? 0 r1) + (+! (-> this current-joint) 1) + (if (cpad-hold? 0 l1) + (+! (-> this current-joint) 4) + ) + ) + (when (cpad-pressed? 0 l1) + (+! (-> this current-joint) -1) + (if (cpad-hold? 0 r1) + (+! (-> this current-joint) -4) + ) + ) + (if (< (-> this current-joint) 0) + (set! (-> this current-joint) (the-as int (+ (-> arg0 num-joints) -1))) + ) + (when (>= (-> this current-joint) (the-as int (-> arg0 num-joints))) + (set! (-> this current-joint) 0) + 0 + ) + (none) + ) + +(defmethod ragdoll-edit-info-method-14 ((this ragdoll-edit-info) + (arg0 matrix) + (arg1 vector) + (arg2 (inline-array ragdoll-joint)) + (arg3 ragdoll) + (arg4 process-drawable) + ) + (let ((s2-0 (get-parent-joint arg3 arg2))) + (cond + (s2-0 + (quaternion->matrix arg0 (-> s2-0 quat)) + (set! (-> arg1 quad) (-> s2-0 position quad)) + arg1 + ) + ((< (-> arg2 0 parent-joint) 0) + (quaternion->matrix arg0 (-> arg4 root quat)) + (set! (-> arg1 quad) (-> arg4 root trans quad)) + arg1 + ) + (else + (let* ((v1-8 arg0) + (a3-1 (-> arg4 node-list data (-> arg2 0 parent-joint) bone transform)) + (a0-7 (-> a3-1 rvec quad)) + (a1-6 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-8 rvec quad) a0-7) + (set! (-> v1-8 uvec quad) a1-6) + (set! (-> v1-8 fvec quad) a2-1) + (set! (-> v1-8 trans quad) a3-2) + ) + (vector<-cspace! arg1 (-> arg4 node-list data (-> arg2 0 parent-joint))) + ) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod ragdoll-edit-info-method-15 ((this ragdoll-edit-info)) + (dotimes (s5-0 (-> this child-stack-num)) + (let ((s4-0 (-> this child-stack s5-0))) + (case (-> this analog-func) + ((5) + (let ((s3-0 add-debug-text-3d) + (s2-0 #t) + (s1-0 577) + ) + (format (clear *temp-string*) "~%~R~%" (-> s4-0 max-angle)) + (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* (-> s4-0 position) (font-color orange) (the-as vector2h #f)) + ) + ) + ((3) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-1 577) + ) + (format (clear *temp-string*) "~%~R~%" (-> s4-0 axial-slop)) + (s3-1 s2-1 (the-as bucket-id s1-1) *temp-string* (-> s4-0 position) (font-color orange) (the-as vector2h #f)) + ) + ) + ((4) + (let ((s3-2 add-debug-text-3d) + (s2-2 #t) + (s1-2 577) + ) + (format (clear *temp-string*) "~%~M~%" (-> s4-0 joint-length)) + (s3-2 s2-2 (the-as bucket-id s1-2) *temp-string* (-> s4-0 position) (font-color orange) (the-as vector2h #f)) + ) + ) + ((6) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 position) + (-> s4-0 coll-rad) + (new 'static 'rgba :b #xff :a #x80) + ) + ) + ((8) + (let ((s3-3 add-debug-text-3d) + (s2-3 #t) + (s1-3 577) + ) + (format + (clear *temp-string*) + "~%~f ~f ~f ~f~%" + (-> s4-0 quat x) + (-> s4-0 quat y) + (-> s4-0 quat z) + (-> s4-0 quat w) + ) + (s3-3 s2-3 (the-as bucket-id s1-3) *temp-string* (-> s4-0 position) (font-color orange) (the-as vector2h #f)) + ) + ) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod ragdoll-edit-info-method-16 ((this ragdoll-edit-info) (arg0 ragdoll) (arg1 process-drawable)) + (local-vars + (sv-4352 ragdoll-joint) + (sv-4368 matrix) + (sv-4384 vector) + (sv-4400 matrix) + (sv-4416 matrix) + (sv-4432 vector) + (sv-4448 quaternion) + (sv-4464 matrix) + (sv-4480 matrix) + (sv-4496 matrix) + ) + (let ((s3-0 (new 'stack-no-clear 'inline-array 'matrix 60))) + (dotimes (v1-0 60) + (let ((a0-2 (the-as matrix (-> s3-0 v1-0 rvec)))) + (set! (-> a0-2 rvec quad) (the-as uint128 0)) + (set! (-> a0-2 uvec quad) (the-as uint128 0)) + (set! (-> a0-2 fvec quad) (the-as uint128 0)) + (set! (-> a0-2 trans quad) (the-as uint128 0)) + ) + ) + (dotimes (s2-0 (the-as int (-> arg0 num-joints))) + (let ((s0-0 (-> arg0 ragdoll-joints s2-0))) + (set! sv-4352 (get-parent-joint arg0 (the-as (inline-array ragdoll-joint) s0-0))) + (set! sv-4368 (the-as matrix (-> s3-0 s2-0 rvec))) + (let ((s1-0 (new 'stack-no-clear 'matrix))) + (cond + (sv-4352 + (set! sv-4416 + (matrix-axis-angle! (new 'stack-no-clear 'matrix) (-> s0-0 pre-tform) (- (-> s0-0 pre-tform w))) + ) + (set! sv-4432 (new 'stack-no-clear 'vector)) + (let* ((v1-11 s1-0) + (a3-0 + (the-as + matrix + (-> s3-0 + (/ (the-as uint (&- (the-as pointer sv-4352) (the-as uint (the-as pointer (-> arg0 ragdoll-joints))))) + (the-as uint 192) + ) + rvec + ) + ) + ) + (a0-9 (-> a3-0 rvec quad)) + (a1-5 (-> a3-0 uvec quad)) + (a2-2 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-11 rvec quad) a0-9) + (set! (-> v1-11 uvec quad) a1-5) + (set! (-> v1-11 fvec quad) a2-2) + (set! (-> v1-11 trans quad) a3-1) + ) + (set! (-> sv-4432 quad) (-> s1-0 trans quad)) + (vector-reset! (-> s1-0 trans)) + (when (and (-> this auto-setup-now) + (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index))) + ) + (set! sv-4384 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s0-0 position) sv-4432) 1.0)) + (set! sv-4400 (new 'stack-no-clear 'matrix)) + (matrix*! sv-4416 sv-4416 s1-0) + (matrix-from-two-vectors! sv-4400 (-> sv-4416 uvec) sv-4384) + (matrix*! sv-4416 sv-4416 sv-4400) + (matrix-transpose! sv-4400 s1-0) + (matrix*! sv-4416 sv-4416 sv-4400) + (matrix->axis-angle (-> s0-0 pre-tform) sv-4416) + ) + (let ((t9-10 matrix*!) + (a0-21 s1-0) + (a2-8 s1-0) + ) + (t9-10 a0-21 sv-4416 a2-8) + ) + (set! (-> s1-0 trans quad) (-> sv-4432 quad)) + (vector-! (-> sv-4368 uvec) (-> s0-0 position) (-> sv-4352 position)) + (vector-normalize! (-> sv-4368 uvec) 1.0) + (vector-flatten! (-> sv-4368 rvec) (-> s1-0 rvec) (-> sv-4368 uvec)) + (vector-normalize! (-> sv-4368 rvec) 1.0) + (vector-cross! (-> sv-4368 fvec) (-> sv-4368 rvec) (-> sv-4368 uvec)) + (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) + (set! (-> sv-4368 rvec w) 0.0) + (set! (-> sv-4368 uvec w) 0.0) + (set! (-> sv-4368 fvec w) 0.0) + ) + ((= s0-0 (-> arg0 ragdoll-joints)) + (quaternion->matrix sv-4368 (-> s0-0 quat)) + (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) + (quaternion->matrix s1-0 (-> arg1 root quat)) + (set! (-> s1-0 trans quad) (-> arg1 root trans quad)) + ) + (else + (let* ((v1-43 sv-4368) + (a3-2 (-> arg1 node-list data (-> s0-0 joint-index) bone transform)) + (a0-43 (-> a3-2 rvec quad)) + (a1-27 (-> a3-2 uvec quad)) + (a2-10 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> v1-43 rvec quad) a0-43) + (set! (-> v1-43 uvec quad) a1-27) + (set! (-> v1-43 fvec quad) a2-10) + (set! (-> v1-43 trans quad) a3-3) + ) + (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) + (let* ((a2-11 s1-0) + (a3-4 sv-4368) + (v1-46 (-> a3-4 rvec quad)) + (a0-46 (-> a3-4 uvec quad)) + (a1-28 (-> a3-4 fvec quad)) + (a3-5 (-> a3-4 trans quad)) + ) + (set! (-> a2-11 rvec quad) v1-46) + (set! (-> a2-11 uvec quad) a0-46) + (set! (-> a2-11 fvec quad) a1-28) + (set! (-> a2-11 trans quad) a3-5) + ) + (vector<-cspace! (-> s1-0 trans) (-> arg1 node-list data (-> s0-0 parent-joint))) + ) + ) + (when (and (-> this auto-setup-now) + (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index))) + ) + (set! sv-4464 (new 'stack-no-clear 'matrix)) + (set! sv-4480 (new 'stack-no-clear 'matrix)) + (let* ((a2-13 sv-4464) + (a3-6 sv-4368) + (v1-56 (-> a3-6 rvec quad)) + (a0-49 (-> a3-6 uvec quad)) + (a1-32 (-> a3-6 fvec quad)) + (a3-7 (-> a3-6 trans quad)) + ) + (set! (-> a2-13 rvec quad) v1-56) + (set! (-> a2-13 uvec quad) a0-49) + (set! (-> a2-13 fvec quad) a1-32) + (set! (-> a2-13 trans quad) a3-7) + ) + (vector-reset! (-> sv-4464 trans)) + (matrix-transpose! sv-4464 sv-4464) + (set! sv-4448 (matrix->quaternion + (new 'stack-no-clear 'quaternion) + (-> arg1 node-list data (-> s0-0 joint-index) bone transform) + ) + ) + (quaternion-normalize! sv-4448) + (quaternion->matrix sv-4480 sv-4448) + (matrix*! sv-4480 sv-4480 sv-4464) + (matrix->axis-angle (-> s0-0 geo-tform) sv-4480) + ) + (case (-> this skel-visible) + ((1) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> sv-4368 trans) + (-> s1-0 trans) + (new 'static 'rgba :r #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + (when (or (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + (zero? (-> this analog-func)) + (not (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index)))) + ) + (let ((f30-0 0.25)) + (if (and (nonzero? (-> this analog-func)) + (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index))) + ) + (set! f30-0 0.35) + ) + (add-debug-matrix #t (bucket-id debug-no-zbuf1) sv-4368 (* 4096.0 f30-0)) + ) + ) + (set! sv-4496 + (matrix-axis-angle! (new 'stack-no-clear 'matrix) (-> s0-0 geo-tform) (- (-> s0-0 geo-tform w))) + ) + (matrix*! sv-4496 sv-4496 sv-4368) + (set! (-> sv-4496 trans quad) (-> (the-as matrix sv-4368) trans quad)) + (let ((t9-30 add-debug-matrix) + (a0-66 #t) + (a1-46 577) + (a3-10 #x4419999a) + ) + (t9-30 a0-66 (the-as bucket-id a1-46) sv-4496 (the-as meters a3-10)) + ) + (let ((a2-22 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> s0-0 quat)))) + (set! (-> a2-22 trans quad) (-> (the-as matrix sv-4368) trans quad)) + (add-debug-matrix #t (bucket-id debug-no-zbuf1) a2-22 (meters 0.15)) + ) + (when (or (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + (nonzero? (-> this analog-func)) + (not (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index)))) + ) + (let ((f30-1 0.25)) + (if (and (zero? (-> this analog-func)) + (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index))) + ) + (set! f30-1 0.35) + ) + (add-debug-matrix #t (bucket-id debug-no-zbuf1) s1-0 (* 4096.0 f30-1)) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defun show-maya-skeleton ((arg0 process-drawable) (arg1 int) (arg2 int)) + (local-vars (sv-96 symbol) (sv-112 int) (sv-128 (function _varargs_ object))) + (when arg0 + (dotimes (s3-0 (-> arg0 node-list length)) + (let ((s2-0 (new 'stack-no-clear 'matrix)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (let* ((v1-1 s2-0) + (a3-0 (-> arg0 node-list data s3-0 bone transform)) + (a0-4 (-> a3-0 rvec quad)) + (a1-2 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-1 rvec quad) a0-4) + (set! (-> v1-1 uvec quad) a1-2) + (set! (-> v1-1 fvec quad) a2-1) + (set! (-> v1-1 trans quad) a3-1) + ) + (vector<-cspace! (-> s2-0 trans) (-> arg0 node-list data s3-0)) + (when (or (= arg1 -1) (= arg1 s3-0)) + (add-debug-matrix #t (bucket-id debug-no-zbuf1) s2-0 (the-as meters arg2)) + (let ((s0-0 add-debug-text-3d)) + (set! sv-96 #t) + (set! sv-112 577) + (set! sv-128 format) + (let ((a0-9 (clear *temp-string*)) + (a1-6 "~%~D ~S~%") + (a2-3 s3-0) + (a3-5 (if (-> arg0 node-list data s3-0 joint) + (-> arg0 node-list data s3-0 joint name) + "?" + ) + ) + ) + (sv-128 a0-9 a1-6 a2-3 a3-5) + ) + (let ((a2-4 *temp-string*) + (a3-6 (-> s2-0 trans)) + (t0-0 4) + (t1-0 #f) + ) + (s0-0 sv-96 (the-as bucket-id sv-112) a2-4 a3-6 (the-as font-color t0-0) (the-as vector2h t1-0)) + ) + ) + ) + (let ((a1-8 (-> arg0 node-list data s3-0 parent))) + (when a1-8 + (vector<-cspace! s1-0 a1-8) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s2-0 trans) + s1-0 + (new 'static 'rgba :g #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defun ragdoll-print-default-joints ((arg0 process-drawable)) + (cond + (arg0 + (dotimes (s5-0 (-> arg0 node-list length)) + (let ((s4-0 (-> arg0 node-list data s5-0 joint))) + (when s4-0 + (let* ((s3-0 (-> s4-0 parent)) + (s2-0 (or (not s3-0) (= (-> s3-0 number) (+ (-> s4-0 number) -1)))) + ) + (if (not s2-0) + (format #t "~%") + ) + (format #t "(:joint-name ~15S :parent-joint ~15S )~%" (-> s4-0 name) (if s2-0 + "-1" + (-> s3-0 name) + ) + ) + ) + ) + ) + ) + ) + (else + (format 0 "ragdoll-print-default-joints called with no process~%") + ) + ) + (none) + ) + +(defmethod ragdoll-edit-info-method-17 ((this ragdoll-edit-info) (arg0 ragdoll) (arg1 process-drawable)) + (local-vars (v0-23 object) (v0-32 object) (sv-848 matrix) (sv-864 matrix) (sv-880 matrix)) + (set! (-> this last-frame-dur) (- (current-time) (-> this last-frame))) + (set-time! (-> this last-frame)) + (when (cpad-pressed? 0 l2) + (set! (-> this editing) (not (-> this editing))) + (cond + ((-> this editing) + (set! *external-cam-mode* 'locked) + ) + (*target* + (set! *external-cam-mode* #f) + ) + (else + (set! *external-cam-mode* 'pad-0) + ) + ) + ) + (cond + ((or (not (-> this editing)) (cpad-hold? 0 r2)) + (if (not (-> this editing)) + (format *stdcon* "press l2 to edit ragdoll~%") + (format *stdcon* "release r2 to continue editing ragdoll~%") + ) + (if (or (cpad-hold? 0 r2) (not *target*)) + (set! *external-cam-mode* 'pad-0) + ) + (fill-child-stack! this arg0) + ) + (else + (set! *external-cam-mode* 'locked) + (ragdoll-edit-info-method-12 this) + (cycle-joints! this arg0) + (fill-child-stack! this arg0) + (set! (-> this auto-setup-now) #f) + (let ((s2-0 ">") + (s3-0 " ") + ) + (if (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + (set! s2-0 " ") + ) + (format *stdcon* " r1/l1: select joint ~D~%" (-> this current-joint)) + (format *stdcon* " dpad: select function~%") + (format *stdcon* " r2/l2: move camera~%") + (format *stdcon* " r2: advance single-step~%") + (format *stdcon* " x, tri: toggle/call~%") + (format *stdcon* " rpush: stop editing~%") + (format *stdcon* "------------------------~%") + (let ((t9-13 format) + (a0-19 *stdcon*) + (a1-13 " ~S analog: ~S~%") + (a2-2 (if (zero? (-> this current-func)) + s2-0 + s3-0 + ) + ) + (v1-42 (-> this analog-func)) + ) + (t9-13 a0-19 a1-13 a2-2 (cond + ((zero? v1-42) + "rotate parent" + ) + ((= v1-42 1) + "rotate geo" + ) + ((= v1-42 2) + "global scale" + ) + ((= v1-42 3) + "axial slop" + ) + ((= v1-42 4) + "length" + ) + ((= v1-42 5) + "max angle" + ) + ((= v1-42 6) + "collision radius" + ) + ((= v1-42 7) + "rotate orient" + ) + ((= v1-42 8) + "rotate" + ) + (else + "???" + ) + ) + ) + ) + (let* ((v1-46 (-> arg0 ragdoll-joints (-> this current-joint))) + (t9-14 format) + (a0-21 *stdcon*) + (a1-14 " ~S joint type: ~S~%") + (a2-4 (if (= (-> this current-func) 1) + s2-0 + s3-0 + ) + ) + (v1-47 (-> v1-46 joint-type)) + ) + (t9-14 a0-21 a1-14 a2-4 (cond + ((zero? v1-47) + "cone" + ) + ((= v1-47 1) + "hinge" + ) + (else + "???" + ) + ) + ) + ) + (format *stdcon* " ~S auto setup~%" (if (= (-> this current-func) 2) + s2-0 + s3-0 + ) + ) + (let ((t9-16 format) + (a0-23 *stdcon*) + (a1-16 " ~S skel: ~S~%") + (a2-8 (if (= (-> this current-func) 3) + s2-0 + s3-0 + ) + ) + (v1-50 (-> this skel-visible)) + ) + (t9-16 a0-23 a1-16 a2-8 (cond + ((zero? v1-50) + "visible" + ) + ((= v1-50 1) + "calculated" + ) + ((= v1-50 2) + "hidden" + ) + ((= v1-50 3) + "maya" + ) + ((= v1-50 4) + "ragdoll+maya" + ) + (else + "???" + ) + ) + ) + ) + (let ((t9-17 format) + (a0-24 *stdcon*) + (a1-17 " ~S run: ~S~%") + (a2-10 (if (= (-> this current-func) 4) + s2-0 + s3-0 + ) + ) + (v1-52 (-> this single-step)) + ) + (t9-17 a0-24 a1-17 a2-10 (cond + ((zero? v1-52) + "free" + ) + ((= v1-52 1) + "r2 single step" + ) + ((= v1-52 2) + "locked" + ) + (else + "???" + ) + ) + ) + ) + (format + *stdcon* + " ~S collision: ~S~%" + (if (= (-> this current-func) 5) + s2-0 + s3-0 + ) + (if (-> this collision) + "on" + "off" + ) + ) + (format + *stdcon* + " ~S gravity: ~S~%" + (if (= (-> this current-func) 6) + s2-0 + s3-0 + ) + (if (-> this gravity) + "on" + "off" + ) + ) + (format + *stdcon* + " ~S mirror: ~S~%" + (if (= (-> this current-func) 7) + s2-0 + s3-0 + ) + (if (= (-> arg1 node-list data 2 param0) cspace<-parented-matrix-joint-flip-z!) + "on" + "off" + ) + ) + (let ((t9-21 format) + (a0-28 *stdcon*) + (a1-21 " ~S affect: ~S~%") + (a2-18 (if (= (-> this current-func) 8) + s2-0 + s3-0 + ) + ) + (v1-60 (-> this affect)) + ) + (t9-21 a0-28 a1-21 a2-18 (cond + ((zero? v1-60) + "current" + ) + ((= v1-60 1) + "children" + ) + ((= v1-60 2) + "all" + ) + (else + "???" + ) + ) + ) + ) + (format *stdcon* " ~S print to listener~%" (cond + ((= (-> this current-func) 9) + (empty) + s2-0 + ) + (else + s3-0 + ) + ) + ) + ) + (let ((v1-62 0)) + (if (cpad-pressed? 0 x) + (+! v1-62 1) + ) + (if (cpad-pressed? 0 triangle) + (+! v1-62 -1) + ) + (when (nonzero? v1-62) + (let ((a0-43 (-> this current-func))) + (set! v0-23 + (cond + ((zero? a0-43) + (set! v0-23 (+ (-> this analog-func) v1-62)) + (set! (-> this analog-func) (the-as uint v0-23)) + v0-23 + ) + ((= a0-43 1) + (let ((a0-48 (-> arg0 ragdoll-joints (-> this current-joint)))) + (+! (-> a0-48 joint-type) v1-62) + (cond + ((< (the-as int (-> a0-48 joint-type)) 0) + (set! (-> a0-48 joint-type) (the-as uint 1)) + ) + ((>= (the-as int (-> a0-48 joint-type)) 2) + (set! (-> a0-48 joint-type) (the-as uint 0)) + 0 + ) + ) + (dotimes (v1-70 (-> this child-stack-num)) + (set! (-> this child-stack v1-70 joint-type) (-> a0-48 joint-type)) + ) + ) + #f + ) + ((= a0-43 2) + (set! (-> this auto-setup-now) (the-as basic #t)) + (if (= (-> arg1 node-list data 2 param0) cspace<-parented-matrix-joint-flip-z!) + (format 0 "WARNING: auto setup invoked on mirrored ragdoll--this probably won't work right.~%") + ) + (if (!= (-> this affect) 2) + (format 0 "WARNING: auto setup invoked with affect not set to all.~%") + ) + ) + ((= a0-43 3) + (+! (-> this skel-visible) v1-62) + (cond + ((< (the-as int (-> this skel-visible)) 0) + (set! v0-23 4) + (set! (-> this skel-visible) (the-as uint v0-23)) + v0-23 + ) + ((>= (the-as int (-> this skel-visible)) 5) + (set! (-> this skel-visible) (the-as uint 0)) + 0 + ) + ) + ) + ((= a0-43 4) + (+! (-> this single-step) v1-62) + (cond + ((< (the-as int (-> this single-step)) 0) + (set! v0-23 2) + (set! (-> this single-step) (the-as uint v0-23)) + v0-23 + ) + ((>= (the-as int (-> this single-step)) 3) + (set! (-> this single-step) (the-as uint 0)) + 0 + ) + ) + ) + ((= a0-43 5) + (set! v0-23 (not (-> this collision))) + (set! (-> this collision) (the-as symbol v0-23)) + v0-23 + ) + ((= a0-43 6) + (set! v0-23 (not (-> this gravity))) + (set! (-> this gravity) (the-as symbol v0-23)) + v0-23 + ) + ((= a0-43 7) + (cond + ((= (-> arg1 node-list data 2 param0) cspace<-parented-matrix-joint-flip-z!) + (set! v0-23 (-> arg1 node-list data 2)) + (set! (-> (the-as cspace v0-23) param0) + (the-as (function cspace transformq none) cspace<-parented-matrix-joint!) + ) + (set! (-> (the-as cspace v0-23) param1) #f) + (set! (-> (the-as cspace v0-23) param2) #f) + ) + (else + (set! v0-23 (-> arg1 node-list data 2)) + (set! (-> (the-as cspace v0-23) param0) + (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!) + ) + (set! (-> (the-as cspace v0-23) param1) #f) + (set! (-> (the-as cspace v0-23) param2) #f) + ) + ) + v0-23 + ) + ((= a0-43 8) + (set! v0-23 (+ (-> this affect) v1-62)) + (set! (-> this affect) (the-as uint v0-23)) + v0-23 + ) + ((= a0-43 9) + (format #t "~%") + (format + #t + ":orient-tform (~7f ~7f ~7f ~9R)~%" + (-> arg0 orient-tform x) + (-> arg0 orient-tform y) + (-> arg0 orient-tform z) + (-> arg0 orient-tform w) + ) + (format #t ":scale (~7f ~7f ~7f)~%" (-> arg0 scale x) (-> arg0 scale y) (-> arg0 scale z)) + (dotimes (s3-1 (the-as int (-> arg0 num-joints))) + (let ((s2-1 (-> arg0 ragdoll-joints s3-1))) + (if (!= (-> s2-1 parent-joint) -1) + (format #t "~%") + ) + (format #t "(:joint-name ~15S " (-> arg1 node-list data (-> s2-1 joint-index) joint name)) + (set! v0-32 + (cond + ((= (-> s2-1 parent-joint) -1) + (format #t ":parent-joint ~15D " -1) + v0-32 + ) + (else + (let ((a2-30 (get-parent-joint arg0 (the-as (inline-array ragdoll-joint) s2-1)))) + (if a2-30 + (format #t ":parent-joint ~15S " (-> arg1 node-list data (-> a2-30 joint-index) joint name)) + ) + ) + ) + ) + ) + (let ((t9-33 format) + (a0-69 #t) + (a1-45 ":joint-type ~S ") + (v1-106 (-> s2-1 joint-type)) + ) + (t9-33 a0-69 a1-45 (cond + ((= v1-106 1) + "hinge" + ) + ((zero? v1-106) + " cone" + ) + (else + "???" + ) + ) + ) + ) + (format #t ":axial-slop ~9R " (-> s2-1 axial-slop)) + (format #t ":max-angle ~9R " (-> s2-1 max-angle)) + (format #t ":coll-rad ~7M " (-> s2-1 coll-rad)) + (let ((a2-39 (sound-name->string (-> s2-1 hit-sound)))) + (if (zero? (-> a2-39 data 0)) + (set! a2-39 "\"\"") + ) + (format #t ":hit-sound ~15s " a2-39) + ) + (format + #t + ":pre-tform (~7f ~7f ~7f ~9R) " + (-> s2-1 pre-tform x) + (-> s2-1 pre-tform y) + (-> s2-1 pre-tform z) + (-> s2-1 pre-tform w) + ) + (format + #t + ":geo-tform (~7f ~7f ~7f ~9R))~%" + (-> s2-1 geo-tform x) + (-> s2-1 geo-tform y) + (-> s2-1 geo-tform z) + (-> s2-1 geo-tform w) + ) + ) + ) + (format #t "~%") + ) + (else + (format 0 "~%ERROR: bad ragdoll-edit-func~%") + ) + ) + ) + ) + ) + ) + (cond + ((< (the-as int (-> this analog-func)) 0) + (set! (-> this analog-func) (the-as uint 8)) + ) + ((>= (the-as int (-> this analog-func)) 9) + (set! (-> this analog-func) (the-as uint 0)) + 0 + ) + ) + (cond + ((< (the-as int (-> this affect)) 0) + (set! (-> this affect) (the-as uint 2)) + ) + ((>= (the-as int (-> this affect)) 3) + (set! (-> this affect) (the-as uint 0)) + 0 + ) + ) + (let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 48.0 110.0 1.0)) + (f28-0 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 48.0 110.0 1.0)) + (f26-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 1.0)) + ) + (when (or (!= f30-0 0.0) (!= f28-0 0.0) (!= f26-0 0.0)) + (let ((v1-135 (-> this analog-func))) + (cond + ((or (zero? v1-135) (= v1-135 1) (= v1-135 7) (= v1-135 8)) + (set! f30-0 (* 546.13336 f30-0)) + (set! f28-0 (* -546.13336 f28-0)) + (set! f26-0 (* 546.13336 f26-0)) + ) + ((= v1-135 2) + (let ((f0-25 (* 0.01 f30-0))) + (set! f30-0 (+ 1.0 f0-25)) + ) + (let ((f0-27 (* -0.01 f28-0))) + (set! f28-0 (+ 1.0 f0-27)) + ) + (let ((f0-29 (* 0.01 f26-0))) + (set! f26-0 (+ 1.0 f0-29)) + ) + ) + ((or (= v1-135 5) (= v1-135 3)) + (set! f30-0 (* 45.511112 f30-0)) + (set! f28-0 (* -45.511112 f28-0)) + (set! f26-0 (* 45.511112 f26-0)) + ) + ((or (= v1-135 4) (= v1-135 6)) + (set! f30-0 (* 40.96 f30-0)) + (set! f28-0 (* -40.96 f28-0)) + (set! f26-0 (* 40.96 f26-0)) + ) + ) + ) + (case (-> this analog-func) + ((7) + (let* ((s3-2 (-> arg0 orient-tform)) + (s2-2 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s3-2 (- (-> s3-2 w)))) + ) + (let ((t9-47 matrix-rotate-xyz!) + (a0-96 (new 'stack-no-clear 'matrix)) + (a1-64 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-64 x) f30-0) + (set! (-> a1-64 y) f28-0) + (set! (-> a1-64 z) f26-0) + (set! (-> a1-64 w) 1.0) + (let ((s1-0 (t9-47 a0-96 a1-64)) + (s0-0 (new 'stack-no-clear 'matrix)) + ) + (let ((a2-46 (new 'stack-no-clear 'vector))) + (ragdoll-edit-info-method-14 this s0-0 a2-46 (-> arg0 ragdoll-joints) arg0 arg1) + ) + (matrix*! s2-2 s0-0 s2-2) + (matrix*! s2-2 s1-0 s2-2) + (matrix-transpose! s0-0 s0-0) + (matrix*! s2-2 s0-0 s2-2) + ) + ) + (matrix->axis-angle s3-2 s2-2) + ) + ) + ((2) + (set! (-> arg0 scale x) (* (-> arg0 scale x) f30-0)) + (set! (-> arg0 scale y) (* (-> arg0 scale y) f28-0)) + (set! (-> arg0 scale z) (* (-> arg0 scale z) f26-0)) + ) + (else + (dotimes (s3-3 (-> this child-stack-num)) + (let ((s2-3 (-> this child-stack s3-3)) + (v1-164 (-> this analog-func)) + ) + (cond + ((zero? v1-164) + (let* ((s2-4 (-> s2-3 pre-tform)) + (s1-1 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s2-4 (- (-> s2-4 w)))) + ) + (let ((t9-55 matrix-rotate-xyz!) + (a0-105 (new 'stack-no-clear 'matrix)) + (a1-72 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-72 x) f30-0) + (set! (-> a1-72 y) f28-0) + (set! (-> a1-72 z) f26-0) + (set! (-> a1-72 w) 1.0) + (let ((s0-1 (t9-55 a0-105 a1-72))) + (set! sv-848 (new 'stack-no-clear 'matrix)) + (let ((a2-51 (new 'stack-no-clear 'vector))) + (ragdoll-edit-info-method-14 + this + sv-848 + a2-51 + (the-as (inline-array ragdoll-joint) (-> this child-stack s3-3)) + arg0 + arg1 + ) + ) + (matrix*! s1-1 sv-848 s1-1) + (matrix*! s1-1 s0-1 s1-1) + ) + ) + (matrix-transpose! sv-848 sv-848) + (let ((t9-60 matrix*!) + (a0-110 s1-1) + (a2-54 s1-1) + ) + (t9-60 a0-110 sv-848 a2-54) + ) + (matrix->axis-angle s2-4 s1-1) + ) + ) + ((= v1-164 1) + (let* ((s1-2 (-> s2-3 geo-tform)) + (s0-2 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s1-2 (- (-> s1-2 w)))) + ) + (let ((t9-63 matrix-rotate-xyz!) + (a0-114 (new 'stack-no-clear 'matrix)) + (a1-80 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-80 x) f30-0) + (set! (-> a1-80 y) f28-0) + (set! (-> a1-80 z) f26-0) + (set! (-> a1-80 w) 1.0) + (set! sv-864 (t9-63 a0-114 a1-80)) + ) + (set! sv-880 (new 'stack-no-clear 'matrix)) + (let ((a2-56 (new 'stack-no-clear 'vector))) + (ragdoll-edit-info-method-14 + this + sv-880 + a2-56 + (the-as (inline-array ragdoll-joint) (-> this child-stack s3-3)) + arg0 + arg1 + ) + ) + (let ((a2-58 (matrix-axis-angle! (new 'stack-no-clear 'matrix) (-> s2-3 pre-tform) (- (-> s2-3 pre-tform w))))) + (matrix*! sv-880 sv-880 a2-58) + ) + (matrix*! s0-2 sv-880 s0-2) + (let ((t9-68 matrix*!) + (a0-119 s0-2) + (a2-60 s0-2) + ) + (t9-68 a0-119 sv-864 a2-60) + ) + (matrix-transpose! sv-880 sv-880) + (let ((t9-70 matrix*!) + (a0-121 s0-2) + (a2-61 s0-2) + ) + (t9-70 a0-121 sv-880 a2-61) + ) + (matrix->axis-angle s1-2 s0-2) + ) + ) + ((= v1-164 5) + (set! (-> s2-3 max-angle) (fmin 65536.0 (fmax 0.0 (+ (-> s2-3 max-angle) f28-0)))) + ) + ((= v1-164 3) + (set! (-> s2-3 axial-slop) (fmin 65536.0 (fmax 0.0 (+ (-> s2-3 axial-slop) f28-0)))) + ) + ((= v1-164 4) + (set! (-> s2-3 joint-length) (fmax 40.96 (+ (-> s2-3 joint-length) f28-0))) + ) + ((= v1-164 6) + (set! (-> s2-3 coll-rad) (fmax 0.0 (+ (-> s2-3 coll-rad) f28-0))) + ) + ((= v1-164 8) + (let ((t9-72 matrix-rotate-xyz!) + (a0-128 (new 'stack-no-clear 'matrix)) + (a1-89 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-89 x) f30-0) + (set! (-> a1-89 y) f28-0) + (set! (-> a1-89 z) f26-0) + (set! (-> a1-89 w) 1.0) + (let* ((a1-90 (t9-72 a0-128 a1-89)) + (a2-62 (matrix->quaternion (new 'stack-no-clear 'quaternion) a1-90)) + ) + (quaternion*! (-> s2-3 quat) (-> s2-3 quat) a2-62) + ) + ) + (quaternion-normalize! (-> s2-3 quat)) + ) + (else + (format *stdcon* "~%ERROR: bad ragdoll-analog-func~%") + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((v1-183 (-> this skel-visible))) + (if (or (zero? v1-183) (= v1-183 4) (= v1-183 1)) + (ragdoll-edit-info-method-15 this) + ) + ) + (if (or (-> this auto-setup-now) (case (-> this skel-visible) + ((1) + #t + ) + ) + ) + (ragdoll-edit-info-method-16 this arg0 arg1) + ) + (let ((v1-194 (-> this skel-visible))) + (if (or (= v1-194 3) (= v1-194 4)) + (show-maya-skeleton arg1 -1 #x4499999a) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/physics/ragdoll-h.gc b/goal_src/jak3/engine/physics/ragdoll-h.gc index 9c5d6fbc302..e149d052053 100644 --- a/goal_src/jak3/engine/physics/ragdoll-h.gc +++ b/goal_src/jak3/engine/physics/ragdoll-h.gc @@ -5,6 +5,59 @@ ;; name in dgo: ragdoll-h ;; dgos: GAME +(declare-type ragdoll basic) +(declare-type ragdoll-joint structure) +(declare-type ragdoll-proc process) +(declare-type wings process-drawable) + +;; +++ragdoll-joint-flag +(defenum ragdoll-joint-flag + :type uint32 + :bitfield #t + (rjf0 0) + (rjf1 1) + (rjf2 2) + (rjf3 3) + (rjf4 4) + (rjf5 5) + (rjf6 6) + (rjf7 7) + (rjf8 8) + (rjf9 9) + (rjf10 10) + (rjf11 11) + (rjf12 12) + (rjf13 13) + (rjf14 14) + (rjf15 15) + ) +;; ---ragdoll-joint-flag + + +;; +++ragdoll-flag +(defenum ragdoll-flag + :type uint32 + :bitfield #t + (rf0 0) + (rf1 1) + (rf2 2) + (rf3 3) + (rf4 4) + (rf5 5) + (rf6 6) + (rf7 7) + (rf8 8) + (rf9 9) + (rf10 10) + (rf11 11) + (rf12 12) + (rf13 13) + (rf14 14) + (rf15 15) + ) +;; ---ragdoll-flag + + ;; DECOMP BEGINS (deftype ragdoll-edit-info (structure) @@ -18,21 +71,21 @@ (skel-visible uint64) (current-joint int8) (auto-setup-now basic) - (child-stack object 60) + (child-stack ragdoll-joint 60) (child-stack-num int8) - (last-frame uint64) - (last-frame-dur uint64) + (last-frame time-frame) + (last-frame-dur time-frame) ) (:methods - (ragdoll-edit-info-method-9 () none) - (ragdoll-edit-info-method-10 () none) - (ragdoll-edit-info-method-11 () none) - (ragdoll-edit-info-method-12 () none) - (ragdoll-edit-info-method-13 () none) - (ragdoll-edit-info-method-14 () none) - (ragdoll-edit-info-method-15 () none) - (ragdoll-edit-info-method-16 () none) - (ragdoll-edit-info-method-17 () none) + (has-joint? (_type_ ragdoll-joint) symbol) + (ragdoll-edit-info-method-10 (_type_ object ragdoll-joint) symbol) + (fill-child-stack! (_type_ ragdoll) none) + (ragdoll-edit-info-method-12 (_type_) none) + (cycle-joints! (_type_ ragdoll) none) + (ragdoll-edit-info-method-14 (_type_ matrix vector (inline-array ragdoll-joint) ragdoll process-drawable) vector) + (ragdoll-edit-info-method-15 (_type_) none) + (ragdoll-edit-info-method-16 (_type_ ragdoll process-drawable) none) + (ragdoll-edit-info-method-17 (_type_ ragdoll process-drawable) none) ) ) @@ -58,7 +111,7 @@ (axial-slop float) (max-angle float) (coll-rad float) - (hit-sound uint128) + (hit-sound sound-name) ) ) @@ -67,7 +120,7 @@ ((orient-tform vector :inline) (scale vector :inline) (bg-collide-with collide-spec) - (joint-setup basic) + (joint-setup (array ragdoll-joint-setup)) ) ) @@ -81,17 +134,17 @@ (pre-tform vector :inline) (geo-tform vector :inline) (axial-slop float) - (max-angle float) + (max-angle degrees) (joint-length float) (coll-rad float) - (ragdoll-joint-flags uint32) + (ragdoll-joint-flags ragdoll-joint-flag) (joint-type uint64) (joint-index int8) (parent-joint int8) (parent-index int8) (num-children int8) (old-param0 basic) - (hit-sound uint128) + (hit-sound sound-name) (ground-pat uint32) (user0 int32) (original-speed float) @@ -113,14 +166,14 @@ (compress-vel-parallel float) (momentum float) (maximum-stretch float) - (turn-off-start uint64) - (turn-off-duration uint64) - (copy-velocity-start uint64) + (turn-off-start time-frame) + (turn-off-duration time-frame) + (copy-velocity-start time-frame) (root-offset vector :inline) (rotate-vel quaternion :inline) (rotate-adj quaternion :inline) (rotate-adj-count int8) - (ragdoll-flags uint32) + (ragdoll-flags ragdoll-flag) (flex-blend float) (stable-joints int8) (ragdoll-joint-remap uint8 100) @@ -129,42 +182,46 @@ (water-info water-info :inline) ) (:methods - (ragdoll-method-9 () none) - (ragdoll-method-10 () none) - (ragdoll-method-11 () none) - (ragdoll-method-12 () none) - (ragdoll-method-13 () none) - (ragdoll-method-14 () none) - (ragdoll-method-15 () none) - (ragdoll-method-16 () none) - (ragdoll-method-17 () none) - (ragdoll-method-18 () none) - (ragdoll-method-19 () none) - (ragdoll-method-20 () none) - (ragdoll-method-21 () none) - (ragdoll-method-22 () none) - (ragdoll-method-23 () none) - (ragdoll-method-24 () none) - (ragdoll-method-25 () none) + (ragdoll-method-9 (_type_ matrix process-drawable) none) + (ragdoll-method-10 (_type_ process-drawable symbol vector symbol) none) + (turn-off-for-duration! (_type_ time-frame) none) + (get-parent-joint (_type_ (inline-array ragdoll-joint)) ragdoll-joint) + (ragdoll-method-13 (_type_ ragdoll-edit-info) none) + (ragdoll-method-14 (_type_) none) + (ragdoll-method-15 (_type_ process-drawable matrix) none) + (ragdoll-setup! (_type_ process-drawable ragdoll-setup) none) + (ragdoll-method-17 (_type_ process-drawable) none) + (ragdoll-method-18 (_type_) none) + (ragdoll-method-19 (_type_ vector int object vector) none) + (ragdoll-method-20 (_type_ vector) none) + (ragdoll-method-21 (_type_ vector vector float) vector) + (get-max-angle-for-joint-idx (_type_ int) degrees) + (ragdoll-method-23 (_type_ vector vector float symbol) none) + (ragdoll-method-24 (_type_ vector int) none) + (ragdoll-method-25 (_type_ process-drawable) none) ) ) (deftype ragdoll-proc (process) - ((ragdoll ragdoll) + ((parent (pointer process-drawable) :override) + (ragdoll ragdoll) (last-attack-id uint32) ) + (:state-methods + idle + ) (:methods - (ragdoll-proc-method-14 () none) - (ragdoll-proc-method-15 () none) - (ragdoll-proc-method-16 () none) - (ragdoll-proc-method-17 () none) - (ragdoll-proc-method-18 () none) - (ragdoll-proc-method-19 () none) + (ragdoll-proc-method-15 (_type_ symbol vector symbol) none) + (ragdoll-proc-method-16 (_type_ int) none) + (ragdoll-proc-method-17 (_type_ matrix) none) + (ragdoll-proc-method-18 (_type_ ragdoll-edit-info process) none) + (ragdoll-proc-method-19 (_type_) none) ) ) (deftype wings-ragdoll-proc (ragdoll-proc) - () + ((parent (pointer wings) :override) + ) ) diff --git a/goal_src/jak3/engine/physics/trajectory-h.gc b/goal_src/jak3/engine/physics/trajectory-h.gc index ceec57b78f2..8c155bfa974 100644 --- a/goal_src/jak3/engine/physics/trajectory-h.gc +++ b/goal_src/jak3/engine/physics/trajectory-h.gc @@ -40,7 +40,7 @@ (new (symbol type process-drawable int float collide-spec) _type_) (initialize (_type_ process-drawable int float collide-spec) impact-control) (impact-control-method-10 () none) - (impact-control-method-11 () none) + (impact-control-method-11 (_type_ collide-query process pat-surface) float) ) ) @@ -67,7 +67,7 @@ (new (symbol type vector vector) _type_) (initialize (_type_ vector vector) point-tracker) (point-tracker-method-10 () none) - (point-tracker-method-11 () none) + (point-tracker-method-11 (_type_ vector vector vector float) vector) ) ) @@ -86,8 +86,8 @@ (move-start-time time-frame) ) (:methods - (combo-tracker-method-12 () none) - (combo-tracker-method-13 () none) + (combo-tracker-method-12 (_type_ vector vector process time-frame) combo-tracker) + (combo-tracker-method-13 (_type_ handle vector float vector float) process-focusable) ) ) diff --git a/goal_src/jak3/engine/process-drawable/process-drawable.gc b/goal_src/jak3/engine/process-drawable/process-drawable.gc index 8f157f5244f..ed4e018d26f 100644 --- a/goal_src/jak3/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak3/engine/process-drawable/process-drawable.gc @@ -566,7 +566,7 @@ (defmethod deactivate ((this process-drawable)) "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this part)) - ((method-of-object (-> this part) sparticle-launch-control-method-19)) + (kill-particles (-> this part)) ) (if (nonzero? (-> this sound)) (stop! (-> this sound)) @@ -658,8 +658,8 @@ (set! (-> a0-6 prim-core collide-as) (collide-spec)) (set! (-> a0-6 prim-core collide-with) (collide-spec)) ) - (set! (-> v1-12 unknown-word0) 0) - (set! (-> v1-12 unknown-word1) 0) + (set! (-> v1-12 backup-collide-as) (collide-spec)) + (set! (-> v1-12 backup-collide-with) (collide-spec)) 0 ) ) @@ -882,7 +882,7 @@ (s3-0 (method-of-object s4-0 art-group-get-by-name)) ) (format (clear *temp-string*) "skel-~S" name) - (let ((s4-1 (s3-0 s4-0 *temp-string* (the-as (pointer uint32) #f)))) + (let ((s4-1 (s3-0 s4-0 *temp-string* (the-as (pointer level) #f)))) (if (and (nonzero? s4-1) (valid? s4-1 skeleton-group (the-as string #f) #f 0)) (initialize-skeleton this (the-as skeleton-group s4-1) (the-as pair 0)) (go process-drawable-art-error name) @@ -1472,7 +1472,7 @@ (label cfg-45) (let ((a0-26 (-> gp-0 effect))) (if a0-26 - ((method-of-object a0-26 effect-control-method-9)) + (effect-control-method-9 a0-26) ) ) ) diff --git a/goal_src/jak3/engine/process-drawable/process-focusable.gc b/goal_src/jak3/engine/process-drawable/process-focusable.gc index 64864e250d7..af75242a72b 100644 --- a/goal_src/jak3/engine/process-drawable/process-focusable.gc +++ b/goal_src/jak3/engine/process-drawable/process-focusable.gc @@ -26,7 +26,7 @@ (pilot-riding 14) (flut 15) (tube 16) - (ice 17) + (light 17) (board 18) (gun 19) (pilot 20) ;; also racer? @@ -40,7 +40,10 @@ (indax 28) (arrestable 29) (teleporting 30) - (fs31 31) + (invulnerable 31) + (turret 32) + (no-gravity 33) + (gun-no-target 34) ) ;; ---focus-status @@ -48,6 +51,33 @@ (defmacro focus-test? (pfoc &rest status) `(logtest? (-> (the process-focusable ,pfoc) focus-status) (focus-status ,@status))) +;; +++search-info-flag +(defenum search-info-flag + :type uint32 + :bitfield #t + (abort 0) + (crate 1) + (guard 2) + (attackable 3) + (enemy 4) + (attackable-priority 5) + (high-priority 6) + (on-screen 7) + (prefer-dist 8) + (prefer-angle 9) + (prefer-xz 10) + (cull-angle 11) + (cull-angle-simple 12) + (cull-xz 13) + (back-point 14) + (combo 15) + (probe 16) + (probe-camera 17) + (prefer-center 18) + ) +;; ---search-info-flag + + ;; DECOMP BEGINS (deftype process-focusable (process-drawable) @@ -55,9 +85,9 @@ (focus-status focus-status) ) (:methods - (process-focusable-method-20 (_type_) int) + (process-mask->search-info-flag (_type_) search-info-flag) (get-trans (_type_ int) vector) - (get-quat (_type_) quaternion) + (get-quat (_type_ int) quaternion) (get-transv (_type_) vector) (time-to-apex-or-ground (_type_ int) int) (get-water-height (_type_) meters) @@ -67,20 +97,21 @@ ) -(defmethod process-focusable-method-20 ((this process-focusable)) - (let ((v0-0 0)) +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this process-focusable)) + (let ((search-flag (search-info-flag))) (let ((mask (-> this mask))) (if (logtest? (process-mask crate) mask) - (set! v0-0 (logior v0-0 2)) + (set! search-flag (the-as search-info-flag (logior (the-as int search-flag) (search-info-flag crate)))) ) (if (logtest? (process-mask guard) mask) - (set! v0-0 (logior v0-0 4)) + (set! search-flag (the-as search-info-flag (logior (the-as int search-flag) (search-info-flag guard)))) ) (if (logtest? (process-mask enemy) mask) - (set! v0-0 (logior v0-0 16)) + (set! search-flag (the-as search-info-flag (logior (the-as int search-flag) (search-info-flag enemy)))) ) ) - v0-0 + (the-as search-info-flag search-flag) ) ) @@ -111,7 +142,7 @@ (-> this root transv) ) -(defmethod get-quat ((this process-focusable)) +(defmethod get-quat ((this process-focusable) (arg0 int)) "Get the quaternion for this process." (-> this root quat) ) diff --git a/goal_src/jak3/engine/sound/gsound-h.gc b/goal_src/jak3/engine/sound/gsound-h.gc index e62b27f20b8..cff51ed3f76 100644 --- a/goal_src/jak3/engine/sound/gsound-h.gc +++ b/goal_src/jak3/engine/sound/gsound-h.gc @@ -126,6 +126,47 @@ ) ) +;; TODO change macro back once sound-group is figured out for jak 3 +(defmacro sound-play (name &key (id (new-sound-id)) + &key (vol 100.0) &key (pitch 0) &key (bend 0) + &key (group sfx) + &key (position #t)) + `(sound-play-by-name (static-sound-name ,name) ,id (the int (* (/ 1024.0 100.0) ,vol)) (the int (* 1524.0 ,pitch)) ,bend (sound-group) ,position)) + +(defmacro sound-vol (vol) + "convert to sound volume units" + (if (number? vol) + (* 1 (/ (* vol 1024) 100)) + `(the int (/ (* ,vol 1024) 100)) + ) + ) + +(defmacro static-sound-spec (name &key (num 1.0) &key (group 1) + &key (volume #f) + &key (pitch-mod 0) + &key (fo-min 0) &key (fo-max 0) + &key (fo-curve 0) + &key (mask ())) + (let ((snd-mask mask) + (snd-volume 100.0)) + (when (nonzero? fo-max) (cons! snd-mask 'fo-max)) + (when (nonzero? fo-min) (cons! snd-mask 'fo-min)) + (when (nonzero? fo-curve) (cons! snd-mask 'fo-curve)) + (when (nonzero? pitch-mod) (cons! snd-mask 'pitch)) + (when volume (cons! snd-mask 'volume) (set! snd-volume volume)) + `(new 'static 'sound-spec + :sound-name (static-sound-name ,name) + :num ,num + :group ,group + :volume (sound-vol ,snd-volume) + :pitch-mod ,pitch-mod + :fo-min ,fo-min + :fo-max ,fo-max + :fo-curve ,fo-curve + :mask (sound-mask ,@snd-mask) + )) + ) + (define-extern get-sound-buffer-entry (function pointer)) (define-extern sound-set-ear-trans (function vector vector vector vector vector float int)) diff --git a/goal_src/jak3/engine/sound/gsound.gc b/goal_src/jak3/engine/sound/gsound.gc index af0cd3eb3aa..6f8fd4a5f99 100644 --- a/goal_src/jak3/engine/sound/gsound.gc +++ b/goal_src/jak3/engine/sound/gsound.gc @@ -646,7 +646,7 @@ (sound-unit-vector-convert (-> gp-0 cam-forward) fwd) (sound-unit-vector-convert (-> gp-0 cam-left) left) (set! (-> gp-0 cam-scale) (the int (* 65536.0 scale))) - (set! (-> gp-0 cam-inverted) (if (logtest? (-> *game-info* secrets) (game-secrets screen-flip)) + (set! (-> gp-0 cam-inverted) (if (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) 1 0 ) diff --git a/goal_src/jak3/engine/sound/speech-h.gc b/goal_src/jak3/engine/sound/speech-h.gc index 61416a9bdc8..e6ebf730245 100644 --- a/goal_src/jak3/engine/sound/speech-h.gc +++ b/goal_src/jak3/engine/sound/speech-h.gc @@ -20,63 +20,67 @@ ;; +++speech-type (defenum speech-type :type int8 - (speech-type-0) - (speech-type-1) - (speech-type-2) - (speech-type-3) - (speech-type-4) - (speech-type-5) - (speech-type-6) - (speech-type-7) - (speech-type-8) - (speech-type-9) - (speech-type-10) - (speech-type-11) - (speech-type-12) - (speech-type-13) - (speech-type-14) - (speech-type-15) - (speech-type-16) - (speech-type-17) - (speech-type-18) - (speech-type-19) - (speech-type-20) - (speech-type-21) - (speech-type-22) - (speech-type-23) - (speech-type-24) - (speech-type-25) - (speech-type-26) - (speech-type-27) - (speech-type-28) - (speech-type-29) - (speech-type-30) - (speech-type-31) - (speech-type-32) - (speech-type-33) - (speech-type-34) - (speech-type-35) - (speech-type-36) - (speech-type-37) - (speech-type-38) - (speech-type-39) - (speech-type-40) - (speech-type-41) - (speech-type-42) - (speech-type-43) - (speech-type-44) - (speech-type-45) - (speech-type-46) - (speech-type-47) - (speech-type-48) - (speech-type-49) - (speech-type-50) - (speech-type-51) - (speech-type-52) - (speech-type-53) - (speech-type-54) - (speech-type-55) - (speech-type-56) + (none 0) + (guard-generic-battle 1) + (guard-generic-battle-b 2) + (guard-battle-victory 3) + (guard-battle-victory-b 4) + (guard-change-targets 5) + (guard-change-targets-b 6) + (guard-go-hostile 7) + (guard-go-hostile-b 8) + (guard-hit 9) + (guard-hit-b 10) + (guard-witness-death 11) + (guard-witness-death-b 12) + (guard-chatter 13) + (guard-chatter-b 14) + (guard-chatter-jak 15) + (guard-chatter-jak-b 16) + (guard-bumped-by-jak 17) + (guard-bumped-by-jak-b 18) + (civ-m-ambient 19) + (civ-m-alert 20) + (civ-m-cower 21) + (civ-m-touched-by-player 22) + (civ-m-shot-by-player 23) + (civ-m-avoiding-player-vehicle 24) + (civ-m-hit-by-player-vehicle 25) + (civ-m-player-stealing-vehicle 26) + (civ-f-ambient 27) + (civ-f-alert 28) + (civ-f-cower 29) + (civ-f-touched-by-player 30) + (civ-f-shot-by-player 31) + (civ-f-avoiding-player-vehicle 32) + (civ-f-hit-by-player-vehicle 33) + (race-jak-start 34) + (race-jak-lap 35) + (race-jak-last-lap 36) + (race-jak-hit 37) + (race-jak-got-hit 38) + (race-jak-ambient 39) + (race-jak-pass 40) + (race-jak-jump 41) + (race-jak-win 42) + (race-daxter-start 43) + (race-daxter-lap 44) + (race-daxter-last-lap 45) + (race-daxter-hit 46) + (race-daxter-got-hit 47) + (race-daxter-ambient 48) + (race-daxter-pass 49) + (race-daxter-jump 50) + (race-daxter-win 51) + (race-errol-start 52) + (race-errol-last-lap 53) + (race-errrol-hit 54) + (race-errol-got-hit 55) + (race-errol-ambient 56) + (race-errol-pass 57) + (race-errol-got-passed 58) + (race-errol-win 59) + (race-errol-lose 60) ) ;; ---speech-type @@ -132,12 +136,12 @@ (speech-table (pointer speech-type-info)) ) (:methods - (speech-channel-method-9 () none) - (speech-channel-method-10 () none) - (speech-channel-method-11 () none) - (speech-channel-method-12 () none) - (speech-channel-method-13 () none) - (speech-channel-method-14 () none) + (speech-channel-method-9 (_type_ process-drawable speech-type) int) + (speech-channel-method-10 (_type_ handle) none) + (speech-channel-method-11 (_type_) none) + (reset-channel! (_type_) none) + (init! (_type_) none) + (speech-channel-method-14 (_type_ speech-type float) none) ) ) @@ -147,14 +151,14 @@ (speech-table speech-type-info 61) ) (:methods - (speech-control-method-9 () none) - (speech-control-method-10 () none) + (speech-table-reset! (_type_) none) + (speech-table-set! (_type_ speech-type speech-type-info) none) (speech-control-method-11 (_type_) none) - (speech-control-method-12 () none) - (speech-control-method-13 () none) - (speech-control-method-14 () none) - (speech-control-method-15 () none) - (speech-control-method-16 () none) - (speech-control-method-17 () none) + (speech-control-method-12 (_type_ process-drawable speech-type) none) + (speech-control-method-13 (_type_ process-drawable speech-type int) none) + (speech-control-method-14 (_type_ handle) none) + (speech-control-method-15 (_type_) none) + (speech-control-method-16 (_type_) none) + (speech-control-method-17 (_type_ speech-type float) none) ) ) diff --git a/goal_src/jak3/engine/sound/speech.gc b/goal_src/jak3/engine/sound/speech.gc index 92a6b3efb3b..27cc278ab3f 100644 --- a/goal_src/jak3/engine/sound/speech.gc +++ b/goal_src/jak3/engine/sound/speech.gc @@ -7,3 +7,595 @@ ;; DECOMP BEGINS +(defmethod reset-channel! ((this speech-channel)) + (set! (-> this request handle) (the-as handle #f)) + (set! (-> this request priority) -10000000000000000000000000000000000000.0) + 0 + (none) + ) + +(defmethod init! ((this speech-channel)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) + (set! (-> this last-request priority) -10000000000000000000000000000000000000.0) + 0 + (none) + ) + +(defun-debug speech-type->string ((arg0 speech-type)) + (case arg0 + (((speech-type race-daxter-start)) + "race-daxter-start" + ) + (((speech-type civ-f-touched-by-player)) + "civ-f-touched-by-player" + ) + (((speech-type civ-m-hit-by-player-vehicle)) + "civ-m-hit-by-player-vehicle" + ) + (((speech-type race-jak-lap)) + "race-jak-lap" + ) + (((speech-type race-jak-start)) + "race-jak-start" + ) + (((speech-type civ-m-player-stealing-vehicle)) + "civ-m-player-stealing-vehicle" + ) + (((speech-type race-daxter-got-hit)) + "race-daxter-got-hit" + ) + (((speech-type guard-go-hostile)) + "guard-go-hostile" + ) + (((speech-type race-jak-ambient)) + "race-jak-ambient" + ) + (((speech-type civ-f-shot-by-player)) + "civ-f-shot-by-player" + ) + (((speech-type guard-chatter)) + "guard-chatter" + ) + (((speech-type civ-f-alert)) + "civ-f-alert" + ) + (((speech-type civ-f-ambient)) + "civ-f-ambient" + ) + (((speech-type guard-generic-battle)) + "guard-generic-battle" + ) + (((speech-type guard-chatter-jak)) + "guard-chatter-jak" + ) + (((speech-type civ-f-avoiding-player-vehicle)) + "civ-f-avoiding-player-vehicle" + ) + (((speech-type guard-battle-victory-b)) + "guard-battle-victory-b" + ) + (((speech-type race-jak-pass)) + "race-jak-pass" + ) + (((speech-type race-daxter-jump)) + "race-daxter-jump" + ) + (((speech-type guard-bumped-by-jak)) + "guard-bumped-by-jak" + ) + (((speech-type race-errol-start)) + "race-errol-start" + ) + (((speech-type guard-bumped-by-jak-b)) + "guard-bumped-by-jak-b" + ) + (((speech-type race-daxter-pass)) + "race-daxter-pass" + ) + (((speech-type race-errol-win)) + "race-errol-win" + ) + (((speech-type race-jak-jump)) + "race-jak-jump" + ) + (((speech-type race-errol-got-passed)) + "race-errol-got-passed" + ) + (((speech-type race-daxter-hit)) + "race-daxter-hit" + ) + (((speech-type civ-f-hit-by-player-vehicle)) + "civ-f-hit-by-player-vehicle" + ) + (((speech-type guard-hit)) + "guard-hit" + ) + (((speech-type guard-go-hostile-b)) + "guard-go-hostile-b" + ) + (((speech-type civ-m-touched-by-player)) + "civ-m-touched-by-player" + ) + (((speech-type race-errol-last-lap)) + "race-errol-last-lap" + ) + (((speech-type guard-battle-victory)) + "guard-battle-victory" + ) + (((speech-type race-jak-last-lap)) + "race-jak-last-lap" + ) + (((speech-type race-jak-win)) + "race-jak-win" + ) + (((speech-type guard-chatter-b)) + "guard-chatter-b" + ) + (((speech-type race-errol-got-hit)) + "race-errol-got-hit" + ) + (((speech-type civ-m-cower)) + "civ-m-cower" + ) + (((speech-type race-errol-lose)) + "race-errol-lose" + ) + (((speech-type race-errrol-hit)) + "race-errol-hit" + ) + (((speech-type race-daxter-win)) + "race-daxter-win" + ) + (((speech-type race-daxter-ambient)) + "race-daxter-ambient" + ) + (((speech-type none)) + "none" + ) + (((speech-type guard-witness-death)) + "guard-witness-death" + ) + (((speech-type race-daxter-lap)) + "race-daxter-lap" + ) + (((speech-type civ-m-shot-by-player)) + "civ-m-shot-by-player" + ) + (((speech-type guard-change-targets-b)) + "guard-change-targets-b" + ) + (((speech-type civ-m-alert)) + "civ-m-alert" + ) + (((speech-type civ-m-ambient)) + "civ-m-ambient" + ) + (((speech-type civ-m-avoiding-player-vehicle)) + "civ-m-avoiding-player-vehicle" + ) + (((speech-type race-jak-hit)) + "race-jak-hit" + ) + (((speech-type race-errol-pass)) + "race-errol-pass" + ) + (((speech-type guard-chatter-jak-b)) + "guard-chatter-jak-b" + ) + (((speech-type guard-generic-battle-b)) + "guard-generic-battle-b" + ) + (((speech-type guard-witness-death-b)) + "guard-witness-death-b" + ) + (((speech-type race-errol-ambient)) + "race-errol-ambient" + ) + (((speech-type race-daxter-last-lap)) + "race-daxter-last-lap" + ) + (((speech-type civ-f-cower)) + "civ-f-cower" + ) + (((speech-type guard-hit-b)) + "guard-hit-b" + ) + (((speech-type guard-change-targets)) + "guard-change-targets" + ) + (((speech-type race-jak-got-hit)) + "race-jak-got-hit" + ) + (else + "*unknown*" + ) + ) + ) + +(defun-debug gui-status->string ((arg0 gui-status)) + (case arg0 + (((gui-status ready)) + "ready" + ) + (((gui-status active)) + "active" + ) + (((gui-status stop)) + "stop" + ) + (((gui-status unknown)) + "unknown" + ) + (((gui-status hide)) + "hide" + ) + (((gui-status pending)) + "pending" + ) + (else + "*unknown*" + ) + ) + ) + +(defmethod speech-channel-method-11 ((this speech-channel)) + (local-vars (s3-0 int)) + (with-pp + (logclear! (-> this flags) (speech-channel-flag disable)) + (if (or (not (-> *setting-control* user-current speech-control)) + (level-group-method-28 *level*) + (nonzero? (-> this id)) + ) + (logior! (-> this flags) (speech-channel-flag disable)) + ) + (set! (-> this target-pos quad) (-> (target-pos 0) quad)) + (when (not (logtest? (-> this flags) (speech-channel-flag disable))) + (let ((s5-1 (-> this speech-table (-> this request speech-type)))) + (cond + (s5-1 + (let ((a0-8 (- (-> this update-time) (-> this request time))) + (v1-20 (handle->process (-> this request handle))) + ) + (if (and (!= (-> this request handle) #f) + (or (< (the-as time-frame (-> s5-1 request-timeout)) a0-8) + (not v1-20) + (let ((f0-0 245760.0)) + (< (* f0-0 f0-0) + (vector-vector-distance-squared (-> this target-pos) (-> (the-as process-drawable v1-20) root trans)) + ) + ) + ) + ) + (reset-channel! this) + ) + ) + (let ((s4-0 (handle->process (-> this request handle)))) + (when s4-0 + (when (and (>= (- (-> *display* game-clock frame-counter) (the-as int (-> s5-1 time))) + (the-as time-frame (-> s5-1 delay)) + ) + (>= (- (-> *display* game-clock frame-counter) (-> this end-time)) + (the-as time-frame (-> s5-1 delay-pre-time)) + ) + ) + (let ((s2-0 (-> s5-1 list length)) + (v1-40 (-> s5-1 play-index)) + ) + (when (> s2-0 0) + (cond + ((logtest? (-> s5-1 flags) (speech-type-flag random-order)) + (set! s3-0 (rand-vu-int-count s2-0)) + (when (= s3-0 (-> s5-1 play-index)) + (+! s3-0 1) + (if (>= s3-0 s2-0) + (set! s3-0 0) + ) + ) + ) + (else + (set! s3-0 (+ v1-40 1)) + (if (>= s3-0 s2-0) + (set! s3-0 0) + ) + ) + ) + (set! (-> s5-1 play-index) s3-0) + (let ((s2-1 (-> s5-1 list s3-0))) + (mem-copy! (the-as pointer (-> this last-request)) (the-as pointer (-> this request)) 21) + (set! (-> this start-time) (-> *display* game-clock frame-counter)) + (set! (-> this delay) (the-as uint (speech-channel-method-14 this (-> this request speech-type) 1.0))) + (if (logtest? (-> s5-1 flags) (speech-type-flag linked-next)) + (set! (-> this speech-table (+ (-> this request speech-type) 1) play-index) s3-0) + ) + (set! (-> this id) (add-process *gui-control* s4-0 (-> this gui-channel) (gui-action play) s2-1 -99.0 0)) + ) + (sound-params-set! *gui-control* (-> this id) #f -1 -1 -1 (-> *setting-control* user-current talker-volume)) + (reset-channel! this) + (if (nonzero? (-> this id)) + (logior! (-> this flags) (speech-channel-flag disable)) + ) + ) + ) + ) + ) + ) + ) + (else + (reset-channel! this) + ) + ) + ) + ) + (set! (-> this update-time) (-> *display* game-clock frame-counter)) + (when (nonzero? (-> this id)) + (let ((s4-1 (handle->process (-> this last-request handle)))) + (cond + ((and s4-1 (-> *setting-control* user-current speech-control)) + (when *sound-player-enable* + (let ((s5-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> s5-2 command) (sound-command set-param)) + (set! (-> s5-2 id) (-> this id)) + (set! (-> s5-2 params volume) (the int (* 1024.0 (-> *setting-control* user-current talker-volume)))) + (set! (-> s5-2 params fo-min) 15) + (set! (-> s5-2 params fo-max) 90) + (set! (-> s5-2 params fo-curve) 9) + (let ((a1-14 (-> (the-as process-drawable s4-1) root trans))) + (let ((s4-2 pp)) + (when (= a1-14 #t) + (if (and s4-2 (type? s4-2 process-drawable) (nonzero? (-> (the-as process-drawable s4-2) root))) + (set! a1-14 (-> (the-as process-drawable s4-2) root trans)) + (set! a1-14 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> s5-2 params trans) a1-14) + ) + (set! (-> s5-2 params mask) (the-as uint 481)) + (-> s5-2 id) + ) + ) + ) + (else + (set-action! + *gui-control* + (gui-action stop) + (-> this id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> this id) (new 'static 'sound-id)) + 0 + ) + ) + ) + (case (get-status *gui-control* (-> this id)) + (((gui-status pending)) + (when (>= (- (-> *display* game-clock frame-counter) (-> this start-time)) (seconds 1)) + (set-action! + *gui-control* + (gui-action stop) + (-> this id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this end-time) (-> this update-time)) + ) + ) + (((gui-status unknown)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) + (set! (-> this end-time) (-> this update-time)) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod speech-channel-method-14 ((this speech-channel) (arg0 speech-type) (arg1 float)) + (let ((s4-0 (-> this speech-table arg0))) + 0 + (let ((v0-1 + (the int + (* arg1 (the float (rand-vu-int-range (the-as int (-> s4-0 min-delay)) (the-as int (-> s4-0 max-delay))))) + ) + ) + ) + (set! (-> s4-0 delay) (the-as uint v0-1)) + (set! (-> s4-0 time) (the-as uint (-> *display* game-clock frame-counter))) + (when (logtest? (-> s4-0 flags) (speech-type-flag linked-next)) + (let ((v1-11 (-> this speech-table (+ arg0 1)))) + (set! (-> v1-11 delay) (the-as uint v0-1)) + (set! (-> v1-11 time) (the-as uint (-> *display* game-clock frame-counter))) + ) + ) + ) + ) + (none) + ) + +(defmethod speech-channel-method-9 ((this speech-channel) (arg0 process-drawable) (arg1 speech-type)) + (let ((s3-0 (-> this speech-table arg1))) + (when (and s3-0 (>= (- (-> *display* game-clock frame-counter) (the-as int (-> s3-0 time))) + (the-as time-frame (-> s3-0 delay)) + ) + ) + (when (and (logtest? (-> s3-0 flags) (speech-type-flag skip-first-time)) + (logtest? (-> s3-0 flags) (speech-type-flag first-time)) + ) + (logclear! (-> s3-0 flags) (speech-type-flag first-time)) + (speech-channel-method-14 this arg1 1.0) + (return 0) + ) + (let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> this target-pos))) + (f1-0 245760.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (let* ((f1-3 -1.0) + (f2-0 409600.0) + (f0-2 (+ (* f0-0 (/ f1-3 (* f2-0 f2-0))) (the float (-> s3-0 priority)))) + ) + (when (< (-> this request priority) f0-2) + (set! (-> this request priority) f0-2) + (set! (-> this request handle) (process->handle arg0)) + (set! (-> this request speech-type) arg1) + (set! (-> this request time) (-> *display* game-clock frame-counter)) + ) + ) + ) + ) + ) + ) + 0 + ) + +(defmethod speech-channel-method-10 ((this speech-channel) (arg0 handle)) + (when (= arg0 (handle->process (-> this last-request handle))) + (set-action! + *gui-control* + (gui-action stop) + (-> this id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) + (set! (-> this last-request priority) -10000000000000000000000000000000000000.0) + ) + 0 + (none) + ) + +(defmethod speech-control-method-12 ((this speech-control) (arg0 process-drawable) (arg1 speech-type)) + (let ((v1-2 (-> this speech-table arg1))) + (when v1-2 + (let ((a0-1 (-> this channel-array (-> v1-2 channel)))) + (if (not (logtest? (-> a0-1 flags) (speech-channel-flag disable))) + (speech-channel-method-9 a0-1 arg0 arg1) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod speech-control-method-17 ((this speech-control) (arg0 speech-type) (arg1 float)) + (let ((v1-2 (-> this speech-table arg0))) + (if v1-2 + (speech-channel-method-14 (-> this channel-array (-> v1-2 channel)) arg0 arg1) + ) + ) + (none) + ) + +(defmethod speech-control-method-11 ((this speech-control)) + (dotimes (s5-0 2) + (speech-channel-method-11 (-> this channel-array s5-0)) + ) + 0 + (none) + ) + +(defmethod speech-table-set! ((this speech-control) (arg0 speech-type) (arg1 speech-type-info)) + (set! (-> this speech-table arg0) arg1) + (logior! (-> arg1 flags) (speech-type-flag first-time)) + 0 + (none) + ) + +(defmethod speech-control-method-14 ((this speech-control) (arg0 handle)) + (dotimes (s4-0 2) + (speech-channel-method-10 (-> this channel-array s4-0) arg0) + ) + 0 + (none) + ) + +(defmethod speech-control-method-15 ((this speech-control)) + (speech-table-reset! this) + (let ((s5-0 (-> this channel-array))) + ((method-of-type speech-channel init!) (the-as speech-channel s5-0)) + (set! (-> s5-0 0 speech-table) (-> this speech-table)) + (set! (-> s5-0 0 gui-channel) (gui-channel guard)) + ) + (let ((s5-1 (-> this channel-array 1))) + (init! s5-1) + (set! (-> s5-1 speech-table) (-> this speech-table)) + (set! (-> s5-1 gui-channel) (gui-channel citizen)) + ) + 0 + (none) + ) + +(defmethod speech-control-method-16 ((this speech-control)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel guard) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel citizen) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (dotimes (s5-0 2) + (reset-channel! (-> this channel-array s5-0)) + ) + 0 + (none) + ) + +(defmethod speech-table-reset! ((this speech-control)) + (dotimes (v1-0 61) + (set! (-> this speech-table v1-0) #f) + ) + (dotimes (s5-0 2) + (reset-channel! (-> this channel-array s5-0)) + ) + (speech-table-set! this (speech-type none) (new 'static 'speech-type-info + :priority 3 + :delay-pre-time (seconds 1) + :request-timeout (seconds 1) + :min-delay (seconds 1) + :max-delay (seconds 1) + :list (new 'static 'boxed-array :type string) + ) + ) + 0 + (none) + ) + +(define *speech-control* (new 'static 'speech-control)) + +(speech-control-method-15 *speech-control*) + +(defmethod speech-control-method-13 ((this speech-control) (arg0 process-drawable) (arg1 speech-type) (arg2 int)) + (if (not (-> *setting-control* user-current disable-guard-chatter?)) + (speech-control-method-12 this arg0 (+ arg1 (logand arg2 1))) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/target/board/board-h.gc b/goal_src/jak3/engine/target/board/board-h.gc index 59d263c1b4c..5c24f915570 100644 --- a/goal_src/jak3/engine/target/board/board-h.gc +++ b/goal_src/jak3/engine/target/board/board-h.gc @@ -5,5 +5,363 @@ ;; name in dgo: board-h ;; dgos: GAME +;; +++board-tricks +(defenum board-tricks + :type uint32 + :bitfield #f + (none 0) + (board-spin 1) + (board-boost 2) + (board-flip 3) + (board-rail 4) + (board-rail-jump 5) + (board-nosegrab 6) + (board-board-spin 7) + (board-board-flip 8) + (board-noseflip 9) + (board-kickflip 10) + (board-kickspin 11) + (board-method 12) + (board-method-cross 13) + (board-backgrab 14) + (board-airwalk 15) + (board-jump 16) + (board-duck-jump 17) + (board-quick-jump 18) + (darkjak 19) + (darkjak-bomb0 20) + (darkjak-bomb1 21) + (darkjak-smack 22) + (darkjak-tracking 23) + (lightjak 24) + (lightjak-regen 25) + (lightjak-swoop 26) + (lightjak-freeze 27) + (lightjak-shield 28) + ) +;; ---board-tricks + + ;; DECOMP BEGINS +(deftype board (process-drawable) + ((parent (pointer target) :override) + (control control-info :overlay-at root) + (shadow-backup shadow-geo :offset 208) + (main joint-mod) + (in-head-time time-frame) + ) + (:state-methods + (idle symbol) + use + hidden + ) + ) + + +(deftype board-info (basic) + ((board (pointer board)) + (camera-interp float) + (process (pointer target)) + (board-trans vector :inline) + (board-quat vector :inline) + (board-scale vector :inline) + (main joint-mod) + (upper-body joint-mod) + (mode-sound-bank connection) + (sound-bank-knob float) + (sound-air-knob float) + (wind-sound-id sound-id) + (wind-sound-pitch float) + (wind-sound-volume float) + (engine-sound-id sound-id) + (engine-sound-pitch float) + (engine-sound-volume float) + (bank-sound-id sound-id) + (bank-sound-pitch float) + (bank-sound-volume float) + (ride-sound-id sound-id) + (spin-sound-id sound-id) + (spin-sound-volume float) + (spin-sound-pitch float) + (turn-sound-id sound-id) + (trick-sound-id sound-id) + (jump-sound-id sound-id) + (eco-sound-id sound-id) + (eco-sound-volume float) + (charge-sound-id sound-id) + (adjust-time time-frame) + (up-vector vector 2 :inline) + (slow-transv vector :inline) + (board-time time-frame) + (board-get-on-time time-frame) + (in-air-time time-frame) + (last-jump-time time-frame) + (jump-end-time time-frame) + (unk-time-frame01 time-frame) + (stick-lock symbol) + (stick-off symbol) + (stance-info ground-tween-info :inline) + (mods-backup surface) + (attack-id uint32) + (latch? symbol) + (probe-intersect vector :inline) + (probe-normal vector :inline) + (probe-pat pat-surface) + (probe symbol) + (unstuck-time time-frame) + (stuck-count int32) + (thrust-scale float) + (flip-time time-frame) + (transv-max meters) + (turn-anim-tilt? symbol) + (turn-anim-mag float) + (turn-anim-targ float) + (turn-anim-frame float) + (unk-float000 float) + (unk-float001 float) + (turn-anim-vel float) + (turn-anim-duck float) + (turn-anim-duck-vel float) + (tilt-anim-frame vector :inline) + (tilt-anim-targ vector :inline) + (smack-surface-time time-frame) + (smack-speed meters) + (smack-normal vector :inline) + (glance-time time-frame) + (glance-speed meters) + (glance-in-transv vector :inline) + (glance-out-transv vector :inline) + (glance-normal vector :inline) + (on-flat-time time-frame) + (jump-land-time time-frame) + (slip-factor float) + (ground-on-dir vector :inline) + (ride-time time-frame) + (ride-start-time time-frame) + (ride-button-time time-frame) + (ride-lean-targ float) + (ride-lean float) + (ride-leanv float) + (ride-lean-mag float) + (ride-tilt-targ float) + (ride-tilt float) + (ride-tiltv float) + (ride-tilt-mag float) + (ride-lock symbol) + (ride-lock-on symbol) + (ride-speed meters) + (ride-mode uint32) + (ride-rot degrees) + (ride-rot-old degrees) + (ride-rot-abs degrees 2) + (ride-rotv-abs degrees) + (ride-touch-segment vector 2 :inline) + (ride-dir vector :inline) + (ride-vertex-length int16) + (ride-vertex-length-old int16) + (ride-vertex-base int16) + (ride-vertex-base2 int16) + (ride-vertex-index float) + (ride-vertex-index2 float) + (ride-vertex-index-old float) + (ride-vertex vector 3 :inline) + (ride-segment vector :inline) + (ride-dir-lean vector :inline) + (ride-pad-vector vector 1 :inline) + (ride-vertex-old vector 3 :inline) + (ride-segment-old vector :inline) + (ride-vertex-trail vector 128 :inline) + (halfpipe-side-time time-frame) + (halfpipe-jump-time time-frame) + (halfpipe-lip-time time-frame) + (halfpipe-time time-frame) + (halfpipe-gspot-time time-frame) + (halfpipe-lip-event symbol) + (spin-check-time time-frame) + (spin-time time-frame) + (spin-start-time time-frame) + (spin-start-dir vector :inline) + (spin-control float) + (spin-ground-start-time time-frame) + (spin-ground-time time-frame) + (spin-ground-press-time time-frame) + (flip-control float) + (flip-count int32) + (unk-time000 time-frame :offset 3152) + (tricky-time time-frame) + (tricky-exit-time time-frame) + (duck-start-time time-frame) + (unk-float005 float) + (unk-float006 float) + (unk-float007 float) + (trickx-count int32) + (unk-time001 time-frame :offset 3208) + (hold-start-time time-frame) + (hold-exit-time time-frame) + (l2-start-time time-frame) + (rotyv-max degrees) + (rotyv degrees) + (roty degrees) + (roty-cum degrees) + (unk-deg00 degrees) + (upper-body-rotyv-max degrees :offset 3260) + (upper-body-rotyv degrees) + (upper-body-roty degrees) + (cushion-base meters) + (cushion-offset meters) + (shock-offset meters) + (shock-offsetv meters) + (shock-rotx meters) + (effect-part sparticle-launch-control) + (charge-part sparticle-launch-control) + (trick-count int32) + (trick-array board-tricks 16) + (trick-points-array float 16 :offset 3368) + (trick-list board-tricks 16 :offset 3432) + (charge-start-time time-frame :offset 3496) + (charge-time time-frame) + (charge-progress float) + (zap-start-time time-frame :offset 3520) + ) + (:methods + (add-to-trick-list (_type_ board-tricks float) none) + (flush-trick-list (_type_) none) + ) + ) + + +(deftype target-board-bank (basic) + ((jump-height-min meters) + (jump-height-max meters) + (duck-jump-height-min meters) + (duck-jump-height-max meters) + (turn-frames float) + (wall-kick-window time-frame) + (cushion meters) + (trickx-jump-height-min meters) + (trickx-jump-height-max meters) + (tricky-jump-height-min meters) + (tricky-jump-height-max meters) + (trickz-jump-height-min meters) + (trickz-jump-height-max meters) + (charge-jump-time time-frame) + (charge-jump-fade-time time-frame) + (charge-jump-height meters) + (zap-duration time-frame) + (zap-reset-time time-frame) + ) + ) + + +(define *TARGET_BOARD-bank* (new 'static 'target-board-bank + :jump-height-min (meters 1.01) + :jump-height-max (meters 3.5) + :duck-jump-height-min (meters 2.5) + :duck-jump-height-max (meters 5) + :turn-frames 10.0 + :wall-kick-window (seconds 0.05) + :cushion (meters 1) + :trickx-jump-height-min (meters 0.9) + :trickx-jump-height-max (meters 1.2) + :tricky-jump-height-min (meters 0.9) + :tricky-jump-height-max (meters 1.2) + :trickz-jump-height-min (meters 0.9) + :trickz-jump-height-max (meters 1.2) + :charge-jump-time (seconds 0.7) + :charge-jump-fade-time (seconds 0.25) + :charge-jump-height (meters 3.5) + :zap-duration (seconds 0.25) + :zap-reset-time (seconds 0.25) + ) + ) + +(defbehavior want-to-board? target () + (and (logtest? (logand (game-feature board) (-> *setting-control* user-current features)) (-> self game features)) + (or (and (cpad-pressed? (-> self control cpad number) r2) + (or (!= *cheat-mode* 'debug) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) + ) + (not *pause-lock*) + (time-elapsed? (-> self control time-of-last-debug-heal) (seconds 0.1)) + (>= (-> self control last-time-on-surface) (-> self control time-of-last-debug-float)) + ) + (or (-> self board latch?) (= (-> *setting-control* user-current board) 'force)) + ) + (not (focus-test? self dead hit grabbed in-head edge-grab pole flut tube board pilot mech indax teleporting)) + (or (zero? (-> self board)) (time-elapsed? (-> self board board-time) (seconds 0.5))) + (not (logtest? (target-flags prevent-board invisible) (-> self target-flags))) + (< (-> self board board-time) (-> self control list-time-on-ground)) + (not (logtest? (surface-flag no-board) (-> self control current-surface flags))) + (or (not (logtest? (-> self control current-surface flags) (surface-flag duck))) (can-exit-duck? self)) + (not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (zero? (-> self lightjak shield-start-time)) + (not *artist-fix-visible*) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'sphere 3))) + (dotimes (s4-0 3) + ((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere) + ) + (let ((v1-56 (new 'stack-no-clear 'vector))) + (set! (-> v1-56 quad) (-> self control trans quad)) + (if (focus-test? self on-water) + (set! (-> v1-56 y) (-> self water height)) + ) + (set! (-> s5-0 0 quad) (-> v1-56 quad)) + (+! (-> s5-0 0 y) 8192.0) + (set! (-> s5-0 0 r) 2867.2) + (set! (-> s5-0 1 quad) (-> v1-56 quad)) + (+! (-> s5-0 1 y) 12288.0) + (set! (-> s5-0 1 r) 2867.2) + (set! (-> s5-0 2 quad) (-> v1-56 quad)) + ) + (+! (-> s5-0 2 y) 16384.0) + (set! (-> s5-0 2 r) 2867.2) + (let ((v1-60 gp-0)) + (set! (-> v1-60 spheres) s5-0) + (set! (-> v1-60 best-other-prim) (the-as collide-shape-prim 3)) + (set! (-> v1-60 collide-with) + (logclear + (-> self control root-prim prim-core collide-with) + (collide-spec civilian enemy vehicle-sphere projectile) + ) + ) + (set! (-> v1-60 ignore-process0) #f) + (set! (-> v1-60 ignore-process1) #f) + (set! (-> v1-60 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-60 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-60 action-mask) (collide-action solid)) + ) + ) + (and (if (fill-and-probe-using-spheres *collide-cache* gp-0) + #f + #t + ) + (begin (set! (-> self board latch?) #t) (time-elapsed? (-> self gun gun-time) (seconds 0.4))) + ) + ) + ) + ) + +(defskelgroup skel-board board board-lod0-jg board-board-idle-ja + ((board-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :shadow board-shadow-mg + :shadow-joint-index 3 + :light-index 1 + ) + +(define *board-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #xa)) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w 81920.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) diff --git a/goal_src/jak3/engine/target/board/board-states.gc b/goal_src/jak3/engine/target/board/board-states.gc index 418bbfc6c5b..eb12e03038f 100644 --- a/goal_src/jak3/engine/target/board/board-states.gc +++ b/goal_src/jak3/engine/target/board/board-states.gc @@ -7,3 +7,3656 @@ ;; DECOMP BEGINS +(defun vector-vector-angle ((arg0 vector) (arg1 vector)) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (gp-0 (new 'stack-no-clear 'matrix)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (forward-up-nopitch->inv-matrix gp-0 (new 'static 'vector :z 1.0 :w 1.0) arg1) + (matrix-transpose! s4-0 gp-0) + (vector-matrix*! s3-0 arg0 s4-0) + (vector-y-angle s3-0) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defbehavior target-board-anim-trans target () + (let ((f26-0 + (deg- + (quaternion-vector-y-angle (-> self control dir-targ) (-> self control local-normal)) + (quaternion-vector-y-angle (-> self control quat-for-control) (-> self control local-normal)) + ) + ) + (f28-0 + (* (deg- + (quaternion-vector-y-angle (-> self control quat-for-control) (-> self control local-normal)) + (quaternion-vector-y-angle (-> self control last-quat-for-control) (-> self control local-normal)) + ) + (-> self clock frames-per-second) + ) + ) + (f30-0 (-> self board turn-anim-targ)) + ) + (let ((f0-1 (lerp-scale 1.0 -1.0 f28-0 -32768.0 32768.0))) + (if (or (< (fabs f0-1) 0.1) (< (-> self control turn-to-magnitude) 0.3)) + (seek! (-> self board turn-anim-mag) 0.0 (* 8.0 (seconds-per-frame))) + (seek! (-> self board turn-anim-mag) f0-1 (* 2.0 (seconds-per-frame))) + ) + ) + (set! (-> self board turn-anim-targ) (+ (lerp-scale + (* 0.5 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.5 (-> *TARGET_BOARD-bank* turn-frames)) + f26-0 + -5461.3335 + 5461.3335 + ) + (lerp-scale + (* 0.3 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.3 (-> *TARGET_BOARD-bank* turn-frames)) + f28-0 + -32768.0 + 32768.0 + ) + (lerp-scale + (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (-> self board turn-anim-mag) + 1.0 + -1.0 + ) + ) + ) + (when (and (or (< (* f30-0 (-> self board turn-anim-targ)) 0.0) (= f30-0 0.0)) + (and (< (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) (fabs (- f30-0 (-> self board turn-anim-targ)))) + (>= (current-time) (-> self control turn-lockout-end-time)) + ) + ) + (let ((v1-50 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-50 command) (sound-command set-param)) + (set! (-> v1-50 id) (-> self board turn-sound-id)) + (set! (-> v1-50 params volume) -4) + (set! (-> v1-50 auto-time) 120) + (set! (-> v1-50 auto-from) 2) + (set! (-> v1-50 params mask) (the-as uint 17)) + (-> v1-50 id) + ) + (set! (-> self board turn-sound-id) (sound-play "board-turn")) + ) + ) + (set! (-> self board turn-anim-duck-vel) (* 0.98 (-> self board turn-anim-duck-vel))) + (+! (-> self board turn-anim-duck-vel) (* -8.0 (seconds-per-frame))) + (when (and (board-on-ground?) (time-elapsed? (-> self board unk-time-frame01) (seconds 0.2))) + (if (logtest? (-> self control status) (collide-status impact-surface)) + (+! (-> self board turn-anim-duck-vel) (lerp-scale 0.0 15.0 (-> self control normal-impact-vel) 0.0 81920.0)) + ) + (let ((f0-38 (vector-dot (the-as vector (-> self board up-vector)) (-> self board up-vector 1)))) + (if (< f0-38 1.0) + (+! (-> self board turn-anim-duck-vel) (* (lerp-scale 400.0 0.0 f0-38 0.6 1.0) (seconds-per-frame))) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior target-board-spin-check target () + (when (and (or (cpad-pressed? (-> self control cpad number) r1) + (and (cpad-hold? (-> self control cpad number) r1) + (time-elapsed? (-> self board spin-check-time) (seconds 0.3)) + ) + ) + (and (not (and (and (-> self next-state) + (let ((v1-24 (-> self next-state name))) + (or (= v1-24 'target-board-trickx) (= v1-24 'target-board-tricky) (= v1-24 'target-board-hold)) + ) + ) + (not (time-elapsed? (-> self board spin-start-time) (seconds 0.5))) + ) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) + (= (-> self ext-anim) (target-anim board)) + ) + ) + (set-time! (-> self board spin-start-time)) + (set! (-> self board spin-start-dir quad) (-> self node-list data 3 bone transform fvec quad)) + (vector-flatten! (-> self control turn-to-alt-heading) (-> self control c-R-w fvec) *up-vector*) + (vector-normalize! (-> self control turn-to-alt-heading) 1.0) + (rot->dir-targ! (-> self control)) + (set! (-> self board rotyv-max) (lerp-scale + 218453.33 + 91022.22 + (the float (- (current-time) (-> self control last-time-on-surface))) + 0.0 + 300.0 + ) + ) + (set! (-> self board rotyv) 0.0) + (set! (-> self board roty) 0.0) + (set! (-> self board roty-cum) 0.0) + (set! (-> self board unk-deg00) 0.0) + (set! (-> self board spin-sound-id) (new 'static 'sound-id)) + (set! (-> self control mod-surface) *board-spin-mods*) + ) + (cond + ((and (cpad-hold? (-> self control cpad number) r1) + (or (= (-> self control mod-surface name) 'spin) + (not (time-elapsed? (-> self board spin-time) (seconds 0.05))) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) + (= (-> self ext-anim) (target-anim board)) + ) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self control mod-surface) *board-spin-mods*) + (set-time! (-> self board spin-time)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> gp-0 w) 0.0) + (let ((f28-0 (analog-input (the int (* 128.0 (-> gp-0 x))) 0.0 64.0 110.0 2184533.2)) + (f30-0 (analog-input (the int (* 128.0 (-> gp-0 z))) 0.0 96.0 110.0 1.0)) + ) + (if (and (zero? (-> self board spin-sound-id)) (< 5461.3335 (fabs (-> self board rotyv)))) + (set! (-> self board spin-sound-id) (sound-play "board-spin-loop")) + ) + (if (and (< (* 0.9 (fabs (-> self board spin-control))) (fabs f28-0)) + (>= (* (-> self board spin-control) f28-0) 0.0) + ) + (set! (-> self board spin-control) f28-0) + ) + (if (not (-> self control danger-mode)) + (target-danger-set! 'board-spin #f) + ) + (+! (-> self board rotyv) (* (-> self board spin-control) (seconds-per-frame))) + (when (and (< (fabs f28-0) 1092266.6) + (< (fabs (-> self board spin-control)) 1092266.6) + (< (* 0.9 (fabs (-> self board flip-control))) (fabs f30-0)) + (>= (* (-> self board flip-control) f30-0) 0.0) + (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) 4096.0) + ) + (set! (-> self board flip-control) f30-0) + (go + target-board-flip + (-> *TARGET_BOARD-bank* jump-height-min) + (-> *TARGET_BOARD-bank* jump-height-max) + (if (focus-test? self halfpipe) + 'halfpipe + ) + ) + ) + ) + ) + ) + (else + (set! (-> self control mod-surface) (-> self board mods-backup)) + ) + ) + (set-time! (-> self board spin-check-time)) + (cond + ((and (or (cpad-pressed? (-> self control cpad number) l1) + (< (-> self control last-time-on-surface) (-> self board duck-start-time)) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) + (= (-> self ext-anim) (target-anim board)) + ) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self control mod-surface) *board-spin-mods*) + (set-time! (-> self board unk-time000)) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (set! (-> gp-2 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) + (set! (-> gp-2 y) 0.0) + (set! (-> gp-2 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> gp-2 w) 0.0) + (let ((f30-1 (analog-input (the int (* 128.0 (-> gp-2 x))) 0.0 64.0 110.0 1.0)) + (f28-1 (analog-input (the int (* 128.0 (-> gp-2 z))) 0.0 96.0 110.0 1.0)) + ) + (when (and (< (fabs f30-1) 0.5) + (< (fabs (-> self board unk-float005)) 0.5) + (= (-> self board unk-float006) 0.0) + (< (* 0.9 (fabs (-> self board unk-float006))) (fabs f28-1)) + (>= (* (-> self board unk-float006) f28-1) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (time-elapsed? (-> self board tricky-exit-time) (seconds 0.05)) + (< (-> self board tricky-exit-time) (-> self board duck-start-time)) + ) + ) + ) + (set! (-> self board unk-float006) f28-1) + (go + target-board-tricky + (-> *TARGET_BOARD-bank* tricky-jump-height-min) + (-> *TARGET_BOARD-bank* tricky-jump-height-max) + (if (focus-test? self halfpipe) + 'halfpipe + ) + ) + ) + (when (and (< (fabs f28-1) 0.5) + (< (fabs (-> self board unk-float006)) 0.5) + (= (-> self board unk-float005) 0.0) + (< (* 0.9 (fabs (-> self board unk-float005))) (fabs f30-1)) + (>= (* (-> self board unk-float005) f30-1) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (time-elapsed? (-> self board tricky-exit-time) (seconds 0.05)) + ) + ) + ) + (set! (-> self board unk-float005) f30-1) + (go + target-board-trickx + (-> *TARGET_BOARD-bank* trickx-jump-height-min) + (-> *TARGET_BOARD-bank* trickx-jump-height-max) + (if (focus-test? self halfpipe) + 'halfpipe + ) + ) + ) + ) + ) + ) + ((and (or (cpad-pressed? (-> self control cpad number) l2) + (< (-> self control last-time-on-surface) (-> self board l2-start-time)) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) + (= (-> self ext-anim) (target-anim board)) + ) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self control mod-surface) *board-spin-mods*) + (set-time! (-> self board unk-time001)) + (let ((gp-5 (new 'stack-no-clear 'vector))) + (set! (-> gp-5 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) + (set! (-> gp-5 y) 0.0) + (set! (-> gp-5 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> gp-5 w) 0.0) + (let ((f30-2 (analog-input (the int (* 128.0 (-> gp-5 x))) 0.0 64.0 110.0 1.0)) + (f28-2 (analog-input (the int (* 128.0 (-> gp-5 z))) 0.0 96.0 110.0 1.0)) + ) + (when (and (< (fabs f30-2) 0.5) + (< (fabs (-> self board unk-float005)) 0.5) + (= (-> self board unk-float006) 0.0) + (< (* 0.9 (fabs (-> self board unk-float006))) (fabs f28-2)) + (>= (* (-> self board unk-float006) f28-2) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (time-elapsed? (-> self board hold-exit-time) (seconds 0.05)) + (< (-> self board hold-exit-time) (-> self board l2-start-time)) + ) + ) + ) + (set! (-> self board unk-float006) f28-2) + (go + target-board-hold + (-> *TARGET_BOARD-bank* trickz-jump-height-min) + (-> *TARGET_BOARD-bank* trickz-jump-height-max) + (if (focus-test? self halfpipe) + 'halfpipe + ) + ) + ) + (when (and (< (fabs f28-2) 0.5) + (< (fabs (-> self board unk-float006)) 0.5) + (= (-> self board unk-float005) 0.0) + (< (* 0.9 (fabs (-> self board unk-float005))) (fabs f30-2)) + (>= (* (-> self board unk-float005) f30-2) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (time-elapsed? (-> self board hold-exit-time) (seconds 0.05)) + ) + ) + ) + (set! (-> self board unk-float005) f30-2) + (go + target-board-hold + (-> *TARGET_BOARD-bank* trickz-jump-height-min) + (-> *TARGET_BOARD-bank* trickz-jump-height-max) + (if (focus-test? self halfpipe) + 'halfpipe + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defbehavior target-board-halfpipe-trans target () + (when (and (focus-test? self halfpipe) *camera*) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s5-0 (camera-master-method-15 *camera* (new 'stack-no-clear 'vector)))) + (vector-flatten! gp-0 (-> self control edge-grab-across-edge-dir) (-> *camera* local-down)) + (when (< (vector-dot gp-0 s5-0) 0.0) + (let* ((v1-11 (camera-master-method-14 *camera* (new 'stack-no-clear 'vector))) + (f0-3 (vector-dot (-> self control edge-grab-edge-dir) v1-11)) + (s4-1 (vector-float*! (new 'stack-no-clear 'vector) (-> self control edge-grab-edge-dir) f0-3)) + ) + (vector-flatten! s4-1 s4-1 (-> *camera* local-down)) + (if (< 0.0 (vector-dot s4-1 s5-0)) + (vector-negate! gp-0 s4-1) + ) + ) + ) + ) + (vector-normalize! gp-0 8192.0) + (+! (-> gp-0 y) 40960.0) + (vector+! gp-0 gp-0 (get-trans self 6)) + (vector-! gp-0 gp-0 (get-trans self 0)) + (send-event *camera* 'relative-position gp-0) + ) + (set-setting! 'matrix-blend-max-angle 'abs (degrees 12.000001) 0) + (set-setting! 'matrix-blend-max-partial 'abs 0.5 0) + ) + 0 + (none) + ) + +(defbehavior target-board-resolve-points target () + (when (= (-> self board main mode) (joint-mod-mode rotate)) + (let ((f0-1 (fabs (-> self board roty-cum)))) + (cond + ((>= f0-1 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-spin) 4000.0) + ) + ((>= f0-1 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-spin) 2000.0) + ) + ((>= f0-1 49152.0) + (add-to-trick-list (-> self board) (board-tricks board-spin) 500.0) + ) + ) + ) + ) + (set! (-> self board roty-cum) 0.0) + (set! (-> self board flip-count) 0) + (if (time-elapsed? (-> self board in-air-time) (seconds 0.2)) + (flush-trick-list (-> self board)) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defbehavior target-board-ground-check target () + (when (board-on-ground?) + (when (!= (-> self board roty-cum) 0.0) + (let ((f30-0 (fabs (-> self board roty-cum))) + (f28-0 (vector-y-angle (-> self control transv))) + (f0-2 (y-angle (-> self control))) + ) + (if (not (time-elapsed? (-> self board halfpipe-time) (seconds 0.1))) + (set! f28-0 (+ 32768.0 f28-0)) + ) + (let ((f0-5 (fabs (deg-diff f0-2 f28-0)))) + (when (and (>= f30-0 41870.223) (>= 32768.0 f0-5)) + (cond + ((>= f30-0 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-boost) 2000.0) + ) + ((>= f30-0 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-boost) 1000.0) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-boost) 500.0) + ) + ) + (let ((f30-1 (lerp-scale 20480.0 40960.0 f30-0 49152.0 182044.44))) + (vector+float*! + (-> self control transv) + (-> self control transv) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + f30-1 + ) + ) + (if (< (vector-length (-> self control transv)) 114688.0) + (vector-normalize! (-> self control transv) 114688.0) + ) + (when (not (logtest? (-> self control old-status) (collide-status on-surface))) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (set! (-> gp-2 quad) (-> self control trans quad)) + (+! (-> gp-2 y) 2048.0) + (cond + ((logtest? (-> *part-group-id-table* 189 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-2 quad)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-1 + (let ((t9-11 (method-of-type part-tracker-subsampler activate))) + (t9-11 (the-as part-tracker-subsampler s5-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-12 run-function-in-process) + (a0-15 s5-1) + (a1-9 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 189)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-12) a0-15 a1-9 *part-tracker-subsampler-params-default*) + ) + (-> s5-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-2 quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-2 + (let ((t9-14 (method-of-type part-tracker activate))) + (t9-14 (the-as part-tracker s5-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-15 run-function-in-process) + (a0-20 s5-2) + (a1-12 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 189)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-15) a0-20 a1-12 *part-tracker-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + ) + (let ((s5-3 (process-spawn + manipy + :init manipy-init + gp-2 + (-> self entity) + (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (when s5-3 + (quaternion-copy! (-> (the-as process-drawable (-> s5-3 0)) root quat) (-> self control quat-for-control)) + (send-event (ppointer->process s5-3) 'anim-mode 'play1) + (send-event (ppointer->process s5-3) 'anim "idle") + (send-event (ppointer->process s5-3) 'speed 1.5) + (set-vector! (-> (the-as process-drawable (-> s5-3 0)) root scale) 0.2 0.4 0.2 1.0) + ) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) + (sound-play "board-boost") + ) + ) + ) + ) + ) + (target-board-resolve-points) + ) + (set! (-> self board turn-anim-tilt?) #t) + (none) + ) + +(defbehavior target-board-halfpipe-check target () + (local-vars (v0-3 collide-action)) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control ground-contact-normal) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (board-on-ground?) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (and (< (-> self control surface-angle) 0.3) (zero? (-> self board halfpipe-side-time))) + ) + (set-time! (-> self board halfpipe-side-time)) + (set! v0-3 (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset))) + (set! (-> self control root-prim prim-core action) v0-3) + v0-3 + ) + (else + (if (and (not (board-on-ground?)) + (nonzero? (-> self board halfpipe-side-time)) + (time-elapsed? (-> self board halfpipe-side-time) (seconds 0.05)) + ) + (go target-board-halfpipe) + ) + (when (time-elapsed? (-> self board halfpipe-side-time) (seconds 0.2)) + (set! (-> self board halfpipe-side-time) 0) + (set! v0-3 (logclear (-> self control root-prim prim-core action) (collide-action no-normal-reset))) + (set! (-> self control root-prim prim-core action) v0-3) + v0-3 + ) + ) + ) + ) + ) + +(defbehavior target-board-jump-trans target () + (when (and (!= (-> self state-time) (current-time)) (jump-hit-ground-stuck?)) + (set-time! (-> self board jump-land-time)) + (go target-board-hit-ground) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) + (target-board-smack-surface?) + ) + (if (and (cpad-pressed? (-> self control cpad number) 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))) + (not (logtest? (water-flag touch-water) (-> self water flags))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-wall-kick))) + (= (-> self ext-anim) (target-anim board)) + ) + ) + (go target-board-jump-kick) + ) + (target-board-spin-check) + (none) + ) + +(defstate target-board-start (target) + :event target-board-handler + :exit target-board-exit + :code (behavior ((arg0 handle)) + (target-board-init) + (remove-exit) + (go target-board-get-on) + ) + :post target-post + ) + +(defstate target-board-stance (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('lip) + (when (and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< (-> self control poly-angle) 0.5) + (let ((s5-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control ground-contact-normal) + ) + ) + ) + (vector-normalize! s5-0 1.0) + (< 0.0 (vector-dot (-> self control transv) s5-0)) + ) + ) + (set-time! (-> self board halfpipe-lip-time)) + (set-time! (-> self board halfpipe-side-time)) + (set! (-> self board halfpipe-lip-event) (the-as symbol (-> block param 0))) + (let ((v0-2 (the-as object (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset)))) + ) + (set! (-> self control root-prim prim-core action) (the-as collide-action v0-2)) + v0-2 + ) + ) + ) + (('jump) + (sound-play "board-launch") + (go + target-board-jump + (the-as meters (-> block param 0)) + (the-as meters (-> block param 1)) + (the-as symbol (-> block param 2)) + ) + ) + (else + (target-board-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self control mod-surface) *board-walk-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + :exit (behavior () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-stance) (= v1-3 'target-board-duck-stance)) + ) + ) + ) + (set! (-> self board halfpipe-side-time) 0) + 0 + ) + (logclear! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self board turn-anim-tilt?) #f) + (when (not (and (-> self next-state) + (let ((v1-13 (-> self next-state name))) + (or (= v1-13 'target-board-stance) (= v1-13 'target-board-duck-stance) (= v1-13 'target-board-ride-edge)) + ) + ) + ) + (set! (-> self board turn-anim-frame) 0.0) + (set! (-> self board turn-anim-mag) 0.0) + (set! (-> self board turn-anim-vel) 0.0) + (set! (-> self board turn-anim-duck) 0.0) + ) + (target-board-exit) + ) + :trans (behavior () + (if (and (cpad-hold? (-> self control cpad number) l1) + (not (logtest? (-> self target-flags) (target-flags prevent-duck))) + (not (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout))) + ) + (go target-board-duck-stance) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control ground-contact-normal) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + ) + ) + ((and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (< (-> self control surface-angle) 0.5) + ) + (set-time! (-> self board halfpipe-jump-time)) + (vector-float*! + (-> self control transv) + (-> self control transv) + (+ 1.0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + ) + ) + (else + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + ) + ) + ) + (if (cpad-pressed? (-> self control cpad number) r1) + (set-time! (-> self board spin-ground-press-time)) + ) + (when (and (can-feet? #t) + (and (cpad-pressed? (-> self control cpad number) triangle) (< (target-height-above-ground) 8192.0)) + ) + (cond + ((= (-> self ext-anim) (target-anim board)) + (go target-board-turn-around) + ) + ((not (time-elapsed? (-> self board spin-ground-press-time) (seconds 0.3))) + (set-time! (-> self board spin-ground-start-time)) + ) + ) + ) + (target-board-halfpipe-check) + (if (target-board-smack-surface?) + 0 + ) + (target-board-anim-trans) + (cond + ((board-on-ground?) + (target-board-ground-check) + (set! (-> self control mod-surface) *board-walk-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + ((and (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) + (or (= (-> self control mod-surface name) 'spin) (< 4096.0 (target-height-above-ground))) + ) + (set! (-> self control mod-surface) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (target-board-spin-check) + ) + (else + (set! (-> self control mod-surface) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + ) + ) + :code (behavior () + (let ((gp-0 (-> self board stance-info))) + (let ((f30-0 0.0)) + (let ((s5-0 30) + (v1-3 (ja-group)) + ) + (when (not (and (and v1-3 (= v1-3 jakb-board-turn-left-ja)) (= (ja-group-size) 4))) + (let ((v1-10 (ja-group))) + (cond + ((and v1-10 (= v1-10 jakb-board-get-on-ja)) + (ja-channel-set! 1) + (ja-no-eval :group! jakb-board-get-on-land-ja :num! (seek! max 1.8) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.8)) + ) + (suspend) + (set! (-> self board turn-anim-duck) 1.0) + (set! (-> self board turn-anim-duck-vel) 15.0) + ) + ((let ((v1-45 (ja-group))) + (and v1-45 (= v1-45 jakb-board-turn-around-ja)) + ) + (set! s5-0 60) + ) + ) + ) + (ja-channel-push! 4 (the-as time-frame s5-0)) + (set! f30-0 (ja-frame-num 0)) + ) + ) + (ground-tween-initialize + gp-0 + (the-as uint 0) + (the-as uint jakb-board-turn-ja) + (the-as uint jakb-board-turn-up-ja) + (the-as uint jakb-board-turn-down-ja) + (the-as uint jakb-board-turn-right-ja) + (the-as uint jakb-board-turn-left-ja) + f30-0 + ) + ) + (ja :chan 3 :group! jakb-board-duck-turn-ja) + (until #f + (target-board-turn-anim 0) + (let ((f0-10 (* 1.6 (-> self control ctrl-slope-z))) + (f1-2 (* 1.6 (-> self control ctrl-slope-x))) + ) + (cond + ((not (-> self board turn-anim-tilt?)) + (set! f0-10 0.0) + (set! f1-2 0.0) + ) + ((= (-> self control ground-pat mode) (pat-mode halfpipe)) + (set! f0-10 0.0) + ) + ) + (ground-tween-update gp-0 f0-10 f1-2 0.1) + ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (cond + ((>= (-> self board turn-anim-duck) 0.0) + (let ((a0-31 (-> self skel root-channel 3))) + (let ((f0-14 (-> self board turn-anim-duck))) + (set! (-> a0-31 frame-interp 1) f0-14) + (set! (-> a0-31 frame-interp 0) f0-14) + ) + (set! (-> a0-31 frame-group) (the-as art-joint-anim jakb-board-duck-turn-ja)) + (set! (-> a0-31 param 0) 0.0) + (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim jakb-board-duck-turn-ja) num-func-chan) + ) + ) + (else + (let ((a0-32 (-> self skel root-channel 3))) + (let ((f0-17 (- (-> self board turn-anim-duck)))) + (set! (-> a0-32 frame-interp 1) f0-17) + (set! (-> a0-32 frame-interp 0) f0-17) + ) + (set! (-> a0-32 frame-group) (the-as art-joint-anim jakb-board-air-turn-ja)) + (set! (-> a0-32 param 0) 0.0) + (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim jakb-board-air-turn-ja) num-func-chan) + ) + ) + ) + (suspend) + (can-play-stance-amibent?) + ) + ) + #f + ) + :post target-board-post + ) + +(defstate target-board-duck-stance (target) + :event (-> target-board-stance event) + :enter (behavior () + (set! (-> self control mod-surface) *board-duck-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + :exit (behavior () + (set! (-> self board turn-anim-duck-vel) -8.0) + ((-> target-board-stance exit)) + ) + :trans (behavior () + (if (and (or (not (cpad-hold? (-> self control cpad number) l1)) + (logtest? (-> self target-flags) (target-flags prevent-duck)) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + ) + (can-exit-duck? self) + ) + (go target-board-stance) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control ground-contact-normal) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + ) + ) + ((and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (< (-> self control surface-angle) 0.5) + ) + (let ((f30-0 (if (cpad-hold? (-> self control cpad number) l1) + (* (-> self board charge-progress) (-> *TARGET_BOARD-bank* charge-jump-height)) + 0.0 + ) + ) + ) + (sound-play "board-launch") + (when (!= (-> self board charge-progress) 0.0) + (cond + ((logtest? (-> *part-group-id-table* 191 flags) (sp-group-flag sp13)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-2 + (let ((t9-8 (method-of-type part-tracker-subsampler activate))) + (t9-8 (the-as part-tracker-subsampler gp-2) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-9 run-function-in-process) + (a0-35 gp-2) + (a1-7 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 191)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) (-> self node-list data 0 bone transform)) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-9) a0-35 a1-7 *part-tracker-subsampler-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + (else + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-3 + (let ((t9-11 (method-of-type part-tracker activate))) + (t9-11 (the-as part-tracker gp-3) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-12 run-function-in-process) + (a0-38 gp-3) + (a1-10 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 191)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) (-> self node-list data 0 bone transform)) + ((the-as (function object object object none) t9-12) a0-38 a1-10 *part-tracker-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + ) + ) + (set-time! (-> self board halfpipe-jump-time)) + (set! (-> self board charge-progress) 0.0) + (sound-stop (-> self board charge-sound-id)) + (vector-float*! + (-> self control transv) + (-> self control transv) + (+ 1.0 f30-0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + ) + ) + ) + (else + (flush-trick-list (-> self board)) + (deg-diff (vector-y-angle (-> self control c-R-w fvec)) (vector-y-angle (-> self control to-target-pt-xz))) + (go + target-board-jump + (-> *TARGET_BOARD-bank* duck-jump-height-min) + (-> *TARGET_BOARD-bank* duck-jump-height-max) + (the-as symbol *board-duck-jump-mods*) + ) + ) + ) + ) + ) + (if (cpad-pressed? (-> self control cpad number) r1) + (set-time! (-> self board spin-ground-press-time)) + ) + (if (and (cpad-hold? (-> self control cpad number) r1) + (can-feet? #t) + (not (time-elapsed? (-> self board spin-ground-press-time) (seconds 0.3))) + (board-turn-around?) + ) + (set-time! (-> self board spin-ground-start-time)) + ) + (target-board-halfpipe-check) + (if (target-board-smack-surface?) + 0 + ) + (target-board-anim-trans) + (set! (-> self board turn-anim-duck-vel) 8.0) + (cond + ((board-on-ground?) + (target-board-ground-check) + (set! (-> self control mod-surface) *board-duck-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + ((and (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) + (or (= (-> self control mod-surface name) 'spin) (< 4096.0 (target-height-above-ground))) + ) + (set! (-> self control mod-surface) *board-duck-jump-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (target-board-spin-check) + ) + (else + (set! (-> self control mod-surface) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + ) + ) + :code (-> target-board-stance code) + :post target-board-post + ) + +(defstate target-board-jump (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'edge-grab) (not (time-elapsed? (-> self state-time) (seconds 0.1)))) + (return #f) + ) + (target-board-handler proc argc message block) + ) + :enter (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) + (local-vars + (sv-144 (function vector entity-actor skeleton-group vector manipy-options none :behavior manipy)) + (sv-160 entity-actor) + ) + (if (= arg2 'hit) + (set! arg2 #f) + ) + (when (not (time-elapsed? (-> self board ride-time) (seconds 0.5))) + (set! arg2 (the-as symbol *board-ride-jump-mods*)) + (let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0))) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + s2-0 + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set! (-> self control turn-lockout-end-time) + (+ (current-time) (the int (lerp-scale 225.0 0.0 (vector-dot s2-0 (-> self control c-R-w fvec)) -1.0 1.0))) + ) + ) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set-time! (-> self state-time)) + (let ((f30-0 0.0)) + (when (and (cpad-hold? (-> self control cpad number) l1) (!= (-> self board charge-progress) 0.0)) + (+! f30-0 (* (-> self board charge-progress) (-> *TARGET_BOARD-bank* charge-jump-height))) + (sound-play "board-launch") + (cond + ((logtest? (-> *part-group-id-table* 191 flags) (sp-group-flag sp13)) + (let ((s3-3 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s3-3 + (let ((t9-7 (method-of-type part-tracker-subsampler activate))) + (t9-7 (the-as part-tracker-subsampler s3-3) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-8 run-function-in-process) + (a0-14 s3-3) + (a1-8 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 191)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) (-> self node-list data 0 bone transform)) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-8) a0-14 a1-8 *part-tracker-subsampler-params-default*) + ) + (-> s3-3 ppointer) + ) + ) + ) + (else + (let ((s3-4 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s3-4 + (let ((t9-10 (method-of-type part-tracker activate))) + (t9-10 (the-as part-tracker s3-4) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-11 run-function-in-process) + (a0-17 s3-4) + (a1-11 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 191)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) (-> self node-list data 0 bone transform)) + ((the-as (function object object object none) t9-11) a0-17 a1-11 *part-tracker-params-default*) + ) + (-> s3-4 ppointer) + ) + ) + ) + ) + ) + (set! (-> self board charge-progress) 0.0) + (sound-stop (-> self board charge-sound-id)) + (cond + ((and (< 0.0 (-> self board shock-offsetv)) + (not (time-elapsed? (-> self board jump-land-time) (seconds 0.5))) + (time-elapsed? (-> self board ride-time) (seconds 0.5)) + ) + (let ((s3-5 (new 'stack-no-clear 'vector))) + (set! (-> s3-5 quad) (-> self control trans quad)) + (+! (-> s3-5 y) 2048.0) + (cond + ((logtest? (-> *part-group-id-table* 190 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s3-5 quad)) + (let ((s2-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s2-2 + (let ((t9-14 (method-of-type part-tracker-subsampler activate))) + (t9-14 (the-as part-tracker-subsampler s2-2) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-15 run-function-in-process) + (a0-28 s2-2) + (a1-14 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 190)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-15) a0-28 a1-14 *part-tracker-subsampler-params-default*) + ) + (-> s2-2 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s3-5 quad)) + (let ((s2-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s2-3 + (let ((t9-17 (method-of-type part-tracker activate))) + (t9-17 (the-as part-tracker s2-3) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-18 run-function-in-process) + (a0-33 s2-3) + (a1-17 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 190)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-18) a0-33 a1-17 *part-tracker-params-default*) + ) + (-> s2-3 ppointer) + ) + ) + ) + ) + (let* ((s1-1 (get-process *default-dead-pool* manipy #x20000 1)) + (s2-4 + (when s1-1 + (let ((t9-20 (method-of-type manipy activate))) + (t9-20 (the-as manipy s1-1) self "manipy" (the-as pointer #x70004000)) + ) + (let ((s2-5 run-function-in-process) + (s0-1 s1-1) + ) + (set! sv-144 manipy-init) + (set! sv-160 (-> self entity)) + (let ((t0-2 (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer level) #f))) + (t1-1 #f) + (t2-1 0) + ) + ((the-as (function object object object object object object object none) s2-5) + s0-1 + sv-144 + s3-5 + sv-160 + t0-2 + t1-1 + t2-1 + ) + ) + ) + (-> s1-1 ppointer) + ) + ) + ) + (when s2-4 + (quaternion-copy! (-> (the-as process-drawable (-> s2-4 0)) root quat) (-> self control quat-for-control)) + (send-event (ppointer->process s2-4) 'anim-mode 'play1) + (send-event (ppointer->process s2-4) 'anim "idle") + (send-event (ppointer->process s2-4) 'speed 1.5) + (set-vector! (-> (the-as process-drawable (-> s2-4 0)) root scale) 0.2 0.4 0.2 1.0) + ) + ) + ) + (set! f30-0 (+ 8192.0 f30-0)) + (add-to-trick-list (-> self board) (board-tricks board-quick-jump) 0.0) + (sound-play "board-q-jump") + ) + (else + (if (= (the-as object arg2) *board-duck-jump-mods*) + (add-to-trick-list (-> self board) (board-tricks board-duck-jump) 0.0) + (add-to-trick-list (-> self board) (board-tricks board-jump) 0.0) + ) + (set! (-> self board jump-sound-id) (sound-play "board-jump")) + ) + ) + (init-var-jump + (+ arg0 f30-0) + (+ arg1 f30-0) + #t + #f + (-> self control transv) + (if (time-elapsed? (-> self board last-jump-time) (seconds 0.1)) + 2.0 + 0.0 + ) + ) + ) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! arg2 (cond + ((the-as object arg2) + (empty) + arg2 + ) + (else + (the-as symbol *board-jump-mods*) + ) + ) + ) + (set! (-> self control mod-surface) (the-as surface arg2)) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :exit target-board-exit + :trans (behavior () + (target-board-jump-trans) + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (set! (-> self board shock-offset) (* 0.8 (-> self board shock-offset))) + ) + :code (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) + (cond + ((= arg2 'hit) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-board-hit-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + ((and (= (-> self ext-anim) (target-anim board)) (>= (the-as float (-> self control unknown-word04)) 20480.0)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! jakb-board-jump-high-ja :num! min) + (suspend) + (until (ja-done? 0) + (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f0-11 (- 25.0 (ja-aframe-num 0))) + (gp-1 (-> self skel root-channel 0)) + ) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group frames num-frames) -1))) + (let ((v1-49 (and (< 0.0 f30-0) (< 0.0 f0-11)))) + (set! (-> gp-1 param 1) + (cond + (v1-49 + (fmin (fmin 1.5 f0-11) (/ (* 5.0 f0-11) (the float (time-to-apex f30-0 -245760.0)))) + ) + ((< (seconds 0.165) (target-time-to-ground)) + 1.5 + ) + (else + 0.8 + ) + ) + ) + ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + (suspend) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + (else + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! jakb-board-jump-ja :num! min) + (suspend) + (until (ja-done? 0) + (let ((f30-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f0-20 (- 10.0 (ja-aframe-num 0))) + (gp-3 (-> self skel root-channel 0)) + ) + (set! (-> gp-3 param 0) (the float (+ (-> gp-3 frame-group frames num-frames) -1))) + (let ((v1-74 (and (< 0.0 f30-1) (< 0.0 f0-20)))) + (set! (-> gp-3 param 1) + (cond + (v1-74 + (fmin (fmin 1.5 f0-20) (/ (* 5.0 f0-20) (the float (time-to-apex f30-1 -245760.0)))) + ) + ((< (seconds 0.165) (target-time-to-ground)) + 0.5 + ) + (else + 0.25 + ) + ) + ) + ) + (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) + ) + (suspend) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + ) + (ja :group! jakb-board-jump-loop-ja) + (until #f + (suspend) + (ja :num! (loop!)) + ) + #f + ) + :post target-board-post + ) + +(defstate target-board-halfpipe (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('edge-grab) + (format + #t + "halfpipe found edge ~m~%" + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + (let ((v1-6 *edge-grab-info*)) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (the-as vector (-> v1-6 world-vertex)) + (-> v1-6 world-vertex 1) + ) + 1.0 + ) + ) + (vector-cross! + (-> self control edge-grab-across-edge-dir) + (-> self control edge-grab-edge-dir) + (-> self control dynam gravity-normal) + ) + (let ((v1-11 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control edge-grab-across-edge-dir) (-> self control transv)))) + 0.0 + (vector-! + v1-11 + (-> self control transv) + (vector-float*! v1-11 (-> self control edge-grab-across-edge-dir) f0-2) + ) + ) + (let* ((f0-3 (vector-length v1-11)) + (f1-1 f0-3) + (f2-0 -2048.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control edge-grab-across-edge-dir) f2-0) + (vector-float*! v1-11 v1-11 (/ f0-3 f1-1)) + ) + ) + ) + ) + (('ramp) + (when (not (-> self control did-move-to-pole-or-max-jump-height)) + (let ((v0-3 (the-as object #t))) + (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float v0-3)) + v0-3 + ) + ) + ) + (('grenade) + (if (and (< (the-as float (-> block param 0)) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + (= (-> self ext-anim) (target-anim board)) + ) + (go target-board-grenade (process->handle proc)) + ) + ) + (else + (target-board-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self focus-status) (focus-status halfpipe)) + (set-time! (-> self state-time)) + (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self control mod-surface) *board-halfpipe-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self control sliding-start-time) 0) + (when (< (vector-dot (-> self control c-R-w uvec) (-> self control dynam gravity-normal)) 0.7) + (vector-matrix*! (-> self control transv-ctrl) (-> self control transv) (-> self control w-R-c)) + (set! (-> self control transv-ctrl y) 0.0) + (vector-matrix*! (-> self control transv) (-> self control transv-ctrl) (-> self control c-R-w)) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float #f)) + (target-method-28 *target* *collide-cache* *collide-edge-board-halfpipe-spec*) + (when (not (-> self control unknown-spool-anim00)) + (let ((gp-0 (vector-flatten! + (-> self control edge-grab-across-edge-dir) + (-> self control dynam gravity-normal) + (-> self control ground-contact-normal) + ) + ) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (vector-rotate-y! (-> self control edge-grab-edge-dir) (-> self control edge-grab-across-edge-dir) 16384.0) + (let ((v1-40 (new-stack-vector0))) + (let ((f0-5 (vector-dot gp-0 (-> self control transv)))) + 0.0 + (vector-! v1-40 (-> self control transv) (vector-float*! v1-40 gp-0 f0-5)) + ) + (let* ((f0-6 (vector-length v1-40)) + (f1-2 f0-6) + (f2-0 -2048.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) gp-0 f2-0) + (vector-float*! v1-40 v1-40 (/ f0-6 f1-2)) + ) + ) + ) + ) + ) + (if (or (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 20480.0) + (< (vector-dot + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + ) + 0.3 + ) + ) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + ) + :exit (behavior () + (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-flip) + (= v1-3 'target-board-hold) + (= v1-3 'target-board-trickx) + (= v1-3 'target-board-tricky) + (= v1-3 'target-board-grenade) + (= v1-3 'target-board-falling) + ) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status halfpipe)) + ) + (send-event *camera* 'relative-position #f) + (remove-setting! 'matrix-blend-max-angle) + (remove-setting! 'matrix-blend-max-partial) + (logclear! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (target-board-exit) + ) + :trans (behavior () + (when (and (or (= (the-as int (-> self control did-move-to-pole-or-max-jump-height)) #t) + (and (not (time-elapsed? (-> self board halfpipe-lip-time) (seconds 0.1))) + (= (-> self board halfpipe-lip-event) 'lipramp) + ) + ) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float 'done)) + (let ((v1-16 (new-stack-vector0)) + (f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-16 (-> self control transv) (vector-float*! v1-16 (-> self control dynam gravity-normal) f0-2)) + (let* ((f1-4 (vector-length v1-16)) + (f2-0 f1-4) + ) + (if (!= f1-4 0.0) + (set! f1-4 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-2) + (vector-float*! v1-16 v1-16 (/ f1-4 f2-0)) + ) + ) + ) + ) + (set-time! (-> self board halfpipe-time)) + (if (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + (set-time! (-> self board halfpipe-gspot-time)) + ) + (when (jump-hit-ground-stuck?) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (when (and (cpad-pressed? (-> self control cpad number) x) + (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.6)) + (not (time-elapsed? (-> self state-time) (-> *TARGET-bank* ground-timeout))) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (set-time! (-> self board halfpipe-jump-time)) + (vector-float*! + (-> self control transv) + (-> self control transv) + (+ 1.0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + ) + ) + (target-board-spin-check) + (cond + ((> (-> self control sliding-start-time) 0) + (cond + ((< 0.7 (-> self control turn-to-magnitude)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control edge-grab-across-edge-dir quad)) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (if (< 0.7 (vector-dot (-> self control to-target-pt-xz) gp-0)) + (+! (-> self control sliding-start-time) (- (current-time) (-> self clock old-frame-counter))) + (set! (-> self control sliding-start-time) 1) + ) + ) + ) + (else + (set! (-> self control sliding-start-time) 1) + ) + ) + ) + ((and (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (< (-> self board halfpipe-lip-time) (+ (-> self state-time) (seconds -0.2))) + ) + (set! (-> self control sliding-start-time) 1) + ) + ) + (when (or (>= (-> self control sliding-start-time) (seconds 0.05)) + (and (time-elapsed? (-> self board halfpipe-gspot-time) (seconds 0.5)) + (< (-> self board halfpipe-lip-time) (+ (-> self state-time) (seconds -0.2))) + ) + ) + (+! (-> self control transv x) (* 20480.0 (-> self control edge-grab-across-edge-dir x))) + (+! (-> self control transv z) (* 20480.0 (-> self control edge-grab-across-edge-dir z))) + (go target-board-stance) + ) + (target-board-halfpipe-trans) + ) + :code (behavior () + (cond + ((not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-board-jump-ja :num! (seek! (ja-aframe 8.0 0) 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0) 0.5)) + ) + (ja-no-eval :group! jakb-board-jump-ja :num! (seek! (ja-aframe 10.0 0) 0.2) :frame-num (ja-aframe 8.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0) 0.2)) + ) + (ja-no-eval :group! jakb-board-jump-ja :num! (seek! (ja-aframe 12.0 0) 0.1) :frame-num (ja-aframe 10.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0) 0.1)) + ) + (sleep-code) + ) + (else + ((the-as (function none) (-> target-board-stance code))) + ) + ) + ) + :post target-board-post + ) + +(defstate target-board-falling (target) + :event target-board-handler + :enter (behavior () + (if (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2) (not *pause-lock*)) + (set! (-> self control mod-surface) *board-air-mods*) + (set! (-> self control mod-surface) *board-jump-mods*) + ) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + :exit (-> target-board-halfpipe exit) + :trans (behavior () + (target-board-jump-trans) + (if (focus-test? self halfpipe) + (target-board-halfpipe-trans) + ) + (when (and (= *cheat-mode* 'debug) (and (cpad-hold? (-> self control cpad number) r2) (not *pause-lock*))) + (set! (-> self control mod-surface) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 jakb-board-jump-loop-ja)) + ) + ((let ((v1-8 (ja-group))) + (and v1-8 (= v1-8 jakb-board-noseflip-ja)) + ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.5)) + ) + ((let ((v1-22 (ja-group))) + (and v1-22 (or (= v1-22 jakb-board-flip-backward-ja) + (= v1-22 jakb-board-flip-backward-loop-ja) + (= v1-22 jakb-board-flip-forward-ja) + (= v1-22 jakb-board-flip-forward-loop-ja) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.2)) + ) + (else + (let ((v1-36 (ja-group))) + (cond + ((and v1-36 (= v1-36 jakb-board-spin-ja)) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.1)) + ) + (else + (ja-channel-push! 1 (seconds 0.5)) + ) + ) + ) + ) + ) + ) + (cond + ((focus-test? self halfpipe) + (ja :group! jakb-board-duck-turn-ja :num! (identity (ja-aframe 0.0 0))) + (loop + (suspend) + (ja-blend-eval) + ) + ) + (else + (ja :group! jakb-board-jump-loop-ja) + (loop + (suspend) + (ja-blend-eval) + (ja :num! (loop!)) + ) + ) + ) + ) + :post target-board-post + ) + +(defstate target-board-jump-kick (target) + :event target-board-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (sound-play "board-k-jump") + ) + :exit target-board-exit + :trans (behavior () + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (target-board-smack-surface?) + (cond + ((not (time-elapsed? (-> self board smack-surface-time) (seconds 0.2))) + (go target-board-wall-kick (-> self board smack-normal) (-> self board smack-speed)) + ) + ((not (time-elapsed? (-> self board glance-time) (seconds 0.2))) + (go + target-board-wall-kick + (vector-normalize-copy! (-> self control unknown-vector38) (-> self board glance-out-transv) 1.0) + (-> self board glance-speed) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-board-jump-kick-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 2)) + (ja :group! jakb-board-jump-loop-ja) + (until #f + (suspend) + (ja :num! (loop!)) + ) + #f + ) + :post target-board-post + ) + +(defstate target-board-wall-kick (target) + :event target-board-handler + :enter (behavior ((arg0 vector) (arg1 float)) + (sound-play "board-kick") + (set! (-> self control transv quad) (-> arg0 quad)) + (vector-xz-normalize! (-> self control transv) (* 0.8 arg1)) + (set! (-> self control unknown-word04) (the-as uint (fmax 81920.0 (* 0.8 arg1)))) + (set! (-> self control unknown-vector38 quad) (-> arg0 quad)) + (set! (-> self control transv y) 0.0) + (vector-turn-to (vector-negate! (new 'stack-no-clear 'vector) (-> self control transv))) + (set! (-> self control transv y) (- (sqrtf (* 24576.0 (-> self control dynam gravity-length))) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *board-wall-kick-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self board smack-surface-time) 0) + 0 + ) + :exit target-board-exit + :trans target-board-jump-trans + :code (behavior ((arg0 vector) (arg1 float)) + (ja-no-eval :group! jakb-board-jump-kickoff-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (< 31.0 (ja-aframe-num 0))) + (go target-board-hit-ground) + ) + (let ((v1-21 (-> self control unknown-vector38))) + (set! (-> self control transv x) (-> v1-21 x)) + (set! (-> self control transv z) (-> v1-21 z)) + ) + (vector-xz-normalize! (-> self control transv) (the-as float (-> self control unknown-word04))) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek!)) + ) + enter-state + (go target-board-falling) + ) + :post target-board-post + ) + +(defstate target-board-flip (target) + :event (-> target-board-jump event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-word04) (the-as uint arg2)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set-time! (-> self state-time)) + (cond + ((= arg2 'halfpipe) + (logior! (-> self focus-status) (focus-status halfpipe)) + (target-board-halfpipe-trans) + ) + (else + (init-var-jump arg0 arg1 #t #f (-> self control transv) 1.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) + ) + ) + ) + (set! (-> self control mod-surface) *board-flip-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (let ((v1-25 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-25 command) (sound-command set-param)) + (set! (-> v1-25 id) (-> self board jump-sound-id)) + (set! (-> v1-25 params volume) -4) + (set! (-> v1-25 auto-time) 72) + (set! (-> v1-25 auto-from) 2) + (set! (-> v1-25 params mask) (the-as uint 17)) + (-> v1-25 id) + ) + (set! (-> self control unknown-sound-id00) (sound-play "board-flip")) + (target-start-attack) + (target-danger-set! 'board-spin #f) + ) + :exit (behavior () + (target-danger-set! 'harmless #f) + (set! (-> self board flip-control) 0.0) + (add-to-trick-list + (-> self board) + (board-tricks board-flip) + (+ (* 500.0 (the float (-> self board flip-count))) (if (>= (-> self board flip-count) 2) + 2000.0 + 0.0 + ) + ) + ) + (let ((v1-9 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-9 command) (sound-command set-param)) + (set! (-> v1-9 id) (-> self control unknown-sound-id00)) + (set! (-> v1-9 params volume) -4) + (set! (-> v1-9 auto-time) 24) + (set! (-> v1-9 auto-from) 2) + (set! (-> v1-9 params mask) (the-as uint 17)) + (-> v1-9 id) + ) + ((-> target-board-halfpipe exit)) + ) + :trans (behavior () + (cond + ((= (-> self control unknown-spool-anim00) 'halfpipe) + (target-board-halfpipe-trans) + ) + (else + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((gp-0 (>= (-> self board flip-control) 0.0))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 x) 0.0) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> s5-0 w) 1.0) + (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (s4-0 0) + ) + (while (not (and (or (not (cpad-hold? (-> self control cpad number) r1)) + (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) + ) + (nonzero? s4-0) + ) + ) + (cond + (gp-0 + (cond + ((zero? s4-0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-board-flip-forward-ja :num! (seek! (ja-aframe 15.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 15.0 0))) + ) + ) + (else + (ja-no-eval :group! jakb-board-flip-forward-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ((zero? s4-0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-board-flip-backward-ja :num! (seek! (ja-aframe 10.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0))) + ) + ) + (else + (ja-no-eval :group! jakb-board-flip-backward-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (+! (-> self board flip-count) 1) + (set! f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (+! s4-0 1) + ) + ) + ) + (cond + (gp-0 + (ja-no-eval :group! jakb-board-flip-forward-ja :num! (seek!) :frame-num (ja-aframe 15.0 0)) + (until (ja-done? 0) + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-board-flip-backward-ja :num! (seek!) :frame-num (ja-aframe 10.0 0)) + (until (ja-done? 0) + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (go target-board-falling) + ) + :post target-board-post + ) + +(defstate target-board-hold (target) + :event (-> target-board-jump event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-word04) (the-as uint arg2)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set-time! (-> self state-time)) + (set-time! (-> self board hold-start-time)) + (cond + ((= arg2 'halfpipe) + (logior! (-> self focus-status) (focus-status halfpipe)) + (target-board-halfpipe-trans) + ) + (else + (init-var-jump arg0 arg1 #t #f (-> self control transv) 1.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) + ) + ) + ) + (set! (-> self control mod-surface) *board-flip-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self control dynam gravity-length) 147456.0) + ) + :exit (behavior () + (set! (-> self board unk-float006) 0.0) + (set-time! (-> self board hold-exit-time)) + (let ((v1-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-3 command) (sound-command set-param)) + (set! (-> v1-3 id) (-> self board trick-sound-id)) + (set! (-> v1-3 params volume) -4) + (set! (-> v1-3 auto-time) 24) + (set! (-> v1-3 auto-from) 2) + (set! (-> v1-3 params mask) (the-as uint 17)) + (-> v1-3 id) + ) + (let ((v1-7 (ja-group))) + (if (and v1-7 (= v1-7 jakb-board-noseflip-ja)) + (sound-play "board-boots") + ) + ) + ((-> target-board-halfpipe exit)) + ) + :trans (behavior () + (target-board-spin-check) + (cond + ((= (-> self control unknown-spool-anim00) 'halfpipe) + (target-board-halfpipe-trans) + ) + (else + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> gp-0 w) 1.0) + (let ((f30-0 (analog-input (the int (* 128.0 (-> gp-0 x))) 0.0 96.0 110.0 1.0)) + (f28-0 (analog-input (the int (* 128.0 (-> gp-0 z))) 0.0 96.0 110.0 1.0)) + ) + (while (not (or (not (cpad-hold? (-> self control cpad number) l2)) + (jump-hit-ground-stuck?) + (< (target-time-to-ground) (seconds 0.3)) + ) + ) + (cond + ((and (< f30-0 0.0) (< (fabs f28-0) (fabs f30-0))) + (let ((v1-17 (ja-group))) + (cond + ((and v1-17 (= v1-17 jakb-board-method-cross-loop-ja)) + (ja :num! (loop!)) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-method-cross) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-method-cross-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-board-method-cross-loop-ja :num! min) + ) + ) + ) + ) + ((and (< f28-0 0.0) (< (fabs f30-0) (fabs f28-0))) + (let ((v1-61 (ja-group))) + (cond + ((and v1-61 (= v1-61 jakb-board-backgrab-loop-ja)) + (ja :num! (loop!)) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-backgrab) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-backgrab-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-board-backgrab-loop-ja :num! min) + ) + ) + ) + ) + ((and (< 0.0 f28-0) (< (fabs f30-0) (fabs f28-0))) + (let ((v1-105 (ja-group))) + (cond + ((and v1-105 (= v1-105 jakb-board-airwalk-loop-ja)) + (ja :num! (loop!)) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-airwalk) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-airwalk-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-board-airwalk-loop-ja :num! min) + ) + ) + ) + ) + (else + (let ((v1-147 (ja-group))) + (cond + ((and v1-147 (= v1-147 jakb-board-method-loop-ja)) + (ja :num! (loop!)) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-method) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-method-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-board-method-loop-ja :num! min) + ) + ) + ) + ) + ) + (suspend) + ) + ) + ) + (let ((v1-200 (ja-group))) + (cond + ((and v1-200 (= v1-200 jakb-board-method-loop-ja)) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-method-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-230 (ja-group))) + (and v1-230 (= v1-230 jakb-board-method-cross-loop-ja)) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-method-cross-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-260 (ja-group))) + (and v1-260 (= v1-260 jakb-board-backgrab-loop-ja)) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-backgrab-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-290 (ja-group))) + (and v1-290 (= v1-290 jakb-board-airwalk-loop-ja)) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-airwalk-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ) + ) + (let ((v1-318 (new-stack-vector0)) + (f0-83 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-318 + (-> self control transv) + (vector-float*! v1-318 (-> self control dynam gravity-normal) f0-83) + ) + (let* ((f1-11 (vector-length v1-318)) + (f2-4 f1-11) + ) + (if (< 0.0 f0-83) + (set! f0-83 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-83) + (vector-float*! v1-318 v1-318 (/ f1-11 f2-4)) + ) + ) + ) + (go target-board-falling) + ) + :post target-board-post + ) + +(defstate target-board-tricky (target) + :event (-> target-board-jump event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-word04) (the-as uint arg2)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set-time! (-> self state-time)) + (set-time! (-> self board tricky-time)) + (cond + ((= arg2 'halfpipe) + (logior! (-> self focus-status) (focus-status halfpipe)) + (target-board-halfpipe-trans) + ) + (else + (init-var-jump arg0 arg1 #t #f (-> self control transv) 1.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) + ) + ) + ) + (set! (-> self control mod-surface) *board-flip-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self control dynam gravity-length) 147456.0) + ) + :exit (behavior () + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (set! (-> self board unk-float006) 0.0) + (set-time! (-> self board tricky-exit-time)) + (let ((v1-10 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-10 command) (sound-command set-param)) + (set! (-> v1-10 id) (-> self board trick-sound-id)) + (set! (-> v1-10 params volume) -4) + (set! (-> v1-10 auto-time) 24) + (set! (-> v1-10 auto-from) 2) + (set! (-> v1-10 params mask) (the-as uint 17)) + (-> v1-10 id) + ) + (let ((v1-14 (ja-group))) + (if (and v1-14 (= v1-14 jakb-board-noseflip-ja)) + (sound-play "board-boots") + ) + ) + ((-> target-board-halfpipe exit)) + ) + :trans (behavior () + (target-board-spin-check) + (cond + ((= (-> self control unknown-spool-anim00) 'halfpipe) + (target-board-halfpipe-trans) + ) + (else + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 x) 0.0) + (set! (-> v1-0 y) 0.0) + (set! (-> v1-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> v1-0 w) 1.0) + (let ((f30-0 (analog-input (the int (* 128.0 (-> v1-0 z))) 0.0 96.0 110.0 1.0))) + (while (not (or (not (cpad-hold? (-> self control cpad number) l1)) + (jump-hit-ground-stuck?) + (< (target-time-to-ground) (seconds 0.3)) + ) + ) + (cond + ((< f30-0 0.0) + (add-to-trick-list (-> self board) (board-tricks board-kickspin) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-kickspin-a-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + (ja-no-eval :group! jakb-board-kickspin-b-ja :num! (seek! max 1.05) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.05)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (ja-no-eval :group! jakb-board-kickspin-c-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-92 (ja-group))) + (and v1-92 (= v1-92 jakb-board-nosegrab-loop-ja)) + ) + (ja :num! (loop!)) + ) + ((< 40960.0 (target-height-above-ground)) + (add-to-trick-list (-> self board) (board-tricks board-nosegrab) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-nosegrab")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-nosegrab-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-board-nosegrab-loop-ja :num! min) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-noseflip) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-noseflip")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-noseflip-ja :num! (seek! (ja-aframe 20.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + (goto cfg-40) + ) + ) + (suspend) + ) + ) + ) + (label cfg-40) + (let ((v1-168 (ja-group))) + (when (and v1-168 (= v1-168 jakb-board-nosegrab-loop-ja)) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-nosegrab-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ) + (let ((v1-196 (new-stack-vector0)) + (f0-53 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-196 + (-> self control transv) + (vector-float*! v1-196 (-> self control dynam gravity-normal) f0-53) + ) + (let* ((f1-5 (vector-length v1-196)) + (f2-2 f1-5) + ) + (if (< 0.0 f0-53) + (set! f0-53 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-53) + (vector-float*! v1-196 v1-196 (/ f1-5 f2-2)) + ) + ) + ) + (go target-board-falling) + ) + :post target-board-post + ) + +(defstate target-board-trickx (target) + :event (-> target-board-jump event) + :enter (-> target-board-tricky enter) + :exit (behavior () + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (sound-play "board-boots") + ((-> target-board-tricky exit)) + ) + :trans (behavior () + (target-board-spin-check) + (when (!= (-> self control unknown-spool-anim00) 'halfpipe) + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + ) + (when (jump-hit-ground-stuck?) + (set-time! (-> self board jump-land-time)) + (go target-board-hit-ground) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((gp-0 (>= (-> self board unk-float005) 0.0)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 x) 0.0) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> s5-0 w) 1.0) + (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (s4-0 0) + ) + (while (not (and (or (not (cpad-hold? (-> self control cpad number) r1)) + (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) + ) + (nonzero? s4-0) + ) + ) + (cond + (gp-0 + (add-to-trick-list (-> self board) (board-tricks board-kickflip) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-kickflip")) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! jakb-board-kickflip-a-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + (ja-no-eval :group! jakb-board-kickflip-b-ja :num! (seek! max 1.05) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.05)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (ja-no-eval :group! jakb-board-kickflip-c-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-board-spin) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-boardspin")) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-board-spin-ja :num! (seek! max 0.95) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.95)) + ) + ) + ) + (+! (-> self board trickx-count) 1) + (set! f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (+! s4-0 1) + ) + ) + ) + (go target-board-falling) + ) + :post target-board-post + ) + +(defstate target-board-hit-ground (target) + :event target-board-handler + :enter (behavior () + (logclear! (-> self focus-status) (focus-status halfpipe)) + (if (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + ) + :exit target-board-exit + :trans (behavior () + (if (and (cpad-hold? (-> self control cpad number) l1) + (not (logtest? (-> self target-flags) (target-flags prevent-duck))) + ) + (go target-board-duck-stance) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + (if (target-board-smack-surface?) + 0 + ) + ) + :code (behavior () + (set! (-> self control mod-surface) *board-walk-mods*) + (let ((v1-3 (ja-group))) + (cond + ((and v1-3 (or (= v1-3 jakb-board-method-end-ja) (= v1-3 jakb-board-nosegrab-end-ja))) + (ja-no-eval :num! (seek! max 1.5)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-18 (ja-group))) + (and v1-18 (= v1-18 jakb-board-method-loop-ja)) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-method-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-48 (ja-group))) + (and v1-48 (= v1-48 jakb-board-nosegrab-loop-ja)) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-nosegrab-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ) + ) + (go target-board-stance) + ) + :post target-board-post + ) + +(defstate target-board-turn-to (target) + :event target-board-handler + :enter (behavior ((arg0 vector) (arg1 time-frame)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (when (not (or (= (-> self control dynam gravity-length) 245760.0) + (not (time-elapsed? (-> self board ride-time) (seconds 0.2))) + ) + ) + (let ((v1-11 (new-stack-vector0)) + (f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-11 (-> self control transv) (vector-float*! v1-11 (-> self control dynam gravity-normal) f0-2)) + (let* ((f1-3 (vector-length v1-11)) + (f2-0 f1-3) + ) + (if (< f0-2 0.0) + (set! f0-2 (* 5.0 f0-2)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-2) + (vector-float*! v1-11 v1-11 (/ f1-3 f2-0)) + ) + ) + ) + ) + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *board-turn-to-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self control sliding-start-time) arg1) + (vector-normalize-copy! (-> self control unknown-vector38) arg0 1.0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control unknown-vector38) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set! (-> self control turn-lockout-end-time) (+ (current-time) arg1)) + ) + :exit target-board-exit + :trans (behavior () + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + (if (time-elapsed? (-> self state-time) (-> self control sliding-start-time)) + (go target-board-stance) + ) + (target-board-anim-trans) + (when (board-on-ground?) + (let ((gp-0 (-> self board turn-anim-tilt?))) + (target-board-ground-check) + (set! (-> self board turn-anim-tilt?) gp-0) + ) + ) + (set! (-> self board turn-anim-targ) (* 10.0 (-> self board turn-anim-targ))) + ) + :code (-> target-board-stance code) + :post target-board-post + ) + +(defstate target-board-turn-around (target) + :event target-board-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self control mod-surface) *turn-around-mods*) + (set! (-> self control bend-target) 1.0) + ) + :exit (behavior () + (set-forward-vel 0.0) + (set! (-> self control ctrl-xz-vel) 0.0) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set! (-> self control bend-target) 0.0) + (target-board-exit) + ) + :trans (behavior () + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + (target-board-anim-trans) + (when (board-on-ground?) + (let ((gp-0 (-> self board turn-anim-tilt?))) + (target-board-ground-check) + (set! (-> self board turn-anim-tilt?) gp-0) + ) + ) + (set! (-> self board turn-anim-targ) (* 10.0 (-> self board turn-anim-targ))) + ) + :code (behavior () + (let ((f30-0 (-> self control ctrl-xz-vel)) + (gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control))) + ) + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! jakb-board-turn-around-ja :num! min) + (quaternion-rotate-y! (-> self control dir-targ) (-> self control quat-for-control) 32768.0) + (compute-alignment! (-> self align)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.25)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (set! (-> self control ctrl-xz-vel) + (* f30-0 (* 0.000024414063 (-> self clock frames-per-second) (-> self align delta trans z))) + ) + (vector-float*! (-> self control transv) gp-0 (-> self control ctrl-xz-vel)) + (let ((v1-31 (new-stack-vector0)) + (f1-2 (vector-dot (-> self control standard-dynamics gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-31 + (-> self control transv) + (vector-float*! v1-31 (-> self control standard-dynamics gravity-normal) f1-2) + ) + (let* ((f2-0 (vector-length v1-31)) + (f0-12 f2-0) + (f1-4 (fmax -8192.0 (fmin 8192.0 f1-2))) + (f2-1 (fmin 368640.0 f2-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control standard-dynamics gravity-normal) f1-4) + (vector-float*! v1-31 v1-31 (/ f2-1 f0-12)) + ) + ) + ) + ) + ) + (remove-exit) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set! (-> self control bend-target) 0.0) + (go target-board-stance) + ) + :post target-board-post + ) + +(defstate target-board-ride-edge (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('edge-grab 'push-transv 'push-trans) + #f + ) + (('end-mode) + (case (-> block param 0) + (('ride) + (when (-> block param 1) + (let ((v1-7 (/ (- (current-time) (-> self board ride-start-time)) 300))) + (if (> v1-7 0) + (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-7))) + ) + ) + ) + (when (< 32768.0 (-> self control ctrl-xz-vel)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + ) + (go target-board-turn-to (-> self control transv) (seconds 0.2)) + ) + (('board) + (go target-board-get-off (process->handle proc) #f) + ) + ) + ) + (else + (target-board-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set-time! (-> self state-time)) + (let ((v1-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-2 command) (sound-command set-param)) + (set! (-> v1-2 id) (-> self board charge-sound-id)) + (set! (-> v1-2 params volume) -4) + (set! (-> v1-2 auto-time) 24) + (set! (-> v1-2 auto-from) 2) + (set! (-> v1-2 params mask) (the-as uint 17)) + (-> v1-2 id) + ) + (logior! (-> self focus-status) (focus-status rail)) + (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control mod-surface) *board-ride-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (let ((v1-14 (-> self control transv-ctrl))) + (set! (-> self board ride-speed) (sqrtf (+ (* (-> v1-14 x) (-> v1-14 x)) (* (-> v1-14 z) (-> v1-14 z))))) + ) + (set! (-> self board ride-lean-targ) 0.0) + (set! (-> self board ride-lean) 0.0) + (set! (-> self board ride-leanv) 0.0) + (set! (-> self board ride-tilt-targ) 0.0) + (set! (-> self board ride-tilt) 0.0) + (set! (-> self board ride-tiltv) 0.0) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self board spin-control) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board flip-count) 0) + (set! (-> self board unk-float005) 0.0) + (set! (-> self board unk-float006) 0.0) + (set! (-> self control unknown-word04) (the-as uint #t)) + (set! (-> self control unknown-word04) (the-as uint 1000)) + (target-board-compute-edge) + (let ((f0-17 (vector-dot (-> self control c-R-w fvec) (-> self control edge-grab-edge-dir)))) + (cond + ((< 0.7 f0-17) + (set! (-> self board ride-mode) (the-as uint 0)) + (set! (-> self board ride-rot) 0.0) + ) + ((< f0-17 -0.7) + (set! (-> self board ride-mode) (the-as uint 1)) + (set! (-> self board ride-rot) 32768.0) + ) + (else + (let ((f0-21 (vector-dot (the-as vector (-> self control c-R-w)) (-> self control edge-grab-edge-dir)))) + (cond + ((< 0.7 f0-21) + (set! (-> self board ride-mode) (the-as uint 2)) + (set! (-> self board ride-rot) -16384.0) + ) + (else + (set! (-> self board ride-mode) (the-as uint 3)) + (set! (-> self board ride-rot) 16384.0) + ) + ) + ) + ) + ) + ) + (let ((f0-24 0.0)) + (if arg0 + (set! f0-24 (+ 250.0 f0-24)) + ) + (if (and (!= (-> self board ride-rot-old) -1.0) (!= (-> self board ride-rot) (-> self board ride-rot-old))) + (set! f0-24 (+ 500.0 f0-24)) + ) + (add-to-trick-list (-> self board) (board-tricks board-rail-jump) f0-24) + ) + ) + :exit (behavior () + (logclear! (-> self control status) (collide-status probe-hit)) + (let ((v1-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-2 command) (sound-command set-param)) + (set! (-> v1-2 id) (-> self board ride-sound-id)) + (set! (-> v1-2 params volume) -4) + (set! (-> v1-2 auto-time) 24) + (set! (-> v1-2 auto-from) 2) + (set! (-> v1-2 params mask) (the-as uint 17)) + (-> v1-2 id) + ) + ((-> target-board-stance exit)) + (set! (-> self neck flex-blend) 1.0) + (logclear! (-> self focus-status) (focus-status rail)) + (logclear! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self board ride-rot-old) (-> self board ride-rot)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let* ((s5-0 (new 'stack-no-clear 'collide-query)) + (a0-16 (-> self control)) + (t9-2 (method-of-object a0-16 find-ground)) + (a1-0 s5-0) + (a2-3 (logclear (-> self control root-prim prim-core collide-with) (collide-spec water))) + (a3-0 8192.0) + (t0-0 81920.0) + (t1-0 1024.0) + ) + (if (t9-2 a0-16 a1-0 a2-3 a3-0 t0-0 t1-0) + (set! (-> self control gspot-pat-surfce) (-> s5-0 best-other-tri pat)) + ) + ) + (if (< (-> self control trans y) (-> self control gspot-pos y)) + (set! (-> gp-0 quad) (-> self control gspot-pos quad)) + ) + (move-to-point! + (-> self control) + (vector+! (new 'stack-no-clear 'vector) gp-0 (new 'static 'vector :y 204.8 :w 1.0)) + ) + ) + ) + :trans (behavior () + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (let ((v1-15 (/ (- (current-time) (-> self board ride-start-time)) 300))) + (if (> v1-15 0) + (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-15))) + ) + ) + (+! (-> self control trans y) 1228.8) + (go + target-board-jump + (-> *TARGET_BOARD-bank* jump-height-min) + (-> *TARGET_BOARD-bank* jump-height-max) + (the-as symbol *board-ride-jump-mods*) + ) + ) + (if (cpad-pressed? (-> self control cpad number) square) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + (if (-> self control unknown-spool-anim00) + (set-time! (-> self board ride-button-time)) + ) + (set! (-> self board turn-anim-targ) (* (-> self board ride-lean) (- (-> *TARGET_BOARD-bank* turn-frames)))) + (cond + ((= (-> self board ride-speed) 0.0) + (let ((v1-43 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-43 command) (sound-command set-param)) + (set! (-> v1-43 id) (-> self board ride-sound-id)) + (set! (-> v1-43 params volume) -4) + (set! (-> v1-43 auto-time) 24) + (set! (-> v1-43 auto-from) 2) + (set! (-> v1-43 params mask) (the-as uint 17)) + (-> v1-43 id) + ) + ) + (else + (let ((f30-1 + (* (lerp-scale 0.7 1.0 (fabs (-> self board ride-lean)) 0.0 1.0) + (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (* 0.5 (-> self control mod-surface transv-max))) + ) + ) + (f28-1 + (+ (lerp-scale 0.0 0.05 (fabs (-> self board ride-lean)) 0.0 1.0) + (lerp-scale -0.05 0.0 (fabs (-> self board ride-speed)) 0.0 (* 0.3 (-> self control mod-surface transv-max))) + ) + ) + ) + (if (!= (-> self control unknown-word04) (-> self control ground-pat material)) + (sound-stop (-> self board ride-sound-id)) + ) + (let* ((v1-65 (-> self control ground-pat material)) + (a0-44 (if (or (= v1-65 (pat-material wood)) (= v1-65 (pat-material crwood)) (= v1-65 (pat-material hdwood))) + (make-u128 (the-as uint #x646f6f772d6c69) (the-as uint #x61722d6472616f62)) + (make-u128 (the-as uint #x6c746d2d6c69) (the-as uint #x61722d6472616f62)) + ) + ) + ) + (sound-play-by-name + (the-as sound-name a0-44) + (-> self board ride-sound-id) + (the int (* 1024.0 f30-1)) + (the int (* 1524.0 f28-1)) + 0 + (sound-group) + #t + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint (-> self control ground-pat material))) + ) + ) + (when (< 4096.0 (-> self board ride-speed)) + (let ((gp-1 (vector+float*! (new 'stack-no-clear 'vector) (-> self control trans) (-> self board ride-dir) -4096.0)) + ) + (set! (-> *part-id-table* 670 init-specs 1 initial-valuef) + (lerp-scale 0.1 2.0 (fabs (-> self board ride-speed)) 0.0 (* 0.3 (-> self control mod-surface transv-max))) + ) + (launch-particles (-> *part-id-table* 670) gp-1) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (let* ((v1-1 (-> self board ride-mode)) + (gp-0 (cond + ((zero? v1-1) + jakb-board-ride-turn-front-ja + ) + ((= v1-1 1) + jakb-board-ride-turn-back-ja + ) + ((= v1-1 2) + jakb-board-ride-turn-left-ja + ) + ((= v1-1 3) + jakb-board-ride-turn-right-ja + ) + (else + (the-as art-element #f) + ) + ) + ) + ) + (when (!= (ja-group) gp-0) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) + ) + ) + (until #f + (ja :num-func num-func-identity + :frame-num (ja-aframe + (fmax -5.0 (fmin 5.0 (+ (* 3.0 (-> self board ride-lean)) + (* 0.5 (sin (* 145.63556 (the float (- (current-time) (-> self state-time)))))) + ) + ) + ) + 0 + ) + ) + (suspend) + ) + #f + ) + :post (behavior () + (target-board-ride-post) + ) + ) + +(defstate target-board-grenade (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('target) + (handle->process (-> self control unknown-handle02)) + ) + (else + (target-board-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 handle)) + (logior! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self control unknown-handle02) arg0) + (set-time! (-> self state-time)) + (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self control mod-surface) *board-halfpipe-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (let ((v1-12 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-12 (-> self control transv) (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-1)) + (let* ((f1-2 (vector-length v1-12)) + (f2-0 f1-2) + ) + (if (and (!= f1-2 0.0) (< 2.0 (/ f0-1 f1-2))) + (set! f1-2 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-1) + (vector-float*! v1-12 v1-12 (/ f1-2 f2-0)) + ) + ) + ) + ) + :exit (behavior () + (send-event (handle->process (-> self control unknown-handle02)) 'exit) + ((-> target-board-halfpipe exit)) + ) + :trans (behavior () + (set-time! (-> self board halfpipe-time)) + (if (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + (set-time! (-> self board halfpipe-gspot-time)) + ) + (if (not (time-elapsed? (-> self state-time) (seconds 1))) + (vector+float*! + (-> self control transv) + (-> self control transv) + (-> self control dynam gravity-normal) + (* 122880.0 (seconds-per-frame)) + ) + ) + (when (jump-hit-ground-stuck?) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (when (time-elapsed? (-> self board halfpipe-gspot-time) (seconds 0.5)) + (+! (-> self control transv x) (* 20480.0 (-> self control edge-grab-across-edge-dir x))) + (+! (-> self control transv z) (* 20480.0 (-> self control edge-grab-across-edge-dir z))) + (go target-board-stance) + ) + ) + :code (behavior ((arg0 handle)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-board-grenade-ja :num! (seek! (ja-aframe 19.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0))) + ) + (let ((a1-5 (joint-node jakb-lod0-jg extra)) + (gp-2 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (let ((a0-7 (handle->process arg0))) + (set! (-> gp-2 ent) (if a0-7 + (-> a0-7 entity) + ) + ) + ) + (set! (-> gp-2 charge) 0.1) + (set! (-> gp-2 options) (projectile-options)) + (logclear! (-> gp-2 options) (projectile-options po14 po15 po16)) + (set! (-> gp-2 notify-handle) (the-as handle #f)) + (set! (-> gp-2 owner-handle) (the-as handle #f)) + (set! (-> gp-2 target-handle) (the-as uint #f)) + (set! (-> gp-2 target-pos quad) (the-as uint128 0)) + (set! (-> gp-2 ignore-handle) (process->handle self)) + (let* ((v1-27 *game-info*) + (a0-14 (+ (-> v1-27 attack-id) 1)) + ) + (set! (-> v1-27 attack-id) a0-14) + (set! (-> gp-2 attack-id) a0-14) + ) + (set! (-> gp-2 timeout) (seconds 4)) + (vector<-cspace! (-> gp-2 pos) a1-5) + (set! (-> gp-2 vel quad) (-> *zero-vector* quad)) + (spawn-projectile grenade gp-2 self *default-dead-pool*) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (sleep-code) + ) + :post target-board-post + ) + +(defstate target-board-get-on (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + message + (the-as attack-info (-> block param 1)) + proc + (the-as touching-shapes-entry (-> block param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self board shock-offsetv) 0.0) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control mod-surface) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (let ((a0-5 (target-time-to-ground))) + (cond + ((logtest? (water-flag touch-water) (-> self water flags)) + (let ((v1-10 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-10 (-> self control transv) (vector-float*! v1-10 (-> self control dynam gravity-normal) f0-2)) + ) + (let* ((f0-3 (vector-length v1-10)) + (f1-1 f0-3) + (f2-2 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.33 (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) + (vector-float*! v1-10 v1-10 (/ f0-3 f1-1)) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + ((< a0-5 (seconds 0.25)) + (let ((v1-12 (new-stack-vector0))) + (let ((f0-6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-12 (-> self control transv) (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-6)) + ) + (let* ((f0-7 (vector-length v1-12)) + (f1-3 f0-7) + (f2-5 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.0016666667 (the float (- (seconds 0.66) a0-5)) (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-5) + (vector-float*! v1-12 v1-12 (/ f0-7 f1-3)) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + (else + (let ((v1-14 (new-stack-vector0))) + (let ((f0-10 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-14 (-> self control transv) (vector-float*! v1-14 (-> self control dynam gravity-normal) f0-10)) + ) + (let* ((f0-11 (vector-length v1-14)) + (f1-5 f0-11) + (f2-7 (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-7) + (vector-float*! v1-14 v1-14 (/ f0-11 f1-5)) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ) + ) + (let ((v1-17 (new-stack-vector0)) + (f0-14 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-17 (-> self control transv) (vector-float*! v1-17 (-> self control dynam gravity-normal) f0-14)) + (let* ((f2-8 (vector-length v1-17)) + (f1-8 f2-8) + ) + (if (< 81920.0 f2-8) + (set! f2-8 81920.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-14) + (vector-float*! v1-17 v1-17 (/ f2-8 f1-8)) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :exit target-board-exit + :code (behavior () + (send-event (ppointer->process (-> self board board)) 'open) + (ja-channel-push! 1 (the-as time-frame (if (-> self control unknown-spool-anim00) + 9 + 60 + ) + ) + ) + (let ((f30-1 (if (-> self control unknown-spool-anim00) + 1.25 + (fmax 1.0 (fmin 2.0 (/ 249.99 (the float (target-time-to-ground))))) + ) + ) + ) + (ja-no-eval :group! jakb-board-get-on-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (when (logtest? (-> self control status) (collide-status on-surface)) + (set! (-> self board turn-anim-duck-vel) 0.0) + (goto cfg-19) + ) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (set! (-> self board turn-anim-duck-vel) 15.0) + (while (not (jump-hit-ground-stuck?)) + (suspend) + ) + (label cfg-19) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (logior! (-> self control status) (collide-status on-surface)) + (go target-board-hit-ground) + ) + :post target-board-post + ) + +(defstate target-board-get-off (target) + :event (-> target-board-get-on event) + :enter (behavior ((arg0 handle) (arg1 symbol)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self board shock-offsetv) 0.0) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control mod-surface) (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvf 30.0 + :turnvv 18204.445 + :turnvvf 30.0 + :tiltv 131072.0 + :tiltvf 30.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (let ((a0-6 (target-time-to-ground))) + (cond + ((< a0-6 (seconds 0.207)) + (let ((v1-12 (new-stack-vector0))) + (let ((f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-12 (-> self control transv) (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-3)) + ) + (let* ((f0-4 (vector-length v1-12)) + (f1-1 f0-4) + (f2-2 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.0016666667 (the float (- (seconds 0.66) a0-6)) (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) + (vector-float*! v1-12 v1-12 (/ f0-4 f1-1)) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + (else + (let ((v1-14 (new-stack-vector0))) + (let ((f0-7 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-14 (-> self control transv) (vector-float*! v1-14 (-> self control dynam gravity-normal) f0-7)) + ) + (let* ((f0-8 (vector-length v1-14)) + (f1-3 f0-8) + (f2-4 (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-4) + (vector-float*! v1-14 v1-14 (/ f0-8 f1-3)) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :exit target-board-exit + :code (behavior ((arg0 handle) (arg1 symbol)) + (local-vars (v1-117 symbol) (a0-36 int)) + (let ((f30-0 1.5151515)) + (let ((v1-1 arg1)) + (cond + ((= v1-1 'hit) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-board-hit-get-off-ja :num! (seek! (ja-aframe 24.0 0) 2.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) 2.5)) + ) + ) + ((-> self control unknown-spool-anim00) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-board-get-off-pre-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (ja-no-eval :group! jakb-board-get-off-ja :num! (seek! (ja-aframe 24.0 0) f30-0) :frame-num 0.0) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (>= (ja-aframe-num 0) 14.0)) + (go target-falling #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) f30-0)) + ) + ) + (else + (set! f30-0 (fmax 0.5 (fmin 2.0 (/ 150.0 (the float (target-time-to-ground)))))) + (ja-channel-push! 1 (seconds 0.1)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (ja-no-eval :group! jakb-board-get-off-ja + :num! (seek! (ja-aframe 24.0 0) f30-0) + :frame-num (ja-aframe 11.0 0) + ) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (>= (ja-aframe-num 0) 14.0)) + (go target-falling #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) f30-0)) + ) + ) + ) + ) + (send-event (ppointer->process (-> self board board)) 'close) + (logclear! (-> self focus-status) (focus-status board)) + (set! (-> self control pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :board #x1) + ) + (ja-no-eval :num! (seek! max f30-0)) + ) + (while (let ((t9-36 ja-done?)) + (set! a0-36 0) + (not (t9-36 a0-36)) + ) + (if (jump-hit-ground-stuck?) + (go target-falling #f) + ) + (suspend) + (ja-eval) + ) + (set! (-> self board turn-anim-duck-vel) 15.0) + (if (and (board-on-ground?) + (let ((v1-115 #x100000)) + (set! a0-36 (the-as int (-> self water flags))) + (not (or (logtest? v1-115 (the-as water-flag a0-36)) + (begin + (let ((v1-118 #t)) + (set! a0-36 (the-as int (logand (-> self control status) (collide-status on-water)))) + (set! a0-36 a0-36) + (cmove-#f-zero v1-117 (the-as collide-status a0-36) v1-118) + ) + v1-117 + ) + ) + ) + ) + ) + (go target-hit-ground (the-as symbol a0-36)) + (go target-falling (if (= arg1 'hit) + 'hit + ) + ) + ) + ) + :post (behavior () + (set! (-> self control bend-speed) 0.0) + (set! (-> self control bend-target) 0.0) + (vector-seek! (-> self control draw-offset) *null-vector* (* 16384.0 (seconds-per-frame))) + (target-post) + (target-board-effect) + ) + ) + +(defstate target-board-grab (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (case message + (('end-mode) + (case (-> block param 0) + (('grab) + (go target-board-stance) + ) + (('board) + (go target-grab 'stance) + ) + ) + ) + (('clone-anim) + (go target-board-clone-anim (process->handle (the-as process (-> block param 0)))) + ) + (('change-mode) + (case (-> block param 0) + (('normal) + (go target-grab 'stance) + ) + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self control mod-surface) *grab-mods*) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self target-flags) (target-flags tf2)) + (logior! (-> self focus-status) (focus-status grabbed)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self board stick-off) #t) + (let ((v1-9 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-9 command) (sound-command set-param)) + (set! (-> v1-9 id) (-> self board charge-sound-id)) + (set! (-> v1-9 params volume) -4) + (set! (-> v1-9 auto-time) 24) + (set! (-> v1-9 auto-from) 2) + (set! (-> v1-9 params mask) (the-as uint 17)) + (-> v1-9 id) + ) + ) + :exit (behavior () + (set! (-> self board stick-off) #f) + (logclear! (-> self target-flags) (target-flags tf2)) + (logclear! (-> self focus-status) (focus-status grabbed)) + (logclear! (-> self water flags) (water-flag jump-out)) + (target-board-exit) + ) + :code (behavior ((arg0 symbol)) + (let ((v1-2 (ja-group))) + (when (not (and v1-2 (= v1-2 jakb-board-stance-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-board-stance-ja :num! (identity (ja-aframe 0.0 0))) + ) + ) + (until #f + (set-forward-vel 0.0) + (suspend) + ) + #f + ) + :post target-board-post + ) + +(defstate target-board-clone-anim (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ((-> target-board-grab event) proc argc message block) + ) + :enter (-> target-clone-anim enter) + :exit (behavior () + (set! (-> self control draw-offset y) (the-as float (-> self control unknown-word04))) + (set! (-> self control cspace-offset y) (-> self control draw-offset y)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + ((-> target-clone-anim exit)) + ((-> target-board-start exit)) + (vector-reset! (-> self control transv)) + ) + :code (behavior ((arg0 handle)) + (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) + (set! (-> self control draw-offset y) 0.0) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (clone-anim arg0 #t "") + (go target-board-stance) + ) + :post target-no-ja-move-post + ) + +(defstate target-board-hit (target) + :event target-board-handler + :exit (behavior () + (when (not (and (-> self next-state) + (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-death) (= v1-3 'target-board-get-off) (= v1-3 'target-board-hit)) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status dead hit)) + (logclear! (-> self target-flags) (target-flags disable-attacks)) + ) + (let ((gp-1 (focus-test? self hit))) + (target-exit) + (if gp-1 + (logior! (-> self focus-status) (focus-status hit)) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (target-board-exit) + ) + :trans (behavior () + (when (= *cheat-mode* 'debug) + (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) + (set-time! (-> self control time-of-last-debug-heal)) + (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) + (go target-board-stance) + ) + ) + ) + :code (behavior ((arg0 symbol) (arg1 attack-info)) + (logclear! (-> self water flags) (water-flag jump-out)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-4 command) (sound-command set-param)) + (set! (-> v1-4 id) (-> self board charge-sound-id)) + (set! (-> v1-4 params volume) -4) + (set! (-> v1-4 auto-time) 24) + (set! (-> v1-4 auto-from) 2) + (set! (-> v1-4 params mask) (the-as uint 17)) + (-> v1-4 id) + ) + (set-time! (-> self state-time)) + (let ((gp-0 (-> self attack-info))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-8 gp-0)) + (set! (-> v1-8 attacker) (the-as handle #f)) + (set! (-> v1-8 mode) 'generic) + (set! (-> v1-8 shove-back) 6144.0) + (set! (-> v1-8 shove-up) 4915.2) + (set! (-> v1-8 angle) #f) + (set! (-> v1-8 trans quad) (-> self control trans quad)) + (set! (-> v1-8 control) 0.0) + (set! (-> v1-8 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout)) + (set! (-> v1-8 speed) 1.0) + (set! (-> v1-8 damage) (-> *FACT-bank* health-default-inc)) + (set! (-> v1-8 knock) (knocked-type knocked-type-0)) + ) + (case arg0 + (('shove) + (let ((v1-11 gp-0)) + (set! (-> v1-11 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-11 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-11 angle) 'shove) + ) + ) + ) + (combine! gp-0 arg1 self) + (when (not (logtest? (-> gp-0 mask) (attack-mask vector))) + (vector-z-quaternion! (-> gp-0 vector) (-> self control quat-for-control)) + (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) + (set! (-> gp-0 vector y) (-> gp-0 shove-up)) + ) + (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (let ((f0-12 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-12) + 'front + 'back + ) + ) + ) + ) + (cond + ((= arg0 'attack) + (logior! (-> self focus-status) (focus-status hit)) + (set-time! (-> self game hit-time)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) + (ja-channel-set! 0) + (let ((s3-2 (current-time))) + (until (time-elapsed? s3-2 (seconds 1)) + (suspend) + ) + ) + (move-to-point! (-> self control) s4-1) + ) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-stance) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (go target-death (-> gp-0 mode)) + ) + ) + ) + (('drown-death + 'sharkey + 'lava + 'fry + 'slime + 'dark-eco-pool + 'melt + 'instant-death + 'crush + 'death + 'grenade + 'big-explosion + 'bot + 'tentacle + ) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (if (= (-> self game mode) 'play) + (go target-death (-> gp-0 mode)) + ) + ) + (('death) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> gp-0 damage)) (the-as handle #f)) + ) + ) + (target-hit-effect gp-0) + ) + (else + (case (-> gp-0 mode) + (('burn 'burnup) + (sound-play "get-burned") + ) + ) + ) + ) + (when (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health)))) + (when (= (-> gp-0 knock) (knocked-type knocked-type-8)) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set-forward-vel (* -3.0 (-> gp-0 shove-back))) + (go target-board-get-off (the-as handle #f) 'hit) + ) + (if (= (-> gp-0 control) 1.0) + (go target-board-jump (-> gp-0 shove-up) (-> gp-0 shove-up) 'hit) + ) + ) + (set! (-> self control mod-surface) *smack-mods*) + (let ((v1-90 (ja-group))) + (when (not (and v1-90 (or (= v1-90 jakb-board-hit-ja) (= v1-90 jakb-board-hit-forward-ja)))) + (ja-channel-push! 1 (seconds 0.075)) + (if (or (= (-> gp-0 mode) 'shock) (= (-> gp-0 mode) 'shock-red) (= (-> gp-0 mode) 'shockup)) + (ja :group! jakb-board-hit-elec-ja :num! min) + (ja :group! jakb-board-hit-ja :num! min) + ) + ) + ) + (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-board-falling-anim-trans (-> gp-0 speed)) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (go target-death (-> gp-0 mode)) + ) + ) + enter-state + (go target-board-hit-ground) + ) + :post (behavior () + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (target-post) + (target-board-effect) + (case (-> self attack-info mode) + (('shock 'shock-red 'shockup) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.03)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (send-event self 'color-effect 'shock (seconds 0.2)) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) + ) + (target-board-joint-points) + ) + ) diff --git a/goal_src/jak3/engine/target/board/board-util.gc b/goal_src/jak3/engine/target/board/board-util.gc index 66f11084917..0b7254459fe 100644 --- a/goal_src/jak3/engine/target/board/board-util.gc +++ b/goal_src/jak3/engine/target/board/board-util.gc @@ -7,3 +7,225 @@ ;; DECOMP BEGINS +;; WARN: Return type mismatch process-drawable vs board. +(defmethod relocate ((this board) (offset int)) + (if (nonzero? (-> this main)) + (&+! (-> this main) offset) + ) + (the-as board ((method-of-type process-drawable relocate) this offset)) + ) + +(defbehavior board-post board () + (let ((v1-0 (ppointer->process (-> self parent)))) + (set! (-> self root trans quad) (-> (the-as target v1-0) board board-trans quad)) + (let ((a0-4 (-> (the-as target v1-0) board board-quat quad))) + (set! (-> self root quat quad) a0-4) + ) + (set! (-> self root scale quad) (-> (the-as target v1-0) board board-scale quad)) + (set! (-> self draw light-index) (-> (the-as target v1-0) draw light-index)) + (let ((a0-10 (-> (the-as target v1-0) draw color-mult quad))) + (set! (-> self draw color-mult quad) a0-10) + ) + (let ((a0-12 (-> (the-as target v1-0) draw color-emissive quad))) + (set! (-> self draw color-emissive quad) a0-12) + ) + (set! (-> self draw force-fade) (-> (the-as target v1-0) draw force-fade)) + (set! (-> self draw global-effect) (-> (the-as target v1-0) draw global-effect)) + (set! (-> self draw death-vertex-skip) (-> self parent 0 draw death-vertex-skip)) + (set! (-> self draw death-effect) (-> self parent 0 draw death-effect)) + (set! (-> self draw death-timer) (-> self parent 0 draw death-timer)) + (set! (-> self draw death-timer-org) (-> self parent 0 draw death-timer-org)) + (set! (-> self draw death-draw-overlap) (-> self parent 0 draw death-draw-overlap)) + (let ((a0-39 (-> (the-as target v1-0) draw shadow-ctrl settings shadow-dir quad))) + (set! (-> self draw shadow-ctrl settings shadow-dir quad) a0-39) + ) + (cond + ((logtest? (-> (the-as target v1-0) draw shadow-ctrl settings flags) (shadow-flags disable-draw)) + (let ((a0-45 (-> self draw shadow-ctrl))) + (logior! (-> a0-45 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (else + (let ((a0-48 (-> self draw shadow-ctrl))) + (logclear! (-> a0-48 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + (if (or (logtest? (-> (the-as target v1-0) draw status) + (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2) + ) + (or (logtest? (-> (the-as target v1-0) target-effect) 1) + (zero? (-> (the-as target v1-0) skel active-channels)) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (if (logtest? (-> (the-as target v1-0) draw status) (draw-control-status force-fade)) + (logior! (-> self draw status) (draw-control-status force-fade)) + (logclear! (-> self draw status) (draw-control-status force-fade)) + ) + (if (logtest? (-> (the-as target v1-0) target-effect) 7) + (logior! (-> self draw global-effect) (draw-control-global-effect no-textures)) + (logclear! (-> self draw global-effect) (draw-control-global-effect no-textures)) + ) + (if (logtest? (-> (the-as target v1-0) target-effect) 56) + (logior! (-> self draw global-effect) (draw-control-global-effect rim-lights)) + (logclear! (-> self draw global-effect) (draw-control-global-effect rim-lights)) + ) + ) + (ja-post) + 0 + (none) + ) + +(defstate hidden (board) + :virtual #t + :trans (behavior () + (let ((v1-0 (-> self parent))) + (if (not (focus-test? + (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) + ) + in-head + ) + ) + (go-virtual idle #t) + ) + ) + ) + :code (behavior () + (ja-channel-set! 0) + (ja-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + ) + +(defstate idle (board) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (go-virtual use) + ) + ) + ) + :trans (behavior () + (let ((v1-0 (-> self parent))) + (cond + ((focus-test? + (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) + ) + in-head + ) + (+! (-> self in-head-time) (- (current-time) (-> self clock old-frame-counter))) + (if (< (seconds 0.1) (-> self in-head-time)) + (go-virtual hidden) + ) + ) + (else + (set! (-> self in-head-time) 0) + 0 + ) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.1)) + (cond + (arg0 + (ja :group! board-close-ja :num! max) + ) + (else + (ja-no-eval :group! board-close-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (set! (-> self draw shadow) #f) + (sleep-code) + ) + :post board-post + ) + +(defstate use (board) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (go-virtual idle #f) + ) + ) + ) + :trans (behavior () + (let ((v1-0 (-> self parent))) + (if v1-0 + (-> v1-0 0 self) + ) + ) + (let ((v1-2 (-> self parent))) + (cond + ((focus-test? + (the-as target (if v1-2 + (the-as target (-> v1-2 0 self)) + ) + ) + in-head + ) + (go-virtual hidden) + ) + ((let ((v1-9 #x40000) + (a0-3 (-> self parent)) + ) + (not (logtest? (the-as focus-status v1-9) (-> (the-as target (if a0-3 + (the-as target (-> a0-3 0 self)) + ) + ) + focus-status + ) + ) + ) + ) + (go-virtual idle #f) + ) + ) + ) + ) + :code (behavior () + (set! (-> self draw shadow) (-> self shadow-backup)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! board-open-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + ) + :post board-post + ) + +(defbehavior board-init board () + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-board" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-5 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *board-shadow-control* settings shadow-dir quad) v1-5) + ) + (set! (-> self draw shadow-ctrl) *board-shadow-control*) + (set! (-> self shadow-backup) (-> self draw shadow)) + (set! (-> self main) (new 'process 'joint-mod (joint-mod-mode flex-blend) self 3)) + (ja-channel-set! 0) + (go-virtual idle #t) + ) diff --git a/goal_src/jak3/engine/target/board/target-board.gc b/goal_src/jak3/engine/target/board/target-board.gc index aecf6cdcaea..eb05ac67fe0 100644 --- a/goal_src/jak3/engine/target/board/target-board.gc +++ b/goal_src/jak3/engine/target/board/target-board.gc @@ -5,5 +5,3305 @@ ;; name in dgo: target-board ;; dgos: GAME +(declare-type grenade projectile) + +(define-extern *board-spin-post-mods* surface) +(define-extern *board-flip-mods* surface) + ;; DECOMP BEGINS +(define *board-walk-mods* + (new 'static 'surface + :name 'run + :turnv 32768.0 + :turnvf 30.0 + :turnvv 131072.0 + :turnvvf 30.0 + :tiltv 131072.0 + :tiltvf 15.0 + :tiltvv 2621440.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor -0.125 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (if (< 0.9 (-> self control surface-angle)) + (set-time! (-> self board on-flat-time)) + ) + (cond + ((< (-> *setting-control* user-current board-max-speed) (-> self control ctrl-xz-vel)) + (set! (-> arg0 transv-max) + (lerp (-> self control ctrl-xz-vel) (-> *setting-control* user-current board-max-speed) 0.2) + ) + ) + ((and (logtest? (game-secrets board-fast) (-> self game secrets)) + (-> self current-level) + (logtest? (level-flags desert) (-> self current-level info level-flags)) + ) + (set! (-> arg0 transv-max) + (fmin (fmin 245760.0 (-> *setting-control* user-current board-max-speed)) (* 2.5 (-> arg0 transv-max))) + ) + (set! (-> arg0 target-speed) (* 3.5 (-> arg0 target-speed))) + ) + (else + (set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> *setting-control* user-current board-max-speed))) + ) + ) + (set! (-> self board slip-factor) + (lerp-scale 1.0 (-> arg0 slip-factor) (fabs (-> self control ctrl-slope-heading)) 0.0 1.0) + ) + (set! (-> arg0 slip-factor) (-> self board slip-factor)) + (set! (-> arg0 slope-up-factor) (-> arg1 slope-up-factor)) + (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) + (set! (-> arg0 seek0) + (lerp-scale + (* 0.1 (-> arg0 seek0)) + (-> arg0 seek0) + (the float (- (current-time) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (set! (-> arg0 seek90) + (lerp-scale + (* 0.1 (-> arg0 seek90)) + (-> arg0 seek90) + (the float (- (current-time) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (set! (-> arg0 vel-turn) + (lerp-scale 131072.0 (-> arg1 vel-turn) (the float (- (current-time) (-> self board spin-time))) 0.0 600.0) + ) + (set! (-> arg0 turnv) + (lerp-scale 91022.22 (-> arg1 turnv) (the float (- (current-time) (-> self board spin-time))) 0.0 600.0) + ) + (when (not (time-elapsed? (-> self board spin-ground-start-time) (seconds 0.3))) + (set-time! (-> self control last-attack-end-time)) + (set-time! (-> self board spin-ground-time)) + (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) + (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) + (set! (-> arg0 vel-turn) 131072.0) + (set! (-> arg0 turnv) 91022.22) + ) + ) + ) + ) + :flags (surface-flag turn-to-pad) + ) + ) + +(define *board-duck-mods* (new 'static 'surface + :name 'duck + :turnv 21845.334 + :turnvf 30.0 + :turnvv 131072.0 + :turnvvf 30.0 + :tiltv 131072.0 + :tiltvf 15.0 + :tiltvv 2621440.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :transv-max 151552.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 0.5 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 0.75 + :flags (surface-flag no-turn-around turn-to-pad duck) + ) + ) + +(set! (-> *board-duck-mods* mult-hook) (-> *board-walk-mods* mult-hook)) + +(define *board-air-mods* + (new 'static 'surface + :name 'air + :turnv 49152.0 + :turnvf 30.0 + :turnvv 131072.0 + :turnvvf 30.0 + :tiltv 16384.0 + :tiltvf 150.0 + :tiltvv 131072.0 + :tiltvvf 60.0 + :vel-turn 65536.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.8 + :seek90 0.8 + :seek180 0.8 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (when (and (logtest? (game-secrets board-fast) (-> self game secrets)) + (-> self current-level) + (logtest? (level-flags desert) (-> self current-level info level-flags)) + ) + (set! (-> arg0 transv-max) + (fmin (fmin 245760.0 (-> *setting-control* user-current board-max-speed)) (* 2.5 (-> arg0 transv-max))) + ) + (set! (-> arg0 target-speed) (* 3.5 (-> arg0 target-speed))) + ) + ) + ) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +(define *board-jump-mods* (new 'static 'surface + :name 'jump + :turnv 49152.0 + :turnvf 30.0 + :turnvv 524288.0 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 30.0 + :tiltvv 131072.0 + :tiltvvf 18.0 + :vel-turn 10922.667 + :transv-max 143360.0 + :target-speed 102400.0 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +(set! (-> *board-jump-mods* mult-hook) (-> *board-air-mods* mult-hook)) + +(define *board-ride-jump-mods* + (new 'static 'surface + :name 'jump + :turnv 49152.0 + :turnvf 30.0 + :turnvv 32768.0 + :turnvvf 300.0 + :tiltv 32768.0 + :tiltvf 30.0 + :tiltvv 131072.0 + :tiltvvf 18.0 + :transv-max 143360.0 + :target-speed 102400.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (when (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (if (< (-> *setting-control* user-current board-max-speed) (-> self control ctrl-xz-vel)) + (set! (-> arg0 transv-max) + (lerp (-> self control ctrl-xz-vel) (-> *setting-control* user-current board-max-speed) 0.2) + ) + (set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> *setting-control* user-current board-max-speed))) + ) + (let* ((f30-0 (* (+ -20480.0 (-> arg0 transv-max)) (seconds-per-frame) (-> self control turn-to-magnitude))) + (a2-2 (-> self board ride-dir)) + (v1-19 (vector-flatten! (new 'stack-no-clear 'vector) (-> self control to-target-pt-xz) a2-2)) + ) + (vector+float*! (-> self control transv) (-> self control transv) v1-19 f30-0) + ) + ) + ) + ) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +(define *board-duck-jump-mods* *board-jump-mods*) + +(define *board-spin-mods* (copy *board-jump-mods* 'global)) + +(let ((v1-12 *board-spin-mods*)) + (set! (-> v1-12 name) 'spin) + (set! (-> v1-12 flags) (surface-flag no-turn-around check-edge air)) + (set! (-> v1-12 seek0) 0.0) + (set! (-> v1-12 seek90) 0.0) + (set! (-> v1-12 seek180) 0.0) + (set! (-> v1-12 vel-turn) 0.0) + (set! (-> v1-12 turnv) 0.0) + (set! (-> v1-12 turnvv) 0.0) + (set! (-> v1-12 tiltv) 0.0) + (set! (-> v1-12 tiltvf) 0.0) + ) + +(let ((v1-14 (copy *board-jump-mods* 'global))) + (set! (-> v1-14 seek0) 0.0) + (set! (-> v1-14 seek90) 0.0) + (set! (-> v1-14 seek180) 0.0) + (set! (-> v1-14 vel-turn) 0.0) + (set! *board-spin-post-mods* v1-14) + ) + +(let ((v1-16 (copy *board-duck-jump-mods* 'global))) + (set! (-> v1-16 flags) (surface-flag no-turn-around turn-to-vel air)) + (set! (-> v1-16 seek0) 0.0) + (set! (-> v1-16 seek90) 0.0) + (set! (-> v1-16 seek180) 0.0) + (set! (-> v1-16 vel-turn) 0.0) + (set! (-> v1-16 turnv) 49152.0) + (set! (-> v1-16 turnvf) 30.0) + (set! (-> v1-16 turnvv) 0.0) + (set! (-> v1-16 turnvvf) 0.0) + (set! *board-flip-mods* v1-16) + ) + +(define *board-wall-kick-mods* (new 'static 'surface + :name 'jump + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 60.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek180 0.8 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 0.8 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (when (not (time-elapsed? (-> self state-time) (seconds 0.05))) + (set! (-> arg0 turnv) 0.0) + (set! (-> arg0 turnvf) 0.0) + ) + ) + ) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-vel air) + ) + ) + +(define *board-halfpipe-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvf 30.0 + :turnvv 524288.0 + :turnvvf 30.0 + :tiltv 16384.0 + :tiltvf 150.0 + :tiltvv 131072.0 + :tiltvvf 60.0 + :transv-max 143360.0 + :target-speed 102400.0 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flag no-turn-around turn-to-vel air turn-when-centered) + ) + ) + +(define *board-turn-to-mods* (new 'static 'surface + :name 'run + :turnv 524288.0 + :turnvf 30.0 + :tiltv 131072.0 + :tiltvf 15.0 + :tiltvv 2621440.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 0.5 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :flags (surface-flag no-turn-around turn-to-vel turn-when-centered) + ) + ) + +(set! (-> *board-turn-to-mods* mult-hook) (-> *board-walk-mods* mult-hook)) + +(define *board-ride-mods* + (new 'static 'surface + :name 'run + :turnv 218453.33 + :turnvf 30.0 + :turnvv 131072.0 + :turnvvf 30.0 + :tiltv 131072.0 + :tiltvf 60.0 + :tiltvv 262144.0 + :tiltvvf 30.0 + :transv-max 143360.0 + :target-speed 40960.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.1 + :nonlin-fric-dist 1.0 + :slip-factor 0.6 + :slide-factor 1.0 + :slope-up-factor 24576.0 + :slope-down-factor 49152.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (set! (-> arg0 slope-up-factor) (-> arg1 slope-up-factor)) + (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) + (if (< (-> *setting-control* user-current board-max-speed) (-> self control ctrl-xz-vel)) + (set! (-> arg0 transv-max) + (lerp (-> self control ctrl-xz-vel) (-> *setting-control* user-current board-max-speed) 0.2) + ) + (set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> *setting-control* user-current board-max-speed))) + ) + ) + ) + ) + :mode 'ride + :flags (surface-flag no-turn-around turn-to-pad check-edge turn-when-centered) + ) + ) + +(define *collide-edge-board-halfpipe-spec* (new 'static 'collide-edge-spec + :split-dists (new 'static 'array float 2 1024.0 1433.6) + :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) + :flags (collide-edge-spec-flags send-event) + :max-dist-sqrd-to-outward-pt 150994940.0 + :max-dir-cosa-delta -1.0 + :max-dir-cosa-player -2.0 + :touching-segment #f + :local-cache-fill-box (new 'static 'bounding-box + :min (new 'static 'vector :x -8192.0 :y -16384.0 :z -8192.0 :w 1.0) + :max (new 'static 'vector :x 8192.0 :y 16384.0 :z 8192.0 :w 1.0) + ) + :local-within-reach-box (new 'static 'bounding-box + :min (new 'static 'vector :x -7987.2 :y -16179.2 :z -7987.2 :w 1.0) + :max (new 'static 'vector :x 7987.2 :y 16179.2 :z 7987.2 :w 1.0) + ) + :local-player-spheres (new 'static 'inline-array sphere 12 + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x -737.28 :y 4096.0 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 6553.6 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 9420.8 :r 3072.0) + (new 'static 'sphere :x 1720.32 :y 3686.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 5734.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 8601.6 :r 2949.12) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior target-board-green-eco-attack target ((arg0 symbol)) + (local-vars (v1-14 float) (v1-25 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'bounding-box))) + (cond + (arg0 + (set! (-> gp-0 min quad) (-> self control trans quad)) + (set! (-> gp-0 min w) 49152.0) + ) + (else + (vector-normalize! (vector-z-quaternion! (the-as vector gp-0) (-> self control quat)) -12288.0) + (vector+! (the-as vector gp-0) (the-as vector gp-0) (-> self control trans)) + (set! (-> gp-0 min w) 24576.0) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-1 384)) + (let* ((s3-0 (-> s5-1 s4-0)) + (v1-10 (if (type? s3-0 collide-shape) + s3-0 + ) + ) + ) + (when v1-10 + (let* ((s3-1 (-> v1-10 process)) + (a0-11 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (when a0-11 + (when (!= *target* a0-11) + (let ((v1-13 (vector-! (new 'stack-no-clear 'vector) (-> a0-11 root trans) (the-as vector gp-0)))) + 0.0 + (.lvf vf1 (&-> v1-13 quad)) + ) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-14 vf1) + (let ((f0-3 v1-14) + (f1-0 (-> gp-0 min w)) + ) + (if (>= (* f1-0 f1-0) f0-3) + (send-event a0-11 'green-eco-attack) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let* ((s4-1 *target*) + (s5-2 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (when (and s5-2 (< (vector-vector-distance (get-trans s5-2 0) (the-as vector gp-0)) (-> gp-0 min w))) + (when (!= *target* s5-2) + (let ((v1-24 (vector-! (new 'stack-no-clear 'vector) (-> s5-2 control trans) (the-as vector gp-0)))) + 0.0 + (.lvf vf1 (&-> v1-24 quad)) + ) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-25 vf1) + (let ((f0-6 v1-25) + (f1-4 (-> gp-0 min w)) + ) + (if (>= (* f1-4 f1-4) f0-6) + (send-event s5-2 'green-eco-attack) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defbehavior target-board-green-eco-use target ((arg0 float)) + (set! (-> self fact eco-green) (- (-> self fact eco-green) arg0)) + (if (< (-> self fact eco-green) 0.0) + (set! (-> self fact eco-green) 0.0) + ) + (none) + ) + +(defbehavior target-board-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object) (a0-11 uint)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'board + ) + (else + (case arg2 + (('end-mode) + (case (-> arg3 param 0) + (('board) + (go target-board-get-off (process->handle arg0) #f) + ) + ) + ) + (('change-mode) + (let ((v1-8 (-> arg3 param 0))) + (b! (!= v1-8 'grab) cfg-21 :delay (set! a0-11 (the-as uint #f))) + (b! (focus-test? self dead) cfg-20 :delay (set! v0-0 #f)) + (set! v0-0 (if (not (-> arg3 param 1)) + #t + (go target-board-grab (the-as symbol a0-11)) + ) + ) + (label cfg-20) + (b! #t cfg-32 :delay (nop!)) + (label cfg-21) + (set! v0-0 (cond + ((= v1-8 'normal) + (go target-board-get-off (process->handle arg0) #f) + ) + ((= v1-8 'falling) + enter-state + (go target-board-falling) + ) + ((= v1-8 'pilot) + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + (label cfg-32) + v0-0 + ) + (('swim 'wade 'slide 'pole-grab) + #f + ) + (('clone-anim) + (go target-board-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('edge-grab) + (let ((gp-1 *edge-grab-info*) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (-> gp-1 world-vertex 1) + (the-as vector (-> gp-1 world-vertex)) + ) + 1.0 + ) + (vector+float*! s5-1 (-> self control trans) (-> self control c-R-w fvec) (* 40960.0 (seconds-per-frame))) + (let ((f0-2 (vector-segment-overlap s5-1 (the-as vector (-> gp-1 world-vertex)) (-> gp-1 world-vertex 1)))) + (if (and (time-elapsed? (-> self board ride-time) (seconds 0.4)) + (>= f0-2 0.0) + (>= 1.0 f0-2) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-duck-stance))) + ) + (go target-board-ride-edge (logtest? (-> self control mod-surface flags) (surface-flag air))) + ) + ) + ) + ) + (('touched) + (cond + ((and (-> self control danger-mode) ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + ) + (when (target-send-attack + arg0 + (-> self control danger-mode) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + (case (-> self control danger-mode) + (('board-spin) + (cond + ((logtest? (-> *part-group-id-table* 184 flags) (sp-group-flag sp13)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-2 + (let ((t9-12 (method-of-type part-tracker-subsampler activate))) + (t9-12 (the-as part-tracker-subsampler gp-2) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-13 run-function-in-process) + (a0-53 gp-2) + (a1-12 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 184)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 37) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-13) a0-53 a1-12 *part-tracker-subsampler-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + (else + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-3 + (let ((t9-15 (method-of-type part-tracker activate))) + (t9-15 (the-as part-tracker gp-3) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-16 run-function-in-process) + (a0-56 gp-3) + (a1-15 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 184)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 37) + ((the-as (function object object object none) t9-16) a0-56 a1-15 *part-tracker-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + ) + ) + ) + (target-timed-invulnerable (seconds 0.5) self 2) + ) + ) + (else + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) (process->ppointer self)) + (set! (-> a1-17 num-params) 2) + (set! (-> a1-17 message) 'attack) + (set! (-> a1-17 param 0) (-> arg3 param 0)) + (set! (-> a1-17 param 1) + (the-as + uint + (static-attack-info :mask (vehicle-impulse-factor) ((id (-> self board attack-id)) + (damage 2.0) + (vehicle-damage-factor 0.0) + (vehicle-impulse-factor 0.0) + (mode 'board) + (penetrate-using (-> self control penetrate-using)) + ) + ) + ) + ) + (set! v0-0 (send-event-function arg0 a1-17)) + ) + (when v0-0 + (let* ((v1-85 (-> self game)) + (a0-67 (+ (-> v1-85 attack-id) 1)) + ) + (set! (-> v1-85 attack-id) a0-67) + (set! (-> self board attack-id) a0-67) + ) + ) + v0-0 + ) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-board-hit + ) + ) + (('shove) + (when (not (focus-test? self hit)) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 168) + (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) + (set! (-> self attack-info-rec attacker) (process->handle arg0)) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) + ) + (go target-board-hit 'shove (-> self attack-info-rec)) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +(defbehavior board-turn-around? target () + (let* ((gp-0 (vector<-pad-in-surface! (new-stack-vector0) #f)) + (s5-0 (vector-normalize! gp-0 1.0)) + (t9-2 vector-normalize!) + (a0-2 (new-stack-vector0)) + ) + (set! (-> a0-2 quad) (-> self control transv quad)) + (let ((f30-0 (vector-dot s5-0 (t9-2 a0-2 1.0))) + (s5-1 (-> self control transv-history)) + (f26-0 -1000.0) + (f28-0 0.0) + (s2-0 -1) + (s3-0 (new 'static 'array time-frame 2 (seconds 0) (seconds 0))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (countdown (v1-7 15) + (let ((a0-5 (-> s5-1 v1-7 quad))) + (set! (-> s5-1 (+ v1-7 1) quad) a0-5) + ) + ) + (cond + ((>= (-> self control pad-magnitude) 0.2) + (set! (-> s5-1 0 quad) (-> gp-0 quad)) + (set! (-> s5-1 0 w) (-> self control pad-magnitude)) + ) + (else + (vector-normalize-copy! (-> s5-1 0) (-> self control transv) 1.0) + (set! (-> s5-1 0 w) 0.2) + ) + ) + (dotimes (v1-18 16) + (+! f28-0 (-> s5-1 v1-18 w)) + (vector+float*! s4-0 s4-0 (-> s5-1 v1-18) (-> s5-1 v1-18 w)) + (when (< f26-0 (-> s5-1 v1-18 w)) + (set! s2-0 v1-18) + (set! f26-0 (-> s5-1 v1-18 w)) + ) + ) + (let ((f28-1 (* 0.0625 f28-0))) + (vector-normalize! s4-0 1.0) + (set! (-> self control idx-of-fastest-xz-vel) s2-0) + (set! (-> self control average-xz-vel) f28-1) + ) + (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) + (set-time! (-> s3-0 0)) + ) + (and (>= (the-as uint (- (current-time) (-> s3-0 0))) (the-as uint 300)) + (< f30-0 0.0) + (< (vector-dot s4-0 gp-0) -0.5) + (< 0.5 (vector-dot gp-0 (-> s5-1 1))) + (< 0.5 (vector-dot gp-0 (-> s5-1 2))) + (< 0.5 (vector-dot gp-0 (-> s5-1 3))) + (= (-> self ext-anim) (target-anim board)) + (< 0.7 (-> self control pad-magnitude)) + (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.3)) + (time-elapsed? (-> self control time-of-last-lc) (seconds 0.3)) + (logtest? (-> self control status) (collide-status on-surface)) + (and (< 0.7 (-> self control surface-angle)) #t) + ) + ) + ) + ) + +(defbehavior target-board-setup target ((arg0 symbol)) + (when (zero? (-> self board)) + (set! (-> self board) (new 'process 'board-info)) + (set! (-> self board process) (the-as (pointer target) (process->ppointer self))) + (set! (-> self board latch?) #f) + (set! (-> self board engine-sound-id) (new-sound-id)) + (set! (-> self board ride-sound-id) (new-sound-id)) + (set! (-> self board spin-sound-id) (new 'static 'sound-id)) + (set! (-> self board wind-sound-id) (new-sound-id)) + (set! (-> self board bank-sound-id) (new-sound-id)) + (set! (-> self board eco-sound-id) (new-sound-id)) + (set! (-> self board charge-sound-id) (new-sound-id)) + (let* ((v1-12 (-> self game)) + (a0-5 (+ (-> v1-12 attack-id) 1)) + ) + (set! (-> v1-12 attack-id) a0-5) + (set! (-> self board attack-id) a0-5) + ) + (set! (-> self board board) (the-as (pointer board) #f)) + (set! (-> self board mode-sound-bank) #f) + ) + (cond + (arg0 + (if (not (-> self board board)) + (set! (-> self board board) + (process-spawn board :init board-init :name "board" :from *8k-dead-pool* :to self) + ) + ) + ) + (else + (when (-> self board board) + (deactivate (-> self board board 0)) + (set! (-> self board board) (the-as (pointer board) #f)) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-board-init target () + (target-lightjak-end-mode #t) + (target-darkjak-end-mode #t) + (target-gun-end-mode #f) + (target-exit) + (target-board-setup #t) + (set! (-> self pending-ext-anim) (target-anim board)) + (set! (-> self board latch?) #f) + (if (zero? (-> self board main)) + (set! (-> self board main) (new 'process 'joint-mod (joint-mod-mode flex-blend) self 3)) + ) + (if (zero? (-> self board upper-body)) + (set! (-> self board upper-body) (new 'process 'joint-mod (joint-mod-mode flex-blend) self 5)) + ) + (if (zero? (-> self board effect-part)) + (set! (-> self board effect-part) (create-launch-control (-> *part-group-id-table* 185) self)) + ) + (if (zero? (-> self board charge-part)) + (set! (-> self board charge-part) (create-launch-control (-> *part-group-id-table* 186) self)) + ) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + (set! (-> self board engine-sound-pitch) 0.0) + (set! (-> self board engine-sound-volume) 1.0) + (set! (-> self board bank-sound-pitch) 0.0) + (set! (-> self board bank-sound-volume) 0.0) + (set! (-> self board wind-sound-pitch) 0.0) + (set! (-> self board wind-sound-volume) 1.0) + (set! (-> self board spin-sound-volume) 0.0) + (set! (-> self board eco-sound-volume) 0.0) + (set! (-> self board sound-air-knob) 0.0) + (set! (-> self board sound-bank-knob) 0.0) + (set! (-> self board turn-sound-id) (new 'static 'sound-id)) + (set! (-> self board mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modebord 0.0 0))) + (set-time! (-> self board board-get-on-time)) + (set! (-> self board stick-lock) #f) + (set! (-> self board stick-off) #f) + (set-time! (-> self board unstuck-time)) + (set! (-> self board stuck-count) 0) + (set! (-> self board slip-factor) 1.0) + (set! (-> self board probe) #f) + (set! (-> self board halfpipe-side-time) 0) + (set! (-> self board spin-control) 0.0) + (set! (-> self board rotyv) 0.0) + (set! (-> self board roty) 0.0) + (set! (-> self board roty-cum) 0.0) + (set! (-> self board unk-deg00) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board flip-count) 0) + (set! (-> self board unk-float005) 0.0) + (set! (-> self board unk-float006) 0.0) + (set! (-> self board unk-float007) 0.0) + (set! (-> self board trick-count) 0) + (countdown (v1-69 16) + (set! (-> self board trick-list 0) (board-tricks none)) + ) + (set! (-> self board charge-progress) 0.0) + (set! (-> self board upper-body-rotyv) 0.0) + (set! (-> self board upper-body-roty) 0.0) + (set! (-> self board upper-body-rotyv-max) 91022.22) + (set! (-> self board ride-lock) #f) + (set! (-> self board ride-lock-on) #f) + (set! (-> self board ride-rot-old) -1.0) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1)) + (logior! (-> self focus-status) (focus-status board)) + (logclear! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control bend-target) 1.0) + (let ((v1-90 (-> self node-list data))) + (set! (-> v1-90 0 param0) (the-as (function cspace transformq none) cspace<-transformq+world-trans!)) + (set! (-> v1-90 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-90 0 param2) (the-as basic (-> self control cspace-offset))) + ) + (target-collide-set! 'board 0.0) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (set! (-> self board thrust-scale) 1.0) + (set! (-> self board turn-anim-targ) 0.0) + (set! (-> self board turn-anim-frame) 0.0) + (set! (-> self board turn-anim-vel) 0.0) + (set! (-> self board turn-anim-duck) 0.0) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self board cushion-base) 0.0) + (set! (-> self board cushion-offset) 0.0) + (set! (-> self board shock-offset) 0.0) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self board shock-rotx) 0.0) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (set-setting! 'string-spline-max-move 'abs (meters 2) 0) + (set-setting! 'string-spline-accel 'abs (meters 0.045) 0) + (set-setting! 'string-spline-max-move-player 'abs (meters 1.5) 0) + (set-setting! 'string-spline-accel-player 'abs (meters 0.035) 0) + (none) + ) + +(defbehavior target-board-exit target () + (when (not (and (-> self next-state) + (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-stance) + (= v1-3 'target-board-jump) + (= v1-3 'target-board-hit-ground) + (= v1-3 'target-board-jump-kick) + (= v1-3 'target-board-wall-kick) + (= v1-3 'target-board-ride-edge) + (= v1-3 'target-board-duck-stance) + (= v1-3 'target-board-falling) + (= v1-3 'target-board-flip) + (= v1-3 'target-board-trickx) + (= v1-3 'target-board-tricky) + (= v1-3 'target-board-hold) + (= v1-3 'target-board-halfpipe) + (= v1-3 'target-board-grenade) + (= v1-3 'target-board-turn-to) + (= v1-3 'target-board-turn-around) + (= v1-3 'target-board-hit) + (= v1-3 'target-board-get-off) + (= v1-3 'target-board-grab) + (= v1-3 'target-board-clone-anim) + ) + ) + ) + ) + (set! (-> self board latch?) #f) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + (if (-> self board board) + (mode-set! (-> self board board 0 main) (joint-mod-mode flex-blend)) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (logclear! (-> self focus-status) (focus-status board)) + (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape no-normal-reset)) + (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control mod-surface) *walk-mods*) + (logclear! (-> self target-flags) (target-flags tf6)) + (remove-setting! 'string-spline-max-move) + (remove-setting! 'string-spline-accel) + (remove-setting! 'string-spline-max-move-player) + (remove-setting! 'string-spline-accel-player) + (let ((v1-51 (-> self node-list data))) + (set! (-> v1-51 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-51 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-51 0 param2) (the-as basic (-> self control cspace-offset))) + ) + (target-collide-set! 'normal 0.0) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :board #x1) + ) + (sound-stop (-> self board wind-sound-id)) + (sound-stop (-> self board engine-sound-id)) + (sound-stop (-> self board bank-sound-id)) + (sound-stop (-> self board ride-sound-id)) + (sound-stop (-> self board spin-sound-id)) + (sound-stop (-> self board eco-sound-id)) + (sound-stop (-> self board charge-sound-id)) + (set! (-> self board spin-sound-id) (new 'static 'sound-id)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (set! (-> self control cspace-offset quad) (the-as uint128 0)) + (remove-setting! 'sound-flava) + (setting-control-method-14 *setting-control* (-> self board mode-sound-bank)) + (set! (-> self board mode-sound-bank) #f) + (set! (-> self pending-ext-anim) (target-anim default)) + (joint-control-cleanup + (-> self skel) + (-> self ext-anim-control heap) + (the-as art-joint-anim jakb-stance-loop-ja) + ) + (send-event (ppointer->process (-> self sidekick)) 'cleanup) + (if (and (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> self game features) + ) + (-> *setting-control* user-current board-trail) + ) + (set! (-> self fact eco-green) 0.0) + ) + (target-exit) + ) + (none) + ) + +(defbehavior target-board-falling-anim-trans target () + (let ((v1-2 (ja-group))) + (cond + ((not (and v1-2 (= v1-2 jakb-board-jump-loop-ja))) + (ja-channel-push! 1 (seconds 0.33)) + (ja :group! jakb-board-jump-loop-ja) + ) + ((let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 jakb-board-jump-loop-ja)) + ) + (ja :num! (loop!)) + ) + ) + ) + 0 + (none) + ) + +(defbehavior board-on-ground? target () + (logtest? (-> self control status) (collide-status on-surface)) + ) + +(defbehavior target-board-smack-surface? target () + (when (and (logtest? (-> self control status) (collide-status touch-wall)) + (< (+ (current-time) (seconds -0.05)) (-> self control last-time-touching-actor)) + (< 0.7 (-> self control touch-angle)) + (< 73728.0 (-> self control ctrl-xz-vel)) + (and (< (vector-dot (-> self control wall-contact-normal) (-> self control dynam gravity-normal)) 0.3) + (not (logtest? (-> self control status) (collide-status touch-actor))) + ) + ) + (set-time! (-> self board smack-surface-time)) + (set! (-> self board smack-speed) (-> self control ctrl-xz-vel)) + (set! (-> self board smack-normal quad) (-> self control wall-contact-normal quad)) + #t + ) + ) + +(defbehavior board-add-thrust target () + (let ((gp-0 (-> self control transv-ctrl))) + (let* ((v1-1 gp-0) + (f0-7 (cond + ((= (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 0.0) + 0.0 + ) + (else + (let ((f0-5 (-> gp-0 z)) + (v1-4 gp-0) + ) + (/ f0-5 (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z))))) + ) + ) + ) + ) + (f30-0 + (if (>= f0-7 0.0) + (+ (* f0-7 (-> self control current-surface seek0)) (* (- 1.0 f0-7) (-> self control current-surface seek90))) + (+ (* (fabs f0-7) (-> self control current-surface seek180)) + (* (+ 1.0 f0-7) (-> self control current-surface seek90)) + ) + ) + ) + (f28-0 (cond + ((-> self board stick-off) + 0.0 + ) + ((= (-> self control ground-pat mode) (pat-mode halfpipe)) + 1.0 + ) + (*target-rc-board-controls* + 1.0 + ) + ((< (-> gp-0 z) 0.0) + (fmax 0.75 (-> self control turn-to-magnitude)) + ) + (else + (-> self control turn-to-magnitude) + ) + ) + ) + ) + (when (not (or (= (-> self control current-surface vel-turn) 0.0) (< (-> gp-0 z) 0.0))) + (let ((f0-22 (atan (-> gp-0 x) (-> gp-0 z)))) + (vector-rotate-y! gp-0 gp-0 (fmin + (* 0.03 (-> self clock time-adjust-ratio) (- f0-22)) + (* (-> self control current-surface vel-turn) (seconds-per-frame)) + ) + ) + ) + ) + (let* ((f0-28 (* f30-0 (-> self board thrust-scale) (lerp-scale 0.4 1.0 f28-0 0.3 1.0))) + (f1-22 (-> self control current-surface target-speed)) + (f1-23 + (if (< (-> self control local-slope-z) 0.0) + (+ f1-22 (* (- (-> self control local-slope-z)) (-> self control current-surface slope-down-factor))) + (+ f1-22 (* (- (-> self control local-slope-z)) (-> self control current-surface slope-up-factor))) + ) + ) + ) + (when (-> self board stick-off) + (set! f0-28 0.0) + (set! f1-23 0.0) + ) + (when (and (not (time-elapsed? (-> self control last-time-touching-actor) (seconds 1))) + (>= f28-0 0.5) + (< (vector-dot (-> self control wall-contact-normal) (-> self control to-target-pt-xz)) -0.7) + (logtest? (-> self control mod-surface flags) (surface-flag air)) + (< 0.0 (-> gp-0 y)) + ) + (cond + ((and (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.1)) + (< 0.3 (-> self control blocked-factor)) + ) + (set! f0-28 f1-23) + ) + ((< (-> gp-0 z) 0.0) + (set! (-> gp-0 z) 0.0) + ) + ) + ) + (+! (-> gp-0 z) (* f0-28 (seconds-per-frame))) + (when (!= f1-23 0.0) + (let ((f0-33 (- 1.0 (/ (* f30-0 (seconds-per-frame)) f1-23)))) + (set! (-> gp-0 x) (* (-> gp-0 x) f0-33)) + (set! (-> gp-0 z) (* (-> gp-0 z) f0-33)) + ) + ) + (set! (-> self board transv-max) f1-23) + ) + ) + (let ((f0-35 (-> self control current-surface transv-max)) + (v1-87 gp-0) + ) + (if (>= (sqrtf (+ (* (-> v1-87 x) (-> v1-87 x)) (* (-> v1-87 z) (-> v1-87 z)))) f0-35) + (vector-xz-normalize! gp-0 f0-35) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-matrix*! s5-0 gp-0 (-> self control c-R-w)) + (vector-float*! s5-0 s5-0 0.5) + (vector+! s5-0 s5-0 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + s5-0 + (meters 0.2) + "ltransv" + (the-as rgba (new 'static 'rgba :g #xff :a #x80)) + ) + (set! (-> s5-0 quad) (-> self control btransv quad)) + (vector-float*! s5-0 s5-0 0.5) + (vector+! s5-0 s5-0 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + s5-0 + (meters 0.2) + "btransv" + (the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + ) + ) + ) + 0 + (none) + ) + +(defun segment-array-vector->index ((arg0 (inline-array vector)) (arg1 int) (arg2 float) (arg3 float)) + (let ((gp-0 -1) + (f30-0 0.0) + (f0-0 0.0) + ) + (while (< (+ gp-0 1) arg1) + (+! gp-0 1) + (set! f30-0 (vector-segment-overlap (the-as vector arg2) (-> arg0 gp-0) (-> arg0 (+ gp-0 1)))) + (set! f0-0 (/ arg3 (vector-vector-distance (-> arg0 gp-0) (-> arg0 (+ gp-0 1))))) + (if (>= 1.0 (+ f30-0 f0-0)) + (return (+ (the float gp-0) f30-0 f0-0)) + ) + ) + (+ (the float gp-0) f30-0 f0-0) + ) + ) + +(defun segment-array-index->vector ((arg0 (inline-array vector)) (arg1 int) (arg2 float) (arg3 vector)) + (let ((v0-0 (the int arg2))) + (let* ((f0-2 arg2) + (f0-4 (- f0-2 (the float (the int f0-2)))) + ) + (when (>= v0-0 arg1) + (set! v0-0 (+ arg1 -1)) + (set! f0-4 (- arg2 (the float v0-0))) + ) + (let ((v1-5 (-> arg0 v0-0)) + (a1-3 (-> arg0 (+ v0-0 1))) + ) + (vector+float*! arg3 v1-5 (vector-! (new 'stack-no-clear 'vector) a1-3 v1-5) f0-4) + ) + ) + v0-0 + ) + ) + +(defbehavior target-board-exit-check target () + (if (and (or (and (cpad-pressed? (-> self control cpad number) r2) + (or (!= *cheat-mode* 'debug) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) + ) + (not *pause-lock*) + (!= (-> *setting-control* user-current board) 'force) + ) + (or (logtest? (target-flags prevent-board) (-> self target-flags)) + (not (logtest? (logand (game-feature board) (-> *setting-control* user-current features)) (-> self game features)) + ) + ) + ) + (and (not (focus-test? self dead grabbed)) + (time-elapsed? (-> self board board-get-on-time) (seconds 1)) + (< (-> self board board-get-on-time) + (max (-> self control list-time-on-ground) (-> self control last-time-of-stuck)) + ) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-grab))) + ) + ) + (go target-board-get-off (process->handle self) #f) + ) + 0 + (none) + ) + +(defbehavior target-board-trail target () + (when (and (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> self game features) + ) + (-> *setting-control* user-current board-trail) + (focus-test? self board) + (< 0.0 (-> self fact eco-green)) + ) + (target-board-green-eco-attack #f) + (target-board-green-eco-use 0.075) + ) + 0 + (none) + ) + +(defbehavior target-board-effect target () + (let ((gp-0 0)) + (cond + ((focus-test? self rail) + (set! gp-0 10) + ) + ((= (-> self control mod-surface name) 'spin) + (set! gp-0 3) + ) + ((and (-> self next-state) (= (-> self next-state name) 'target-board-flip)) + (set! gp-0 4) + ) + ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (set! gp-0 1) + ) + ((not (logtest? (-> self control status) (collide-status on-surface))) + (set! gp-0 2) + ) + ) + (if (board-on-ground?) + (seek! (-> self board sound-air-knob) 0.0 (* 16.0 (seconds-per-frame))) + (seek! + (-> self board sound-air-knob) + (lerp-scale 0.0 1.0 (target-height-above-ground) 409.6 28672.0) + (* 2.0 (seconds-per-frame)) + ) + ) + (let ((f30-0 (fabs (/ (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames))))) + (seek! (-> self board sound-bank-knob) f30-0 (if (< (-> self board sound-bank-knob) f30-0) + (* 0.5 (seconds-per-frame)) + (seconds-per-frame) + ) + ) + (set! (-> self board engine-sound-volume) (lerp-scale 0.8 1.0 f30-0 0.0 1.0)) + ) + (set! (-> self board engine-sound-pitch) + (+ (lerp-scale 0.0 -0.1 (-> self board sound-bank-knob) 0.0 1.0) + (lerp-scale -0.15 0.0 (-> self board shock-offset) -3072.0 52.0192) + ) + ) + (set! (-> self board bank-sound-volume) (lerp-scale 0.0 1.0 (-> self board sound-bank-knob) 0.0 1.0)) + (set! (-> self board bank-sound-pitch) (lerp-scale 0.0 -0.2 (-> self board sound-bank-knob) 0.0 1.0)) + 0 + (let ((f0-25 (-> self board sound-air-knob))) + (if (< 0.0 f0-25) + (set! (-> self board engine-sound-volume) (lerp-scale (-> self board engine-sound-volume) 0.3 f0-25 0.0 1.0)) + ) + ) + (let ((t9-12 sound-play-by-spec) + (a0-18 (static-sound-spec "board-steady" :group 1 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-18 volume) (the int (* 1024.0 (-> self board engine-sound-volume)))) + (set! (-> a0-18 pitch-mod) (the int (* 1524.0 (-> self board engine-sound-pitch)))) + (set! (-> a0-18 reg 0) (the-as uint gp-0)) + (t9-12 a0-18 (-> self board engine-sound-id) (the-as vector #t)) + ) + (if (< (-> self board bank-sound-volume) 0.1) + (sound-stop (-> self board bank-sound-id)) + (sound-play-by-name + (static-sound-name "board-bank") + (-> self board bank-sound-id) + (the int (* 1024.0 (-> self board bank-sound-volume))) + (the int (* 1524.0 (-> self board bank-sound-pitch))) + 0 + (sound-group) + #t + ) + ) + (let ((t9-15 sound-play-by-spec) + (a0-23 (static-sound-spec "board-wind" :group 1 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-23 volume) (the int (-> self board wind-sound-volume))) + (set! (-> a0-23 pitch-mod) (the int (-> self board wind-sound-pitch))) + (set! (-> a0-23 reg 0) (the-as uint gp-0)) + (t9-15 a0-23 (-> self board wind-sound-id) (the-as vector #t)) + ) + ) + (cond + ((= (-> self control mod-surface name) 'spin) + (seek! + (-> self board spin-sound-volume) + (lerp-scale 0.0 1.0 (fabs (-> self board rotyv)) 0.0 91022.22) + (* 8.0 (seconds-per-frame)) + ) + (seek! + (-> self board spin-sound-pitch) + (lerp-scale 0.0 0.3 (fabs (-> self board rotyv)) 36408.89 91022.22) + (seconds-per-frame) + ) + (when *sound-player-enable* + (let ((v1-89 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-89 command) (sound-command set-param)) + (set! (-> v1-89 id) (-> self board spin-sound-id)) + (set! (-> v1-89 params volume) (the int (* 1024.0 (-> self board spin-sound-volume)))) + (set! (-> v1-89 params mask) (the-as uint 1)) + (-> v1-89 id) + ) + ) + ) + (else + (set! (-> self board spin-sound-volume) 0.0) + ) + ) + (when (and (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> self game features) + ) + (and (-> *setting-control* user-current board-trail) + (focus-test? self board) + (< 0.0 (-> self fact eco-green)) + ) + ) + (seek! (-> self board eco-sound-volume) 1.0 (seconds-per-frame)) + (let ((t9-22 sound-play-by-spec) + (a0-43 (static-sound-spec "eco-loop" :group 1 :volume 0.0)) + ) + (set! (-> a0-43 volume) (the int (* 1024.0 (-> self board eco-sound-volume)))) + (t9-22 a0-43 (-> self board eco-sound-id) (the-as vector #t)) + ) + ) + (when (and (< (* (-> self board turn-anim-frame) (-> self board unk-float001)) 0.0) + (time-elapsed? (-> self board adjust-time) (seconds 0.5)) + ) + (set-time! (-> self board adjust-time)) + (sound-play "board-adjust") + ) + (if (!= (-> self board upper-body-rotyv) 0.0) + (mode-set! (-> self board upper-body) (joint-mod-mode rotate)) + ) + (when (= (-> self board upper-body mode) (joint-mod-mode rotate)) + (set! (-> self board upper-body-rotyv) + (* 0.95 (fmax + (fmin (-> self board upper-body-rotyv) (-> self board upper-body-rotyv-max)) + (- (-> self board upper-body-rotyv-max)) + ) + ) + ) + (+! (-> self board upper-body-rotyv) (* -10.0 (seconds-per-frame) (-> self board upper-body-roty))) + (let ((f1-25 (* (-> self board upper-body-rotyv) (seconds-per-frame))) + (f0-74 (-> self board upper-body-roty)) + ) + (+! (-> self board upper-body-roty) f1-25) + (when (< (* f0-74 (-> self board upper-body-roty)) 0.0) + (set! (-> self board upper-body-roty) 0.0) + (set! (-> self board upper-body-rotyv) 0.0) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + ) + ) + (twist-set! (-> self board upper-body) (the-as float #f) (-> self board upper-body-roty) (the-as float #f)) + ) + (when (and (board-on-ground?) + (not (or (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2)) + (zero? (-> self skel active-channels)) + ) + ) + ) + (spawn (-> self board effect-part) (-> self control trans)) + (do-effect (-> self skel effect) (the-as symbol "effect-board-poof") 0.0 -1) + (if (< (-> self board shock-offset) -2048.0) + (do-effect (-> self skel effect) (the-as symbol "effect-board-poof") 0.0 -1) + ) + ) + (vector-lerp! (-> self board slow-transv) (-> self board slow-transv) (-> self control transv) 0.2) + (if (< (-> self board slow-transv y) 0.0) + (set! (-> self board slow-transv y) 0.0) + ) + (if (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> self game features) + ) + (target-board-trail) + ) + (none) + ) + +(defbehavior target-board-physics target ((arg0 vector)) + (let ((f30-0 0.5)) + (if (time-elapsed? (-> self board unk-time-frame01) (seconds 0.3)) + (+! (-> self board shock-offsetv) (* (- (-> arg0 y) (-> self control transv y)) f30-0)) + (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + ) + (+! (-> self board shock-offsetv) + (+ (* -10.0 (seconds-per-frame) (-> self board shock-offset)) + (if (board-on-ground?) + (* (-> self control dynam gravity-length) (seconds-per-frame) f30-0) + 0.0 + ) + ) + ) + ) + (cond + ((= (-> self control mod-surface mode) 'ride) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self board shock-offset) (* 0.96 (-> self board shock-offset))) + ) + ((and (or (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.2))) + (< (-> self board shock-offset) 0.0) + ) + (!= (-> self control mod-surface mode) 'air) + ) + (+! (-> self board shock-offset) (* (-> self board shock-offsetv) (seconds-per-frame))) + ) + ) + (set! (-> self board shock-offset) + (* (-> self board shock-offset) (lerp-scale 0.99 0.98 (-> self control ctrl-xz-vel) 0.0 28672.0)) + ) + (cond + ((< 40960.0 (-> self board shock-offset)) + (set! (-> self board shock-offset) 40960.0) + (set! (-> self board shock-offsetv) 0.0) + ) + ((< (-> self board shock-offset) -3072.0) + (when (< (-> self board shock-offsetv) -12288.0) + (case (-> self control ground-pat material) + (((pat-material waterbottom)) + (let ((gp-1 (sound-play "swim-enter" :pitch -0.5)) + (v1-62 (the-as sound-rpc-set-param (get-sound-buffer-entry))) + ) + (set! (-> v1-62 command) (sound-command set-param)) + (set! (-> v1-62 id) gp-1) + (set! (-> v1-62 params volume) -4) + (set! (-> v1-62 params fo-curve) 1) + (set! (-> v1-62 auto-time) 480) + (set! (-> v1-62 auto-from) 2) + (set! (-> v1-62 params mask) (the-as uint 273)) + (-> v1-62 id) + ) + ) + (else + (sound-play-by-name + (static-sound-name "board-bounce") + (new-sound-id) + (the int (* 1024.0 (lerp-scale 1.0 0.3 (-> self board shock-offsetv) -40960.0 -12288.0))) + 0 + 0 + (sound-group) + #t + ) + ) + ) + ) + (set! (-> self board shock-offset) -3072.0) + (set! (-> self board shock-offsetv) 0.0) + (cond + ((logtest? (-> *part-group-id-table* 23 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-3 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-3 + (let ((t9-9 (method-of-type part-tracker-subsampler activate))) + (t9-9 (the-as part-tracker-subsampler gp-3) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-10 run-function-in-process) + (a0-31 gp-3) + (a1-8 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 23)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-10) a0-31 a1-8 *part-tracker-subsampler-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-4 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-4 + (let ((t9-12 (method-of-type part-tracker activate))) + (t9-12 (the-as part-tracker gp-4) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-13 run-function-in-process) + (a0-37 gp-4) + (a1-11 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 23)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-13) a0-37 a1-11 *part-tracker-params-default*) + ) + (-> gp-4 ppointer) + ) + ) + ) + ) + ) + ) + (set! (-> self control draw-offset y) + (+ (-> self board cushion-base) (-> self board cushion-offset) (-> self board shock-offset)) + ) + (if (< (-> self control draw-offset y) 0.0) + (set! (-> self control draw-offset y) 0.0) + ) + 0 + (none) + ) + +(defbehavior target-board-collision target () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control transv quad)) + (when (focus-test? self halfpipe) + (when (-> self control unknown-spool-anim00) + *edge-grab-info* + (let ((v1-9 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control edge-grab-across-edge-dir) (-> self control transv))) + ) + 0.0 + (vector-! + v1-9 + (-> self control transv) + (vector-float*! v1-9 (-> self control edge-grab-across-edge-dir) f0-1) + ) + (let* ((f1-2 (vector-length v1-9)) + (f2-0 f1-2) + ) + (if (< 0.0 f0-1) + (set! f0-1 -2048.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control edge-grab-across-edge-dir) f0-1) + (vector-float*! v1-9 v1-9 (/ f1-2 f2-0)) + ) + ) + ) + ) + ) + (let ((a2-6 (new 'stack-no-clear 'collide-query)) + (v1-10 (-> self control)) + ) + (set! (-> a2-6 collide-with) (-> v1-10 root-prim prim-core collide-with)) + (set! (-> a2-6 ignore-process0) self) + (set! (-> a2-6 ignore-process1) #f) + (set! (-> a2-6 ignore-pat) (-> v1-10 pat-ignore-mask)) + (set! (-> a2-6 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-10 (-> v1-10 transv) a2-6 (meters 1)) + ) + (when (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (= (-> self ext-anim) (target-anim board)) + ) + (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one)) + (set! (-> *collide-edge-board-spec* touching-segment) #f) + (target-method-28 *target* *collide-cache* *collide-edge-board-spec*) + ) + (target-board-physics gp-0) + (deg-diff (vector-y-angle gp-0) (vector-y-angle (-> self control transv))) + (let* ((v1-25 gp-0) + (f30-0 (sqrtf (+ (* (-> v1-25 x) (-> v1-25 x)) (* (-> v1-25 z) (-> v1-25 z))))) + ) + (when (and (logtest? (-> self control status) (collide-status touch-wall)) + (and (< 16384.0 f30-0) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-smack))) + (not (focus-test? self halfpipe)) + (!= (-> self control ground-pat mode) 3) + (time-elapsed? (-> self board halfpipe-time) (seconds 0.1)) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> self control wall-contact-normal quad)) + (vector-normalize! s5-1 1.0) + (let ((s3-0 (vector-reflect! (new 'stack-no-clear 'vector) gp-0 s5-1)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-1 quad) (-> self control c-R-w fvec quad)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (set! (-> s4-1 y) 0.0) + (vector-normalize! s4-1 1.0) + (let ((f0-11 (y-angle (-> self control)))) + (deg-diff f0-11 (vector-y-angle s3-0)) + ) + (let ((s2-1 (vector-matrix*! (new 'stack-no-clear 'vector) (-> self control transv) (-> self control w-R-c))) + (s3-1 (vector-matrix*! (new 'stack-no-clear 'vector) s3-0 (-> self control w-R-c))) + ) + (logior! (-> self control status) (collide-status glance)) + (set-time! (-> self board glance-time)) + (let ((v1-64 s2-1)) + (set! (-> self board glance-speed) (sqrtf (+ (* (-> v1-64 x) (-> v1-64 x)) (* (-> v1-64 z) (-> v1-64 z))))) + ) + (set! (-> self board glance-normal quad) (-> s5-1 quad)) + (set! (-> self board glance-in-transv quad) (-> gp-0 quad)) + (set! (-> s3-1 y) (-> s2-1 y)) + (vector-xz-normalize! s3-1 (-> self board glance-speed)) + (vector-matrix*! (-> self control transv) s3-1 (-> self control c-R-w)) + ) + (set! (-> self board glance-out-transv quad) (-> self control transv quad)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (when (and (< (vector-dot s4-1 s5-1) -0.77) (not (logtest? (-> self focus-status) (focus-status dead hit)))) + (cond + ((not (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + ) + (if (< 32768.0 f30-0) + (sound-play "board-glance") + ) + (go target-board-turn-to (-> self control transv) (seconds 0.2)) + ) + (else + (set! (-> self control turn-lockout-end-time) + (the-as time-frame (max (+ (current-time) (seconds 0.1)) (-> self control turn-lockout-end-time))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'collide-query))) + (let ((v1-103 gp-3)) + (set! (-> v1-103 radius) 1638.4) + (set! (-> v1-103 collide-with) + (logclear (-> self control root-prim prim-core collide-with) (collide-spec crate)) + ) + (set! (-> v1-103 ignore-process0) self) + (set! (-> v1-103 ignore-process1) #f) + (set! (-> v1-103 ignore-pat) (-> self control pat-ignore-mask)) + (set! (-> v1-103 action-mask) (collide-action solid)) + ) + (vector+float*! (-> gp-3 start-pos) (-> self control trans) (-> self control c-R-w fvec) 10240.0) + (vector+float*! (-> gp-3 start-pos) (-> gp-3 start-pos) (-> self control dynam gravity-normal) 8192.0) + (vector-float*! (-> gp-3 move-dist) (-> self control dynam gravity-normal) -49152.0) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-3) 0.0) + (set! (-> self board probe-intersect quad) (-> gp-3 best-other-tri intersect quad)) + (set! (-> self board probe-normal quad) (-> gp-3 best-other-tri normal quad)) + (set! (-> self board probe-pat) (-> gp-3 best-other-tri pat)) + (set! (-> self board probe) #t) + ) + (else + (set! (-> self board probe) #f) + ) + ) + ) + (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) + ) + (set-time! (-> self control last-time-of-stuck)) + ) + 0 + (none) + ) + +(defbehavior target-board-joint-points target () + (when (-> self board board) + (let ((a1-0 (-> self node-list data 37 bone transform))) + (matrix->transformq (the-as transformq (-> self board board-trans)) a1-0) + ) + (set! (-> self board board-scale quad) (-> self control scale quad)) + (let ((a0-4 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *board-shadow-control* settings shadow-dir quad) a0-4) + ) + ) + 0 + (none) + ) + +(defbehavior target-board-pre-move target () + (cond + ((and (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (begin + (set-time! (-> self board in-air-time)) + (and (not (and (-> self next-state) + (let ((v1-12 (-> self next-state name))) + (or (= v1-12 'target-board-stance) (= v1-12 'target-board-duck-stance) (= v1-12 'target-board-turn-to)) + ) + ) + ) + (and (or (and (or (< 20480.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + ) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (< (-> self control gspot-slope-z) 0.0) + ) + (or (not (or (= (-> self control gspot-pat-surfce mode) (pat-mode ground)) + (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + ) + ) + (or (= (-> self control gspot-pat-surfce event) (pat-event rail)) + (and (logtest? (-> self water flags) (water-flag active)) + (< (-> self control gspot-pos y) (-> self water surface-height)) + ) + (and (and (-> self next-state) + (let ((v1-53 (-> self next-state name))) + (or (= v1-53 'target-board-hold) (= v1-53 'target-board-trickx) (= v1-53 'target-board-tricky)) + ) + ) + (not (logtest? (focus-status halfpipe) (-> self focus-status))) + ) + (and (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + (and (< (fabs (vector-dot (-> self control gspot-normal) (-> self control dynam gravity-normal))) 0.7) + (not (logtest? (focus-status halfpipe) (-> self focus-status))) + ) + ) + ) + ) + ) + (time-elapsed? (-> self board last-jump-time) (seconds 0.2)) + ) + ) + ) + ) + (set! (-> self control bend-speed) 0.0) + (set! (-> self control bend-target) 0.0) + ) + (else + (set! (-> self control bend-speed) 1024.0) + (set! (-> self control bend-target) 1.0) + (when (not (time-elapsed? (-> self board last-jump-time) (seconds 0.1))) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + (-> self control gspot-normal) + ) + (quaternion-slerp! + (-> self control quat-for-control) + (-> self control quat-for-control) + (-> self control dir-targ) + 0.1 + ) + ) + ) + ) + (if (and (cpad-hold? (-> self control cpad number) square) (not (-> self board ride-lock))) + (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) + (logclear! (-> self control root-prim prim-core action) (collide-action check-edge)) + ) + (if (not (cpad-hold? (-> self control cpad number) square)) + (set! (-> self board ride-lock) #f) + ) + (cond + ((and (-> self next-state) (let ((v1-121 (-> self next-state name))) + (or (= v1-121 'target-board-get-on) (= v1-121 'target-board-get-off)) + ) + ) + ) + ((and (-> self next-state) + (let ((v1-126 (-> self next-state name))) + (or (= v1-126 'target-board-trickx) (= v1-126 'target-board-tricky) (= v1-126 'target-board-hold)) + ) + ) + (seek! (-> self control dynam gravity-length) 245760.0 (* 30.0 (seconds-per-frame))) + ) + ((= (-> self control mod-surface name) 'spin) + (set! (-> self control dynam gravity-length) + (lerp-scale 245760.0 204800.0 (fabs (-> self board rotyv)) 0.0 145635.56) + ) + ) + ((and (-> self next-state) (= (-> self next-state name) 'target-board-halfpipe)) + (if (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self control dynam gravity-length) 163840.0) + ) + ) + ((and (-> self next-state) + (let ((v1-159 (-> self next-state name))) + (or (= v1-159 'target-board-stance) (= v1-159 'target-board-duck-stance) (= v1-159 'target-board-turn-to)) + ) + ) + (cond + (#f + (set! (-> self control dynam gravity-length) 245760.0) + ) + ((time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) + (seek! (-> self control dynam gravity-length) 245760.0 (* 245760.0 (seconds-per-frame))) + ) + (else + (set! (-> self control dynam gravity-length) 81920.0) + ) + ) + ) + (else + (set! (-> self control dynam gravity-length) 245760.0) + ) + ) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (if (< (-> self control force-turn-to-strength) 0.0) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> self control cpad stick0-speed))) + ) + (when (and (-> self board probe) (not (logtest? (focus-status halfpipe) (-> self focus-status)))) + (let ((f30-0 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self board probe-intersect) (-> self control trans)) + ) + ) + (f26-0 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self board probe-intersect) (-> self control gspot-pos)) + ) + ) + (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (let ((f0-36 + (* (-> self control local-slope-z) + (vector-length + (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self board probe-intersect)) + (-> self control standard-dynamics gravity-normal) + ) + ) + ) + ) + ) + (when (and (= (-> self board probe-pat mode) (pat-mode ground)) + (!= (-> self board probe-pat event) 13) + (time-elapsed? (-> self board unk-time-frame01) (seconds 0.2)) + (< 819.2 (- f30-0 f0-36)) + (or (< (-> self board jump-end-time) (-> self control last-time-on-surface)) + (not (time-elapsed? (-> self board jump-end-time) (seconds 0.2))) + ) + (< 0.98 (vector-dot (-> self board probe-normal) (-> self control standard-dynamics gravity-normal))) + (< f26-0 8192.0) + (< f30-0 8192.0) + (or (< (* 0.2 f28-0) f30-0) (not (time-elapsed? (-> self board last-jump-time) (seconds 0.1)))) + ) + (vector+float*! + (-> self control transv) + (-> self control transv) + (-> self control dynam gravity-normal) + (* 7.0 (fmin 4096.0 f30-0)) + ) + (if (time-elapsed? (-> self board last-jump-time) (seconds 0.1)) + (set-time! (-> self board jump-end-time)) + ) + (set-time! (-> self board last-jump-time)) + ) + ) + (when (and (not (logtest? (-> self control status) (collide-status on-surface))) + (< 0.0 f28-0) + (or (and (or (< (target-height-above-ground) 4096.0) + (not (time-elapsed? (-> self board last-jump-time) (seconds 0.1))) + ) + (< 8192.0 (- f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self board slow-transv)))) + ) + (not (time-elapsed? (-> self board unk-time-frame01) (seconds 0.1))) + ) + (>= 204.8 f30-0) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-jump))) + ) + (set-time! (-> self board unk-time-frame01)) + (vector-length (-> self control transv)) + (let ((v1-303 (new-stack-vector0)) + (f0-51 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-303 + (-> self control transv) + (vector-float*! v1-303 (-> self control dynam gravity-normal) f0-51) + ) + (let* ((f1-24 (vector-length v1-303)) + (f2-0 f1-24) + (f0-52 (* 0.9 f0-51)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-52) + (vector-float*! v1-303 v1-303 (/ f1-24 f2-0)) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-board-real-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (target-board-pre-move) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (when (-> self board stick-off) + (let ((f0-5 0.0)) + (set! (-> self control cpad stick0-speed) f0-5) + (set! (-> self control pad-magnitude) f0-5) + ) + ) + (when *target-rc-board-controls* + (vector-rotate-y! + s5-0 + (-> self control c-R-w fvec) + (* -42.666668 (+ -128.0 (the float (-> self control cpad leftx)))) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> self control trans) + s5-0 + (meters 2) + (the-as rgba (new 'static 'rgba :g #xff :a #x80)) + ) + ) + (turn-to-vector s5-0 (-> self control pad-magnitude)) + ) + (if (and (= (-> self control pad-magnitude) 0.0) + (>= (current-time) (-> self control turn-lockout-end-time)) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) + (time-elapsed? (-> self board last-jump-time) (seconds 0.1)) + ) + (rot->dir-targ! (-> self control)) + ) + (when (and (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1))) + (>= (current-time) (-> self control turn-lockout-end-time)) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) + (time-elapsed? (-> self board last-jump-time) (seconds 0.1)) + ) + (let* ((s3-0 + (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal)) + (-> self control local-normal) + ) + ) + (a2-4 + (forward-up-nopitch->quaternion + (new 'stack-no-clear 'quaternion) + s3-0 + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + ) + ) + (quaternion-slerp! + (-> self control dir-targ) + (-> self control dir-targ) + a2-4 + (* 0.05 (fabs (-> self control ctrl-slope-heading))) + ) + ) + ) + (if (cpad-pressed? (-> self control cpad number) l1) + (set-time! (-> self board duck-start-time)) + ) + (if (cpad-pressed? (-> self control cpad number) l2) + (set-time! (-> self board l2-start-time)) + ) + (board-add-thrust) + (add-gravity) + (cond + ((= (-> self control mod-surface name) 'spin) + (set! (-> self board rotyv) + (* 0.95 (fmax (fmin (-> self board rotyv) (-> self board rotyv-max)) (- (-> self board rotyv-max)))) + ) + (let ((f0-15 (* (-> self board rotyv) (seconds-per-frame)))) + (set! (-> self board roty) (the float (sar (shl (the int (+ (-> self board roty) f0-15)) 48) 48))) + (set! (-> self board unk-deg00) (-> self board roty-cum)) + (+! (-> self board roty-cum) f0-15) + ) + (seek! (-> self board rotyv-max) 91022.22 (* 91022.22 (seconds-per-frame))) + (mode-set! (-> self board main) (joint-mod-mode rotate)) + (twist-set! (-> self board main) (the-as float #f) (-> self board roty) (the-as float #f)) + (mode-set! (-> self board board 0 main) (joint-mod-mode rotate)) + (twist-set! (-> self board board 0 main) (the-as float #f) (-> self board roty) (the-as float #f)) + ) + (else + (cond + ((!= (-> self board main mode) (joint-mod-mode flex-blend)) + (let ((f0-24 (fabs (-> self board roty-cum)))) + (cond + ((>= f0-24 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-spin) 4000.0) + ) + ((>= f0-24 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-spin) 2000.0) + ) + ((>= f0-24 49152.0) + (add-to-trick-list (-> self board) (board-tricks board-spin) 500.0) + ) + ) + ) + (let ((v1-142 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-142 command) (sound-command set-param)) + (set! (-> v1-142 id) (-> self board spin-sound-id)) + (set! (-> v1-142 params volume) -4) + (set! (-> v1-142 auto-time) 120) + (set! (-> v1-142 auto-from) 2) + (set! (-> v1-142 params mask) (the-as uint 17)) + (-> v1-142 id) + ) + (set! (-> self board spin-sound-id) (new 'static 'sound-id)) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board board 0 main) (joint-mod-mode flex-blend)) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (set! (-> s5-3 quad) (-> self node-list data 3 bone transform fvec quad)) + (vector-rotate-y! s5-3 s5-3 15109.688) + (if (not (and (-> self next-state) + (let ((v1-160 (-> self next-state name))) + (or (= v1-160 'target-board-flip) + (= v1-160 'target-board-hold) + (= v1-160 'target-board-trickx) + (= v1-160 'target-board-tricky) + ) + ) + ) + ) + (forward-up-nopitch->quaternion + (-> self control quat-for-control) + s5-3 + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + ) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self board upper-body-rotyv) (-> self board rotyv)) + (set! (-> self board roty) 0.0) + (set! (-> self board rotyv) 0.0) + ) + ((and (= (-> self control danger-mode) 'board-spin) + (or (board-on-ground?) (time-elapsed? (-> self board spin-time) (seconds 0.5))) + ) + (target-danger-set! 'harmless #f) + ) + ) + (when (board-on-ground?) + (set! (-> self board spin-control) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board unk-float005) 0.0) + (set! (-> self board unk-float006) 0.0) + (set! (-> self board unk-float007) 0.0) + (set! (-> self board ride-rot-old) -1.0) + ) + ) + ) + (cond + ((and (cpad-pressed? (-> self control cpad number) l1) + (logtest? (game-feature board-launch) (-> self game features)) + ) + (set-time! (-> self board charge-start-time)) + ) + ((and (cpad-hold? (-> self control cpad number) l1) + (logtest? (game-feature board-launch) (-> self game features)) + ) + (when (board-on-ground?) + (set-time! (-> self board charge-time)) + (seek! + (-> self board charge-progress) + 1.0 + (* (/ 300.0 (the float (-> *TARGET_BOARD-bank* charge-jump-time))) (seconds-per-frame)) + ) + ) + (sound-play-by-name + (static-sound-name "board-charge") + (-> self board charge-sound-id) + (the int (* 1024.0 (-> self board charge-progress))) + 0 + 0 + (sound-group) + (-> self control trans) + ) + ) + ((!= (-> self board charge-progress) 0.0) + (seek! + (-> self board charge-progress) + 0.0 + (* (/ 300.0 (the float (-> *TARGET_BOARD-bank* charge-jump-fade-time))) (seconds-per-frame)) + ) + (if (= (-> self board charge-progress) 0.0) + (sound-stop (-> self board charge-sound-id)) + ) + ) + ) + (if (and (!= (-> self board charge-progress) 0.0) + (not (or (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2)) + (zero? (-> self skel active-channels)) + ) + ) + ) + (spawn + (-> self board charge-part) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg board)) + ) + ) + (cond + ((and (cpad-pressed? (-> self control cpad number) circle) + (time-elapsed? + (-> self board zap-start-time) + (+ (-> *TARGET_BOARD-bank* zap-duration) (-> *TARGET_BOARD-bank* zap-reset-time)) + ) + (not (-> self control danger-mode)) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (and (-> self next-state) (let ((v1-275 (-> self next-state name))) + (or (= v1-275 'target-board-get-on) (= v1-275 'target-board-get-off)) + ) + ) + ) + (not (logtest? (-> self focus-status) (focus-status dead hit grabbed))) + ) + (let ((s5-6 (matrix-identity! (new 'stack-no-clear 'matrix)))) + (sound-play "board-zap") + (target-start-attack) + (target-danger-set! 'board-zap #f) + (set-time! (-> self board zap-start-time)) + (matrix-identity! s5-6) + (vector<-cspace! (-> s5-6 trans) (joint-node jakb-lod0-jg board)) + ) + (cond + ((and (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> self game features) + ) + (-> *setting-control* user-current board-trail) + (focus-test? self board) + (< 0.0 (-> self fact eco-green)) + ) + (cond + ((logtest? (-> *part-group-id-table* 187 flags) (sp-group-flag sp13)) + (let ((s5-7 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-7 + (let ((t9-52 (method-of-type part-tracker-subsampler activate))) + (t9-52 (the-as part-tracker-subsampler s5-7) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-53 run-function-in-process) + (a0-113 s5-7) + (a1-46 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 187)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 37) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-53) a0-113 a1-46 *part-tracker-subsampler-params-default*) + ) + (-> s5-7 ppointer) + ) + ) + ) + (else + (let ((s5-8 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-8 + (let ((t9-55 (method-of-type part-tracker activate))) + (t9-55 (the-as part-tracker s5-8) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-56 run-function-in-process) + (a0-116 s5-8) + (a1-49 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 187)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 37) + ((the-as (function object object object none) t9-56) a0-116 a1-49 *part-tracker-params-default*) + ) + (-> s5-8 ppointer) + ) + ) + ) + ) + (target-board-green-eco-attack #t) + (target-board-green-eco-use 5.0) + ) + ((logtest? (-> *part-group-id-table* 188 flags) (sp-group-flag sp13)) + (let ((s5-9 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-9 + (let ((t9-60 (method-of-type part-tracker-subsampler activate))) + (t9-60 (the-as part-tracker-subsampler s5-9) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-61 run-function-in-process) + (a0-121 s5-9) + (a1-52 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 188)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 37) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-61) a0-121 a1-52 *part-tracker-subsampler-params-default*) + ) + (-> s5-9 ppointer) + ) + ) + ) + (else + (let ((s5-10 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-10 + (let ((t9-63 (method-of-type part-tracker activate))) + (t9-63 (the-as part-tracker s5-10) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-64 run-function-in-process) + (a0-124 s5-10) + (a1-55 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 188)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 37) + ((the-as (function object object object none) t9-64) a0-124 a1-55 *part-tracker-params-default*) + ) + (-> s5-10 ppointer) + ) + ) + ) + ) + (target-timed-invulnerable (-> *TARGET_BOARD-bank* zap-duration) self 2) + ) + ((and (-> self control danger-mode) + (time-elapsed? (-> self board zap-start-time) (-> *TARGET_BOARD-bank* zap-duration)) + ) + (target-danger-set! 'harmless #f) + ) + ) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (cond + ((and (-> self next-state) (= (-> self next-state name) 'target-board-get-off)) + (seek! (-> self board cushion-offset) 0.0 (* 20480.0 (seconds-per-frame))) + ) + ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (seek! + (-> self board cushion-offset) + (lerp-scale (-> *TARGET_BOARD-bank* cushion) 0.0 (target-height-above-ground) 0.0 12288.0) + (* 20480.0 (seconds-per-frame)) + ) + ) + ((focus-test? self on-water) + (seek! + (-> self board cushion-offset) + (+ 2048.0 (-> *TARGET_BOARD-bank* cushion)) + (* 20480.0 (seconds-per-frame)) + ) + ) + (else + (seek! (-> self board cushion-offset) (-> *TARGET_BOARD-bank* cushion) (* 8192.0 (seconds-per-frame))) + ) + ) + (target-board-collision) + (if (!= (-> self control bend-speed) 0.0) + (bend-gravity) + ) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (set-time! (-> self board board-time)) + (target-board-exit-check) + (target-board-effect) + (when (board-on-ground?) + (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + (set! (-> self board up-vector 0 quad) (-> self control local-normal quad)) + (if (= (-> self board roty-cum) 0.0) + (set! (-> self board ground-on-dir quad) (-> self node-list data 3 bone transform fvec quad)) + ) + ) + 0 + (none) + ) + +(defun probe-test ((arg0 control-info) (arg1 vector) (arg2 pat-surface)) + (dotimes (s3-0 3) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-2 (-> arg0 collision-spheres s3-0))) + (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) + (set! (-> s2-0 move-dist quad) (-> arg1 quad)) + (let ((a0-3 s2-0)) + (set! (-> a0-3 radius) (* 0.5 (-> v1-2 prim-core world-sphere w))) + (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) + (set! (-> a0-3 ignore-process0) (-> arg0 process)) + (set! (-> a0-3 ignore-process1) #f) + (set! (-> a0-3 ignore-pat) arg2) + (set! (-> a0-3 action-mask) (collide-action solid)) + ) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) + (return (if (= (-> s2-0 best-other-tri pat event) (pat-event rail)) + 'rail + #t + ) + ) + ) + ) + ) + #f + ) + +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +(defbehavior target-board-compute-edge target () + (local-vars (sv-752 int)) + (let ((s4-0 *edge-grab-info*) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self control transv quad)) + (when (not (edge-grab-info-method-9 s4-0)) + (format #t "exit update~%") + (send-event self 'end-mode 'ride #f) + (return (the-as time-frame #f)) + ) + (vector-normalize-copy! (-> self board ride-dir) (-> self board ride-segment) 1.0) + (when (time-elapsed? (-> self board ride-time) (seconds 0.2)) + (set! (-> self board ride-lock-on) #f) + (set-time! (-> self board ride-start-time)) + (vector-normalize-copy! (-> self board ride-dir) (-> self control transv) 1.0) + (dotimes (v1-26 3) + (vector-reset! (-> self board ride-vertex-old v1-26)) + ) + ) + (set! (-> self board ride-rot-abs 1) (-> self board ride-rot-abs 0)) + (let* ((f30-0 (deg- (vector-y-angle (-> self board ride-dir)) (-> self board ride-rot-abs 0))) + (f30-1 (* f30-0 (lerp-scale 10.0 100.0 (fabs f30-0) 1820.4445 3640.889))) + ) + (+! (-> self board ride-rotv-abs) (* f30-1 (seconds-per-frame))) + (set! (-> self board ride-rotv-abs) (* 0.9 (-> self board ride-rotv-abs))) + (+! (-> self board ride-rot-abs 0) (* (-> self board ride-rotv-abs) (seconds-per-frame))) + (when (>= 0.0 (* f30-1 (deg- (vector-y-angle (-> self board ride-dir)) (-> self board ride-rot-abs 0)))) + (set! (-> self board ride-rotv-abs) 0.0) + (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-dir))) + ) + ) + (set! (-> self control ground-pat) (-> s4-0 edge-tri-pat)) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (-> s4-0 world-vertex 1) + (the-as vector (-> s4-0 world-vertex)) + ) + 1.0 + ) + (set! (-> self control edge-grab-across-edge-dir quad) (-> s4-0 hanging-matrix rvec quad)) + (when (< (vector-dot (-> self control edge-grab-edge-dir) (-> self board ride-dir)) 0.0) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> s4-0 world-vertex 0 quad)) + (set! (-> s4-0 world-vertex 0 quad) (-> s4-0 world-vertex 1 quad)) + (set! (-> s4-0 world-vertex 1 quad) (-> s3-2 quad)) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (-> s4-0 world-vertex 1) + (the-as vector (-> s4-0 world-vertex)) + ) + 1.0 + ) + (set! (-> s3-2 quad) (-> s4-0 adjacent-edge-left-vertex quad)) + (set! (-> s4-0 adjacent-edge-left-vertex quad) (-> s4-0 adjacent-edge-right-vertex quad)) + (set! (-> s4-0 adjacent-edge-right-vertex quad) (-> s3-2 quad)) + ) + (let ((v1-70 (logtest? (-> s4-0 status) 2))) + (if (logtest? (-> s4-0 status) 1) + (logior! (-> s4-0 status) 2) + (logand! (-> s4-0 status) -3) + ) + (if v1-70 + (logior! (-> s4-0 status) 1) + (logand! (-> s4-0 status) -2) + ) + ) + ) + (dotimes (v1-75 3) + (set! (-> self board ride-vertex-old v1-75 quad) (-> self board ride-vertex v1-75 quad)) + ) + (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) + (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) + (set! (-> self board ride-vertex-length-old) (-> self board ride-vertex-length)) + (set! (-> self board ride-vertex 0 quad) (-> s4-0 world-vertex 0 quad)) + (set! (-> self board ride-vertex 1 quad) (-> s4-0 world-vertex 1 quad)) + (set! (-> self board ride-vertex 2 quad) (the-as uint128 0)) + (set! (-> self board ride-vertex-length) 1) + (cond + ((logtest? (-> s4-0 status) 2) + (vector-normalize! + (vector-! (-> self control unknown-vector35) (-> s4-0 adjacent-edge-right-vertex) (-> s4-0 world-vertex 1)) + 1.0 + ) + (set! (-> self board ride-vertex 2 quad) (-> s4-0 adjacent-edge-right-vertex quad)) + (+! (-> self board ride-vertex-length) 1) + 0 + ) + (else + (set! (-> self control unknown-vector35 quad) (the-as uint128 0)) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (let ((s3-3 0)) + (label cfg-26) + (set! (-> self board ride-vertex-index) + (segment-array-vector->index + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (the-as float (-> self control trans)) + 0.0 + ) + ) + (when (and (< (-> self board ride-vertex-index) 0.0) + (not (time-elapsed? (-> self board ride-time) (seconds 0.2))) + (zero? s3-3) + ) + (+! s3-3 1) + (dotimes (v1-114 3) + (set! (-> self board ride-vertex v1-114 quad) (-> self board ride-vertex-old v1-114 quad)) + ) + (set! (-> self board ride-vertex-length) (-> self board ride-vertex-length-old)) + (goto cfg-26) + ) + ) + (set! (-> self board ride-vertex-index) (fmax 0.0 (-> self board ride-vertex-index))) + (set! (-> self board ride-vertex-base) + (segment-array-index->vector + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (-> self board ride-vertex-index) + s4-1 + ) + ) + (vector-! + (-> self board ride-segment) + (-> self board ride-vertex (+ (-> self board ride-vertex-base) 1)) + (-> self board ride-vertex (-> self board ride-vertex-base)) + ) + (dotimes (v1-128 3) + (set! (-> self board ride-vertex v1-128 w) 1.0) + ) + (when (time-elapsed? (-> self board ride-time) (seconds 0.2)) + (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-segment))) + (set! (-> self board ride-rotv-abs) 0.0) + ) + (let ((f0-25 (vector-vector-distance (-> self control trans) s4-1))) + (when #t + (let ((s3-5 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> self control trans)))) + (let ((f1-9 (* 12288.0 (seconds-per-frame)))) + (if (and (not (-> self board ride-lock-on)) (< f1-9 f0-25)) + (vector-normalize! s3-5 f1-9) + (set! (-> self board ride-lock-on) #t) + ) + ) + (if (probe-test (-> self control) s3-5 (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1)) + (logior! (-> self control status) (collide-status probe-hit)) + (move-by-vector! (-> self control) s3-5) + ) + ) + ) + ) + ) + (let ((f30-2 (-> self board ride-speed))) + (vector-normalize-copy! (-> self control to-target-pt-xz) (-> self board ride-segment) 1.0) + (vector-normalize-copy! (-> self control transv) (-> self board ride-segment) f30-2) + (vector-rotate-y! + (-> self board ride-dir-lean) + (-> self control to-target-pt-xz) + (* -4551.1113 (-> self board ride-lean)) + ) + (when (< (-> self board ride-vertex-base) (+ (-> self board ride-vertex-length) -1)) + (let ((a0-100 (-> self board ride-vertex (+ (-> self board ride-vertex-base) 1))) + (s4-2 0) + ) + (let ((s3-7 (vector-! (new 'stack-no-clear 'vector) (&+ a0-100 16) a0-100))) + (if (< 14563.556 (fabs (deg-diff (vector-y-angle s3-7) (vector-y-angle (-> self control to-target-pt-xz))))) + (set! s4-2 (logior s4-2 2)) + ) + (if (< (vector-length s3-7) (fmin 1024.0 (* 0.25 (vector-length (-> self board ride-segment))))) + (set! s4-2 (logior s4-2 32)) + ) + ) + (if (nonzero? s4-2) + (+! (-> self board ride-vertex-length) -1) + ) + ) + ) + (let ((s4-3 0)) + (if (if (time-elapsed? (-> self board ride-start-time) (seconds 0.1)) + (< (fabs f30-2) 2048.0) + (< (fabs f30-2) 16384.0) + ) + (set! s4-3 (logior s4-3 1)) + ) + (let* ((v1-198 (min (the int (-> self board ride-vertex-index)) (+ (-> self board ride-vertex-length) -1))) + (f28-2 + (vector-length + (vector-! + (new 'stack-no-clear 'vector) + (-> self board ride-vertex (+ v1-198 1)) + (-> self board ride-vertex v1-198) + ) + ) + ) + (s3-8 (new 'stack-no-clear 'collide-query)) + (f26-0 81920.0) + ) + (set! sv-752 8) + (let ((v1-205 s3-8)) + (set! (-> v1-205 radius) 1228.8) + (set! (-> v1-205 collide-with) + (logclear (-> self control root-prim prim-core collide-with) (collide-spec crate)) + ) + (set! (-> v1-205 ignore-process0) self) + (set! (-> v1-205 ignore-process1) #f) + (set! (-> v1-205 ignore-pat) (-> self control pat-ignore-mask)) + (set! (-> v1-205 action-mask) (collide-action solid)) + ) + (vector+float*! (-> s3-8 start-pos) (-> self control trans) (-> self board ride-dir) 3276.8) + (vector+float*! (-> s3-8 start-pos) (-> s3-8 start-pos) (-> self control dynam gravity-normal) 5324.8) + (vector-float*! (-> s3-8 move-dist) (-> self control dynam gravity-normal) -49152.0) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* s3-8) 0.0) + (set! f26-0 (- (-> self control trans y) (-> s3-8 best-other-tri intersect y))) + (set! sv-752 (the-as int (-> s3-8 best-other-tri pat))) + ) + (when (and (< (+ (the float (-> self board ride-vertex-length)) (/ 0.0 f28-2)) + (+ (-> self board ride-vertex-index) (/ (* (-> self board ride-speed) (seconds-per-frame)) f28-2)) + ) + (or (>= (-> self board ride-vertex-index) 3.0) + (and (>= f28-2 3686.4) + (and (or (>= f26-0 4096.0) (and (>= f26-0 2048.0) (zero? (shr (shl sv-752 54) 61)))) + (logtest? (shr (shl sv-752 57) 57) 8) + ) + ) + ) + ) + (format + #t + "end with length ~M sp:~M ang:~M b:~X ~f/~f~%" + f28-2 + (-> self board ride-speed) + f26-0 + sv-752 + (+ (-> self board ride-vertex-index) + (/ (* (-> self board ride-speed) (seconds-per-frame)) (vector-length (-> self board ride-segment))) + ) + (+ (the float (-> self board ride-vertex-length)) (/ 0.0 f28-2)) + ) + (set! s4-3 (logior s4-3 4)) + ) + ) + (let ((s3-9 (-> self board ride-vertex (-> self board ride-vertex-base)))) + (if (not (or (vector= s3-9 (the-as vector (-> self board ride-vertex-old))) + (vector= s3-9 (-> self board ride-vertex-old 1)) + (vector= s3-9 (-> self board ride-vertex-old 2)) + (vector= (&+ s3-9 16) (the-as vector (-> self board ride-vertex-old))) + (vector= (&+ s3-9 16) (-> self board ride-vertex-old 1)) + (vector= (&+ s3-9 16) (-> self board ride-vertex-old 2)) + ) + ) + (set! s4-3 (logior s4-3 8)) + ) + ) + (if (time-elapsed? (-> self board ride-button-time) (seconds 0.05)) + (set! s4-3 (logior s4-3 16)) + ) + (if (< (vector-length (-> self board ride-segment)) + (fmin 1024.0 (* 0.25 (vector-length (-> self board ride-segment-old)))) + ) + (set! s4-3 (logior s4-3 32)) + ) + (if (logtest? (collide-status probe-hit) (-> self control status)) + (set! s4-3 (logior s4-3 64)) + ) + (logclear! (-> self control status) (collide-status probe-hit)) + (when (and (not (time-elapsed? (-> self board ride-time) (seconds 0.2))) (nonzero? s4-3)) + (if (logtest? s4-3 1) + (format #t "exit speed ~M~%" f30-2) + ) + (if (logtest? s4-3 2) + (format + #t + "exit angle ~F~%" + (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self board ride-segment-old) 1.0) + (-> self control to-target-pt-xz) + ) + ) + ) + (if (logtest? s4-3 4) + (format + #t + "exit end ~F/~F~%" + (-> self board ride-vertex-index) + (the float (-> self board ride-vertex-length)) + ) + ) + (if (logtest? s4-3 8) + (format #t "exit match~%") + ) + (if (logtest? s4-3 16) + (format #t "exit button~%") + ) + (if (logtest? s4-3 32) + (format #t "exit length~%") + ) + (when (logtest? s4-3 64) + (set! (-> self board ride-lock-on) #f) + (format #t "exit probe~%") + ) + (if (logtest? s4-3 128) + (format #t "exit probe2~%") + ) + (cond + ((or (logtest? s4-3 1) (and (logtest? s4-3 2) (< (fabs f30-2) 32768.0))) + (let ((gp-1 (-> self control edge-grab-across-edge-dir))) + (let* ((a0-162 (vector-rotate-y! (new 'stack-no-clear 'vector) (-> self board ride-dir) -16384.0)) + (f28-3 (* (-> self board ride-lean) (vector-dot a0-162 gp-1))) + ) + (format #t "throw side ~f ~A speed ~m~%" f28-3 (>= f28-3 0.0) f30-2) + (vector-normalize-copy! + (-> self control transv) + gp-1 + (* (lerp-scale 8192.0 32768.0 (fabs (-> self board ride-lean)) 0.0 1.0) (if (>= f28-3 0.0) + 1.0 + -1.0 + ) + ) + ) + ) + (set! (-> self control to-target-pt-xz quad) (-> gp-1 quad)) + ) + ) + ((logtest? s4-3 42) + (move-to-point! (-> self control) gp-0) + (set! (-> self control transv quad) (-> s5-0 quad)) + ) + ) + (when (not (logtest? s4-3 64)) + (let ((a1-78 (vector-float*! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal) 819.2))) + (move-by-vector! (-> self control) a1-78) + ) + ) + (send-event self 'end-mode 'ride (not (logtest? s4-3 75))) + ) + ) + (vector-rotate-y! + (-> self control to-target-pt-xz) + (-> self control to-target-pt-xz) + (+ (-> self board ride-rot) (* -2730.6667 (-> self board ride-lean))) + ) + (set-time! (-> self board ride-time)) + (set! (-> self board ride-speed) f30-2) + ) + ) + ) + (let ((v0-3 (current-time))) + (set! (-> self control last-time-on-surface) v0-3) + v0-3 + ) + ) + +(defbehavior board-ride-add-thrust target ((arg0 vector) (arg1 float)) + (let* ((f30-0 (-> self board ride-speed)) + (f0-4 (lerp-scale + (-> self control current-surface fric) + (* 0.2 (-> self control current-surface fric)) + f30-0 + 0.0 + (-> self control current-surface transv-max) + ) + ) + (f30-1 (seek f30-0 0.0 (* f0-4 (seconds-per-frame)))) + (f28-0 (vector-dot (-> self board ride-dir) arg0)) + (f0-19 (+ f30-1 (* (if (< 0.0 f28-0) + (* f28-0 + (lerp-scale + (-> self control current-surface target-speed) + 0.0 + (-> self board ride-speed) + 0.0 + (-> self control current-surface transv-max) + ) + arg1 + ) + (* 40960.0 arg1 f28-0) + ) + (seconds-per-frame) + ) + ) + ) + (v1-21 (-> self control to-target-pt-xz)) + (f1-6 (vector-dot (-> self control dynam gravity-normal) v1-21)) + (f0-20 (if (< f1-6 0.0) + (+ f0-19 (* (- f1-6) (-> self control current-surface slope-down-factor) (seconds-per-frame))) + (+ f0-19 (* (- f1-6) (-> self control current-surface slope-up-factor) (seconds-per-frame))) + ) + ) + ) + (set! (-> self board ride-speed) (fmax 0.0 (fmin f0-20 (-> self control current-surface transv-max)))) + ) + 0 + (none) + ) + +(defbehavior target-board-ride-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (set! (-> self control bend-speed) 32.0) + (set! (-> self control bend-target) 1.0) + (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) + (if (< (-> self control force-turn-to-strength) 0.0) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> self control cpad stick0-speed))) + ) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (turn-to-vector s5-0 (-> self control pad-magnitude)) + (if (< 0.0 (-> self control turn-to-magnitude)) + (set! (-> self board ride-pad-vector 0 quad) (-> self control to-target-pt-xz quad)) + ) + (board-ride-add-thrust s5-0 (-> self control turn-to-magnitude)) + (let ((s5-1 (vector-rotate-y! (new 'stack-no-clear 'vector) s5-0 16384.0))) + (set! (-> s5-1 y) 0.0) + (vector-xz-normalize! s5-1 (-> self control turn-to-magnitude)) + (let ((f0-16 (vector-dot s5-1 (-> self board ride-dir)))) + (if (>= 0.0 (-> self control turn-to-magnitude)) + (set! f0-16 0.0) + ) + (set! (-> self board ride-lean-targ) f0-16) + (+! (-> self board ride-leanv) (* 100.0 (seconds-per-frame) (- f0-16 (-> self board ride-lean)))) + ) + ) + ) + (set! (-> self board ride-leanv) (* 0.95 (-> self board ride-leanv))) + (seek! + (-> self board ride-lean-mag) + (fabs (analog-input (the-as int (-> self control cpad leftx)) 128.0 32.0 110.0 1.0)) + (* 2.0 (seconds-per-frame)) + ) + (+! (-> self board ride-lean) (* (-> self board ride-leanv) (seconds-per-frame))) + (cond + ((< (-> self board ride-lean) -1.0) + (set! (-> self board ride-lean) -1.0) + (set! (-> self board ride-leanv) (* 0.0 (-> self board ride-leanv))) + ) + ((< 1.0 (-> self board ride-lean)) + (set! (-> self board ride-lean) 1.0) + (set! (-> self board ride-leanv) (* 0.0 (-> self board ride-leanv))) + ) + ) + 0 + (add-gravity) + (reverse-conversions (-> self control transv)) + (target-board-compute-edge) + (do-rotations2) + (pre-collide-setup) + (seek! (-> self board cushion-offset) 1638.4 (* 16384.0 (seconds-per-frame))) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (set! (-> s5-3 quad) (-> self control transv quad)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> self control trans quad)) + (let ((a2-4 (new 'stack-no-clear 'collide-query)) + (v1-83 (-> self control)) + ) + (set! (-> a2-4 collide-with) (-> v1-83 root-prim prim-core collide-with)) + (set! (-> a2-4 ignore-process0) self) + (set! (-> a2-4 ignore-process1) #f) + (set! (-> a2-4 ignore-pat) (-> v1-83 pat-ignore-mask)) + (set! (-> a2-4 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-83 (-> v1-83 transv) a2-4 (meters 1)) + ) + (when (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags two)) + (cond + ((time-elapsed? (-> self board ride-time) (seconds 0.2)) + (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one)) + (set! (-> *collide-edge-board-spec* touching-segment) #f) + ) + (else + (logior! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one)) + (dotimes (v1-102 2) + (set! (-> self board ride-touch-segment v1-102 quad) + (-> self board ride-vertex (+ (-> self board ride-vertex-base) v1-102) quad) + ) + ) + (set! (-> *collide-edge-board-spec* touching-segment) (the-as symbol (-> self board ride-touch-segment))) + ) + ) + (target-method-28 *target* *collide-cache* *collide-edge-board-spec*) + ) + (when (focus-test? self rail) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((f28-1 + (fmax + 0.0 + (segment-array-vector->index + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (the-as float s4-1) + (* (-> self board ride-speed) (seconds-per-frame)) + ) + ) + ) + ) + (set! (-> self board ride-vertex-base2) + (segment-array-index->vector (-> self board ride-vertex) (-> self board ride-vertex-length) f28-1 s3-0) + ) + (set! (-> self board ride-vertex-index2) f28-1) + ) + (if (probe-test + (-> self control) + (vector-! (new 'stack-no-clear 'vector) s3-0 (-> self control trans)) + (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1) + ) + (logior! (-> self control status) (collide-status probe-hit)) + ) + (if (and (-> self board ride-lock-on) (not (logtest? (collide-status probe-hit) (-> self control status)))) + (move-to-point! (-> self control) s3-0) + ) + ) + (set! (-> self control transv quad) (-> s5-3 quad)) + ) + ) + (target-board-physics s5-3) + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (vector-cross! + (-> self control local-normal) + (-> self control edge-grab-across-edge-dir) + (-> self control edge-grab-edge-dir) + ) + (if (< (vector-dot (-> self control local-normal) (-> self control dynam gravity-normal)) 0.0) + (vector-negate! (-> self control local-normal) (-> self control local-normal)) + ) + (set! (-> self control gspot-normal quad) (-> self control local-normal quad)) + (target-powerup-process) + (target-board-exit-check) + (target-board-effect) + (set-time! (-> self board board-time)) + (+! (-> *game-info* board-time) + (- (-> *display* game-clock frame-counter) (-> *display* game-clock old-frame-counter)) + ) + 0 + (none) + ) + +(defbehavior target-board-post target () + (target-board-real-post) + (none) + ) + +(defbehavior target-board-center-anim target () + (set! (-> self board turn-anim-frame) 0.0) + 0 + (none) + ) + +(defbehavior target-board-turn-anim target ((arg0 int)) + (let ((f30-0 (-> self clock clock-ratio))) + (let ((s5-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float s5-1))) + (while (nonzero? s5-1) + (+! s5-1 -1) + (set! (-> self control remaining-ctrl-iterations) s5-1) + (set! (-> self board turn-anim-targ) (fmax -10.0 (fmin 10.0 (-> self board turn-anim-targ)))) + (or (not (>= (* (-> self board turn-anim-targ) (-> self board turn-anim-frame)) 0.0)) + (< (fabs (-> self board turn-anim-frame)) (fabs (-> self board turn-anim-targ))) + ) + (+! (-> self board turn-anim-vel) + (* (- (-> self board turn-anim-targ) (-> self board turn-anim-frame)) + (lerp-scale + 20.0 + (if (< (fabs (-> self board turn-anim-frame)) (fabs (-> self board turn-anim-targ))) + 30.0 + 60.0 + ) + (-> self control ctrl-xz-vel) + 0.0 + (* 0.3 (-> self board transv-max)) + ) + (seconds-per-frame) + ) + ) + (set! (-> self board turn-anim-vel) + (fmax + -100.0 + (fmin + 100.0 + (* (-> self board turn-anim-vel) + (lerp-scale 0.96 0.9 (-> self control ctrl-xz-vel) 0.0 (* 0.3 (-> self board transv-max))) + ) + ) + ) + ) + (set! (-> self board unk-float000) (-> self board turn-anim-frame)) + (+! (-> self board turn-anim-frame) (* (-> self board turn-anim-vel) (seconds-per-frame))) + (set! (-> self board turn-anim-frame) + (fmax + (fmin (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames)) + (- (-> *TARGET_BOARD-bank* turn-frames)) + ) + ) + (if (>= 1.0 (fabs (- (-> self board turn-anim-frame) (-> self board turn-anim-targ)))) + (set! (-> self board unk-float001) (-> self board turn-anim-frame)) + ) + (cond + ((and (>= (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames)) + (>= (-> self board turn-anim-vel) 0.0) + ) + (set! (-> self board turn-anim-vel) 0.0) + ) + ((and (>= (- (-> *TARGET_BOARD-bank* turn-frames)) (-> self board turn-anim-frame)) + (>= 0.0 (-> self board turn-anim-vel)) + ) + (set! (-> self board turn-anim-vel) 0.0) + ) + ) + (ja :chan arg0 + :num-func num-func-identity + :frame-num (ja-aframe + (fmax + (fmin + (+ (fmax + (fmin (-> self board turn-anim-frame) (+ -1.0 (-> *TARGET_BOARD-bank* turn-frames))) + (- (+ -1.0 (-> *TARGET_BOARD-bank* turn-frames))) + ) + (* (sin (* 145.63556 (the float (- (current-time) (-> self state-time))))) + (lerp-scale 1.0 2.0 (fabs (-> self board turn-anim-frame)) 0.0 (-> *TARGET_BOARD-bank* turn-frames)) + ) + ) + (-> *TARGET_BOARD-bank* turn-frames) + ) + (- (-> *TARGET_BOARD-bank* turn-frames)) + ) + arg0 + ) + ) + (let ((f0-62 + (fmin + (if (logtest? (-> self control status) (collide-status on-surface)) + (seek (-> self board turn-anim-duck) 0.0 (seconds-per-frame)) + (-> self board turn-anim-duck) + ) + (lerp-scale 0.0 -1.0 (the float (- (current-time) (-> self control last-time-on-surface))) 30.0 120.0) + ) + ) + ) + (+! (-> self board turn-anim-duck) (* (-> self board turn-anim-duck-vel) (seconds-per-frame))) + (cond + ((< (-> self board turn-anim-duck) f0-62) + (set! (-> self board turn-anim-duck) f0-62) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ((< 1.0 (-> self board turn-anim-duck)) + (set! (-> self board turn-anim-duck) 1.0) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ) + ) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + 0 + (none) + ) + +(defmethod add-to-trick-list ((this board-info) (arg0 board-tricks) (arg1 float)) + (send-event (handle->process (-> this process 0 notify)) 'notify 'trick-point arg0) + (when (and (< (-> this trick-count) 16) (and (< 0.0 arg1) (nonzero? (-> this process 0 fact trick-point-duration)))) + (let ((s4-0 0)) + (when (>= (- (-> *display* game-clock frame-counter) (-> this process 0 fact trick-point-pickup-time)) (seconds 30)) + (countdown (v1-20 16) + (set! (-> this trick-list 0) (board-tricks none)) + ) + ) + (countdown (v1-23 15) + (if (= (-> this trick-list v1-23) arg0) + (+! s4-0 1) + ) + (set! (-> this trick-list (+ v1-23 1)) (-> this trick-list v1-23)) + ) + (set! (-> this trick-list 0) arg0) + (let* ((a0-24 (* arg1 (lerp-scale 1.0 0.1 (the float s4-0) 2.0 6.0))) + (s3-1 (the float (* 25 (/ (+ (the int a0-24) 24) 25)))) + ) + (sound-play "do-trick") + (let ((t9-4 format) + (a0-29 #t) + (a1-8 "trick: ~S (~D) ~,,0f") + (v1-30 arg0) + ) + (t9-4 + a0-29 + a1-8 + (cond + ((= v1-30 (board-tricks darkjak-tracking)) + "darkjak-tracking" + ) + ((= v1-30 (board-tricks board-rail-jump)) + "board-rail-jump" + ) + ((= v1-30 (board-tricks lightjak-swoop)) + "lightjak-swoop" + ) + ((= v1-30 (board-tricks board-nosegrab)) + "board-nosegrab" + ) + ((= v1-30 (board-tricks board-board-spin)) + "board-board-spin" + ) + ((= v1-30 (board-tricks board-kickflip)) + "board-kickflip" + ) + ((= v1-30 (board-tricks lightjak-regen)) + "lightjak-regen" + ) + ((= v1-30 (board-tricks board-method)) + "board-method" + ) + ((= v1-30 (board-tricks board-spin)) + "board-spin" + ) + ((= v1-30 (board-tricks board-kickspin)) + "board-kickspin" + ) + ((= v1-30 (board-tricks board-boost)) + "board-boost" + ) + ((= v1-30 (board-tricks darkjak)) + "darkjak" + ) + ((= v1-30 (board-tricks lightjak)) + "lightjak" + ) + ((= v1-30 (board-tricks board-method-cross)) + "board-method-cross" + ) + ((= v1-30 (board-tricks board-duck-jump)) + "board-duck-jump" + ) + ((= v1-30 (board-tricks board-airwalk)) + "board-airwalk" + ) + ((= v1-30 (board-tricks lightjak-shield)) + "lightjak-shield" + ) + ((= v1-30 (board-tricks board-backgrab)) + "board-backgrab" + ) + ((= v1-30 (board-tricks board-board-flip)) + "board-board-flip" + ) + ((= v1-30 (board-tricks board-rail)) + "board-rail" + ) + ((= v1-30 (board-tricks none)) + "none" + ) + ((= v1-30 (board-tricks lightjak-freeze)) + "lightjak-freeze" + ) + ((= v1-30 (board-tricks darkjak-bomb0)) + "darkjak-bomb0" + ) + ((= v1-30 (board-tricks board-quick-jump)) + "board-quick-jump" + ) + ((= v1-30 (board-tricks darkjak-smack)) + "darkjak-smack" + ) + ((= v1-30 (board-tricks board-noseflip)) + "board-noseflip" + ) + ((= v1-30 (board-tricks darkjak-bomb1)) + "darkjak-bomb1" + ) + ((= v1-30 (board-tricks board-jump)) + "board-jump" + ) + ((= v1-30 (board-tricks board-flip)) + "board-flip" + ) + (else + "*unknown*" + ) + ) + s4-0 + s3-1 + ) + ) + (when (nonzero? (-> this trick-count)) + (format #t " + combo ~,,0f" (-> this trick-points-array (+ (-> this trick-count) -1))) + (+! (-> this trick-points-array (+ (-> this trick-count) -1)) + (-> this trick-points-array (+ (-> this trick-count) -1)) + ) + ) + (format #t "~%") + (set! (-> this trick-array (-> this trick-count)) arg0) + (set! (-> this trick-points-array (-> this trick-count)) s3-1) + ) + ) + (+! (-> this trick-count) 1) + ) + 0 + (none) + ) + +(defmethod flush-trick-list ((this board-info)) + (let ((f30-0 0.0)) + (dotimes (v1-0 (-> this trick-count)) + (+! f30-0 (-> this trick-points-array v1-0)) + ) + (when (< 0.0 f30-0) + (send-event + (handle->process (-> this process 0 notify)) + 'notify + 'trick-flush + f30-0 + (-> this trick-list) + (-> this trick-count) + ) + (send-event (ppointer->process (-> this process)) 'get-pickup (pickup-type trick-point) f30-0) + (sound-play "trick-score") + ) + ) + (set! (-> this trick-count) 0) + 0 + 0 + (none) + ) diff --git a/goal_src/jak3/engine/target/collide-reaction-target.gc b/goal_src/jak3/engine/target/collide-reaction-target.gc index e7979ae3f19..c1df80bd122 100644 --- a/goal_src/jak3/engine/target/collide-reaction-target.gc +++ b/goal_src/jak3/engine/target/collide-reaction-target.gc @@ -5,5 +5,607 @@ ;; name in dgo: collide-reaction-target ;; dgos: GAME +(define-extern collide-shape-moving-angle-set! (function collide-shape-moving vector vector none)) + ;; DECOMP BEGINS +(defun poly-find-nearest-edge ((arg0 nav-poly) (arg1 (inline-array vector)) (arg2 vector) (arg3 vector)) + (local-vars (sv-32 vector) (sv-36 number) (sv-40 int) (sv-48 number) (sv-80 vector)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 4095996000.0) + (set! sv-40 -1) + (set! sv-48 0.0) + (dotimes (s2-0 3) + (let ((s0-0 (-> arg1 s2-0))) + (set! sv-80 (-> arg1 (mod (+ s2-0 1) 3))) + (let ((f30-0 (vector-line-distance-point! arg2 s0-0 sv-80 sv-32)) + (s1-1 (vector-! (new 'stack-no-clear 'vector) sv-80 s0-0)) + ) + 0.0 + (vector-normalize! s1-1 1.0) + (let ((f0-5 (fabs (vector-dot arg3 s1-1)))) + (when (or (< f30-0 (the-as float sv-36)) (and (= f30-0 (the-as float sv-36)) (< (the-as float sv-48) f0-5))) + (set! sv-36 f30-0) + (set! sv-40 s2-0) + (set! sv-48 f0-5) + ) + ) + ) + ) + ) + (set! (-> arg0 vertex 0 quad) (-> arg1 sv-40 quad)) + (set! (-> arg0 vertex1 quad) (-> arg1 (mod (+ sv-40 1) 3) quad)) + arg0 + ) + +(defun target-collision-low-coverage ((arg0 control-info) + (arg1 collide-query) + (arg2 vector) + (arg3 (pointer cshape-reaction-flags)) + (arg4 (pointer collide-status)) + (arg5 (pointer symbol)) + ) + (local-vars + (sv-16 vector) + (sv-20 (pointer cshape-reaction-flags)) + (sv-24 (pointer collide-status)) + (sv-28 (pointer symbol)) + (sv-32 cshape-reaction-flags) + (sv-40 collide-status) + (sv-48 symbol) + (sv-52 vector) + (sv-56 vector) + ) + (set! sv-16 arg2) + (set! sv-20 arg3) + (set! sv-24 arg4) + (set! sv-28 arg5) + (set! sv-32 (-> arg3 0)) + (set! sv-40 (-> arg4 0)) + (set! sv-48 (-> arg5 0)) + (set! sv-52 (-> arg0 low-coverage-tangent)) + (set! sv-56 (vector-cross! (-> arg0 low-coverage-overhang-plane-normal) (-> arg0 poly-normal) sv-16)) + (vector-normalize! sv-56 1.0) + (if (>= (fabs (vector-dot (-> arg0 dynam gravity-normal) sv-56)) 0.866) + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf09))) + ) + (vector-cross! sv-52 sv-16 sv-56) + (if (< 0.0 (vector-dot (-> arg0 dynam gravity-normal) sv-52)) + (vector-negate! sv-52 sv-52) + ) + (vector-normalize! sv-52 1.0) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) + (let ((s3-0 (vector-flatten! (-> arg0 low-coverage-tangent-xz) sv-52 (-> arg0 dynam gravity-normal)))) + (let ((v1-19 s4-0)) + (set! (-> v1-19 radius) 409.6) + (set! (-> v1-19 collide-with) (-> arg1 best-my-prim prim-core collide-with)) + (set! (-> v1-19 ignore-process0) #f) + (set! (-> v1-19 ignore-process1) #f) + (set! (-> v1-19 ignore-pat) (-> arg0 pat-ignore-mask)) + (set! (-> v1-19 action-mask) (collide-action solid)) + ) + (vector-normalize! s3-0 1.0) + (if (< (vector-dot s3-0 sv-16) 0.0) + (vector-negate! s3-0 s3-0) + ) + (set! (-> arg0 low-coverage-slope-to-next1) 4095996000.0) + (set! (-> arg0 low-coverage-dist-to-next2) 4095996000.0) + (vector+float*! (-> s4-0 start-pos) (-> arg1 best-other-tri intersect) s3-0 2867.2) + (vector-normalize-copy! (-> s4-0 move-dist) (-> arg0 dynam gravity-normal) -20480.0) + (vector+float*! (-> s4-0 move-dist) (-> s4-0 move-dist) s3-0 4096.0) + (when (>= (probe-using-line-sphere *collide-cache* s4-0) 0.0) + (set! (-> arg0 low-coverage-slope-to-next1) + (vector-dot + (-> arg0 dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-other-tri intersect) (-> s4-0 best-other-tri intersect)) + ) + ) + (set! (-> arg0 low-coverage-pat-next1) (-> s4-0 best-other-tri pat)) + (set! (-> arg0 low-coverage-norm-of-next1 quad) (-> s4-0 best-other-tri normal quad)) + 0 + ) + (vector+float*! (-> s4-0 start-pos) (-> arg1 best-other-tri intersect) (-> arg0 dynam gravity-normal) 819.2) + (vector-normalize-copy! (-> s4-0 move-dist) (-> arg0 dynam gravity-normal) -20480.0) + (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) s3-0 -819.2) + (vector+float*! (-> s4-0 move-dist) (-> s4-0 move-dist) s3-0 -4096.0) + ) + (when (>= (probe-using-line-sphere *collide-cache* s4-0) 0.0) + (set! (-> arg0 low-coverage-dist-to-next2) + (vector-vector-distance (-> s4-0 start-pos) (-> s4-0 best-other-tri intersect)) + ) + (set! (-> arg0 low-coverage-pat-next2) (-> s4-0 best-other-tri pat)) + (set! (-> arg0 low-coverage-norm-of-next2 quad) (-> s4-0 best-other-tri normal quad)) + 0 + ) + ) + (when (and (not (logtest? sv-32 (cshape-reaction-flags csrf09))) + (and (or (< (* 1.25 (-> arg1 best-my-prim local-sphere w)) (-> arg0 low-coverage-slope-to-next1)) + (= (-> arg0 low-coverage-pat-next1 mode) (pat-mode wall)) + ) + (and (< (-> arg0 low-coverage-dist-to-next2) (* 2.0 (-> arg1 best-my-prim local-sphere w))) + (or (= (-> arg0 low-coverage-pat-next2 mode) (pat-mode ground)) + (= (-> arg0 low-coverage-pat-next2 mode) (pat-mode halfpipe)) + ) + ) + ) + ) + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf07))) + (set-time! (-> arg0 time-of-last-lc-touch-edge)) + (set! sv-40 (logior sv-40 (collide-status touch-edge))) + (set-time! (-> arg0 time-of-last-lc)) + (let ((f30-0 (vector-dot sv-52 (-> arg0 turn-to-target))) + (f0-27 (if (logtest? sv-32 (cshape-reaction-flags csrf01)) + (cos (- 16384.0 (acos (-> arg0 coverage)))) + (-> arg0 coverage) + ) + ) + (f1-11 (vector-dot + (-> arg0 dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg0 trans) (-> arg1 best-other-tri intersect)) + ) + ) + ) + (if (or (not (logtest? sv-32 (cshape-reaction-flags csrf05))) (< 0.5 f0-27)) + (set! sv-48 (the-as symbol #f)) + ) + (when (and (or (and (< f0-27 0.95) (>= f30-0 0.0)) + (and (logtest? sv-32 (cshape-reaction-flags csrf05)) (< f0-27 0.3)) + (< f1-11 (* -0.25 (-> arg1 best-my-prim local-sphere w))) + ) + (>= (vector-dot sv-52 sv-16) -0.000001) + ) + (set! (-> arg0 surf) *edge-surface*) + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf10))) + (set! sv-48 (the-as symbol #f)) + (when (logtest? sv-32 (cshape-reaction-flags csrf05)) + (set! sv-48 #t) + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf12))) + ) + ) + ) + ) + (if (< (-> arg0 surface-angle) 0.0) + (set! sv-48 #t) + ) + (when sv-48 + (cond + ((and (or (or (= (-> arg0 poly-pat mode) (pat-mode ground)) (= (-> arg0 poly-pat mode) (pat-mode halfpipe))) + (and (logtest? sv-32 (cshape-reaction-flags csrf03)) + (>= (* 1.25 (-> arg1 best-my-prim local-sphere w)) (-> arg0 low-coverage-slope-to-next1)) + (or (= (-> arg0 low-coverage-pat-next1 mode) (pat-mode ground)) + (= (-> arg0 low-coverage-pat-next1 mode) (pat-mode halfpipe)) + ) + (< 0.3 (fabs (-> arg0 surface-angle))) + ) + ) + (not (logtest? sv-32 (cshape-reaction-flags csrf07))) + ) + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf06))) + (set! sv-40 (logior sv-40 (collide-status touch-edge))) + (set-time! (-> arg0 time-of-last-lc)) + (set! sv-48 (the-as symbol #f)) + ) + (#t + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf06))) + (set! sv-40 (logior sv-40 (collide-status touch-edge))) + (set-time! (-> arg0 time-of-last-lc)) + ) + ) + ) + (set! (-> sv-24 0) sv-40) + (set! (-> sv-20 0) sv-32) + (set! (-> sv-28 0) sv-48) + 0 + (none) + ) + +(defbehavior target-collision-reaction target ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (local-vars + (sv-80 vector) + (sv-84 vector) + (sv-88 matrix) + (sv-96 collide-status) + (sv-104 cshape-reaction-flags) + (sv-240 symbol) + ) + (set! sv-80 (new-stack-vector0)) + (set! sv-84 (new-stack-vector0)) + (let ((v1-2 (new 'stack-no-clear 'matrix))) + (dotimes (a0-1 2) + (set! (-> v1-2 quad a0-1) (the-as uint128 0)) + ) + (set! sv-88 v1-2) + ) + (set! sv-96 (collide-status)) + (set! sv-104 (cshape-reaction-flags)) + (set! (-> sv-88 rvec quad) (-> arg3 quad)) + (set! (-> sv-88 uvec quad) (-> arg3 quad)) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (vector-float*! a1-3 (-> arg1 move-dist) (the-as float (-> arg1 spheres))) + (move-by-vector! arg0 a1-3) + ) + (set! sv-104 (logior sv-104 (react-to-pat! arg0 (-> arg1 best-other-tri pat)))) + (if (= (-> arg0 poly-pat mode) (pat-mode wall)) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf00))) + ) + (if (logtest? (-> arg0 mod-surface flags) (surface-flag air)) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf05))) + ) + (let ((v1-24 (new 'stack-no-clear 'vector))) + (set! (-> v1-24 quad) (-> arg1 best-my-prim prim-core world-sphere quad)) + (vector-! sv-80 v1-24 (-> arg1 best-other-tri intersect)) + ) + (vector-normalize! sv-80 1.0) + (set! (-> arg0 coverage) (vector-dot sv-80 (-> arg1 best-other-tri normal))) + (when (< (-> arg0 coverage) 0.0) + (set! (-> arg0 coverage) 0.0) + (vector-flatten! sv-80 sv-80 (-> arg1 best-other-tri normal)) + (vector-normalize! sv-80 1.0) + ) + (if (< (-> arg0 coverage) 0.9999) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf03 csrf04))) + ) + (let ((v1-35 (-> sv-80 quad))) + (set! (-> sv-84 quad) v1-35) + ) + (if (= (the-as float (-> arg1 spheres)) 0.0) + (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-84 3.0)) + ) + (set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad)) + (collide-shape-moving-angle-set! arg0 sv-84 (-> sv-88 rvec)) + (if (< (-> arg0 poly-angle) -0.2) + (set! sv-96 (logior sv-96 (collide-status touch-ceiling))) + ) + (if (< (-> arg0 poly-angle) 0.0) + (set! sv-96 (logior sv-96 (collide-status touch-ceiling-sticky))) + ) + (if (!= (-> arg1 best-my-prim prim-id) 6) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf15))) + ) + (if (and (= (-> arg0 cur-pat mode) (pat-mode halfpipe)) (< (-> arg0 poly-angle) 0.75)) + (send-event (-> arg0 process) 'slide) + ) + (set! sv-240 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))) + (if (and sv-240 (and (= (-> arg0 mod-surface mode) 'dive) (< 0.4 (fabs (-> arg0 surface-angle))))) + (set! sv-240 (the-as symbol #f)) + ) + (if (and (logtest? sv-104 (cshape-reaction-flags csrf15)) + (logtest? sv-104 (cshape-reaction-flags csrf05)) + (>= (-> arg0 poly-angle) 0.0) + (not sv-240) + ) + (set! sv-240 #t) + ) + (if sv-240 + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf01))) + ) + (if (logtest? sv-104 (cshape-reaction-flags csrf03)) + (target-collision-low-coverage arg0 arg1 sv-84 (& sv-104) (& sv-96) (& sv-240)) + ) + (when (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) + (set! (-> arg0 transv-on-last-impact quad) (-> arg0 transv quad)) + (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) + (set! (-> arg0 normal-impact-vel) (- (vector-dot (-> arg0 transv) sv-84))) + (set! sv-96 (logior sv-96 (collide-status impact-surface))) + (if (nonzero? (-> arg0 current-surface impact-hook)) + ((-> arg0 current-surface impact-hook) arg0 (the-as (pointer float) (-> sv-88 rvec)) sv-84) + ) + (when (not sv-240) + (let ((f0-21 (- 1.0 (-> arg0 current-surface impact-fric)))) + (when (< f0-21 1.0) + (let ((v1-113 (new-stack-vector0)) + (f1-13 (vector-dot (-> arg0 dynam gravity-normal) (-> sv-88 rvec))) + ) + 0.0 + (vector-! v1-113 (-> sv-88 rvec) (vector-float*! v1-113 (-> arg0 dynam gravity-normal) f1-13)) + (let* ((f2-2 (vector-length v1-113)) + (f3-0 f2-2) + ) + (if (< f1-13 0.0) + (set! f1-13 (* f1-13 f0-21)) + ) + (vector+! + (-> sv-88 rvec) + (vector-float*! (-> sv-88 rvec) (-> arg0 dynam gravity-normal) f1-13) + (vector-float*! v1-113 v1-113 (/ f2-2 f3-0)) + ) + ) + ) + ) + ) + ) + ) + (set! sv-96 (logior sv-96 (collide-status touch-surface))) + (cond + ((-> arg1 best-other-prim) + (set! sv-96 (logior sv-96 (collide-status touch-actor))) + (set! (-> arg0 actor-contact-pt quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> arg0 actor-contact-normal quad) (-> arg0 poly-normal quad)) + (set! (-> arg0 actor-contact-handle) (process->handle (-> arg1 best-other-prim cshape process))) + ) + ((= (-> arg0 poly-pat material) (pat-material waterbottom)) + ) + (else + (set! sv-96 (logior sv-96 (collide-status touch-background))) + ) + ) + (cond + (sv-240 + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf02))) + (set! sv-96 (logior sv-96 (collide-status touch-wall))) + (set! (-> arg0 cur-pat mode) 1) + (set! (-> arg0 wall-contact-pt quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> arg0 wall-contact-poly-normal quad) (-> arg0 poly-normal quad)) + (set! (-> arg0 wall-contact-normal quad) (-> sv-84 quad)) + (set! (-> arg0 wall-contact-pat) (-> arg1 best-other-tri pat)) + (cond + ((and (focus-test? (the-as process-focusable (-> arg0 process)) mech) + (logtest? sv-104 (cshape-reaction-flags csrf15)) + (logtest? sv-104 (cshape-reaction-flags csrf05)) + (< 0.0 (vector-dot sv-84 (-> arg0 dynam gravity-normal))) + (< 0.0 (vector-dot (-> sv-88 rvec) (-> arg0 dynam gravity-normal))) + ) + (set! (-> arg0 surf) *edge-surface*) + (set! sv-104 (logior (cshape-reaction-flags csrf16) sv-104)) + (vector-flatten! arg2 (vector-negate! (new 'stack-no-clear 'vector) (-> arg0 dynam gravity-normal)) sv-84) + (vector-normalize! arg2 (vector-dot arg2 (-> sv-88 rvec))) + ) + (else + (vector-reflect-flat! arg2 (-> sv-88 rvec) sv-84) + ) + ) + (cond + ((and (or (and (>= (-> arg1 best-my-prim local-sphere w) + (vector-dot + (-> arg0 ground-poly-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-other-tri intersect) (-> arg0 ground-touch-point)) + ) + ) + (not (time-elapsed? (-> arg0 list-time-on-ground) (seconds 0.3))) + ) + (logtest? sv-104 (cshape-reaction-flags csrf15)) + ) + (>= (vector-dot + (-> arg0 dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-other-tri intersect) (-> arg0 ground-touch-point)) + ) + 0.0 + ) + (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) + (not (logtest? sv-104 (cshape-reaction-flags csrf05))) + (not (logtest? (state-flags sf26) (-> arg0 process state-flags))) + ) + ) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf08))) + (set! sv-104 (logclear sv-104 (cshape-reaction-flags csrf06))) + (let ((s3-4 (vector-cross! (new 'stack-no-clear 'vector) (-> arg0 poly-normal) (-> arg0 ground-poly-normal)))) + (vector-normalize! s3-4 1.0) + (vector-float*! arg2 s3-4 (vector-dot (-> sv-88 rvec) s3-4)) + ) + (vector+! arg2 arg2 (-> arg0 poly-normal)) + ) + (else + ) + ) + ) + (else + (set! sv-96 (logior sv-96 (collide-status on-surface))) + (set! (-> arg0 cur-pat mode) 0) + (if (= (-> arg1 best-my-prim prim-id) 6) + (set! (-> arg0 local-normal quad) (-> sv-84 quad)) + ) + (cond + ((and (focus-test? (the-as process-focusable (-> arg0 process)) board) + (not (focus-test? (the-as process-focusable (-> arg0 process)) halfpipe)) + (!= (-> arg0 cur-pat mode) 3) + (!= (-> arg0 ground-pat mode) 3) + ) + (vector-reflect-flat-gravity! arg2 (-> sv-88 rvec) sv-84 (-> arg0 dynam gravity-normal)) + (vector+! arg2 arg2 sv-84) + ) + ((and (or (>= (fabs (-> arg0 trans x)) 16777216.0) (>= (fabs (-> arg0 trans z)) 16777216.0)) + (and (not (focus-test? (the-as process-focusable (-> arg0 process)) board)) (< 0.7 (-> arg0 surface-angle))) + ) + (vector-reflect-flat-above! arg2 (-> sv-88 rvec) sv-84) + ) + (else + (vector-reflect-flat! arg2 (-> sv-88 rvec) sv-84) + (vector+! arg2 arg2 sv-84) + ) + ) + (let ((f0-37 (-> arg0 current-surface slope-change-preserve))) + (when (< 0.0 f0-37) + (let ((v1-234 (new-stack-vector0))) + (let ((f1-28 (vector-dot (-> arg0 pre-collide-local-normal) (-> sv-88 rvec)))) + 0.0 + (vector-! v1-234 (-> sv-88 rvec) (vector-float*! v1-234 (-> arg0 pre-collide-local-normal) f1-28)) + ) + (let ((f1-29 (vector-length v1-234))) + f1-29 + (let ((f1-30 f1-29) + (f2-5 (vector-length arg2)) + ) + (if (and (< 409.6 (fabs (- f2-5 f1-30))) (< f2-5 f1-30)) + (vector-normalize! arg2 (lerp-scale f2-5 f1-30 f0-37 0.0 1.0)) + ) + ) + ) + ) + ) + ) + (set! (-> arg0 ground-touch-point w) 0.0) + (when (not (logtest? sv-104 (cshape-reaction-flags csrf00 csrf01 csrf02 csrf03 csrf14))) + (set! sv-96 (logior sv-96 (collide-status on-ground))) + (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) + (set! (-> arg0 ground-contact-normal quad) (-> sv-84 quad)) + (set! (-> arg0 ground-local-norm-dot-grav) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) + (set-time! (-> arg0 list-time-on-ground)) + (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) + (set! (-> arg0 ground-touch-point quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> arg0 ground-contact-sphere-center quad) (-> arg1 best-my-prim prim-core world-sphere quad)) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf11))) + (if (= (-> arg0 poly-pat material) (pat-material waterbottom)) + (set! sv-96 (logior sv-96 (collide-status on-water))) + ) + ) + ) + ) + (logior! (-> arg0 status) sv-96) + (set! (-> arg0 reaction-flag) sv-104) + (when *debug-segment* + (+! (-> arg0 history-idx) 1) + (let ((v1-271 (clear-record-tags! *history* (history-channel surface-normal) (-> arg0 history-idx) (the-as uint 2))) + ) + (set! (-> v1-271 origin quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> v1-271 vector quad) (-> arg0 surface-normal quad)) + ) + (let ((v1-274 (clear-record-tags! *history* (history-channel local-normal) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-274 origin quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> v1-274 vector quad) (-> arg0 local-normal quad)) + ) + (set! (-> (clear-record-tags! *history* (history-channel intersect) (-> arg0 history-idx) (the-as uint 2)) + vector + quad + ) + (-> arg1 best-other-tri intersect quad) + ) + (let ((v1-280 (clear-record-tags! *history* (history-channel transv-out) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-280 origin quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> v1-280 vector quad) (-> arg2 quad)) + ) + (let ((v1-283 (clear-record-tags! *history* (history-channel transv-in) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-283 origin quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> v1-283 vector quad) (-> sv-88 uvec quad)) + ) + (let ((v1-286 (clear-record-tags! *history* (history-channel transv) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-286 origin quad) (-> arg0 trans quad)) + (set! (-> v1-286 vector quad) (-> arg0 transv quad)) + ) + (set! (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector quad) + (-> arg0 trans quad) + ) + (let ((v1-292 (clear-record-tags! *history* (history-channel pat) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-292 vector x) (the-as float (-> arg0 cur-pat))) + ) + (let ((v1-294 (clear-record-tags! *history* (history-channel collide-status) (-> arg0 history-idx) (the-as uint 2))) + ) + (set! (-> v1-294 collide-status) (-> arg0 status)) + (set! (-> v1-294 vector z) (the-as float (-> arg0 reaction-flag))) + ) + ) + sv-96 + ) + +(defun target-collision-no-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (if (= (-> arg0 mod-surface mode) 'air) + (logior! (-> arg0 reaction-flag) (cshape-reaction-flags csrf05)) + ) + (when *debug-segment* + (+! (-> arg0 history-idx) 1) + (let ((v1-9 (clear-record-tags! *history* (history-channel transv-out) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-9 origin quad) (-> arg0 trans quad)) + (set! (-> v1-9 vector quad) (-> arg2 quad)) + ) + (let ((v1-12 (clear-record-tags! *history* (history-channel transv-in) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-12 origin quad) (-> arg0 trans quad)) + (set! (-> v1-12 vector quad) (-> arg3 quad)) + ) + (let ((v1-15 (clear-record-tags! *history* (history-channel transv) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-15 origin quad) (-> arg0 trans quad)) + (set! (-> v1-15 vector quad) (-> arg0 transv quad)) + ) + (set! (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector quad) + (-> arg0 trans quad) + ) + (let ((v1-21 (clear-record-tags! *history* (history-channel collide-status) (-> arg0 history-idx) (the-as uint 2))) + ) + (set! (-> v1-21 collide-status) (logior (-> arg0 status) (collide-status no-touch))) + (set! (-> v1-21 vector z) (the-as float (-> arg0 reaction-flag))) + ) + ) + 0 + (none) + ) + +(define *collide-edge-board-spec* (new 'static 'collide-edge-spec + :split-dists (new 'static 'array float 2 1024.0 1433.6) + :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) + :flags (collide-edge-spec-flags find-adjacent-edge send-event) + :ignore-pat (new 'static 'pat-surface :noentity #x1 :nogrind #x1 :probe #x1) + :max-dist-sqrd-to-outward-pt 67108864.0 + :max-dir-cosa-delta -1.0 + :max-dir-cosa-player -2.0 + :touching-segment #f + :local-cache-fill-box (new 'static 'bounding-box + :min (new 'static 'vector :x -12288.0 :y -11059.2 :z -12288.0 :w 1.0) + :max (new 'static 'vector :x 12288.0 :y 16384.0 :z 12288.0 :w 1.0) + ) + :local-within-reach-box (new 'static 'bounding-box + :min (new 'static 'vector :x -11878.4 :y -2867.2 :z -11878.4 :w 1.0) + :max (new 'static 'vector :x 11878.4 :y 2867.2 :z 11878.4 :w 1.0) + ) + :local-player-spheres (new 'static 'inline-array sphere 12 + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x -737.28 :y 4096.0 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 6553.6 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 9420.8 :r 3072.0) + (new 'static 'sphere :x 1720.32 :y 3686.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 5734.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 8601.6 :r 2949.12) + ) + ) + ) + +(defbehavior rail-surface-touch target () + (when (time-elapsed? (-> self control time-of-last-surface-change) (seconds 0.2)) + (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one send-event)) + (set! (-> *collide-edge-board-spec* touching-segment) #f) + (target-method-28 *target* *collide-cache* *collide-edge-board-spec*) + (logior! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags send-event)) + (let ((gp-0 *edge-grab-info*)) + (when (-> gp-0 found-edge?) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (the-as vector (-> gp-0 world-vertex)) + (-> gp-0 world-vertex 1) + ) + 1.0 + ) + (set! (-> self control edge-grab-across-edge-dir quad) (-> gp-0 hanging-matrix rvec quad)) + (send-event + self + 'push-transv + (vector-float*! + (new 'stack-no-clear 'vector) + (-> self control edge-grab-across-edge-dir) + (seek (vector-length (-> self control additional-decaying-velocity)) 40960.0 (* 81920.0 (seconds-per-frame))) + ) + (seconds 0.3) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior gravel-surface-touch target () + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defbehavior mushroom-surface-touch target () + (lerp-scale 0.0 1.0 (-> self control surface-angle) 0.8 0.0) + (if (< (-> self control surface-angle) 0.8) + (seek! (-> *mushroom-surface* slip-factor) 0.0 (* 0.5 (seconds-per-frame))) + (seek! (-> *mushroom-surface* slip-factor) 1.0 (* 2.5 (seconds-per-frame))) + ) + (none) + ) diff --git a/goal_src/jak3/engine/target/darkjak-h.gc b/goal_src/jak3/engine/target/darkjak-h.gc index c0783cbe338..9fb900b5c18 100644 --- a/goal_src/jak3/engine/target/darkjak-h.gc +++ b/goal_src/jak3/engine/target/darkjak-h.gc @@ -7,3 +7,26 @@ ;; DECOMP BEGINS +(deftype darkjak-info (basic) + ((process (pointer target)) + (latch-out-time time-frame) + (attack-id uint32) + (start-time time-frame) + (attack-time time-frame) + (attack-count uint64) + (lightning-count int32) + (charge-effect handle) + (stage darkjak-stage) + (want-stage darkjak-stage) + (clock-pos float) + (clock-vel float) + (clock-on symbol) + (hud handle 1) + (tone sound-id) + (bomb uint32) + (mode-sound-bank connection) + ) + (:methods + (darkjak-info-method-9 () none) + ) + ) diff --git a/goal_src/jak3/engine/target/flut/flut-h.gc b/goal_src/jak3/engine/target/flut/flut-h.gc index 08173cbe1f5..1a7dc171c78 100644 --- a/goal_src/jak3/engine/target/flut/flut-h.gc +++ b/goal_src/jak3/engine/target/flut/flut-h.gc @@ -5,5 +5,65 @@ ;; name in dgo: flut-h ;; dgos: GAME +;; +++flut-flag +(defenum flut-flag + :type uint64 + :bitfield #t + ) +;; ---flut-flag + + ;; DECOMP BEGINS +(deftype flut-info (basic) + ((entity entity-actor) + (flut-trans vector :inline) + (flut-quat vector :inline) + (flut-scale vector :inline) + (prev-quat quaternion :inline) + (stick-lock symbol) + (flap-sound-id uint32) + (mode-sound-bank connection) + (mode basic) + (color-index int32) + (as-daxter? symbol) + (art-group-backup art-group) + (flut-start-time time-frame) + (wild-turn-time time-frame) + (wild-turn-rate degrees) + (attack-id uint32) + ) + ) + + +(deftype flut (process-focusable) + ((extra-trans vector :inline) + (condition int32) + (shadow-backup shadow-geo) + (rider handle) + (nav-sphere-handle handle) + (probe-time time-frame) + (count-lock basic) + (flags flut-flag) + (mode basic) + (color-index int32) + (minimap connection-minimap) + ) + (:methods + (flut-method-28 () none) + (flut-method-29 () none) + (flut-method-30 () none) + (flut-method-31 () none) + (flut-method-32 () none) + (flut-method-33 () none) + (flut-method-34 () none) + ) + ) + + +(defskelgroup skel-flut flut-saddle flut-saddle-lod0-jg -1 + ((flut-saddle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :shadow flut-saddle-shadow-mg + :light-index 1 + ) diff --git a/goal_src/jak3/engine/target/gun/gun-h.gc b/goal_src/jak3/engine/target/gun/gun-h.gc index d24ee711a73..6f87ed9b72e 100644 --- a/goal_src/jak3/engine/target/gun/gun-h.gc +++ b/goal_src/jak3/engine/target/gun/gun-h.gc @@ -5,5 +5,291 @@ ;; name in dgo: gun-h ;; dgos: GAME +;; +++gun-track-flags +(defenum gun-track-flags + :bitfield #t + :type uint16 + (gutflags-0) + (gutflags-1) + (gutflags-2) + (gutflags-3) + (gutflags-4) + ) +;; ---gun-track-flags + + ;; DECOMP BEGINS +(deftype gun (process-drawable) + ((parent (pointer target) :override) + (control control-info :overlay-at root) + (shadow-backup shadow-geo :offset 208) + (read-scale symbol) + (gun-type pickup-type) + (barrel joint-mod 2) + (mag joint-mod 4) + (mag-scale float 4) + (extra handle) + ) + (:state-methods + idle + (use symbol) + hidden + die + ) + ) + + +(deftype gun-info (basic) + ((process (pointer target)) + (gun (pointer gun)) + (gun-pos transformq :inline) + (gun-trans vector :inline :overlay-at (-> gun-pos trans)) + (gun-quat quaternion :inline :overlay-at (-> gun-pos rot data 0)) + (gun-scale vector :inline :overlay-at (-> gun-pos scale)) + (gun-type pickup-type) + (using-gun-type pickup-type) + (active? symbol) + (latch? symbol) + (put-away? symbol) + (surpress-time time-frame) + (fire-time time-frame) + (gun-delay-fire float) + (gun-time time-frame) + (gun-get-on-time time-frame) + (active-time time-frame) + (fire-delay uint32) + (gun-control uint32) + (gun-target (pointer process-focusable)) + (gun-daxter float) + (gun-select-time time-frame 4) + (gun-roty-rel degrees) + (gun-roty degrees) + (gun-roty-targ degrees) + (hips joint-mod) + (upper-body joint-mod) + (chest joint-mod) + (strip prim-strip) + (uv-slide float) + (fire-dir-rot degrees) + (fire-dir vector :inline) + (unk-vec vector :inline) + (fire-point vector :inline :offset 256) + (fire-dir-backup vector :inline) + (fire-dir-out vector :inline) + (fire-pending int32) + (fire-pending-time time-frame) + (fire-start-time time-frame) + (fire-charge float) + (fire-spin degrees) + (fire-spinv degrees) + (fire-chamber int32) + (fire-range meters) + (laser-active? symbol) + (laser-point vector :inline) + (laser-dir vector :inline) + (unk-vec00 vector :inline) + (laser-hit-point vector :inline :offset 400) + (track? gun-track-flags) + (track-tilt degrees) + (track-turn degrees) + (track-find-range meters) + (track-turnv-range meters) + (track-tilt-range meters) + (track-turn-range meters) + (track-tilt-max degrees) + (track-turn-max degrees) + (track-angle-mult float) + (track-beam-size float) + (track-auto-fire symbol) + (track-require uint32) + (track-target-hold-time time-frame) + (track-start-time time-frame) + (track-press-start-time time-frame) + (track-target focus 2 :inline) + (track-trans vector :inline) + (track-dir vector :inline) + (turn-fast-hold-time time-frame) + (blue-whine-sound-id sound-id) + (blue-whine-volume float) + (mode-sound-bank connection) + (top-anim-twist vector :inline) + (top-anim-twist-targ vector :inline) + (top-anim-look-at vector :inline) + (top-anim-twist-reset uint64) + (top-anim-gun-height meters) + (top-anim-blue-cycle float) + (top-anim-low-high float) + (top-anim-extra-twistv degrees) + (top-anim-tilt-up degrees) + (attack-combo combo-tracker :inline) + (combo-window-start time-frame) + (combo-window-state symbol) + (combo-fire-delay uint32) + (charge-ammo float) + (charge-start-time time-frame) + (charge-inc-time time-frame) + (charge-active? handle) + (part sparticle-launch-control) + (ammo-required float) + ) + (:methods + (gun-info-method-9 (_type_) vector) + ) + ) + + +(defun using-gun? ((arg0 target)) + (nonzero? (-> arg0 gun gun-type)) + ) + +(defun enabled-gun? ((arg0 target)) + (nonzero? (-> arg0 gun using-gun-type)) + ) + +;; WARN: Return type mismatch int vs pickup-type. +(defun gun->ammo ((arg0 pickup-type)) + (let ((v1-0 arg0)) + (the-as pickup-type (cond + ((or (= v1-0 (pickup-type eco-yellow)) + (= v1-0 (pickup-type gun-yellow-1)) + (= v1-0 (pickup-type gun-yellow-2)) + (= v1-0 (pickup-type gun-yellow-3)) + ) + (the-as pickup-type (pickup-type ammo-yellow)) + ) + ((or (= v1-0 (pickup-type eco-red)) + (= v1-0 (pickup-type gun-red-1)) + (= v1-0 (pickup-type gun-red-2)) + (= v1-0 (pickup-type gun-red-3)) + ) + (the-as pickup-type (pickup-type ammo-red)) + ) + ((or (= v1-0 (pickup-type eco-blue)) + (= v1-0 (pickup-type gun-blue-1)) + (= v1-0 (pickup-type gun-blue-2)) + (= v1-0 (pickup-type gun-blue-3)) + ) + (the-as pickup-type (pickup-type ammo-blue)) + ) + ((or (= v1-0 (pickup-type eco-dark)) + (= v1-0 (pickup-type gun-dark-1)) + (= v1-0 (pickup-type gun-dark-2)) + (= v1-0 (pickup-type gun-dark-3)) + ) + (the-as pickup-type (pickup-type ammo-dark)) + ) + (else + (the-as pickup-type (pickup-type none)) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs pickup-type. +(defun gun->eco ((arg0 pickup-type)) + (let ((v1-0 arg0)) + (the-as pickup-type (cond + ((or (= v1-0 (pickup-type eco-yellow)) + (= v1-0 (pickup-type gun-yellow-1)) + (= v1-0 (pickup-type gun-yellow-2)) + (= v1-0 (pickup-type gun-yellow-3)) + ) + (the-as pickup-type (pickup-type eco-yellow)) + ) + ((or (= v1-0 (pickup-type eco-red)) + (= v1-0 (pickup-type gun-red-1)) + (= v1-0 (pickup-type gun-red-2)) + (= v1-0 (pickup-type gun-red-3)) + ) + (the-as pickup-type (pickup-type eco-red)) + ) + ((or (= v1-0 (pickup-type eco-blue)) + (= v1-0 (pickup-type gun-blue-1)) + (= v1-0 (pickup-type gun-blue-2)) + (= v1-0 (pickup-type gun-blue-3)) + ) + (the-as pickup-type (pickup-type eco-blue)) + ) + ((or (= v1-0 (pickup-type eco-dark)) + (= v1-0 (pickup-type gun-dark-1)) + (= v1-0 (pickup-type gun-dark-2)) + (= v1-0 (pickup-type gun-dark-3)) + ) + (the-as pickup-type (pickup-type eco-dark)) + ) + (else + (the-as pickup-type (pickup-type none)) + ) + ) + ) + ) + ) + +(defmethod get-gun-ammo ((this fact-info-target)) + (let ((v1-2 (gun->ammo (-> this process gun gun-type)))) + (if (= v1-2 (pickup-type none)) + 0.0 + (-> this process game gun-ammo (+ v1-2 -15)) + ) + ) + ) + +(deftype beam-info (structure) + ((y-scale float) + ) + ) + + +(defskelgroup skel-gun gun gun-lod0-jg -1 + ((gun-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.5) + :shadow gun-shadow-mg + :shadow-joint-index 3 + :light-index 1 + ) + +(define *gun-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #xa)) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w 81920.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +(defskelgroup skel-ammo-yellow gun gun-ammo-yellow-lod0-jg gun-ammo-idle-ja + ((gun-ammo-yellow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + :light-index 1 + ) + +(defskelgroup skel-ammo-red gun gun-ammo-red-lod0-jg gun-ammo-idle-ja + ((gun-ammo-red-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + :light-index 1 + ) + +(defskelgroup skel-ammo-blue gun gun-ammo-blue-lod0-jg gun-ammo-idle-ja + ((gun-ammo-blue-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + :light-index 1 + ) + +(defskelgroup skel-ammo-dark gun gun-ammo-dark-lod0-jg gun-ammo-idle-ja + ((gun-ammo-dark-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + :light-index 1 + ) + +(defskelgroup skel-gun-red-cone gun gun-red-cone-lod0-jg gun-red-cone-idle-ja + ((gun-red-cone-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + ) diff --git a/goal_src/jak3/engine/target/gun/gun-util.gc b/goal_src/jak3/engine/target/gun/gun-util.gc index 3ac7ac8d721..de5c72eac90 100644 --- a/goal_src/jak3/engine/target/gun/gun-util.gc +++ b/goal_src/jak3/engine/target/gun/gun-util.gc @@ -7,3 +7,1162 @@ ;; DECOMP BEGINS +(deftype gun-eject (projectile-bounce) + () + ) + + +(defmethod projectile-method-31 ((this gun-eject)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (let ((v1-5 (-> this skel root-channel 0))) + (set! (-> v1-5 frame-group) (-> this parent 0 skel channel 0 frame-group)) + ) + (let ((t9-3 (method-of-type projectile-bounce projectile-method-31))) + (t9-3 this) + ) + (quaternion-copy! (-> this root quat) (-> this parent 0 root quat)) + (set! (-> this timeout) (seconds 4)) + (set! (-> this root root-prim local-sphere w) 3276.8) + (logclear! (-> this mask) (process-mask projectile)) + 0 + (none) + ) + +(deftype gun-mag-yellow (projectile-bounce) + () + ) + + +(defmethod projectile-method-31 ((this gun-mag-yellow)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile-bounce projectile-method-31))) + (t9-2 this) + ) + (set! (-> this timeout) (seconds 4)) + (sound-play "dark-shot-fire") + 0 + (none) + ) + +(deftype gun-mag-red (projectile-bounce) + () + ) + + +(defmethod projectile-method-31 ((this gun-mag-red)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile-bounce projectile-method-31))) + (t9-2 this) + ) + (set! (-> this timeout) (seconds 4)) + (sound-play "dark-shot-fire") + 0 + (none) + ) + +(deftype gun-mag-blue (projectile-bounce) + () + ) + + +(defmethod projectile-method-31 ((this gun-mag-blue)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile-bounce projectile-method-31))) + (t9-2 this) + ) + (set! (-> this timeout) (seconds 4)) + (sound-play "dark-shot-fire") + 0 + (none) + ) + +(deftype gun-mag-dark (projectile-bounce) + () + ) + + +(defmethod projectile-method-31 ((this gun-mag-dark)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile-bounce projectile-method-31))) + (t9-2 this) + ) + (set! (-> this timeout) (seconds 4)) + (sound-play "dark-shot-fire") + 0 + (none) + ) + +(define *beam-info* (new 'static 'beam-info)) + +(defun birth-func-setup-beam ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (a0-2 float) (a0-3 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a0-1 arg2) + (v1-0 *particle-quat*) + ) + (cond + ((< (-> v1-0 w) 0.0) + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-2 vf1) + ) + (else + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-3 vf1) + ) + ) + ) + (set! (-> arg2 conerot w) (-> *beam-info* y-scale)) + 0 + (none) + ) + ) + +(defun birth-func-laser-pointer ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (a0-2 float) (a0-3 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a0-1 arg2) + (v1-0 *particle-quat*) + ) + (cond + ((< (-> v1-0 w) 0.0) + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-2 vf1) + ) + (else + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-3 vf1) + ) + ) + ) + (set! (-> arg2 conerot w) (-> *beam-info* y-scale)) + (set! (-> arg1 user1-int16) (the-as uint (logand (/ (-> *display* base-clock frame-counter) 10) 31))) + 0 + (none) + ) + ) + +(defun draw-beam ((arg0 sparticle-launcher) (arg1 vector) (arg2 vector) (arg3 symbol)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) + (set! (-> s5-0 1 quad) (-> arg2 quad)) + (let ((v1-2 (get-field-spec-by-id arg0 (sp-field-id spt-scale-y)))) + (when v1-2 + (let ((f30-0 (-> v1-2 initial-valuef))) + (if arg3 + (set! f30-0 (fmin f30-0 (vector-length arg2))) + ) + (vector-normalize! (-> s5-0 1) f30-0) + (set! (-> *beam-info* y-scale) f30-0) + ) + ) + ) + (vector+! (-> s5-0 0) arg1 (-> s5-0 1)) + (when (line-in-view-frustum? arg1 (-> s5-0 0)) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (vector+float*! s3-1 arg1 (-> s5-0 1) 0.5) + (vector-normalize! (-> s5-0 1) 1.0) + (forward-up->quaternion *particle-quat* (-> s5-0 1) *y-vector*) + (let ((t9-5 sp-launch-particles-var) + (a0-12 *sp-particle-system-3d*) + (a1-9 arg0) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> s3-1 quad)) + (t9-5 a0-12 a1-9 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (dotimes (s5-1 2) + (quaternion-rotate-local-z! *particle-quat* *particle-quat* 10922.667) + (let ((t9-7 sp-launch-particles-var) + (a0-14 *sp-particle-system-3d*) + (a1-11 arg0) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> s3-1 quad)) + (t9-7 a0-14 a1-11 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch process-drawable vs gun. +(defmethod relocate ((this gun) (offset int)) + (dotimes (v1-0 2) + (if (nonzero? (-> this barrel v1-0)) + (&+! (-> this barrel v1-0) offset) + ) + ) + (dotimes (v1-3 4) + (if (nonzero? (-> this mag v1-3)) + (&+! (-> this mag v1-3) offset) + ) + ) + (the-as gun ((method-of-type process-drawable relocate) this offset)) + ) + +;; WARN: Return type mismatch prim-strip vs gun-info. +(defmethod relocate ((this gun-info) (offset int)) + (the-as gun-info (when (nonzero? (-> this strip)) + (let ((v0-0 (&+ (-> this strip) offset))) + (set! (-> this strip) v0-0) + v0-0 + ) + ) + ) + ) + +(defbehavior gun-post gun () + (let ((gp-0 (ppointer->process (-> self parent)))) + (let ((s5-0 self)) + (set! self (the-as gun gp-0)) + (target-gun-compute-pos) + (set! self s5-0) + ) + (set! (-> self root trans quad) (-> (the-as target gp-0) gun gun-pos trans quad)) + (let ((v1-6 (-> (the-as target gp-0) gun gun-pos quat quad))) + (set! (-> self root quat quad) v1-6) + ) + (set! (-> self root scale quad) (-> (the-as target gp-0) gun gun-pos scale quad)) + (when (-> self read-scale) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (matrix->scale (-> (the-as target gp-0) node-list data 36 bone transform) s5-1) + (vector-float*! s5-1 s5-1 0.71428573) + (if (< 0.0 (-> (the-as target gp-0) gun gun-daxter)) + (matrix->scale (-> (the-as target gp-0) sidekick 0 node-list data 28 bone transform) s4-0) + ) + (vector-lerp! (-> self root scale) s5-1 s4-0 (-> (the-as target gp-0) gun gun-daxter)) + ) + ) + (set! (-> self draw light-index) (-> (the-as target gp-0) draw light-index)) + (let ((v1-28 (-> (the-as target gp-0) draw color-mult quad))) + (set! (-> self draw color-mult quad) v1-28) + ) + (let ((v1-30 (-> (the-as target gp-0) draw color-emissive quad))) + (set! (-> self draw color-emissive quad) v1-30) + ) + (set! (-> self draw force-fade) (-> (the-as target gp-0) draw force-fade)) + (set! (-> self draw global-effect) (-> (the-as target gp-0) draw global-effect)) + (set! (-> self draw death-vertex-skip) (-> self parent 0 draw death-vertex-skip)) + (set! (-> self draw death-effect) (-> self parent 0 draw death-effect)) + (set! (-> self draw death-timer) (-> self parent 0 draw death-timer)) + (set! (-> self draw death-timer-org) (-> self parent 0 draw death-timer-org)) + (set! (-> self draw death-draw-overlap) (-> self parent 0 draw death-draw-overlap)) + (let ((v1-57 (-> (the-as target gp-0) draw shadow-ctrl settings shadow-dir quad))) + (set! (-> self draw shadow-ctrl settings shadow-dir quad) v1-57) + ) + (cond + ((logtest? (-> (the-as target gp-0) draw shadow-ctrl settings flags) (shadow-flags disable-draw)) + (let ((v1-63 (-> self draw shadow-ctrl))) + (logior! (-> v1-63 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (else + (let ((v1-66 (-> self draw shadow-ctrl))) + (logclear! (-> v1-66 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + (twist-set! (-> self barrel 0) (the-as float #f) (the-as float #f) (-> (the-as target gp-0) gun fire-spin)) + (twist-set! + (-> self barrel 1) + (the-as float #f) + (the-as float #f) + (if (= (-> self gun-type) (pickup-type gun-blue-2)) + (-> (the-as target gp-0) gun fire-spin) + 0.0 + ) + ) + (if (or (logtest? (-> (the-as target gp-0) draw status) + (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2) + ) + (or (logtest? (-> (the-as target gp-0) target-effect) 1) + (zero? (-> (the-as target gp-0) skel active-channels)) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (if (logtest? (-> (the-as target gp-0) draw status) (draw-control-status force-fade)) + (logior! (-> self draw status) (draw-control-status force-fade)) + (logclear! (-> self draw status) (draw-control-status force-fade)) + ) + (if (logtest? (-> (the-as target gp-0) target-effect) 7) + (logior! (-> self draw global-effect) (draw-control-global-effect no-textures)) + (logclear! (-> self draw global-effect) (draw-control-global-effect no-textures)) + ) + (if (logtest? (-> (the-as target gp-0) target-effect) 56) + (logior! (-> self draw global-effect) (draw-control-global-effect rim-lights)) + (logclear! (-> self draw global-effect) (draw-control-global-effect rim-lights)) + ) + ) + (dotimes (gp-1 4) + (cond + ((= (-> self parent 0 game gun-ammo gp-1) 0.0) + (when (!= (-> self mag-scale gp-1) 0.0) + (let ((s5-2 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (vector<-cspace! s3-0 (-> self mag gp-1 joint)) + (vector-normalize-copy! s4-1 (-> self mag gp-1 joint bone transform uvec) 40960.0) + (+! (-> s4-1 y) 81920.0) + (set! (-> s5-2 ent) (-> self entity)) + (set! (-> s5-2 charge) 1.0) + (set! (-> s5-2 options) (projectile-options)) + (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) + (set! (-> s5-2 pos quad) (-> s3-0 quad)) + (set! (-> s5-2 vel quad) (-> s4-1 quad)) + ) + (set! (-> s5-2 notify-handle) (the-as handle #f)) + (set! (-> s5-2 owner-handle) (the-as handle #f)) + (set! (-> s5-2 target-handle) (the-as uint #f)) + (set! (-> s5-2 target-pos quad) (the-as uint128 0)) + (set! (-> s5-2 ignore-handle) (process->handle self)) + (let* ((v1-133 *game-info*) + (a0-59 (+ (-> v1-133 attack-id) 1)) + ) + (set! (-> v1-133 attack-id) a0-59) + (set! (-> s5-2 attack-id) a0-59) + ) + (set! (-> s5-2 timeout) (seconds 4)) + (let ((t9-8 spawn-projectile) + (v1-135 gp-1) + ) + (t9-8 + (cond + ((zero? v1-135) + gun-mag-yellow + ) + ((= v1-135 1) + gun-mag-red + ) + ((= v1-135 2) + gun-mag-blue + ) + (else + gun-mag-dark + ) + ) + s5-2 + self + *default-dead-pool* + ) + ) + ) + ) + (set! (-> self mag-scale gp-1) 0.0) + (trs-set! (-> self mag gp-1) (the-as vector #f) (the-as quaternion #f) *zero-vector*) + ) + (else + (seek! (-> self mag-scale gp-1) 1.0 (* 8.0 (seconds-per-frame))) + (let* ((f30-0 (-> self mag-scale gp-1)) + (s5-3 (-> self mag gp-1)) + (s4-2 (method-of-object s5-3 trs-set!)) + (s3-1 #f) + (s2-0 #f) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s1-0 x) (lerp-scale 0.1 1.0 f30-0 0.4 1.0)) + (set! (-> s1-0 y) (lerp-scale 0.0 1.0 f30-0 0.0 0.4)) + (set! (-> s1-0 z) (lerp-scale 0.1 1.0 f30-0 0.4 1.0)) + (set! (-> s1-0 w) 1.0) + (s4-2 s5-3 (the-as vector s3-1) (the-as quaternion s2-0) s1-0) + ) + ) + ) + ) + (ja-post) + (if *display-sidekick-stats* + (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) + ) + 0 + (none) + ) + +(defstate hidden (gun) + :virtual #t + :trans (behavior () + (let ((v1-0 (-> self parent))) + (if (not (focus-test? + (the-as process-focusable (if v1-0 + (the-as process-focusable (-> v1-0 0 self)) + ) + ) + in-head + ) + ) + (go-virtual idle) + ) + ) + ) + :code (behavior () + (ja-channel-set! 0) + (ja-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + ) + +(defstate idle (gun) + :virtual #t + :trans (behavior () + (set! (-> self gun-type) (-> self parent 0 game gun-type)) + (let ((a0-0 (ppointer->process (-> self parent)))) + (cond + ((focus-test? (the-as process-focusable a0-0) in-head) + (go-virtual hidden) + ) + ((nonzero? (-> self parent 0 gun gun-type)) + (go-virtual use (the-as symbol a0-0)) + ) + ) + ) + ) + :code (behavior () + (set! (-> self draw shadow) #f) + (ja-channel-set! 1) + (set! (-> self read-scale) #f) + (until #f + (ja-no-eval :group! gun-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post gun-post + ) + +(defstate use (gun) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notice) + (case (-> block param 0) + (('die) + (if (-> *setting-control* user-current gun-eject) + (go-virtual die) + ) + ) + ) + ) + (('release) + (send-event (ppointer->process (-> self parent)) 'release) + ) + (('eject-point) + (vector<-cspace! (the-as vector (-> block param 0)) (joint-node gun-lod0-jg backCover)) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set-time! (-> self state-time)) + (set! (-> self draw shadow) (-> self shadow-backup)) + (logior! (-> self skel status) (joint-control-status sync-math)) + ) + :exit (behavior () + (logclear! (-> self skel status) (joint-control-status sync-math)) + ) + :trans (behavior () + (local-vars (a0-14 object)) + (let ((v1-0 (ppointer->process (-> self parent))) + (a0-1 (-> self parent)) + ) + (cond + ((focus-test? + (the-as process-focusable (if a0-1 + (the-as process-focusable (-> a0-1 0 self)) + ) + ) + in-head + ) + (go-virtual hidden) + ) + ((and (= (-> self parent 0 gun gun-type) (pickup-type none)) + (or (not (-> (the-as process-focusable v1-0) skel top-anim frame-group)) + (!= (-> (the-as process-focusable v1-0) skel top-anim interp) 1.0) + ) + ) + (go-virtual idle) + ) + ((begin + (set! a0-14 (!= (-> self parent 0 game gun-type) (-> self gun-type))) + (and (the-as symbol a0-14) (let ((v1-16 (-> self state-time))) + (set! a0-14 (current-time)) + (!= v1-16 (the-as time-frame a0-14)) + ) + ) + ) + (go-virtual use (the-as symbol a0-14)) + ) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.1)) + (gun->eco (-> self gun-type)) + (let ((gp-0 (-> self gun-type))) + (gun->eco (-> self parent 0 game gun-type)) + (let ((v1-8 (-> self parent 0 game gun-type))) + (set! (-> self gun-type) v1-8) + (cond + ((and (= gp-0 (pickup-type gun-red-1)) (= v1-8 (pickup-type gun-red-2))) + (ja-no-eval :group! gun-gun-red1-red2-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((and (= gp-0 (pickup-type gun-yellow-2)) (= v1-8 (pickup-type gun-yellow-3))) + (ja-no-eval :group! gun-gun-yellow2-yellow3-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((and (= gp-0 (pickup-type gun-blue-1)) (= v1-8 (pickup-type gun-blue-2))) + (ja-no-eval :group! gun-gun-blue1-blue2-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((and (= gp-0 (pickup-type gun-dark-1)) (= v1-8 (pickup-type gun-dark-2))) + (ja-no-eval :group! gun-gun-dark1-dark2-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((and (= gp-0 (pickup-type gun-dark-2)) (= v1-8 (pickup-type gun-dark-3))) + (ja-no-eval :group! gun-gun-dark2-dark3-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + (let* ((v1-131 (-> self gun-type)) + (gp-1 (cond + ((= v1-131 (pickup-type gun-yellow-1)) + gun-idle-yellow-ja + ) + ((= v1-131 (pickup-type gun-yellow-2)) + gun-idle-yellow2-ja + ) + ((= v1-131 (pickup-type gun-yellow-3)) + gun-idle-yellow3-ja + ) + ((= v1-131 (pickup-type gun-red-1)) + gun-idle-red-ja + ) + ((= v1-131 (pickup-type gun-red-2)) + gun-idle-red2-ja + ) + ((= v1-131 (pickup-type gun-red-3)) + gun-idle-red3-ja + ) + ((= v1-131 (pickup-type gun-blue-1)) + gun-idle-blue-ja + ) + ((= v1-131 (pickup-type gun-blue-2)) + gun-idle-blue2-ja + ) + ((= v1-131 (pickup-type gun-blue-3)) + gun-idle-blue3-ja + ) + ((= v1-131 (pickup-type gun-dark-2)) + gun-idle-dark2-ja + ) + ((= v1-131 (pickup-type gun-dark-3)) + gun-idle-dark3-ja + ) + (else + gun-idle-dark-ja + ) + ) + ) + (s5-0 '(("jakb-gun-yellow-fire" . "gun-yellow-fire") + ("jakb-gun-yellow-fire-low" . "gun-yellow-fire-low") + ("jakb-pilot-gun-yellow-fire" . "gun-yellow-fire") + ("jakb-gun-red-fire" . "gun-red-fire") + ("jakb-pilot-gun-red-fire" . "gun-red-fire") + ("jakb-gun-blue-fire" . "gun-blue-fire") + ("jakb-pilot-gun-blue-fire" . "gun-blue-fire") + ("jakb-gun-blue-fire-single" . "gun-blue-fire-single") + ("jakb-pilot-gun-blue-fire-single" . "gun-blue-fire-single") + ("jakb-gun-dark-fire" . "gun-dark-fire") + ("jakb-pilot-gun-dark-fire" . "gun-dark-fire") + ("jakb-gun-red-fire-2" . "gun-red-fire-2") + ("jakb-gun-yellow-fire-3" . "gun-yellow-fire-3") + ("jakb-gun-blue-fire-2" . "gun-blue-fire-2") + ) + ) + (v1-156 (-> self parent)) + (s4-0 (if v1-156 + (the-as process-focusable (-> v1-156 0 self)) + ) + ) + ) + (until #f + (let* ((v1-160 (-> s4-0 skel top-anim frame-group)) + (s3-0 (if v1-160 + (-> v1-160 name) + ) + ) + (s2-0 (nassoc s3-0 s5-0)) + (s1-0 (if s2-0 + (-> (the-as pair s2-0) cdr) + ) + ) + ) + (cond + ((string= (the-as string s1-0) "gun-red-fire") + (case (-> self gun-type) + (((pickup-type gun-red-3)) + (set! s1-0 "gun-red-fire-3") + ) + ) + ) + ((or (string= (the-as string s1-0) "gun-yellow-fire") (string= (the-as string s1-0) "gun-yellow-fire-low")) + (case (-> self gun-type) + (((pickup-type gun-yellow-2)) + (set! s1-0 "gun-yellow-fire-2") + ) + (((pickup-type gun-yellow-3)) + (set! s1-0 "gun-yellow-fire-3") + ) + ) + ) + ((string= (the-as string s1-0) "gun-blue-fire") + (case (-> self gun-type) + (((pickup-type gun-blue-3)) + (set! s1-0 "gun-blue-fire-3") + ) + ) + ) + ((string= (the-as string s1-0) "gun-blue-fire-single") + (case (-> self gun-type) + (((pickup-type gun-blue-3)) + (set! s1-0 "gun-blue-fire-3-single") + ) + ) + ) + ((string= (the-as string s1-0) "gun-dark-fire") + (case (-> self gun-type) + (((pickup-type gun-red-2)) + (set! s1-0 "gun-red-fire-2") + ) + (((pickup-type gun-dark-2)) + (set! s1-0 "gun-dark-fire-2") + ) + (((pickup-type gun-dark-3)) + (set! s1-0 "gun-dark-fire-3") + ) + ) + ) + ) + (let ((a1-27 (if s1-0 + (get-art-by-name (-> self draw art-group) (the-as string s1-0) art-joint-anim) + ) + ) + ) + (cond + (s2-0 + (ja :group! a1-27 :num! (identity (-> s4-0 skel top-anim frame-num))) + (set! (-> self read-scale) #f) + ) + ((nmember s3-0 '("jakb-gun-attack-butt" + "jakb-gun-attack-butt-end" + "jakb-gun-attack-butt-blue" + "jakb-gun-attack-butt-blue-end" + "jakb-gun-attack-from-stance" + "jakb-gun-attack-from-stance-end" + "jakb-gun-attack-from-stance-blue" + "jakb-gun-attack-from-stance-blue-end" + "jakb-pilot-gun-red-yellow" + ) + ) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + (set! (-> self read-scale) #t) + ) + ((and (= (-> s4-0 skel top-anim interp) 1.0) + (begin + (set! s2-0 (nassoc s3-0 '(("jakb-gun-yellow-takeout" . "gun-red-yellow") + ("jakb-gun-blue-takeout" . "gun-red-blue") + ("jakb-gun-dark-takeout" . "gun-red-dark") + ("jakb-gun-red-takeout" . "gun-idle-red") + ("jakb-pilot-gun-yellow-takeout" . "gun-red-yellow") + ("jakb-pilot-gun-blue-takeout" . "gun-red-blue") + ("jakb-pilot-gun-dark-takeout" . "gun-red-dark") + ("jakb-pilot-gun-red-takeout" . "gun-idle-red") + ) + ) + ) + s2-0 + ) + ) + (let ((s1-1 + (if s2-0 + (get-art-by-name (-> self draw art-group) (the-as string (-> (the-as pair s2-0) cdr)) art-joint-anim) + ) + ) + ) + (set! (-> self read-scale) #t) + (let* ((v1-208 (-> s4-0 skel top-anim frame-group)) + (f30-0 (+ (* (-> s4-0 skel top-anim frame-num) (-> v1-208 artist-step)) (-> v1-208 artist-base))) + ) + (cond + ((string= s3-0 "jakb-gun-blue-takeout") + (if (>= f30-0 (-> s1-1 artist-base)) + (ja :group! s1-1 :num! (identity (ja-aframe f30-0 0))) + (ja :group! gun-idle-ja) + ) + ) + ((or (string= s3-0 "jakb-gun-dark-takeout") (string= s3-0 "jakb-pilot-gun-dark-takeout")) + (if (>= f30-0 -40.0) + (ja :group! s1-1 :num! (identity (+ 40.0 (ja-aframe f30-0 0)))) + (ja :group! s1-1 :num! min) + ) + ) + ((>= f30-0 -40.0) + (ja :group! s1-1 :num! (identity (ja-aframe f30-0 0))) + ) + (else + (ja :group! gun-idle-ja) + ) + ) + ) + ) + ) + (else + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + (set! (-> self read-scale) #f) + ) + ) + ) + ) + (suspend) + 0 + ) + ) + #f + ) + :post (behavior () + (gun-post) + (let* ((v1-0 (-> self parent)) + (gp-0 (if v1-0 + (the-as process-drawable (-> v1-0 0 self)) + ) + ) + ) + (let ((s5-0 + (and (-> (the-as target gp-0) skel top-anim frame-group) + (not (or (focus-test? (the-as target gp-0) pilot) + (string= (-> (the-as target gp-0) skel top-anim frame-group name) "jakb-gun-attack-from-stance-end") + (string= (-> (the-as target gp-0) skel top-anim frame-group name) "jakb-gun-attack-from-stance") + (string= (-> (the-as target gp-0) skel top-anim frame-group name) "jakb-gun-dark-fire") + (string= (-> (the-as target gp-0) skel top-anim frame-group name) "jakb-gun-stance-dark") + (string= (-> (the-as target gp-0) skel top-anim frame-group name) "jakb-gun-attack-from-stance-blue-end") + ) + ) + ) + ) + ) + (vector<-cspace! (-> (the-as target gp-0) gun fire-point) (joint-node gun-lod0-jg muzzle)) + (set! (-> (the-as target gp-0) gun unk-vec quad) (-> (the-as target gp-0) gun fire-dir quad)) + (cond + ((and (handle->process (-> (the-as target gp-0) gun track-target 0 handle)) + (logtest? (surface-flag gun-direct) (-> (the-as target gp-0) control current-surface flags)) + ) + (vector-! + (-> (the-as target gp-0) gun fire-dir) + (-> (the-as target gp-0) gun track-trans) + (-> (the-as target gp-0) gun fire-point) + ) + (vector-normalize! (-> (the-as target gp-0) gun fire-dir) 1.0) + (set! (-> (the-as target gp-0) gun fire-dir-out quad) (-> (the-as target gp-0) gun fire-dir quad)) + ) + (else + (vector-normalize-copy! + (-> (the-as target gp-0) gun fire-dir) + (-> self node-list data 13 bone transform fvec) + 1.0 + ) + (if s5-0 + (set! (-> (the-as target gp-0) gun fire-dir-out quad) + (-> (the-as target gp-0) node-list data 4 bone transform fvec quad) + ) + ) + (vector-rotate-y! + (-> (the-as target gp-0) gun fire-dir-out) + (-> (the-as target gp-0) gun fire-dir) + (-> (the-as target gp-0) gun fire-dir-rot) + ) + ) + ) + (vector<-cspace! (-> (the-as target gp-0) gun laser-point) (joint-node gun-lod0-jg laser)) + (set! (-> (the-as target gp-0) gun unk-vec00 quad) (-> (the-as target gp-0) gun laser-dir quad)) + (set! (-> (the-as target gp-0) gun laser-dir quad) (-> (the-as target gp-0) gun fire-dir-out quad)) + (if s5-0 + (set! (-> (the-as target gp-0) gun laser-dir quad) + (-> (the-as target gp-0) node-list data 4 bone transform fvec quad) + ) + ) + ) + (let ((s5-1 self)) + (set! self (the-as gun gp-0)) + (target-gun-check) + (set! self s5-1) + ) + ) + ) + ) + +(defstate die (gun) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reset) + (go-virtual idle) + ) + ) + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-float*! + s5-0 + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self parent 0 control quat)) + -20480.0 + ) + (+! (-> s5-0 y) 81920.0) + (set! (-> gp-0 ent) (-> self entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) (-> s4-0 quad)) + (set! (-> gp-0 vel quad) (-> s5-0 quad)) + ) + (set! (-> gp-0 notify-handle) (the-as handle #f)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as uint #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle self)) + (let* ((v1-16 *game-info*) + (a0-13 (+ (-> v1-16 attack-id) 1)) + ) + (set! (-> v1-16 attack-id) a0-13) + (set! (-> gp-0 attack-id) a0-13) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (spawn-projectile gun-eject gp-0 self *default-dead-pool*) + ) + (ja-channel-set! 0) + (ja-post) + (while (logtest? (-> self parent 0 focus-status) (focus-status dead)) + (suspend) + ) + (go-virtual idle) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior gun-init gun () + (change-to-last-brother self) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-5 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *gun-shadow-control* settings shadow-dir quad) v1-5) + ) + (set! (-> self draw shadow-ctrl) *gun-shadow-control*) + (set! (-> self shadow-backup) (-> self draw shadow)) + (set! (-> self barrel 0) (new 'process 'joint-mod (joint-mod-mode rotate) self 8)) + (set! (-> self barrel 1) (new 'process 'joint-mod (joint-mod-mode rotate) self 10)) + (set! (-> self read-scale) #f) + (set! (-> self extra) (the-as handle #f)) + (set! (-> self mag 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 38)) + (set! (-> self mag 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 36)) + (set! (-> self mag 2) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 37)) + (set! (-> self mag 3) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 39)) + (dotimes (v1-15 4) + (set! (-> self mag-scale v1-15) (if (= (-> self parent 0 game gun-ammo v1-15) 0.0) + 0.0 + 1.0 + ) + ) + ) + (go-virtual idle) + (none) + ) + +(defmethod gun-info-method-9 ((this gun-info)) + (when (and (-> this laser-active?) + (-> this active?) + (not (logtest? (-> this gun 0 draw status) (draw-control-status no-draw))) + #t + ) + (let ((s5-0 (-> this laser-point)) + (s4-0 (new 'stack-no-clear 'collide-query)) + (s3-0 (-> this laser-dir)) + (f30-0 (rotate-y<-vector+vector (-> this laser-dir) (-> this unk-vec00))) + ) + (vector+float*! (-> s4-0 start-pos) s5-0 s3-0 -8192.0) + (vector-float*! (-> s4-0 move-dist) s3-0 163840.0) + (let ((v1-13 s4-0)) + (set! (-> v1-13 radius) (-> this track-beam-size)) + (set! (-> v1-13 collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> v1-13 ignore-process0) (ppointer->process (-> this process))) + (set! (-> v1-13 ignore-process1) #f) + (set! (-> v1-13 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-13 action-mask) (collide-action solid semi-solid)) + ) + (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) + (cond + ((>= f0-3 0.0) + (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) (-> s4-0 move-dist) f0-3) + (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) s3-0 (-> this track-beam-size)) + (let* ((s2-0 (-> s4-0 best-other-tri collide-ptr)) + (s0-0 (if (type? s2-0 collide-shape-prim) + (the-as collide-shape-prim s2-0) + ) + ) + (s1-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 start-pos)) 1638.4)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-1 quad) (-> s4-0 start-pos quad)) + (cond + ((and s0-0 + (or (logtest? (process-mask enemy guard) (-> s0-0 cshape process mask)) + (= (handle->process (-> this track-target 0 handle)) (-> s0-0 cshape process)) + ) + (>= (-> this fire-range) (vector-vector-distance s2-1 s5-0)) + ) + (vector+! s2-1 s2-1 s1-0) + (launch-particles (-> *part-id-table* 211) s2-1) + (launch-particles (-> *part-id-table* 210) s2-1) + ) + (else + (vector+! s2-1 s2-1 s1-0) + (launch-particles (-> *part-id-table* 212) s2-1) + ) + ) + ) + ) + (else + (vector+! (-> s4-0 start-pos) (-> s4-0 start-pos) (-> s4-0 move-dist)) + ) + ) + ) + (set! (-> this laser-hit-point quad) (-> s4-0 start-pos quad)) + (let ((s1-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (camera-pos) s5-0) 1.0)) + (t9-10 vector-normalize!) + (a0-37 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-37 quad) (-> s3-0 quad)) + (let ((s2-3 (t9-10 a0-37 1.0)) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (-> s5-0 quad)) + (let ((v1-47 (vector-normalize-copy! (new 'stack-no-clear 'vector) s2-3 327.68)) + (f28-1 (vector-dot s1-3 s2-3)) + ) + (when (< 0.0 f28-1) + (vector+! s3-1 s3-1 v1-47) + (set! (-> *part-id-table* 209 init-specs 13 initial-valuef) f28-1) + (launch-particles (-> *part-id-table* 209) s3-1) + (set! (-> *part-id-table* 208 init-specs 13 initial-valuef) f28-1) + (launch-particles (-> *part-id-table* 208) s3-1) + ) + ) + ) + ) + (let* ((s3-2 (-> *part-id-table* 207)) + (s2-4 (get-field-spec-by-id s3-2 (sp-field-id spt-timer))) + (s1-5 (vector-! (new 'stack-no-clear 'vector) (-> s4-0 start-pos) s5-0)) + (s4-1 (if (< 182.04445 f30-0) + 3 + 1 + ) + ) + (f30-1 (-> s2-4 initial-valuef)) + (f28-2 (vector-vector-distance (camera-pos) s5-0)) + (s0-2 (get-field-spec-by-id s3-2 (sp-field-id spt-scale-x))) + (f0-13 (cond + ((< f28-2 122.88) + 0.0 + ) + ((< 65536.0 f28-2) + 1.0 + ) + (else + (* 0.000015287453 (+ -122.88 f28-2)) + ) + ) + ) + (f28-3 (-> s0-2 initial-valuef)) + (f26-0 (-> s0-2 random-rangef)) + ) + (set! (-> s0-2 initial-valuef) (* f28-3 f0-13)) + (set! (-> s0-2 random-rangef) (* f26-0 f0-13)) + (set! (-> s2-4 initial-valuef) (the float s4-1)) + (draw-beam s3-2 s5-0 s1-5 #t) + (set! (-> s2-4 initial-valuef) f30-1) + (set! (-> s0-2 initial-valuef) f28-3) + (set! (-> s0-2 random-rangef) f26-0) + ) + ) + ) + (-> this laser-dir) + ) + +(defun do-fire-backcheck ((arg0 vector) (arg1 vector)) + (let* ((v1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) + (a0-3 (vector+float*! (new 'stack-no-clear 'vector) arg0 v1-0 -7372.8)) + (gp-1 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> gp-1 start-pos quad) (-> a0-3 quad)) + (vector-float*! (-> gp-1 move-dist) v1-0 40960.0) + (let ((v1-1 gp-1)) + (set! (-> v1-1 radius) 40.96) + (set! (-> v1-1 collide-with) (collide-spec backgnd hit-by-others-list pusher impenetrable-obj)) + (set! (-> v1-1 ignore-process0) #f) + (set! (-> v1-1 ignore-process1) #f) + (set! (-> v1-1 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-1 action-mask) (collide-action solid)) + ) + (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* gp-1))) + (when (>= f0-3 0.0) + (if (< (* (vector-length (-> gp-1 move-dist)) f0-3) 8192.0) + (return #f) + ) + ) + ) + ) + #t + ) + +(defun get-remaining-player-ammo ((arg0 pickup-type)) + 0.0 + (if (or (logtest? (target-flags tf16) (-> *target* target-flags)) + (logtest? (game-secrets endless-ammo) (-> *target* game secrets)) + ) + 1000.0 + (the-as float (send-event *target* 'query 'pickup arg0)) + ) + ) + +;; WARN: Return type mismatch object vs float. +(defun adjust-player-ammo ((arg0 int) (arg1 pickup-type)) + (if (and *target* + (and (focus-test? *target* light) (nonzero? (-> *target* lightjak))) + (not (logtest? (-> *target* lightjak stage) (lightjak-stage ls1))) + ) + (pickup-collectable! (-> *target* fact) (pickup-type eco-pill-light) -1.0 (the-as handle #f)) + ) + (the-as float (send-event *target* 'get-pickup arg1 arg0)) + ) + +(defun adjust-player-ammo-over-time ((arg0 int) (arg1 float) (arg2 pickup-type) (arg3 float)) + (let* ((f0-2 (* 0.0033333334 (the float arg0) arg1)) + (f30-0 (fmin (fmax 0.0 f0-2) arg3)) + ) + (adjust-player-ammo (the-as int (- f30-0)) arg2) + f30-0 + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun truncate-player-ammo ((arg0 pickup-type)) + (let* ((f0-0 (get-remaining-player-ammo arg0)) + (f0-1 (- f0-0 (the float (the int f0-0)))) + ) + (adjust-player-ammo (the-as int (- f0-1)) arg0) + ) + (none) + ) + +(deftype last-gun-fire-time (structure) + ((last-fire-times time-frame 12) + ) + ) + + +(define *last-gun-fire-time* (new 'static 'last-gun-fire-time)) + +(defun compute-gun-fire-time-index ((arg0 int)) + (max 0 (min 11 (+ arg0 -26))) + ) + +(defun get-last-fire-time ((arg0 int)) + (-> *last-gun-fire-time* last-fire-times (compute-gun-fire-time-index arg0)) + ) + +(defun set-last-fire-time ((arg0 int)) + (set-time! (-> *last-gun-fire-time* last-fire-times (compute-gun-fire-time-index arg0))) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/target/indax/indax-h.gc b/goal_src/jak3/engine/target/indax/indax-h.gc index 2322ab3a937..4a8e14c728c 100644 --- a/goal_src/jak3/engine/target/indax/indax-h.gc +++ b/goal_src/jak3/engine/target/indax/indax-h.gc @@ -7,3 +7,11 @@ ;; DECOMP BEGINS +(deftype indax-info (basic) + ((indax-start-time time-frame) + (indax-time time-frame) + (indax-hang-start-time time-frame) + (art-group-backup art-group) + (pad object) + ) + ) diff --git a/goal_src/jak3/engine/target/lightjak-h.gc b/goal_src/jak3/engine/target/lightjak-h.gc index 066bebd4513..caed9d4dd3b 100644 --- a/goal_src/jak3/engine/target/lightjak-h.gc +++ b/goal_src/jak3/engine/target/lightjak-h.gc @@ -5,5 +5,69 @@ ;; name in dgo: lightjak-h ;; dgos: GAME +(declare-type lightjak-shield process-drawable) + +(define-extern *lightjak-trans-mods* surface) +(define-extern *heal-mods* surface) +(define-extern want-to-darkjak? (function symbol :behavior target)) +(define-extern want-to-lightjak? (function symbol :behavior target)) +(define-extern lightjak-shield-init (function none :behavior lightjak-shield)) + ;; DECOMP BEGINS +(deftype wings (process-drawable) + ((parent (pointer target) :override) + (shadow-backup shadow-geo :offset 208) + (ragdoll-proc handle) + (lock? symbol) + (wing-part sparticle-launch-control 2) + ) + (:state-methods + (idle symbol) + use + hidden + close + ) + ) + + +(deftype lightjak-shield (process-drawable) + ((parent (pointer target) :override) + (fade float) + (tone rgba) + ) + (:state-methods + open + close + hit + ) + ) + + +(deftype lightjak-info (basic) + ((process (pointer target)) + (wings (pointer wings)) + (get-off-lock symbol) + (latch-out-time time-frame) + (start-time time-frame) + (attack-id uint32) + (lightjak-before-powerjak symbol) + (attack-time time-frame) + (attack-count time-frame) + (stage lightjak-stage) + (want-stage lightjak-stage) + (get-on-latch uint32) + (tone uint32) + (on-off uint32) + (mode-sound-bank connection) + (swoop-count int32) + (freeze-control handle) + (freeze-screen handle) + (freeze-sound sound-id) + (shield (pointer lightjak-shield)) + (shield-start-time time-frame) + (shield-count-time time-frame) + (regen-start-time time-frame) + (regen-time time-frame) + ) + ) diff --git a/goal_src/jak3/engine/target/lightjak-wings.gc b/goal_src/jak3/engine/target/lightjak-wings.gc index 9631dcff4d7..a5cf5619c70 100644 --- a/goal_src/jak3/engine/target/lightjak-wings.gc +++ b/goal_src/jak3/engine/target/lightjak-wings.gc @@ -5,5 +5,882 @@ ;; name in dgo: lightjak-wings ;; dgos: GAME +(define-extern wings-ragdoll-proc-init-by-other (function ragdoll-proc object :behavior wings-ragdoll-proc)) + ;; DECOMP BEGINS +(defpart 623 + :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x4)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 80.0) + (:b 255.0) + (:a 16.0) + (:omega (degrees 2261.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 409.6) + ) + ) + +(define *jchar-wings-ragdoll-setup* (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.2654 :y -0.0018 :z -0.9641 :w 6300.3945) + :geo-tform (new 'static 'vector :x -0.0691 :y 0.9889 :z -0.1309 :w 40149.74) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6487 :y -0.1165 :z 0.752 :w 2928.8037) + :geo-tform (new 'static 'vector :x -0.2599 :y 0.9602 :z 0.1019 :w 40284.58) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6739 :y 0.0291 :z 0.7381 :w 5517.9307) + :geo-tform (new 'static 'vector :x 0.6239 :y 0.7439 :z -0.2391 :w 38562.84) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7135 :y -0.0779 :z -0.6962 :w 14612.671) + :geo-tform (new 'static 'vector :x 0.427 :y 0.8201 :z -0.3806 :w 42171.234) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9024 :y 0.17 :z -0.3958 :w 11472.295) + :geo-tform (new 'static 'vector :x -0.2578 :y 0.9589 :z 0.118 :w 41397.145) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.3801 :y 0.004 :z -0.9248 :w 10360.44) + :geo-tform (new 'static 'vector :x 0.029 :y 0.9893 :z -0.1425 :w 38818.555) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9764 :y -0.1821 :z 0.1154 :w 2970.6013) + :geo-tform (new 'static 'vector :x -0.3592 :y 0.9097 :z 0.208 :w 39567.34) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7474 :y 0.077 :z 0.6598 :w 8458.804) + :geo-tform (new 'static 'vector :x 0.7599 :y 0.4936 :z -0.4228 :w 40823.484) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9331 :y -0.0047 :z -0.3594 :w 19540.941) + :geo-tform (new 'static 'vector :x -0.371 :y -0.9276 :z 0.0428 :w 19994.434) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6734 :y 0.0697 :z -0.7359 :w 6495.546) + :geo-tform (new 'static 'vector :x 0.2558 :y -0.9488 :z -0.1848 :w 20230.09) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.4255 :y 0.0067 :z -0.9049 :w 20150.281) + :geo-tform (new 'static 'vector :x -0.2495 :y 0.9088 :z -0.3343 :w 35460.62) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6235 :y -0.2077 :z 0.7536 :w 9110.888) + :geo-tform (new 'static 'vector :x -0.4093 :y 0.7846 :z 0.4655 :w 40835.207) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9382 :y 0.1251 :z 0.3225 :w 12873.182) + :geo-tform (new 'static 'vector :x 0.8171 :y 0.4684 :z -0.336 :w 36737.35) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8007 :y 0.0872 :z 0.5926 :w 43485.977) + :geo-tform (new 'static 'vector :x 0.1755 :y -0.9787 :z -0.106 :w 21626.426) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8735 :y -0.2713 :z 0.404 :w 3852.2788) + :geo-tform (new 'static 'vector :x 0.2542 :y -0.9517 :z -0.1717 :w 20847.074) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.3727 :y -0.0018 :z 0.9279 :w 39237.88) + :geo-tform (new 'static 'vector :x -0.3279 :y 0.8812 :z -0.3403 :w 32193.342) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6138 :y -0.2619 :z 0.7446 :w 10673.011) + :geo-tform (new 'static 'vector :x -0.2349 :y 0.9716 :z 0.027 :w 35094.527) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2056 :y 0.0894 :z 0.9745 :w 4970.159) + :geo-tform (new 'static 'vector :x 0.4984 :y 0.8656 :z -0.0465 :w 34449.273) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2011 :y -0.0286 :z -0.9791 :w 10903.315) + :geo-tform (new 'static 'vector :x -0.3811 :y 0.9235 :z 0.0419 :w 34879.68) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2655 :y -0.1245 :z 0.956 :w 8234.635) + :geo-tform (new 'static 'vector :x -0.176 :y 0.9839 :z 0.0286 :w 36081.355) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.2278 :y -0.0045 :z 0.9736 :w 7255.163) + :geo-tform (new 'static 'vector :x 0.1231 :y 0.9802 :z -0.1548 :w 25669.123) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.505 :y 0.1057 :z -0.8565 :w 3937.3848) + :geo-tform (new 'static 'vector :x 0.26 :y 0.9604 :z 0.0998 :w 25394.436) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6633 :y -0.0291 :z -0.7477 :w 5518.568) + :geo-tform (new 'static 'vector :x -0.6247 :y 0.7448 :z -0.2343 :w 27084.008) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7035 :y 0.0779 :z 0.7063 :w 14612.635) + :geo-tform (new 'static 'vector :x -0.4285 :y 0.8213 :z -0.3765 :w 23488.012) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8966 :y -0.17 :z 0.4087 :w 11471.3125) + :geo-tform (new 'static 'vector :x 0.2579 :y 0.9591 :z 0.1158 :w 24282.729) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.3141 :y -0.0019 :z 0.9493 :w 10925.16) + :geo-tform (new 'static 'vector :x 0.012 :y 0.9857 :z -0.1675 :w 27199.225) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9195 :y 0.1659 :z -0.3562 :w 3444.5723) + :geo-tform (new 'static 'vector :x 0.3612 :y 0.9109 :z 0.1992 :w 26365.314) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7192 :y -0.0769 :z -0.6904 :w 8459.351) + :geo-tform (new 'static 'vector :x 0.7654 :y -0.4999 :z 0.4051 :w 40607.035) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9174 :y 0.0049 :z 0.3978 :w 19540.723) + :geo-tform (new 'static 'vector :x -0.3669 :y 0.9295 :z -0.0346 :w 20393.875) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6425 :y -0.0696 :z 0.763 :w 6494.891) + :geo-tform (new 'static 'vector :x 0.2562 :y 0.9502 :z 0.1772 :w 20638.305) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.3625 :y -0.0048 :z 0.9319 :w 19612.213) + :geo-tform (new 'static 'vector :x 0.219 :y 0.8996 :z -0.3777 :w 30652.809) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7243 :y 0.2029 :z -0.6588 :w 9590.757) + :geo-tform (new 'static 'vector :x 0.4178 :y 0.7885 :z 0.4511 :w 25124.445) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9203 :y -0.1251 :z -0.3705 :w 12873.563) + :geo-tform (new 'static 'vector :x 0.8236 :y -0.4721 :z 0.3141 :w 36484.418) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7691 :y -0.0872 :z -0.6331 :w 43486.32) + :geo-tform (new 'static 'vector :x 0.1757 :y 0.9793 :z 0.1 :w 22153.406) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8514 :y 0.2725 :z -0.4481 :w 3853.9175) + :geo-tform (new 'static 'vector :x 0.2546 :y 0.9532 :z 0.1627 :w 21354.834) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.3106 :y -0.0029 :z 0.9505 :w 25369.969) + :geo-tform (new 'static 'vector :x 0.2772 :y 0.8778 :z -0.3905 :w 33952.89) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7403 :y 0.2573 :z -0.621 :w 10801.298) + :geo-tform (new 'static 'vector :x 0.2349 :y 0.9718 :z 0.019 :w 31129.637) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 41 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1393 :y -0.0881 :z -0.9863 :w 4969.959) + :geo-tform (new 'static 'vector :x -0.4987 :y 0.8662 :z -0.0296 :w 31694.191) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 42 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.136 :y 0.0307 :z 0.9902 :w 10903.225) + :geo-tform (new 'static 'vector :x 0.3813 :y 0.9239 :z 0.0294 :w 31281.717) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 43 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.196 :y 0.1065 :z -0.9747 :w 8216.977) + :geo-tform (new 'static 'vector :x 0.176 :y 0.9841 :z 0.0214 :w 30276.574) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + ) + ) + ) + +(defbehavior wings-post wings () + (let* ((a0-0 (-> self parent)) + (v1-0 (if a0-0 + (the-as process-drawable (-> a0-0 0 self)) + ) + ) + ) + (set! (-> self draw light-index) (-> (the-as process-focusable v1-0) draw light-index)) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 0.0) + (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) + (set! (-> self draw death-vertex-skip) (-> self parent 0 draw death-vertex-skip)) + (set! (-> self draw death-effect) (-> self parent 0 draw death-effect)) + (set! (-> self draw death-timer) (-> self parent 0 draw death-timer)) + (set! (-> self draw death-timer-org) (-> self parent 0 draw death-timer-org)) + (set! (-> self draw death-draw-overlap) (-> self parent 0 draw death-draw-overlap)) + (let ((a0-29 (-> v1-0 draw shadow-ctrl settings shadow-dir quad))) + (set! (-> self draw shadow-ctrl settings shadow-dir quad) a0-29) + ) + (if (or (logtest? (-> v1-0 draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2)) + (zero? (-> v1-0 skel active-channels)) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (when (and (not (focus-test? (the-as process-focusable v1-0) in-head)) + (and (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp))) + (not (movie?)) + (< (-> *setting-control* user-current slow-time) 1.0) + ) + ) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f30-0 (fmin 1.0 (-> self clock clock-ratio))) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 623) (sp-field-id spt-a)) initial-valuef) + (* 16.0 (- 1.0 (-> *setting-control* user-current slow-time))) + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg upper_body)) + :rate f30-0 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg chest)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg neckA)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg neckB)) :rate f30-0) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg MhairB)) + :rate f30-0 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Lshould)) + :rate f30-0 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Lforarm)) + :rate f30-0 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg lindA)) :rate f30-0) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg lringA)) + :rate f30-0 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Rshould)) + :rate f30-0 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Rarm)) :rate f30-0) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Rforarm)) + :rate f30-0 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg sk_rhand)) + :rate f30-0 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg rindA)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg gun)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg hips)) :rate f30-0) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Lankle)) + :rate f30-0 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg LbigToe)) + :rate f30-0 + ) + ) + ) + ) + 0 + (none) + ) + +(defstate hidden (wings) + :virtual #t + :trans (behavior () + (let ((v1-0 (-> self parent))) + (if (not (focus-test? + (the-as process-focusable (if v1-0 + (the-as process-focusable (-> v1-0 0 self)) + ) + ) + in-head + ) + ) + (go-virtual idle #f) + ) + ) + ) + :code (behavior () + (ja-channel-set! 0) + (ja-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + ) + +(defstate idle (wings) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (go-virtual use) + ) + (('end-mode) + (go-virtual close) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self lock?) arg0) + ) + :exit (behavior () + (let ((a0-1 (handle->process (-> self ragdoll-proc)))) + (if a0-1 + (ragdoll-proc-method-16 (the-as ragdoll-proc a0-1) 60) + ) + ) + ) + :trans (behavior () + (let ((v1-0 (-> self parent))) + (b! + (not (focus-test? + (the-as process-focusable (if v1-0 + (the-as process-focusable (-> v1-0 0 self)) + ) + ) + in-head + ) + ) + cfg-4 + :delay (empty-form) + ) + ) + (go-virtual hidden) + (b! #t cfg-27 :delay (nop!)) + (label cfg-4) + (if (and (not (-> self lock?)) (let* ((a0-1 (-> self parent)) + (v1-10 (if a0-1 + (the-as process-drawable (-> a0-1 0 self)) + ) + ) + (a0-4 (if (> (-> v1-10 skel active-channels) 0) + (-> v1-10 skel root-channel 0 frame-group) + ) + ) + ) + (and a0-4 (or (= a0-4 (-> v1-10 draw art-group data 493)) + (= a0-4 (-> v1-10 draw art-group data 494)) + (= a0-4 (-> v1-10 draw art-group data 495)) + (= a0-4 (-> v1-10 draw art-group data 496)) + (= a0-4 (-> v1-10 draw art-group data 482)) + (= a0-4 (-> v1-10 draw art-group data 485)) + (= a0-4 (-> v1-10 draw art-group data 483)) + ) + ) + ) + ) + (go-virtual use) + ) + (label cfg-27) + (let ((v1-20 (handle->process (-> self ragdoll-proc)))) + (when v1-20 + (let ((v1-22 (-> (the-as ragdoll-proc v1-20) ragdoll))) + (if v1-22 + (logclear! (-> v1-22 ragdoll-flags) (ragdoll-flag rf2)) + ) + ) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (case arg0 + (('open) + (ja-channel-set! 1) + (ja-no-eval :group! jakb-wings-lightjak-get-on-land-ja :num! (seek! (ja-aframe 45.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 45.0 0))) + ) + (sound-play "ltjak-wings-out") + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + (('force) + (ja-channel-set! 1) + (ja :group! jakb-wings-lightjak-stance-ja :num! max) + (suspend) + 0 + ) + ) + (set! (-> self lock?) #f) + (let ((a0-17 (handle->process (-> self ragdoll-proc)))) + (when (not a0-17) + (set! (-> self ragdoll-proc) (ppointer->handle (process-spawn + ragdoll-proc + :init wings-ragdoll-proc-init-by-other + *jchar-wings-ragdoll-setup* + :name "ragdoll-proc" + :to self + :stack-size #x5000 + ) + ) + ) + (set! a0-17 (handle->process (-> self ragdoll-proc))) + ) + (if (and a0-17 (-> (the-as process-drawable a0-17) root)) + (logior! (-> (the-as ragdoll-proc a0-17) ragdoll ragdoll-flags) (ragdoll-flag rf3 rf4 rf10)) + ) + (ragdoll-proc-method-15 (the-as ragdoll-proc a0-17) #f (the-as vector #f) #t) + ) + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! jakb-wings-lightjak-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (wings-post) + (ja-post) + ) + ) + +(defstate close (wings) + :virtual #t + :code (behavior () + (sound-play "ltjak-wings-in") + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-wings-lightjak-get-off-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-set! 0) + (sleep-code) + ) + :post (-> (method-of-type wings idle) post) + ) + +(defstate use (wings) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (go-virtual idle #f) + ) + (('end-mode) + (go-virtual close) + ) + ) + ) + :trans (behavior () + (let ((v1-0 (ppointer->process (-> self parent))) + (a0-1 (-> self parent)) + ) + (cond + ((focus-test? + (the-as process-focusable (if a0-1 + (the-as process-focusable (-> a0-1 0 self)) + ) + ) + in-head + ) + (go-virtual hidden) + ) + ((let ((a0-8 (if (> (-> (the-as process-focusable v1-0) skel active-channels) 0) + (-> (the-as process-focusable v1-0) skel root-channel 0 frame-group) + ) + ) + ) + (not (and a0-8 (or (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 493)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 494)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 495)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 496)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 482)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 485)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 483)) + ) + ) + ) + ) + (go-virtual idle #f) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! jakb-wings-lightjak-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (wings-post) + (clone-anim-once (ppointer->handle (-> self parent)) #f "wings-") + (ja-post) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior wings-init wings ((arg0 symbol)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar-wings" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self shadow-backup) #f) + (let* ((s5-1 (ppointer->process (-> self parent))) + (v1-6 (if (type? s5-1 process-focusable) + s5-1 + ) + ) + (a0-6 (-> self node-list data)) + ) + (set! (-> a0-6 0 param0) (the-as (function cspace transformq none) cspace<-cspace-normalized!)) + (set! (-> a0-6 0 param1) (the-as basic (-> (the-as process-drawable v1-6) node-list data 6))) + (set! (-> a0-6 0 param2) #f) + ) + (set! (-> self ragdoll-proc) (the-as handle #f)) + (set! (-> self draw shadow-ctrl) *target-shadow-control*) + (cond + ((= arg0 'open) + (go-virtual idle 'open) + ) + ((= arg0 'move) + (go-virtual idle #f) + ) + ((= arg0 'force) + (go-virtual idle 'force) + ) + (else + (go-virtual use) + ) + ) + (none) + ) + +(deftype wings-ragdoll (ragdoll) + ((which-chain int8) + (chain-pos int8) + ) + ) + + +;; WARN: Return type mismatch vector vs none. +(defmethod ragdoll-method-19 ((this wings-ragdoll) (arg0 vector) (arg1 int) (arg2 object) (arg3 vector)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> this gravity quad)) + (let ((s1-0 (-> this ragdoll-joints arg1)) + (f30-0 1.0) + ) + (cond + ((= (-> s1-0 parent-joint) -1) + (+! (-> this chain-pos) 1) + ) + (else + (+! (-> this which-chain) 1) + (set! (-> this chain-pos) 0) + 0 + ) + ) + (let ((v1-12 (-> this which-chain))) + (cond + ((or (zero? v1-12) (= v1-12 4)) + (set! f30-0 100.0) + ) + ((or (= v1-12 1) (= v1-12 5)) + (set! f30-0 50.0) + ) + ((or (= v1-12 2) (= v1-12 6)) + (set! f30-0 10.0) + ) + ) + ) + (vector-float*! (-> this gravity) (&+ arg3 16) f30-0) + (let ((t9-0 (method-of-type ragdoll ragdoll-method-19))) + (t9-0 this arg0 arg1 arg2 arg3) + ) + (when (= (-> s1-0 parent-joint) -1) + (let* ((f0-4 + (+ (* 54.613335 (the float (current-time))) + (* 10922.667 (the float (-> this chain-pos))) + (* 29127.111 (the float (-> this which-chain))) + ) + ) + (f0-5 (- f0-4 (* (the float (the int (/ f0-4 65536.0))) 65536.0))) + ) + (vector+float*! + arg0 + arg0 + (the-as vector (&-> arg3 x)) + (* 5.0 (cos f0-5) f30-0 (the float (-> this chain-pos))) + ) + ) + ) + ) + (set! (-> this gravity quad) (-> s3-0 quad)) + ) + (if (and (= (-> this ragdoll-joints arg1 parent-joint) -1) + (= (-> this ragdoll-joints (+ arg1 -1) parent-joint) -1) + ) + (vector+float*! + arg0 + arg0 + (the-as vector (+ (the-as uint (-> this ragdoll-joints 0 velocity)) (* 192 (+ arg1 -1)))) + 0.25 + ) + ) + (none) + ) + +(defmethod ragdoll-method-18 ((this wings-ragdoll)) + (let ((t9-0 (method-of-type ragdoll ragdoll-method-18))) + (t9-0 this) + ) + (set! (-> this which-chain) -1) + (set! (-> this chain-pos) -1) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod ragdoll-setup! ((this wings-ragdoll) (arg0 process-drawable) (arg1 ragdoll-setup)) + "Set up this ragdoll with the given [[ragdoll-setup]]." + (let ((t9-0 (method-of-type ragdoll ragdoll-setup!))) + (t9-0 this arg0 arg1) + ) + (set! (-> this stretch-vel) 0.7) + (set! (-> this stretch-vel-parallel) 0.8) + (set! (-> this compress-vel) 0.85) + (set! (-> this compress-vel-parallel) 0.75) + (set! (-> this momentum) 0.4) + (set! (-> this maximum-stretch) 1.5) + (none) + ) + +(defbehavior wings-ragdoll-proc-init-by-other wings-ragdoll-proc ((arg0 ragdoll-proc)) + (set! (-> self last-attack-id) (the-as uint 0)) + (set! (-> self ragdoll) (new 'process 'wings-ragdoll)) + (if (nonzero? (-> self ragdoll)) + (ragdoll-setup! + (-> self ragdoll) + (the-as process-drawable (ppointer->process (-> self parent))) + (the-as ragdoll-setup arg0) + ) + (format 0 "ERROR: didn't have enough memory to allocate wings-ragdoll for wings-ragdoll-proc~%") + ) + (go-virtual idle) + ) diff --git a/goal_src/jak3/engine/target/logic-target.gc b/goal_src/jak3/engine/target/logic-target.gc index c7a8142d941..a463cc95208 100644 --- a/goal_src/jak3/engine/target/logic-target.gc +++ b/goal_src/jak3/engine/target/logic-target.gc @@ -7,3 +7,3257 @@ ;; DECOMP BEGINS +(defbehavior build-conversions target ((arg0 vector)) + (when (!= (-> self control prev-surf) (-> self control surf)) + (set! (-> self control prev-surf) (-> self control surf)) + (set-time! (-> self control time-of-last-surface-change)) + ) + (surface-mult! (-> self control current-surface) (-> self control mod-surface) (-> self control surf)) + (when (and (and (= (-> self fact eco-type) 3) (>= (-> self fact eco-level) 1.0)) + (or (= (-> self control mod-surface name) 'run) (= (-> self control mod-surface name) 'jump)) + ) + (+! (-> self control current-surface target-speed) 20480.0) + (+! (-> self control current-surface transv-max) 20480.0) + ) + (when (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (or (= (-> self control mod-surface name) 'run) + (= (-> self control mod-surface name) 'jump) + (= (-> self control mod-surface name) 'attack) + ) + ) + (set! (-> self control current-surface target-speed) + (* 1.2 (-> self darkjak-giant-interp) (-> self control current-surface target-speed)) + ) + (set! (-> self control current-surface transv-max) + (* 1.2 (-> self darkjak-giant-interp) (-> self control current-surface transv-max)) + ) + ) + (let ((f0-11 (-> *setting-control* user-current speed-mult))) + (set! (-> self control current-surface target-speed) (* (-> self control current-surface target-speed) f0-11)) + (set! (-> self control current-surface transv-max) (* (-> self control current-surface transv-max) f0-11)) + ) + (let ((s5-0 (new-stack-vector0))) + (vector-z-quaternion! s5-0 (-> self control quat-for-control)) + (when (logtest? (-> self control mod-surface flags) (surface-flag xz-local)) + (vector-flatten! s5-0 s5-0 (-> self control dynam gravity-normal)) + (vector-normalize! s5-0 1.0) + ) + (forward-up-nopitch->inv-matrix (-> self control c-R-w) s5-0 (-> self control local-normal)) + ) + (matrix-transpose! (-> self control w-R-c) (-> self control c-R-w)) + (vector-matrix*! (-> self control transv-ctrl) arg0 (-> self control w-R-c)) + (set! (-> self control last-gravity-normal quad) (-> self control gravity-normal quad)) + (let ((v0-7 (-> self control gravity-normal))) + (set! (-> v0-7 quad) (-> self control dynam gravity-normal quad)) + v0-7 + ) + ) + +(defbehavior vector-turn-to target ((arg0 vector)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (build-conversions (-> self control transv)) + ) + +;; WARN: Return type mismatch collide-status vs none. +(defbehavior reverse-conversions target ((arg0 vector)) + (let ((v1-1 (-> self control transv-ctrl))) + (set! (-> self control ctrl-xz-vel) (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) + ) + (vector-matrix*! arg0 (-> self control transv-ctrl) (-> self control c-R-w)) + (set! (-> self control old-status) (-> self control status)) + (none) + ) + +(defun-debug draw-history ((arg0 control-info)) + (when (nonzero? *display-collide-history*) + (when (cpad-pressed? 0 l3) + (set! (-> arg0 history-length) (logand (+ (-> arg0 history-length) 1) 3)) + (if (cpad-hold? 0 l2) + (set! (-> arg0 history-length) (the-as uint 1000)) + ) + ) + (let* ((v1-15 (-> arg0 history-length)) + (gp-0 (cond + ((zero? v1-15) + 465 + ) + ((= v1-15 1) + 469 + ) + ((= v1-15 2) + 473 + ) + ((= v1-15 3) + 913 + ) + (else + 384 + ) + ) + ) + (a0-5 (new 'stack 'history-iterator (the-as uint 1800))) + ) + (set! (-> a0-5 out) #t) + (set! (-> a0-5 owner) (the-as uint 2)) + (set! (-> a0-5 channel-mask) (the-as uint gp-0)) + (history-draw a0-5) + ) + ) + (none) + ) + +;; ERROR: function was not converted to expressions. Cannot decompile. + +(defun-debug target-print-stats ((arg0 target) (arg1 symbol)) + (local-vars + (sv-64 int) + (sv-72 int) + (sv-80 art-joint-anim-manager) + (sv-96 string) + (sv-112 string) + (sv-128 string) + (sv-144 string) + (sv-160 string) + (sv-176 string) + (sv-192 string) + (sv-208 string) + (sv-224 string) + (sv-240 string) + (sv-256 string) + (sv-272 string) + (sv-288 string) + (sv-304 string) + ) + (with-pp + (let ((s5-0 pp)) + (set! pp arg0) + (when (and *display-ground-stats* arg0) + (let ((s3-0 format) + (s2-0 arg1) + (s1-0 "~0kpoly:~6X mode:~-8S material:~-10S event:~S~%") + (s0-0 (-> arg0 control poly-pat)) + ) + (set! sv-96 (pat-mode->string (-> arg0 control poly-pat))) + (set! sv-112 (pat-material->string (-> arg0 control poly-pat))) + (let ((t1-0 (pat-event->string (-> arg0 control poly-pat)))) + (s3-0 s2-0 s1-0 s0-0 sv-96 sv-112 t1-0) + ) + ) + (let ((s3-1 format) + (s2-1 arg1) + (s1-1 "~0kgrnd:~6X mode:~-8S material:~-10S event:~S~%") + (s0-1 (-> arg0 control ground-pat)) + ) + (set! sv-128 (pat-mode->string (-> arg0 control ground-pat))) + (set! sv-144 (pat-material->string (-> arg0 control ground-pat))) + (let ((t1-1 (pat-event->string (-> arg0 control ground-pat)))) + (s3-1 s2-1 s1-1 s0-1 sv-128 sv-144 t1-1) + ) + ) + (let ((s3-2 format) + (s2-2 arg1) + (s1-2 "~0kwall:~6X mode:~-8S material:~-10S event:~S~%") + (s0-2 (-> arg0 control wall-contact-pat)) + ) + (set! sv-160 (pat-mode->string (-> arg0 control wall-contact-pat))) + (set! sv-176 (pat-material->string (-> arg0 control wall-contact-pat))) + (let ((t1-2 (pat-event->string (-> arg0 control wall-contact-pat)))) + (s3-2 s2-2 s1-2 s0-2 sv-160 sv-176 t1-2) + ) + ) + (let ((s3-3 format) + (s2-3 arg1) + (s1-3 "~0kgspt:~6X mode:~-8S material:~-10S event:~S~%") + (s0-3 (-> arg0 control gspot-pat-surfce)) + ) + (set! sv-192 (pat-mode->string (-> arg0 control gspot-pat-surfce))) + (set! sv-208 (pat-material->string (-> arg0 control gspot-pat-surfce))) + (let ((t1-3 (pat-event->string (-> arg0 control gspot-pat-surfce)))) + (s3-3 s2-3 s1-3 s0-3 sv-192 sv-208 t1-3) + ) + ) + ) + (when (and *stats-target* arg0) + (format + arg1 + "~0ks: ~M ~X/~X ~A ~A ~A~%" + (-> arg0 control ctrl-xz-vel) + (-> arg0 control status) + (-> arg0 control prev-status) + (if (-> arg0 state) + (-> arg0 state name) + ) + (-> arg0 control surf name) + (-> arg0 control mod-surface name) + ) + (let ((s3-4 (-> arg0 focus-status))) + (if (= (logand s3-4 (focus-status pole)) (focus-status pole)) + (format arg1 "pole ") + ) + (if (= (logand s3-4 (focus-status dead)) (focus-status dead)) + (format arg1 "dead ") + ) + (if (= (logand (focus-status gun) s3-4) (focus-status gun)) + (format arg1 "gun ") + ) + (if (= (logand (focus-status pilot) s3-4) (focus-status pilot)) + (format arg1 "racer ") + ) + (if (= (logand (focus-status mech) s3-4) (focus-status mech)) + (format arg1 "mech ") + ) + (if (= (logand (focus-status shooting) s3-4) (focus-status shooting)) + (format arg1 "shooting ") + ) + (if (= (logand (focus-status halfpipe) s3-4) (focus-status halfpipe)) + (format arg1 "halfpipe ") + ) + (if (= (logand (focus-status light) s3-4) (focus-status light)) + (format arg1 "light ") + ) + (if (= (logand s3-4 (focus-status in-head)) (focus-status in-head)) + (format arg1 "in-head ") + ) + (if (= (logand s3-4 (focus-status grabbed)) (focus-status grabbed)) + (format arg1 "grabbed ") + ) + (if (= (logand s3-4 (focus-status ignore)) (focus-status ignore)) + (format arg1 "ignore ") + ) + (if (= (logand s3-4 (focus-status under-water)) (focus-status under-water)) + (format arg1 "under-water ") + ) + (if (= (logand s3-4 (focus-status disable)) (focus-status disable)) + (format arg1 "disable ") + ) + (if (= (logand s3-4 (focus-status hit)) (focus-status hit)) + (format arg1 "hit ") + ) + (if (= (logand s3-4 (focus-status inactive)) (focus-status inactive)) + (format arg1 "inactive ") + ) + (if (= (logand (focus-status invulnerable) s3-4) (shl #x8000 16)) + (format arg1 "invulnerable ") + ) + (if (= (logand s3-4 (focus-status dangerous)) (focus-status dangerous)) + (format arg1 "dangerous ") + ) + (if (= (logand (focus-status gun-no-target) s3-4) (shl 4 32)) + (format arg1 "gun-no-target ") + ) + (if (= (logand (focus-status teleporting) s3-4) (focus-status teleporting)) + (format arg1 "teleporting ") + ) + (if (= (logand (focus-status indax) s3-4) (focus-status indax)) + (format arg1 "indax ") + ) + (if (= (logand (focus-status turret) s3-4) (shl 1 32)) + (format arg1 "turret ") + ) + (if (= (logand (focus-status tube) s3-4) (focus-status tube)) + (format arg1 "tube ") + ) + (if (= (logand (focus-status pilot) s3-4) (focus-status pilot)) + (format arg1 "pilot ") + ) + (if (= (logand s3-4 (focus-status edge-grab)) (focus-status edge-grab)) + (format arg1 "edge-grab ") + ) + (if (= (logand (focus-status dark) s3-4) (focus-status dark)) + (format arg1 "dark ") + ) + (if (= (logand (focus-status arrestable) s3-4) (focus-status arrestable)) + (format arg1 "arrestable ") + ) + (if (= (logand (focus-status rail) s3-4) (focus-status rail)) + (format arg1 "rail ") + ) + (if (= (logand s3-4 (focus-status pilot-riding)) (focus-status pilot-riding)) + (format arg1 "pilot-riding ") + ) + (if (= (logand (focus-status board) s3-4) (focus-status board)) + (format arg1 "board ") + ) + (if (= (logand s3-4 (focus-status on-water)) (focus-status on-water)) + (format arg1 "on-water ") + ) + (if (= (logand s3-4 (focus-status in-air)) (focus-status in-air)) + (format arg1 "in-air ") + ) + (if (= (logand (focus-status no-gravity) s3-4) (shl 2 32)) + (format arg1 "no-gravity ") + ) + (if (= (logand (focus-status carry) s3-4) (focus-status carry)) + (format arg1 "carry ") + ) + (if (= (logand s3-4 (focus-status flut)) (focus-status flut)) + (format arg1 "flut ") + ) + (if (= (logand s3-4 (focus-status touch-water)) (focus-status touch-water)) + (format arg1 "touch-water ") + ) + (if (= (logand (focus-status super) s3-4) (focus-status super)) + (format arg1 "super ") + ) + ) + (if (logtest? (-> arg0 target-flags) (target-flags tinvuln1)) + (format arg1 "tinvul1 ") + ) + (if (logtest? (target-flags tinvuln2) (-> arg0 target-flags)) + (format arg1 "tinvul2 ") + ) + (if (logtest? (target-flags disable-attacks) (-> arg0 target-flags)) + (format arg1 "disable-attacks ") + ) + (if (logtest? (target-flags invisible) (-> arg0 target-flags)) + (format arg1 "invisible ") + ) + (if (logtest? (target-flags lleg-still) (-> arg0 target-flags)) + (format arg1 "lleg-still ") + ) + (if (logtest? (target-flags rleg-still) (-> arg0 target-flags)) + (format arg1 "rleg-still ") + ) + (if (logtest? (target-flags lleg-no-ik) (-> arg0 target-flags)) + (format arg1 "lleg-no-ik ") + ) + (if (logtest? (target-flags rleg-no-ik) (-> arg0 target-flags)) + (format arg1 "rleg-no-ik ") + ) + (format arg1 "~%") + (format + arg1 + "~0k~9S ~9S ~9S ~9S ~9S ~9S~%" + (if (logtest? (-> arg0 control status) (collide-status on-surface)) + "on-surface" + "" + ) + (if (logtest? (-> arg0 control status) (collide-status on-ground)) + "on-ground" + "" + ) + (if (logtest? (-> arg0 control status) (collide-status touch-surface)) + "t-surface" + "" + ) + (if (logtest? (-> arg0 control status) (collide-status touch-wall)) + "t-wall" + "" + ) + (if (logtest? (-> arg0 control status) (collide-status touch-actor)) + "t-act" + "" + ) + (cond + ((logtest? (-> arg0 control status) (collide-status touch-ceiling)) + "t-ceil" + ) + ((logtest? (-> arg0 control status) (collide-status on-water)) + "on-water" + ) + (else + "" + ) + ) + ) + (when (logtest? (-> arg0 water flags) (water-flag active)) + (format + arg1 + "water at ~M ~5S ~5S ~5S ~5S " + (-> arg0 water height) + (if (logtest? (water-flag touch-water) (-> arg0 water flags)) + "water" + "" + ) + (if (logtest? (water-flag wading) (-> arg0 water flags)) + "wade" + "" + ) + (if (logtest? (water-flag swimming) (-> arg0 water flags)) + "swim" + "" + ) + (if (logtest? (-> arg0 water flags) (water-flag under-water)) + "under" + "" + ) + ) + (format arg1 "~2S~%" (if (logtest? (-> arg0 water flags) (water-flag swim-ground)) + "sg" + "" + ) + ) + ) + (format + arg1 + "~0kan:~,,3f su:~,,3f ti:~,,3f to:~,,3f pa:~,,3f~%" + (-> arg0 control surface-angle) + (-> arg0 control local-slope-z) + (-> arg0 control local-slope-x) + (-> arg0 control touch-angle) + (-> arg0 control poly-angle) + ) + (let ((v1-175 (-> arg0 control trans))) + (format arg1 "pos: ~6,,2m ~6,,2m ~6,,2m " (-> v1-175 x) (-> v1-175 y) (-> v1-175 z)) + ) + (let ((s3-5 format) + (s2-4 arg1) + (s1-4 "~0kpol:~X/~S/~S/~S~%") + (s0-4 (-> arg0 control poly-pat)) + ) + (set! sv-224 (pat-mode->string (-> arg0 control poly-pat))) + (set! sv-240 (pat-material->string (-> arg0 control poly-pat))) + (let ((t1-10 (pat-event->string (-> arg0 control poly-pat)))) + (s3-5 s2-4 s1-4 s0-4 sv-224 sv-240 t1-10) + ) + ) + (let ((s3-6 format) + (s2-5 arg1) + (s1-5 "~0kcur:~X/~S/~S/~S ") + (s0-5 (-> arg0 control cur-pat)) + ) + (set! sv-256 (pat-mode->string (-> arg0 control cur-pat))) + (set! sv-272 (pat-material->string (-> arg0 control cur-pat))) + (let ((t1-11 (pat-event->string (-> arg0 control cur-pat)))) + (s3-6 s2-5 s1-5 s0-5 sv-256 sv-272 t1-11) + ) + ) + (let ((s3-7 format) + (s2-6 arg1) + (s1-6 "~0kgnd:~X/~S/~S/~S~%") + (s0-6 (-> arg0 control ground-pat)) + ) + (set! sv-288 (pat-mode->string (-> arg0 control ground-pat))) + (set! sv-304 (pat-material->string (-> arg0 control ground-pat))) + (let ((t1-12 (pat-event->string (-> arg0 control ground-pat)))) + (s3-7 s2-6 s1-6 s0-6 sv-288 sv-304 t1-12) + ) + ) + (let ((t9-79 format) + (a0-147 arg1) + (a1-59 "~0kvel: x:~M y:~M z:~M yv:~M xzv:~M~%") + (a2-13 (-> arg0 control transv x)) + (a3-14 (-> arg0 control transv y)) + (t0-14 (-> arg0 control transv z)) + (t1-14 (vector-dot (-> arg0 control dynam gravity-normal) (-> arg0 control transv))) + (v1-195 (new-stack-vector0)) + ) + (let ((f0-15 (vector-dot (-> arg0 control dynam gravity-normal) (-> arg0 control transv)))) + 0.0 + (vector-! + v1-195 + (-> arg0 control transv) + (vector-float*! v1-195 (-> arg0 control dynam gravity-normal) f0-15) + ) + ) + (let ((f0-16 (vector-length v1-195))) + f0-16 + (t9-79 a0-147 a1-59 a2-13 a3-14 t0-14 t1-14 f0-16) + ) + ) + (format + arg1 + "~0ky:~,,2M t:~d cy: ~,,2M my: ~,,2M impv:~,,2M " + (-> arg0 control last-trans-any-surf y) + (- (current-time) (-> arg0 control last-time-on-surface)) + (- (-> arg0 control trans y) (-> arg0 control last-trans-any-surf y)) + (- (-> arg0 control highest-jump-mark y) (-> arg0 control last-trans-leaving-surf y)) + (-> arg0 control ground-impact-vel) + ) + (let* ((t9-81 format) + (a0-149 arg1) + (a1-61 "~0k~Tcd: ~,,2M md:~,,2M~%") + (v1-206 (vector-! (new-stack-vector0) (-> arg0 control trans) (-> arg0 control last-trans-any-surf))) + (a2-17 (sqrtf (+ (* (-> v1-206 x) (-> v1-206 x)) (* (-> v1-206 z) (-> v1-206 z))))) + (v1-208 + (vector-! (new-stack-vector0) (-> arg0 control highest-jump-mark) (-> arg0 control last-trans-leaving-surf)) + ) + ) + (t9-81 a0-149 a1-61 a2-17 (sqrtf (+ (* (-> v1-208 x) (-> v1-208 x)) (* (-> v1-208 z) (-> v1-208 z))))) + ) + (format + arg1 + "~0kbend b:~F t:~F s:~F~%" + (-> arg0 control bend-amount) + (-> arg0 control bend-target) + (-> arg0 control bend-speed) + ) + (set! sv-64 0) + (set! sv-72 0) + (set! sv-80 *anim-manager*) + (countdown (s3-8 (-> sv-80 free-index)) + (when (= (-> sv-80 slot s3-8 time-stamp) (-> *display* base-clock frame-counter)) + (set! sv-72 (+ sv-72 1)) + (set! sv-64 (+ sv-64 (used-bytes-for-slot sv-80 s3-8))) + ) + ) + (format + arg1 + "anim cache ~d anims ~dK total, ~d ~dK active~%" + (-> sv-80 free-index) + (sar (&- (-> sv-80 heap current) (the-as uint (-> sv-80 heap base))) 10) + sv-72 + (sar sv-64 10) + ) + (debug-print-channels (-> arg0 skel) arg1) + ) + (draw-history (-> arg0 control)) + (set! pp s5-0) + ) + #f + ) + ) + +(defbehavior read-pad target ((arg0 vector)) + (when (!= (-> self control time-of-last-pad-read) (-> *display* real-clock frame-counter)) + (set! (-> self control last-pad-xz-dir quad) (-> self control pad-xz-dir quad)) + (set! (-> self control last-pad-magnitude) (-> self control pad-magnitude)) + (set! (-> self control time-of-last-pad-read) (-> *display* real-clock frame-counter)) + ) + (set! (-> arg0 x) (sin (-> self control cpad stick0-dir))) + (set! (-> arg0 y) 0.0) + (set! (-> arg0 z) (cos (-> self control cpad stick0-dir))) + (set! (-> arg0 w) 0.0) + (set! (-> self control pad-xz-dir quad) (-> arg0 quad)) + (set! (-> self control pad-magnitude) (-> self control cpad stick0-speed)) + (when (< (-> self control update-cam-R-w-start-time) (current-time)) + (let* ((s5-0 (-> self control cam-R-w)) + (a2-0 (matrix-local->world #t #f)) + (v1-24 (-> a2-0 rvec quad)) + (a0-14 (-> a2-0 uvec quad)) + (a1-1 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 rvec quad) v1-24) + (set! (-> s5-0 uvec quad) a0-14) + (set! (-> s5-0 fvec quad) a1-1) + (set! (-> s5-0 trans quad) a2-1) + ) + ) + (vector-matrix*! arg0 arg0 (-> self control cam-R-w)) + ) + +(defbehavior set-pad target ((arg0 vector)) + (set! (-> self control pad-magnitude) (vector-length arg0)) + (vector-matrix*! (-> self control pad-xz-dir) arg0 (matrix-world->local #t #f)) + arg0 + ) + +(defun warp-vector-into-surface! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 matrix)) + (let ((t9-0 matrix-from-two-vectors!) + (a0-1 (new 'stack-no-clear 'matrix)) + ) + (set! (-> a0-1 rvec quad) (the-as uint128 0)) + (set! (-> a0-1 uvec quad) (the-as uint128 0)) + (set! (-> a0-1 fvec quad) (the-as uint128 0)) + (set! (-> a0-1 trans quad) (the-as uint128 0)) + (let ((a2-1 (t9-0 a0-1 (-> arg3 uvec) arg2))) + (vector-matrix*! arg0 arg1 a2-1) + ) + ) + ) + +(defbehavior vector<-pad-in-surface! target ((arg0 vector) (arg1 symbol)) + (let ((a1-1 (read-pad (new-stack-vector0)))) + (warp-vector-into-surface! arg0 a1-1 (-> self control local-normal) (-> self control cam-R-w)) + ) + (if arg1 + (vector-float*! arg0 arg0 (-> self control pad-magnitude)) + ) + arg0 + ) + +;; WARN: Return type mismatch vector vs none. +(defun vector<-pad-in-matrix! ((arg0 vector) (arg1 cpad-info) (arg2 matrix)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (matrix-local->world #t #f)) + ) + (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> arg1 leftx))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> arg1 lefty))))) + (set! (-> gp-0 w) 0.0) + (let ((f30-0 (vector-length gp-0))) + (vector-matrix*! gp-0 gp-0 s5-0) + (warp-vector-into-surface! arg0 gp-0 (-> arg2 uvec) s5-0) + (vector-matrix*! arg0 arg0 arg2) + (vector-normalize! arg0 f30-0) + ) + ) + (none) + ) + +(defbehavior local-pad-angle target () + (let ((a0-1 (vector<-pad-in-surface! (new-stack-vector0) #f))) + (vector-dot + (vector-normalize! a0-1 1.0) + (vector-z-quaternion! (new-stack-vector0) (-> self control quat-for-control)) + ) + ) + ) + +;; WARN: disable def twice: 93. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defbehavior turn-around? target () + (let* ((a0-1 (vector<-pad-in-surface! (new-stack-vector0) #f)) + (gp-0 (vector-normalize! a0-1 1.0)) + (t9-2 vector-normalize!) + (a0-2 (new-stack-vector0)) + ) + (set! (-> a0-2 quad) (-> self control transv quad)) + (let ((f0-1 (vector-dot gp-0 (t9-2 a0-2 1.0))) + (a1-3 (-> self control transv-history)) + (f2-0 -1000.0) + (f1-0 0.0) + (a0-3 -1) + (v1-7 (new 'static 'array time-frame 1 (seconds 0))) + ) + (countdown (a2-0 15) + (let ((a3-2 (-> a1-3 a2-0 quad))) + (set! (-> a1-3 (+ a2-0 1) quad) a3-2) + ) + ) + (set! (-> a1-3 0 quad) (-> self control transv quad)) + (set! (-> a1-3 0 w) (-> self control ctrl-xz-vel)) + (dotimes (a2-6 16) + (+! f1-0 (-> a1-3 a2-6 w)) + (when (< f2-0 (-> a1-3 a2-6 w)) + (set! a0-3 a2-6) + (set! f2-0 (-> a1-3 a2-6 w)) + ) + ) + (let ((f1-1 (* 0.0625 f1-0))) + (set! (-> self control idx-of-fastest-xz-vel) a0-3) + (set! (-> self control average-xz-vel) f1-1) + (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) + (set-time! (-> v1-7 0)) + ) + (if (logtest? (target-flags tf26) (-> self target-flags)) + (and (>= (the-as uint (- (current-time) (-> v1-7 0))) (the-as uint 300)) + (< f0-1 0.0) + (< (* 0.8 (-> self control current-surface target-speed)) f1-1) + (and (< 0.7 (-> self control pad-magnitude)) (time-elapsed? (-> self control time-of-last-lc) (seconds 0.3))) + ) + (and (>= (the-as uint (- (current-time) (-> v1-7 0))) (the-as uint 300)) + (= (-> self ext-anim) (target-anim default)) + (< f0-1 0.0) + (< (* 0.8 (-> self control current-surface target-speed)) f1-1) + (< 0.7 (-> self control pad-magnitude)) + (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.3)) + (time-elapsed? (-> self control time-of-last-lc) (seconds 0.3)) + (logtest? (-> self control status) (collide-status on-surface)) + (and (< 0.7 (-> self control surface-angle)) #t) + ) + ) + ) + ) + ) + ) + +(defbehavior wall-hide? target () + (when (and (= (-> self ext-anim) (target-anim default)) + (< 0.7 (-> self control pad-magnitude)) + (< 0.7 (-> self control blocked-factor)) + (and (< (-> self control ctrl-xz-vel) 8192.0) + (logtest? (-> self control status) (collide-status touch-wall)) + (not (logtest? (-> self control status) (collide-status touch-actor))) + (or (= (-> self control wall-contact-pat event) (pat-event hide)) + (let ((a0-2 (level-get-target-inside *level*))) + (and a0-2 (logtest? (-> a0-2 info level-flags) (level-flags lf0))) + ) + ) + ) + ) + (if (time-elapsed? (-> self control time-of-last-wall-hide-first-check-pass) (seconds 0.1)) + (set-time! (-> self control time-of-first-wall-hide-first-check-pass)) + ) + (set-time! (-> self control time-of-last-wall-hide-first-check-pass)) + (when (time-elapsed? (-> self control time-of-first-wall-hide-first-check-pass) (seconds 0.5)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-35 (-> gp-0 bbox)) + (a0-13 (-> self control trans)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 x) 8192.0) + (set! (-> a1-0 y) 10240.0) + (set! (-> a1-0 z) 8192.0) + (set! (-> a1-0 w) 1.0) + (vector-! (the-as vector v1-35) a0-13 a1-0) + ) + (let ((v1-37 (-> gp-0 bbox max)) + (a0-15 (-> self control trans)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) 8192.0) + (set! (-> a1-1 y) 10240.0) + (set! (-> a1-1 z) 8192.0) + (set! (-> a1-1 w) 1.0) + (vector+! v1-37 a0-15 a1-1) + ) + (set! (-> gp-0 collide-with) (-> self control root-prim prim-core collide-with)) + (set! (-> gp-0 ignore-process0) self) + (set! (-> gp-0 ignore-process1) #f) + (set! (-> gp-0 ignore-pat) (-> self control pat-ignore-mask)) + ((method-of-object *collide-cache* collide-cache-method-12)) + (dotimes (s5-0 3) + (set! (-> gp-0 start-pos quad) (-> self control collision-spheres s5-0 prim-core world-sphere quad)) + (vector-float*! (-> gp-0 move-dist) (-> self control wall-contact-normal) -8192.0) + (let ((v1-49 gp-0)) + (set! (-> v1-49 radius) 4.096) + (set! (-> v1-49 collide-with) (-> gp-0 collide-with)) + (set! (-> v1-49 ignore-process0) #f) + (set! (-> v1-49 ignore-process1) #f) + (set! (-> v1-49 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-49 action-mask) (collide-action solid)) + ) + (cond + ((and (>= (probe-using-line-sphere *collide-cache* gp-0) 0.0) + (< 0.8 (vector-dot (-> gp-0 best-other-tri normal) (-> self control wall-contact-normal))) + ) + ) + (else + (return #f) + ) + ) + ) + ) + #t + ) + ) + ) + +(defbehavior target-log-trans target () + (let ((v1-1 (-> self control trans-log-idx))) + (set-time! (-> self control trans-log-times v1-1)) + (set! (-> self control trans-log-trans v1-1 quad) (-> self control trans quad)) + (set! (-> self control trans-log-idx) (logand (+ v1-1 1) 127)) + ) + 0 + (none) + ) + +(defbehavior target-move-dist target ((arg0 time-frame)) + (let ((s5-0 (new-stack-vector0)) + (f30-0 0.0) + (gp-0 0) + ) + (let ((s4-0 (-> self control))) + (let* ((v1-0 127) + (a1-2 (logand (+ (-> s4-0 trans-log-idx) v1-0) 127)) + ) + (while (and (not (time-elapsed? (-> s4-0 trans-log-times a1-2) arg0)) (> v1-0 0)) + (vector+! s5-0 s5-0 (-> s4-0 trans-log-trans a1-2)) + (+! gp-0 1) + (+! v1-0 -1) + (set! a1-2 (logand (+ a1-2 v1-0) 127)) + ) + ) + (vector-float/! s5-0 s5-0 (the float gp-0)) + (let ((s3-0 (- 128 gp-0))) + (while (< s3-0 128) + (let ((v1-5 (logand (+ (-> s4-0 trans-log-idx) s3-0) 127))) + (+! f30-0 (vector-vector-distance s5-0 (-> s4-0 trans-log-trans v1-5))) + ) + (+! s3-0 1) + ) + ) + ) + (/ f30-0 (the float gp-0)) + ) + ) + +(defbehavior turn-to-vector target ((arg0 vector) (arg1 float)) + (let ((gp-0 (new-stack-vector0))) + (warp-vector-into-surface! gp-0 arg0 (-> self control local-normal) (-> self control cam-R-w)) + (set! (-> self control last-turn-to-magnitude) (-> self control turn-to-magnitude)) + (set! (-> self control last-turn-to-angle) (-> self control turn-to-angle)) + (set! (-> self control last-to-target-pt-xz quad) (-> self control to-target-pt-xz quad)) + (set! (-> self control last-turn-to-target quad) (-> self control turn-to-target quad)) + (vector-float*! (-> self control turn-to-target) gp-0 arg1) + (if (< 0.0 arg1) + (warp-vector-into-surface! (-> self control to-target-pt-xz) arg0 *up-vector* (-> self control cam-R-w)) + ) + (dotimes (v1-17 7) + (set! (-> self control turn-history-ctrl (+ v1-17 1) quad) (-> self control turn-history-ctrl v1-17 quad)) + ) + (set! (-> self control turn-history-ctrl 0 quad) + (-> (vector-matrix*! gp-0 gp-0 (-> self control w-R-c)) quad) + ) + (let ((f0-6 (atan (-> gp-0 x) (-> gp-0 z)))) + (set! (-> self control turn-to-magnitude) arg1) + (set! (-> self control turn-to-angle) f0-6) + ) + (let ((f0-8 (* arg1 (-> self control current-surface target-speed)))) + (set! (-> self control target-transv quad) (-> (vector-normalize! gp-0 f0-8) quad)) + ) + ) + (let ((gp-1 (new-stack-vector0))) + (vector-matrix*! gp-1 (-> self control target-transv) (-> self control c-R-w)) + (vector-float*! gp-1 gp-1 0.5) + (vector+! gp-1 gp-1 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + gp-1 + (meters 0.2) + "target" + (the-as rgba (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + ) + ) + +(defbehavior target-bend-vel-turn target ((arg0 vector)) + (cond + ((= (-> self control current-surface vel-turn) 0.0) + ) + ((< (-> self control current-surface vel-turn) 0.0) + (let* ((v1-5 arg0) + (f0-6 (sqrtf (+ (* (-> v1-5 x) (-> v1-5 x)) (* (-> v1-5 z) (-> v1-5 z))))) + ) + (set-vector! arg0 0.0 (-> arg0 y) f0-6 1.0) + ) + ) + (else + (let ((f0-10 (atan (-> arg0 x) (-> arg0 z)))) + (vector-rotate-y! arg0 arg0 (fmin + (* 0.03 (-> self clock time-adjust-ratio) (- f0-10)) + (* (-> self control current-surface vel-turn) (seconds-per-frame)) + ) + ) + ) + ) + ) + arg0 + ) + +(defbehavior target-add-slide-factor target ((arg0 vector)) + (let* ((a1-2 (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-negate! (new-stack-vector0) (-> self control dynam gravity-normal)) + (-> self control local-normal) + ) + ) + (s4-1 (vector-matrix*! (new 'stack-no-clear 'vector) a1-2 (-> self control w-R-c))) + (s5-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 1.0)) + ) + (vector+float*! arg0 arg0 s4-1 (-> self control current-surface slide-factor)) + (let ((a1-5 (-> self control low-coverage-tangent))) + (when (not (or (= (- 1.0 (-> self control current-surface slope-up-traction)) 0.0) (< (vector-length s4-1) 0.1))) + (let* ((a0-7 (vector-matrix*! (new 'stack-no-clear 'vector) a1-5 (-> self control w-R-c))) + (v1-15 (new-stack-vector0)) + (f0-5 (vector-dot a0-7 arg0)) + ) + 0.0 + (vector-! v1-15 arg0 (vector-float*! v1-15 a0-7 f0-5)) + (let* ((f1-5 (vector-length v1-15)) + (f2-0 f1-5) + ) + (if (< f0-5 0.0) + (set! f0-5 (* f0-5 (-> self control current-surface slope-up-traction))) + ) + (let ((f0-6 (+ f0-5 (-> self control current-surface slope-down-factor)))) + (vector+! arg0 (vector-float*! arg0 a0-7 f0-6) (vector-float*! v1-15 v1-15 (/ f1-5 f2-0))) + ) + ) + ) + ) + ) + (let ((t9-5 vector-xz-normalize!) + (a0-10 (new-stack-vector0)) + ) + (set! (-> a0-10 quad) (-> arg0 quad)) + (let ((v1-18 (t9-5 a0-10 1.0))) + (set! (-> v1-18 y) 0.0) + (let* ((f0-10 (vector-dot s5-1 v1-18)) + (v1-20 arg0) + (f1-10 (sqrtf (+ (* (-> v1-20 x) (-> v1-20 x)) (* (-> v1-20 z) (-> v1-20 z))))) + ) + (if (>= f0-10 0.0) + (vector-xz-normalize! arg0 (fmax 0.0 (+ f1-10 (* f0-10 (-> self control current-surface slope-down-factor))))) + (vector-xz-normalize! + arg0 + (fmax 0.0 (- f1-10 (* (- f0-10) (-> self control current-surface slope-up-factor)))) + ) + ) + ) + ) + ) + ) + arg0 + ) + +(defbehavior add-thrust target () + (let ((s5-0 (-> self control target-transv)) + (gp-0 (-> self control transv-ctrl)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> self control target-transv quad)) + (target-bend-vel-turn gp-0) + (target-add-slide-factor s5-0) + (let ((t9-2 vector-xz-normalize!) + (a0-2 (new-stack-vector0)) + ) + (set! (-> a0-2 quad) (-> s5-0 quad)) + (let ((s3-0 (t9-2 a0-2 1.0))) + (let ((t9-3 vector-xz-normalize!) + (a0-3 (new-stack-vector0)) + ) + (set! (-> a0-3 quad) (-> gp-0 quad)) + (let ((v1-9 (t9-3 a0-3 1.0))) + (set! (-> s3-0 y) 0.0) + (set! (-> v1-9 y) 0.0) + ) + ) + (let* ((f0-2 (-> s3-0 z)) + (v1-10 gp-0) + (f1-4 (sqrtf (+ (* (-> v1-10 x) (-> v1-10 x)) (* (-> v1-10 z) (-> v1-10 z))))) + (v1-12 s5-0) + (f30-0 + (cond + ((>= f1-4 (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z))))) + (let ((f0-3 (-> self control current-surface fric)) + (f1-5 1.0) + (v1-17 gp-0) + ) + (* f0-3 (fmax f1-5 (/ (sqrtf (+ (* (-> v1-17 x) (-> v1-17 x)) (* (-> v1-17 z) (-> v1-17 z)))) + (-> self control current-surface nonlin-fric-dist) + ) + ) + ) + ) + ) + ((>= f0-2 0.0) + (+ (* f0-2 (-> self control current-surface seek0)) (* (- 1.0 f0-2) (-> self control current-surface seek90))) + ) + (else + (+ (* (fabs f0-2) (-> self control current-surface seek180)) + (* (+ 1.0 f0-2) (-> self control current-surface seek90)) + ) + ) + ) + ) + ) + (let* ((s2-0 (-> self control btransv)) + (s3-1 (vector-matrix*! (new 'stack-no-clear 'vector) s2-0 (-> self control w-R-c))) + ) + (if (< (-> s4-0 x) 0.0) + (set! (-> s3-1 x) (fmax (fmin 0.0 (-> s3-1 x)) (-> s4-0 x))) + (set! (-> s3-1 x) (fmax 0.0 (fmin (-> s3-1 x) (-> s4-0 x)))) + ) + (if (< (-> s4-0 y) 0.0) + (set! (-> s3-1 y) (fmax (fmin 0.0 (-> s3-1 y)) (-> s4-0 y))) + (set! (-> s3-1 y) (fmax 0.0 (fmin (-> s3-1 y) (-> s4-0 y)))) + ) + (if (< (-> s4-0 z) 0.0) + (set! (-> s3-1 z) (fmax (fmin 0.0 (-> s3-1 z)) (-> s4-0 z))) + (set! (-> s3-1 z) (fmax 0.0 (fmin (-> s3-1 z) (-> s4-0 z)))) + ) + (if (< 0.2 (-> self control blocked-factor)) + (vector-seek! s3-1 s4-0 (* 122880.0 (seconds-per-frame))) + ) + (vector-matrix*! s2-0 s3-1 (-> self control c-R-w)) + (let ((f28-0 (vector-vector-xz-distance s3-1 s4-0))) + (when (and (not (logtest? (-> self control status) (collide-status touch-surface))) + (let ((v1-51 gp-0)) + (< (sqrtf (+ (* (-> v1-51 x) (-> v1-51 x)) (* (-> v1-51 z) (-> v1-51 z)))) + (sqrtf (+ (* (-> s3-1 x) (-> s3-1 x)) (* (-> s3-1 z) (-> s3-1 z)))) + ) + ) + ) + (let ((f0-37 (lerp-scale 163840.0 0.0 f28-0 0.0 20480.0))) + (if (and (< f28-0 20480.0) (< (-> s4-0 z) 0.0)) + (set! f0-37 (* 2.0 f0-37)) + ) + (+! f30-0 f0-37) + ) + ) + ) + ) + (if (and (not (logtest? (-> self control status) (collide-status touch-wall))) + (logtest? (-> self control old-status) (collide-status touch-wall)) + (logtest? (-> self control mod-surface flags) (surface-flag air)) + (< 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 collision-spheres 1 prim-core)) + (-> self control wall-contact-pt) + ) + ) + ) + ) + (set-time! (-> self control time-of-last-clear-wall-in-jump)) + ) + (if (not (time-elapsed? (-> self control time-of-last-clear-wall-in-jump) (seconds 0.2))) + (set! f30-0 (+ 204800.0 f30-0)) + ) + (if (and (not (logtest? (-> self control status) (collide-status touch-wall))) + (and (logtest? (-> self control old-status) (collide-status touch-wall)) + (logtest? (-> self control mod-surface flags) (surface-flag air)) + (< 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))) + (let ((f0-45 (* f30-0 (seconds-per-frame)))) + (set! (-> s4-2 y) 0.0) + (let ((v1-104 s4-2)) + (if (< f0-45 (sqrtf (+ (* (-> v1-104 x) (-> v1-104 x)) (* (-> v1-104 z) (-> v1-104 z))))) + (vector-xz-normalize! s4-2 f0-45) + ) + ) + ) + (vector+! gp-0 gp-0 s4-2) + ) + ) + ) + ) + ) + (set! (-> self control velocity-after-thrust) (vector-length gp-0)) + ) + (let ((gp-1 (new-stack-vector0))) + (vector-matrix*! gp-1 (-> self control transv-ctrl) (-> self control c-R-w)) + (vector-float*! gp-1 gp-1 0.5) + (vector+! gp-1 gp-1 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + gp-1 + (meters 0.2) + "ltransv" + (the-as rgba (new 'static 'rgba :g #xff :a #x80)) + ) + (set! (-> gp-1 quad) (-> self control btransv quad)) + (vector-float*! gp-1 gp-1 0.5) + (vector+! gp-1 gp-1 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + gp-1 + (meters 0.2) + "btransv" + (the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + ) + ) + ) + +(defbehavior add-gravity target () + (let ((s5-0 (new-stack-vector0)) + (gp-0 (new-stack-vector0)) + ) + (compute-acc-due-to-gravity (-> self control) s5-0 (-> self control current-surface slip-factor)) + (vector-matrix*! gp-0 s5-0 (-> self control w-R-c)) + (vector-v++! (-> self control transv-ctrl) gp-0) + ) + (let* ((a0-4 + (vector-matrix*! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal) (-> self control w-R-c)) + ) + (v1-9 (new-stack-vector0)) + (f0-2 (vector-dot a0-4 (-> self control transv-ctrl))) + ) + 0.0 + (vector-! v1-9 (-> self control transv-ctrl) (vector-float*! v1-9 a0-4 f0-2)) + (let* ((f1-2 (vector-length v1-9)) + (f2-0 f1-2) + ) + (if (< f1-2 0.00004096) + (set! f1-2 0.0) + ) + (if (< f0-2 (- (-> self control dynam gravity-max))) + (set! f0-2 (- (-> self control dynam gravity-max))) + ) + (vector+! + (-> self control transv-ctrl) + (vector-float*! (-> self control transv-ctrl) a0-4 f0-2) + (vector-float*! v1-9 v1-9 (/ f1-2 f2-0)) + ) + ) + ) + ) + +(defbehavior target-compute-slopes target ((arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s4-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control))) + (s3-0 (new 'stack-no-clear 'matrix)) + (s5-0 (vector-flatten! + (new 'stack-no-clear 'vector) + (-> self control dynam gravity-normal) + (-> self control local-normal) + ) + ) + ) + (forward-up-nopitch->inv-matrix s3-0 (-> self control c-R-w fvec) arg0) + (set-vector! gp-0 0.0 0.0 1.0 1.0) + (vector-matrix*! gp-0 gp-0 s3-0) + (set! (-> self control surface-slope-z) (- (vector-dot (-> self control surface-normal) gp-0))) + (set! (-> self control local-slope-z) (- (vector-dot (-> self control local-normal) gp-0))) + (set! (-> self control gspot-slope-z) (- (vector-dot (-> self control gspot-normal) gp-0))) + (set! (-> self control ctrl-slope-z) (- (vector-dot s4-0 gp-0))) + (set-vector! gp-0 1.0 0.0 0.0 1.0) + (vector-matrix*! gp-0 gp-0 s3-0) + (set! (-> self control surface-slope-x) (- (vector-dot (-> self control surface-normal) gp-0))) + (set! (-> self control local-slope-x) (- (vector-dot (-> self control local-normal) gp-0))) + (set! (-> self control gspot-slope-x) (- (vector-dot (-> self control gspot-normal) gp-0))) + (set! (-> self control ctrl-slope-x) (- (vector-dot s4-0 gp-0))) + (set-vector! gp-0 1.0 0.0 0.0 1.0) + (vector-matrix*! gp-0 gp-0 (-> self control c-R-w)) + (set! (-> self control ctrl-slope-heading) (vector-dot gp-0 s5-0)) + ) + 0 + ) + +(defbehavior do-rotations1 target () + (rotate-toward-orientation! + (-> self control) + (-> self control dir-targ) + 0.0 + (-> self control current-surface tiltv) + 150 + (the int (-> self control current-surface tiltvf)) + 0.0 + ) + ) + +(define *strafe-mode* #f) + +(defbehavior do-rotations2 target () + (if *strafe-mode* + (return 0) + ) + (let ((gp-0 (vector-z-quaternion! (new-stack-vector0) (-> self control dir-targ))) + (s5-0 + (cond + ((logtest? (surface-flag turn-to-alt) (-> self control current-surface flags)) + (-> self control turn-to-alt-heading) + ) + ((and (or (not (logtest? (logior (-> self control status) (-> self control old-status)) + (collide-status on-surface touch-surface) + ) + ) + (not (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.5))) + (not (and (-> self next-state) (let ((v1-18 (-> self next-state name))) + (or (= v1-18 'target-walk) (= v1-18 'target-gun-walk)) + ) + ) + ) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) + (not (time-elapsed? (-> self control time-of-last-lc) (seconds 0.5))) + (logtest? (-> self control current-surface flags) (surface-flag turn-to-pad)) + (!= (-> self control force-turn-to-strength) 0.0) + ) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) + ) + (-> self control to-target-pt-xz) + ) + (else + (-> self control transv) + ) + ) + ) + ) + (let* ((s3-0 (-> self control bent-gravity-normal)) + (s4-0 (forward-up-nopitch->quaternion (new-stack-quaternion0) gp-0 s3-0)) + (s3-1 (forward-up-nopitch->quaternion (new-stack-quaternion0) s5-0 s3-0)) + (f0-2 (acos (vector-dot gp-0 s5-0))) + (f1-2 (* (-> self control current-surface turnvv) (seconds-per-frame))) + ) + (quaternion-slerp! + (-> self control dir-targ) + s4-0 + s3-1 + (cond + ((and (or (>= 0.0 (-> self control turn-to-magnitude)) (< (current-time) (-> self control turn-lockout-end-time))) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-when-centered))) + ) + 0.0 + ) + ((< f0-2 f1-2) + 1.0 + ) + (else + (/ f1-2 f0-2) + ) + ) + ) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + gp-0 + (meters 2) + (the-as rgba (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + s5-0 + (meters 2) + (the-as rgba (new 'static 'rgba :r #xff :g #x80 :a #x80)) + ) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (-> self control c-R-w fvec) + (meters 2) + (the-as rgba (new 'static 'rgba :r #xff :b #xff :a #x80)) + ) + (rotate-toward-orientation! + (-> self control) + (-> self control dir-targ) + (-> self control current-surface turnv) + 0.0 + (the int (-> self control current-surface turnvf)) + 150 + (-> self control turn-go-the-long-way) + ) + (if (and (!= (-> self control turn-go-the-long-way) 0.0) + (< (fabs + (deg-diff + (quaternion-y-angle (-> self control quat-for-control)) + (quaternion-y-angle (-> self control dir-targ)) + ) + ) + 182.04445 + ) + ) + (set! (-> self control turn-go-the-long-way) 0.0) + ) + (quaternion-slerp! + (-> self control quat) + (-> self control quat-for-control) + (-> self control override-quat) + (-> self control override-quat-alpha) + ) + (target-compute-slopes (-> self control dynam gravity-normal)) + ) + +(defun leg-ik-callback ((arg0 joint-mod-ik) (arg1 object) (arg2 object) (arg3 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg3 quad)) + (let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y)))) + (if (< 1228.8 f0-1) + (set! f0-1 1228.8) + ) + (if (< f0-1 409.6) + (set! f0-1 409.6) + ) + (+! (-> arg0 user-position y) f0-1) + ) + (let* ((f0-4 + (vector-dot (-> arg0 user-normal) (vector-! (new 'stack-no-clear 'vector) arg3 (-> arg0 user-position))) + ) + (f30-1 (lerp-scale 1.0 0.0 f0-4 0.0 2048.0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-13 s5-0)) + (let ((a0-4 (-> arg0 user-normal))) + (let ((a1-4 4096.0)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-4 quad)) + ) + (.lvf vf4 (&-> v1-13 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s3-0 quad) vf6) + (vector-float*! (new 'stack-no-clear 'vector) (-> arg0 user-normal) -8192.0) + (let ((s4-1 (new 'stack-no-clear 'vector))) + 0.0 + (let ((f0-8 (intersect-ray-plane s3-0 (-> arg0 user-normal) (-> arg0 user-position) (-> arg0 user-normal))) + (a0-7 s4-1) + ) + (let ((v1-16 (-> arg0 user-normal))) + (let ((a1-7 f0-8)) + (.mov vf7 a1-7) + ) + (.lvf vf5 (&-> v1-16 quad)) + ) + (.lvf vf4 (&-> s3-0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-7 quad) vf6) + ) + (let ((a1-8 s4-1)) + (let ((v1-17 s4-1)) + (let ((a0-8 (-> arg0 user-normal))) + (let ((a2-6 + (- (vector-dot (-> arg0 user-normal) (vector-! (new 'stack-no-clear 'vector) s4-1 (-> arg0 user-position)))) + ) + ) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a0-8 quad)) + ) + (.lvf vf4 (&-> v1-17 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-8 quad) vf6) + ) + (let ((a1-9 s5-0)) + (let ((v1-18 s5-0)) + (let ((a0-10 (vector-! (new 'stack-no-clear 'vector) s4-1 s5-0))) + (let ((a2-9 (fmin 1.0 (* (-> arg0 user-blend) f30-1)))) + (.mov vf7 a2-9) + ) + (.lvf vf5 (&-> a0-10 quad)) + ) + (.lvf vf4 (&-> v1-18 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-9 quad) vf6) + ) + ) + ) + (set-ik-target! arg0 s5-0) + ) + (none) + ) + ) + +(defbehavior target-update-ik target () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-0 (-> gp-0 bbox)) + (a0-1 (-> self control trans)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 x) 8192.0) + (set! (-> a1-0 y) 6144.0) + (set! (-> a1-0 z) 8192.0) + (set! (-> a1-0 w) 1.0) + (vector-! (the-as vector v1-0) a0-1 a1-0) + ) + (let ((v1-2 (-> gp-0 bbox max)) + (a0-3 (-> self control trans)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) 8192.0) + (set! (-> a1-1 y) 6144.0) + (set! (-> a1-1 z) 8192.0) + (set! (-> a1-1 w) 1.0) + (vector+! v1-2 a0-3 a1-1) + ) + (set! (-> gp-0 collide-with) (-> self control root-prim prim-core collide-with)) + (set! (-> gp-0 ignore-process0) self) + (set! (-> gp-0 ignore-process1) #f) + (set! (-> gp-0 ignore-pat) (-> self control pat-ignore-mask)) + ((method-of-object *collide-cache* collide-cache-method-12)) + (dotimes (s5-0 2) + (let ((a1-4 (not (or (logtest? (target-flags lleg-no-ik rleg-no-ik) (-> self target-flags)) + (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (focus-test? self edge-grab pole flut pilot mech) + ) + ) + ) + ) + (enable-set! (-> self leg-ik s5-0) a1-4) + ) + (set! (-> self foot s5-0 twist-max quad) (-> self control ground-contact-normal quad)) + (set! (-> self foot s5-0 trans quad) (-> self control gspot-pos quad)) + (vector-y-quaternion! (-> self foot s5-0 target) (-> self control quat-for-control)) + (set! (-> self foot s5-0 flex-blend) (if (if (zero? s5-0) + (logtest? (target-flags lleg-no-ik) (-> self target-flags)) + (logtest? (target-flags rleg-no-ik) (-> self target-flags)) + ) + 0.0 + 1.0 + ) + ) + (-> self leg-ik s5-0 shoulder-matrix-no-ik) + (let ((v1-51 (-> self leg-ik s5-0 elbow-matrix-no-ik)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s1-0 quad) (-> *y-vector* quad)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((a2-8 s2-0)) + (let ((a0-27 (-> v1-51 trans))) + (let ((a1-8 (-> v1-51 uvec))) + (let ((a3-3 (-> self leg-ik s5-0 hand-dist))) + (.mov vf7 a3-3) + ) + (.lvf vf5 (&-> a1-8 quad)) + ) + (.lvf vf4 (&-> a0-27 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a2-8 quad) vf6) + ) + (let ((a1-9 s2-0)) + (let ((a0-28 (-> v1-51 trans))) + (let ((v1-52 (-> v1-51 uvec))) + (let ((a2-12 (-> self leg-ik s5-0 hand-dist))) + (.mov vf7 a2-12) + ) + (.lvf vf5 (&-> v1-52 quad)) + ) + (.lvf vf4 (&-> a0-28 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-9 quad) vf6) + ) + (let ((f0-13 (lerp-scale 1.0 0.0 (- (-> s2-0 y) (-> self control gspot-pos y)) 819.2 2048.0))) + (seek! (-> self leg-ik s5-0 user-blend) f0-13 (* 4.0 (seconds-per-frame))) + ) + (let ((a1-12 (-> gp-0 start-pos))) + (let ((v1-63 s2-0)) + (let ((a0-31 s1-0)) + (let ((a2-16 4096.0)) + (.mov vf7 a2-16) + ) + (.lvf vf5 (&-> a0-31 quad)) + ) + (.lvf vf4 (&-> v1-63 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-12 quad) vf6) + ) + (vector-float*! (-> gp-0 move-dist) s1-0 -8192.0) + (let ((v1-66 gp-0)) + (set! (-> v1-66 radius) 4.096) + (set! (-> v1-66 collide-with) (-> gp-0 collide-with)) + (set! (-> v1-66 ignore-process0) #f) + (set! (-> v1-66 ignore-process1) #f) + (set! (-> v1-66 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-66 action-mask) (collide-action solid)) + ) + (let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0))) + (cond + ((and (>= f30-0 0.0) (< 0.5 (-> gp-0 best-other-tri normal y))) + (set! (-> s4-0 quad) (-> gp-0 best-other-tri normal quad)) + (when (< 8192.0 (vector-vector-angle-safe *y-vector* s4-0)) + (let* ((a1-17 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s4-0) 1.0)) + (a2-18 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-17 8192.0)) + ) + (vector-orient-by-quat! s4-0 *y-vector* a2-18) + ) + ) + (let ((a1-19 s3-0)) + (let ((v1-77 (-> gp-0 start-pos))) + (let ((a0-45 (-> gp-0 move-dist))) + (let ((a2-19 f30-0)) + (.mov vf7 a2-19) + ) + (.lvf vf5 (&-> a0-45 quad)) + ) + (.lvf vf4 (&-> v1-77 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-19 quad) vf6) + ) + (set! (-> self leg-ik s5-0 user-position quad) (-> s3-0 quad)) + (set! (-> self leg-ik s5-0 user-normal quad) (-> s4-0 quad)) + (set! (-> self foot s5-0 twist-max quad) (-> s4-0 quad)) + ) + (else + (set! (-> self leg-ik s5-0 user-position quad) (-> s2-0 quad)) + (set! (-> self leg-ik s5-0 user-normal quad) (-> *y-vector* quad)) + (set! (-> self foot s5-0 twist-max quad) (-> *y-vector* quad)) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defbehavior pre-collide-setup target () + (if (>= (current-time) (-> self control additional-decaying-velocity-decay-start-time)) + (vector-normalize! + (-> self control additional-decaying-velocity) + (seek (vector-length (-> self control additional-decaying-velocity)) 0.0 (* 40960.0 (seconds-per-frame))) + ) + ) + (cond + ((logtest? (-> self control old-status) (collide-status on-surface)) + (if (>= (+ (current-time) (seconds -0.035)) (-> self control additional-decaying-velocity-end-time)) + (vector-reset! (-> self control additional-decaying-velocity)) + ) + ) + (else + (let ((f30-0 (vector-length (-> self control additional-decaying-velocity)))) + (let* ((v1-22 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control additional-decaying-velocity) 1.0) + ) + (f0-3 (vector-dot (-> self control transv) v1-22)) + ) + (if (< f0-3 0.0) + (set! f30-0 (seek f30-0 0.0 (* -1.0 (seconds-per-frame) f0-3))) + ) + ) + (let ((f0-7 (seek f30-0 0.0 (* 28672.0 (seconds-per-frame))))) + (vector-normalize! (-> self control additional-decaying-velocity) f0-7) + ) + ) + ) + ) + (set! (-> self control collide-extra-velocity quad) (-> self control additional-decaying-velocity quad)) + (set! (-> self control pre-collide-local-normal quad) (-> self control local-normal quad)) + 0 + (none) + ) + +(defbehavior level-setup target () + (let ((gp-0 (-> self current-level))) + (set! (-> self current-level) (level-get-target-inside *level*)) + (if (-> self current-level) + (+! (-> self game task-in-times (-> self current-level info task-level)) + (- (current-time) (-> self clock old-frame-counter)) + ) + ) + (if (and (-> self current-level) (or (not gp-0) (!= (-> gp-0 name) (-> self current-level name)))) + (send-event self 'level-enter (-> self current-level name)) + ) + ) + 0 + (none) + ) + +(defbehavior flag-setup target () + (cond + ((= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (if (zero? (-> self control time-between-zero-inputs)) + (set! (-> self control time-between-zero-inputs) (- (current-time) (-> self control time-of-last-zero-input))) + ) + (set-time! (-> self control time-of-last-zero-input)) + (quaternion-copy! (-> self control last-nonzero-input-dir-targ) (-> self control dir-targ)) + ) + (else + (set-time! (-> self control time-of-last-nonzero-input)) + (set! (-> self control time-between-zero-inputs) 0) + 0 + ) + ) + (level-setup) + (set! (-> self control last-transv quad) (-> self control transv quad)) + (quaternion-copy! (-> self control last-quat-for-control) (-> self control quat-for-control)) + ((-> self control current-surface active-hook)) + (cond + ((logtest? (-> self control status) (collide-status on-surface)) + (set-time! (-> self control last-time-on-surface)) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (if (and (>= (-> self control coverage) 1.0) + (not (logtest? (-> self control status) (collide-status touch-actor on-water))) + (logtest? (-> self control status) (collide-status on-ground)) + ) + (set! (-> self control last-trans-on-ground quad) (-> self control trans quad)) + ) + ((-> self control current-surface touch-hook)) + ) + (else + (let ((v1-49 (-> self control trans))) + (when (logtest? (-> self control old-status) (collide-status on-surface)) + (set! (-> self control last-trans-leaving-surf quad) (-> self control last-trans-any-surf quad)) + (set! (-> self control highest-jump-mark quad) (-> self control last-trans-any-surf quad)) + ) + (set! (-> self control highest-jump-mark x) (-> v1-49 x)) + (set! (-> self control highest-jump-mark z) (-> v1-49 z)) + (if (< (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control highest-jump-mark) v1-49) + ) + 0.0 + ) + (set! (-> self control highest-jump-mark y) (-> v1-49 y)) + ) + ) + ) + ) + (when (and (cpad-pressed? (-> self control cpad number) r3) + (zero? (-> self control remaining-ctrl-iterations)) + (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask movie))) + (not *pause-lock*) + ) + (if (and (= (-> self cam-user-mode) 'normal) + (logtest? (-> self control mod-surface flags) (surface-flag look-around)) + (not (focus-test? self edge-grab pole flut tube light board pilot dark)) + (-> *setting-control* user-current allow-look-around) + (time-elapsed? (the-as int (-> self no-look-around-wait)) (seconds 0.05)) + (not (and (= (-> self control ground-pat material) (pat-material ice)) (< 4096.0 (-> self control ctrl-xz-vel))) + ) + ) + (send-event self 'change-mode 'look-around) + ) + ) + (if (!= (not (logtest? (logand (game-feature sidekick) (-> *setting-control* user-current features)) + (-> self game features) + ) + ) + (not (-> self sidekick)) + ) + (target-sidekick-setup + (logtest? (logand (game-feature sidekick) (-> *setting-control* user-current features)) + (-> self game features) + ) + ) + ) + (if (and (!= (not (logtest? (game-feature board) (-> self game features))) (not (-> self board board))) + (not (logtest? (focus-status board) (-> self focus-status))) + ) + (target-board-setup (logtest? (game-feature board) (-> self game features))) + ) + (if (want-to-board?) + (send-event self 'change-mode 'board #f) + ) + (when (!= (not (-> *setting-control* user-current mirror)) (not (-> self mirror))) + (cond + ((-> self mirror) + (deactivate (-> self mirror 0)) + (set! (-> self mirror) (the-as (pointer process-drawable) #f)) + ) + (else + (let ((gp-1 (process-spawn + manipy + :init manipy-init + (-> self control trans) + (-> self entity) + (target-skel-group) + #f + 2 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (send-event (ppointer->process gp-1) 'anim-mode 'mirror) + (send-event (ppointer->process gp-1) 'mirror #t) + (set! (-> self mirror) (the-as (pointer process-drawable) gp-1)) + ) + ) + ) + ) + (when (and (= *cheat-mode* 'debug) + (cpad-hold? (-> self control cpad number) r2) + (cpad-hold? (-> self control cpad number) l2) + (not *pause-lock*) + (not (focus-test? self grabbed in-head pilot teleporting)) + (not (and (-> self next-state) + (let ((v1-163 (-> self next-state name))) + (or (= v1-163 'target-darkjak-get-on) (= v1-163 'target-lightjak-get-on) (= v1-163 'target-float)) + ) + ) + ) + (= (-> self pending-ext-geo) (-> self ext-geo)) + ) + (send-event *camera* 'reset-follow) + (set-time! (-> self control time-of-last-debug-float)) + (cond + ((focus-test? self mech indax) + (if (not (and (-> self next-state) (let ((v1-176 (-> self next-state name))) + (or (= v1-176 'target-falling) + (= v1-176 'target-board-falling) + (= v1-176 'target-gun-falling) + (= v1-176 'target-mech-falling) + (= v1-176 'target-mech-carry-falling) + (= v1-176 'target-carry-falling) + (= v1-176 'target-indax-falling) + ) + ) + ) + ) + (send-event self 'change-mode 'falling) + ) + (set! (-> self control additional-decaying-velocity-end-time) 0) + (vector-reset! (-> self control additional-decaying-velocity)) + (let ((v1-186 (new-stack-vector0))) + (let ((f0-9 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-186 (-> self control transv) (vector-float*! v1-186 (-> self control dynam gravity-normal) f0-9)) + ) + (let* ((f0-10 (vector-length v1-186)) + (f1-5 f0-10) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-186 v1-186 (/ f0-10 f1-5)) + ) + ) + ) + (let ((a1-44 (new 'stack-no-clear 'vector))) + (set! (-> a1-44 quad) (-> self control trans quad)) + (let ((v1-190 (new-stack-vector0)) + (f0-13 (vector-dot (-> self control dynam gravity-normal) a1-44)) + ) + 0.0 + (vector-! v1-190 a1-44 (vector-float*! v1-190 (-> self control dynam gravity-normal) f0-13)) + (let* ((f1-8 (vector-length v1-190)) + (f2-1 f1-8) + (f0-14 (+ 512.0 f0-13)) + ) + (vector+! + a1-44 + (vector-float*! a1-44 (-> self control dynam gravity-normal) f0-14) + (vector-float*! v1-190 v1-190 (/ f1-8 f2-1)) + ) + ) + ) + (move-to-point! (-> self control) a1-44) + ) + (set! (-> self control surf) *standard-ground-surface*) + ) + (else + (go target-float) + ) + ) + ) + (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (if (and (or (logtest? (-> self control current-surface flags) (surface-flag check-edge)) + (and (and (-> self next-state) (let ((v1-208 (-> self next-state name))) + (or (= v1-208 'target-walk) (= v1-208 'target-gun-walk)) + ) + ) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + ) + (and (< f0-17 0.0) + (and (or (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) *pause-lock*) + (not (focus-test? self flut pilot mech indax)) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + #t + ) + ) + ) + (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) + (logclear! (-> self control root-prim prim-core action) (collide-action check-edge)) + ) + ) + (let ((v1-226 (-> self current-level))) + (if (and (or (time-elapsed? (-> self control last-time-on-surface) (seconds 2)) (focus-test? self pilot)) + (and v1-226 + (< (-> self control trans y) (-> v1-226 info bottom-height)) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) + ) + ) + (send-event + self + 'attack-invinc + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'endlessfall) + ) + ) + ) + ) + ) + (set! (-> self control bend-speed) (if (logtest? (-> self control status) (collide-status on-surface)) + 32.0 + 2.0 + ) + ) + (let ((v1-245 (-> *setting-control* user-current beard))) + (when (!= (-> self beard?) v1-245) + (cond + (v1-245 + (setup-masks (-> self draw) 4 0) + (set! (-> self beard?) #t) + ) + (else + (setup-masks (-> self draw) 0 4) + (set! (-> self beard?) #f) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior post-flag-setup target () + (if (logtest? (-> self control status) (collide-status touch-wall touch-actor)) + (set-time! (-> self control last-time-touching-actor)) + ) + (when (logtest? (-> self target-flags) (target-flags tinvuln1)) + (if (< (logand (-> *display* frame-clock integral-frame-counter) 3) 1) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + ) + (if (time-elapsed? (-> self control invul1-on-time) (-> self control invul1-off-time)) + (target-timed-invulnerable-off self 1) + ) + ) + (when (logtest? (target-flags tinvuln2) (-> self target-flags)) + (if (time-elapsed? (-> self control invul2-on-time) (-> self control invul2-off-time)) + (target-timed-invulnerable-off self 2) + ) + ) + (set! (-> self control jump-kind) #f) + (target-gun-joint-pre) + ((-> self pre-joint-hook)) + (target-log-trans) + (seek! + (-> self hair 0 twist-max z) + (lerp-scale 0.0 1820.4445 (vector-length (-> self control transv)) 0.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! + (-> self hair 0 twist-speed-x) + (lerp-scale 0.5 4.0 (vector-length (-> self control transv)) 0.0 122880.0) + (* 10.0 (seconds-per-frame)) + ) + (let ((f0-9 (+ (-> self hair 0 twist z) (* (-> self hair 0 twist-speed-x) (seconds-per-frame))))) + (set! (-> self hair 0 twist z) (- f0-9 (* (the float (the int (/ f0-9 1.0))) 1.0))) + ) + (if (and (focus-test? self pilot) (nonzero? (-> self pilot)) (= (-> self pilot stance) 1)) + (seek! + (-> self hair 0 twist-max w) + (lerp-scale 0.0 9102.223 (vector-length (-> self control transv)) 0.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! (-> self hair 0 twist-max w) 0.0 (* 65536.0 (seconds-per-frame))) + ) + (trs-set! + (-> self hair 0) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (+ (-> self hair 0 twist-max w) (* (sin (* 32768.0 (-> self hair 0 twist z))) (-> self hair 0 twist-max z))) + ) + (the-as vector #f) + ) + (seek! + (-> self hair 1 twist-max z) + (lerp-scale 0.0 5461.3335 (vector-length (-> self control transv)) 4096.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! + (-> self hair 1 twist-speed-x) + (lerp-scale 1.0 8.0 (vector-length (-> self control transv)) 4096.0 122880.0) + (* 10.0 (seconds-per-frame)) + ) + (let ((f0-33 (+ (-> self hair 1 twist z) (* (-> self hair 1 twist-speed-x) (seconds-per-frame))))) + (set! (-> self hair 1 twist z) (- f0-33 (* (the float (the int (/ f0-33 1.0))) 1.0))) + ) + (trs-set! + (-> self hair 1) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (* (sin (* 32768.0 (-> self hair 1 twist z))) (-> self hair 1 twist-max z)) + ) + (the-as vector #f) + ) + (target-update-ik) + 0 + (none) + ) + +(defbehavior bend-gravity target () + (if (and (logtest? (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (return #f) + ) + (let ((f0-1 + (if (and (logtest? (-> self control status) (collide-status touch-wall)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + 0.0 + (-> self control bend-target) + ) + ) + ) + (seek! (-> self control bend-amount) f0-1 (* (-> self control bend-speed) (seconds-per-frame))) + ) + (set! (-> self control dynam gravity-normal quad) (-> self control standard-dynamics gravity-normal quad)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((f30-0 (-> self control current-surface tiltvv)) + (gp-0 (-> self control gspot-normal)) + ) + (vector-deg-slerp s5-0 (-> self control standard-dynamics gravity-normal) gp-0 (-> self control bend-amount)) + (let ((a2-3 + (matrix-from-two-vectors-smooth! + (new 'stack-no-clear 'matrix) + (-> self control bent-gravity-normal) + s5-0 + f30-0 + (the int (-> self control current-surface tiltvvf)) + ) + ) + ) + (vector-matrix*! (-> self control bent-gravity-normal) (-> self control bent-gravity-normal) a2-3) + ) + (vector-normalize! (-> self control bent-gravity-normal) 1.0) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + gp-0 + (meters 2) + (new 'static 'rgba :b #xff :a #x80) + ) + ) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (-> self control local-normal) + (meters 2) + (the-as rgba (new 'static 'rgba :r #xff :a #x80)) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (-> self control standard-dynamics gravity-normal) + (meters 2.5) + (the-as rgba (new 'static 'rgba :r #xff :a #x80)) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (-> self control dynam gravity-normal) + (meters 3) + (the-as rgba (new 'static 'rgba :r #xff :b #xff :a #x80)) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (-> self control bent-gravity-normal) + (meters 3) + (the-as rgba (new 'static 'rgba :r #xff :b #xff :a #x80)) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + (meters 3) + (the-as rgba (new 'static 'rgba :r #xff :a #x80)) + ) + ) + +(defbehavior target-compute-edge target () + (let ((s5-0 *edge-grab-info*)) + (cond + ((-> s5-0 pilot-edge-grab?) + (set! (-> self control ground-pat) (new 'static 'pat-surface :material (pat-material metal))) + (cond + ((send-event (handle->process (-> s5-0 pilot-edge-grab handle)) 'pilot-edge-grab s5-0) + (let ((a0-7 (handle->process (-> s5-0 pilot-edge-grab handle)))) + (set! (-> s5-0 center-hold-old quad) (-> s5-0 center-hold quad)) + (let ((gp-0 (new 'stack-no-clear 'bone))) + (let* ((v1-13 (-> gp-0 transform)) + (a3-0 (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) + (a0-12 (-> a3-0 rvec quad)) + (a1-4 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-13 rvec quad) a0-12) + (set! (-> v1-13 uvec quad) a1-4) + (set! (-> v1-13 fvec quad) a2-1) + (set! (-> v1-13 trans quad) a3-1) + ) + (vector-matrix*! (-> gp-0 scale) (the-as vector (-> s5-0 pilot-edge-grab)) (-> gp-0 transform)) + (vector-rotate*! (the-as vector (&+ gp-0 80)) (-> s5-0 pilot-edge-grab local-dir) (-> gp-0 transform)) + (set! (-> s5-0 center-hold quad) (-> gp-0 scale quad)) + (set! (-> self control edge-grab-edge-dir quad) (-> (&+ gp-0 80) transform rvec quad)) + ) + ) + ) + (else + (send-event self 'end-mode 'edge-grab) + ) + ) + ) + (else + (if (not (edge-grab-info-method-9 s5-0)) + (send-event self 'end-mode 'edge-grab) + ) + (if *display-edge-collision-marks* + ((method-of-type edge-grab-info edge-grab-info-method-10)) + ) + (set! (-> self control ground-pat) (-> s5-0 edge-tri-pat)) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (the-as vector (-> s5-0 world-vertex)) + (-> s5-0 world-vertex 1) + ) + 1.0 + ) + ) + ) + (let ((gp-2 (vector-cross! + (-> self control edge-grab-across-edge-dir) + (-> self control edge-grab-edge-dir) + (-> self control dynam gravity-normal) + ) + ) + ) + (let ((s4-1 (vector-! (new-stack-vector0) (-> s5-0 center-hold) (-> self control midpoint-of-hands)))) + (set! (-> self control hand-to-edge-dist) (vector-length s4-1)) + (cond + ((and (< 1228.8 (-> self control hand-to-edge-dist)) + (time-elapsed? (-> self control last-successful-compute-edge-time) (seconds 0.2)) + ) + (cond + ((-> s5-0 pilot-edge-grab?) + (case (-> s5-0 pilot-edge-grab?) + (('target-jump) + (seek! (-> s5-0 pilot-grab-interp) 1.0 (* 2.0 (seconds-per-frame))) + ) + (else + (seek! (-> s5-0 pilot-grab-interp) 1.0 (* 1.5 (seconds-per-frame))) + ) + ) + (let* ((f0-11 (fmin 1.0 (* 1.5 (-> s5-0 pilot-grab-interp)))) + (s3-1 (vector-lerp! + (new 'stack-no-clear 'vector) + (-> s5-0 pilot-start-grab-pos) + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 center-hold) (-> self control ctrl-to-hands-offset)) + (smooth-step f0-11) + ) + ) + ) + (set! (-> s3-1 y) (+ (lerp + (-> s5-0 pilot-start-grab-pos y) + (- (-> s5-0 center-hold y) (-> self control ctrl-to-hands-offset y)) + (smooth-step (-> s5-0 pilot-grab-interp)) + ) + (cond + ((= (-> s5-0 pilot-edge-grab?) 'target-jump) + (let ((f1-6 (-> s5-0 pilot-grab-interp))) + (* 8192.0 (- 1.0 f1-6) f1-6) + ) + ) + ((>= (-> s5-0 pilot-grab-interp) 0.5) + (let ((f1-10 (* 2.0 (+ -0.5 (-> s5-0 pilot-grab-interp))))) + (* 8192.0 (- 1.0 f1-10) f1-10) + ) + ) + (else + (let ((f1-13 (* 2.0 (-> s5-0 pilot-grab-interp)))) + (* 32768.0 (- 1.0 f1-13) f1-13) + ) + ) + ) + ) + ) + (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) + (set-time! (-> self control rider-time)) + (vector+! s3-1 s3-1 (-> self control cspace-offset)) + (move-to-point! (-> self control) s3-1) + ) + (set! (-> self control hand-to-edge-dist) 0.0) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + ) + (else + (vector-normalize! s4-1 1638.4) + (let ((a1-20 (vector+! (new 'stack-no-clear 'vector) s4-1 (-> self control cspace-offset)))) + (move-by-vector! (-> self control) a1-20) + ) + (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) + (set-time! (-> self control rider-time)) + (if (and (time-elapsed? (-> self control edge-grab-start-time) (seconds 0.5)) + (time-elapsed? (-> self control last-successful-compute-edge-time) (seconds 0.5)) + ) + (send-event self 'end-mode 'edge-grab) + ) + ) + ) + ) + (else + (let ((a1-23 (new 'stack-no-clear 'vector))) + (vector-! a1-23 (-> s5-0 center-hold) (-> self control ctrl-to-hands-offset)) + (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) + (set-time! (-> self control rider-time)) + (vector+! a1-23 a1-23 (-> self control cspace-offset)) + (move-to-point! (-> self control) a1-23) + ) + (set! (-> self control hand-to-edge-dist) 0.0) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (set-time! (-> self control last-successful-compute-edge-time)) + ) + ) + ) + (forward-up-nopitch->quaternion (-> self control dir-targ) gp-2 (-> self control dynam gravity-normal)) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + (none) + ) + +(defbehavior target-compute-edge-rider target () + (let ((gp-0 *edge-grab-info*)) + (cond + ((-> gp-0 pilot-edge-grab?) + (set! (-> self control ground-pat) (new 'static 'pat-surface :material (pat-material metal))) + (cond + ((send-event (handle->process (-> gp-0 pilot-edge-grab handle)) 'pilot-edge-grab gp-0) + (let ((a0-7 (handle->process (-> gp-0 pilot-edge-grab handle)))) + (set! (-> gp-0 center-hold-old quad) (-> gp-0 center-hold quad)) + (let ((s5-0 (new 'stack-no-clear 'bone))) + (let* ((v1-13 (-> s5-0 transform)) + (a3-0 (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) + (a0-12 (-> a3-0 rvec quad)) + (a1-4 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-13 rvec quad) a0-12) + (set! (-> v1-13 uvec quad) a1-4) + (set! (-> v1-13 fvec quad) a2-1) + (set! (-> v1-13 trans quad) a3-1) + ) + (vector-matrix*! (-> s5-0 scale) (the-as vector (-> gp-0 pilot-edge-grab)) (-> s5-0 transform)) + (vector-rotate*! (the-as vector (&+ s5-0 80)) (-> gp-0 pilot-edge-grab local-dir) (-> s5-0 transform)) + (set! (-> gp-0 center-hold quad) (-> s5-0 scale quad)) + (set! (-> self control edge-grab-edge-dir quad) (-> (&+ s5-0 80) transform rvec quad)) + ) + ) + ) + (else + (send-event self 'end-mode 'edge-grab) + ) + ) + ) + (else + (if (not (edge-grab-info-method-9 gp-0)) + (send-event self 'end-mode 'edge-grab) + ) + (if *display-edge-collision-marks* + ((method-of-type edge-grab-info edge-grab-info-method-10)) + ) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (the-as vector (-> gp-0 world-vertex)) + (-> gp-0 world-vertex 1) + ) + 1.0 + ) + ) + ) + (vector-cross! + (-> self control edge-grab-across-edge-dir) + (-> self control edge-grab-edge-dir) + (-> self control dynam gravity-normal) + ) + (let ((a1-15 (vector-! (new-stack-vector0) (-> gp-0 center-hold) (-> gp-0 center-hold-old)))) + (vector-float*! (-> self control rider-last-move) a1-15 (-> self clock frames-per-second)) + (set-time! (-> self control rider-time)) + (move-by-vector! (-> self control) a1-15) + ) + ) + (set! (-> self control hand-to-edge-dist) 0.0) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + (none) + ) + +(defbehavior target-compute-pole target () + (let* ((s2-0 (the-as swingpole (handle->process (-> self control anim-handle)))) + (gp-0 (-> s2-0 dir)) + ) + (set! (-> self control edge-grab-edge-dir quad) (-> gp-0 quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let* ((s1-0 (get-trans s2-0)) + (s4-1 (vector+float*! (new 'stack-no-clear 'vector) s1-0 gp-0 (the-as float (-> s2-0 edge-length)))) + (s3-1 (vector+float*! (new 'stack-no-clear 'vector) s1-0 gp-0 (- (-> s2-0 edge-length)))) + ) + (let ((v1-9 (new 'stack-no-clear 'vector))) + (vector+! v1-9 s4-1 s3-1) + (vector-float*! v1-9 v1-9 0.5) + (+! (-> v1-9 y) -6144.0) + (send-event *camera* 'ease-in 0.5 v1-9) + ) + (vector-segment-distance-point! (-> self control midpoint-of-hands) s4-1 s3-1 s5-0) + (if (not (time-elapsed? (-> self state-time) (seconds 0.05))) + (set! (-> self control hand-to-edge-dist) + (fmax 0.0 (fmin 1.0 (/ (vector-vector-distance s4-1 s5-0) (* 2.0 (-> s2-0 edge-length))))) + ) + (vector-lerp! s5-0 s4-1 s3-1 (-> self control hand-to-edge-dist)) + ) + (when *display-edge-collision-marks* + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + s1-0 + (-> s2-0 dir) + (meters 3) + (the-as rgba (new 'static 'rgba :r #xff :b #xff :a #x80)) + ) + (add-debug-sphere + #t + (bucket-id bucket583) + (-> self control midpoint-of-hands) + (meters 0.2) + (the-as rgba (new 'static 'rgba :r #xff :a #x80)) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + s4-1 + (meters 0.2) + (the-as rgba (new 'static 'rgba :g #xff :a #x80)) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + s3-1 + (meters 0.2) + (the-as rgba (new 'static 'rgba :g #xff :b #x40 :a #x80)) + ) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) s5-0 (meters 0.2) (new 'static 'rgba :b #xff :a #x80)) + ) + ) + (let ((a0-27 (vector-! (new-stack-vector0) s5-0 (-> self control midpoint-of-hands)))) + (cond + ((and (< 2457.6 (vector-length a0-27)) (not (-> self control did-move-to-pole-or-max-jump-height))) + (move-by-vector! (-> self control) (vector-normalize! a0-27 2457.6)) + ) + (else + (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float #t)) + (move-to-point! + (-> self control) + (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self control ctrl-to-hands-offset)) + ) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + ) + ) + ) + ) + (let ((s5-3 (vector-cross! (-> self control edge-grab-across-edge-dir) gp-0 (-> self control dynam gravity-normal))) + ) + (if (>= 0.0 + (vector-dot s5-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control))) + ) + (vector-negate! s5-3 s5-3) + ) + (forward-up-nopitch->quaternion (-> self control dir-targ) s5-3 (-> self control dynam gravity-normal)) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + (update-transforms (-> self control)) + (none) + ) + +(defbehavior target-calc-camera-pos target () + (let ((s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((and (and (-> self next-state) (= (-> self next-state name) 'target-clone-anim)) + (and (not (logtest? (-> self draw status) (draw-control-status no-draw))) + (begin + (vector<-cspace! s5-0 (joint-node jakb-lod0-jg main)) + (+! (-> s5-0 y) -5896.192) + (< (fabs (- (-> s5-0 y) (-> self control trans y))) 8192.0) + ) + ) + ) + (set! (-> self control camera-pos quad) (-> s5-0 quad)) + ) + ((logtest? (target-flags tf26) (-> self target-flags)) + (vector+! (-> self control camera-pos) (-> self control trans) (new 'static 'vector :y -8192.0 :w 1.0)) + ) + ((focus-test? self board pilot mech indax) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + ) + ((or (logtest? (-> self control status) (collide-status on-water)) + (let ((v1-28 (-> self water flags))) + (and (logtest? (water-flag touch-water) v1-28) + (logtest? (water-flag under-water swimming) v1-28) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + ) + ) + (vector<-cspace! s5-0 (the-as cspace (-> self node-list data))) + (if (not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (set! (-> s5-0 y) (- (-> self water surface-height) (-> self water swim-height))) + ) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg chest)) + (cond + ((>= (+ (current-time) (seconds -2)) (-> self control unknown-time-frame26)) + (set! (-> self control camera-pos quad) (-> s5-0 quad)) + ) + ((not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (vector-lerp! + (-> self control camera-pos) + gp-0 + s5-0 + (* 0.0016666667 (the float (- (current-time) (-> self control unknown-time-frame26)))) + ) + ) + (else + (vector-lerp! + (-> self control camera-pos) + s5-0 + gp-0 + (fmax 0.0 (fmin 1.0 (* 0.0011111111 (the float (- (current-time) (-> self control unknown-time-frame27)))))) + ) + ) + ) + (-> self control camera-pos) + ) + ((and (or (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self control status) (collide-status on-water)) + ) + (logtest? (-> self water flags) (water-flag mud)) + ) + (vector<-cspace! (-> self control camera-pos) (the-as cspace (-> self node-list data))) + (set! (-> self control camera-pos y) (-> self water base-height)) + ) + ((focus-test? self tube) + (set! (-> self control camera-pos quad) (-> self control gspot-pos quad)) + ) + ((logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp)) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + ) + (else + (vector<-cspace! (-> self control camera-pos) (the-as cspace (-> self node-list data))) + ) + ) + ) + 0 + (none) + ) + +(defbehavior joint-points target () + (let ((f0-1 (* 0.00078125 (the float (-> self neck look-at-count))))) + (if (!= f0-1 0.0) + (set! f0-1 (+ 0.12 f0-1)) + ) + (cond + ((>= f0-1 (-> self excitement)) + (seek! (-> self excitement) f0-1 (* 6.0 (seconds-per-frame))) + ) + ((focus-test? self dead ignore hit) + ) + (else + (seek! (-> self excitement) f0-1 (* 0.25 (seconds-per-frame))) + ) + ) + ) + (set-setting! 'sound-excitement 'add (-> self excitement) 0) + (let ((v1-17 (-> self neck))) + (set! (-> v1-17 blend) 0.0) + ) + (set! (-> self neck look-at-count) (the-as uint 0)) + (if (and (logtest? (-> self control current-surface flags) (surface-flag duck)) + (< 0.5 (-> self control duck-gun-tube-transision)) + (not (using-gun? self)) + ) + (set! (-> self neck base-nose) (the-as uint 1)) + (set! (-> self neck base-nose) (the-as uint 2)) + ) + (let ((v1-29 (-> self upper-body))) + (set! (-> v1-29 blend) 0.0) + ) + (cond + ((focus-test? self tube pilot indax) + ) + ((logtest? (water-flag wading) (-> self water flags)) + (let ((f30-0 (- (- (-> self control trans y) (- (-> self water height) (-> self water wade-height)))))) + (set! (-> *wade-surface* alignv) + (lerp-scale 1.0 0.5 f30-0 0.0 (- (-> self water swim-height) (-> self water wade-height))) + ) + (set! (-> *wade-surface* align-speed) (-> *wade-surface* alignv)) + (let ((f0-20 (lerp-scale 0.8 0.6 f30-0 0.0 (- (-> self water swim-height) (-> self water wade-height))))) + (set! (-> *wade-surface* target-speed) f0-20) + (set! (-> *wade-surface* transv-max) f0-20) + ) + ) + (set! (-> self control surf) *wade-surface*) + ) + ((logtest? (water-flag swimming) (-> self water flags)) + (set! (-> self control surf) *swim-surface*) + ) + ((and (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self water flags) (water-flag mud)) + ) + (set! (-> self control surf) *quicksand-surface*) + ) + ) + (let ((a2-5 + (matrix<-no-trans-transformq! (-> self control ctrl-orientation) (the-as transformq (-> self control trans))) + ) + ) + (vector-matrix*! (-> self control ctrl-to-head-offset) (-> *TARGET-bank* head-offset) a2-5) + ) + (vector<-cspace! + (the-as vector (&-> (-> self control) sidekick-root bone)) + (-> self control sidekick-root parent) + ) + (let ((gp-0 (new-stack-vector0)) + (s5-0 (new-stack-vector0)) + ) + (vector<-cspace! gp-0 (-> self control lhand-cspace)) + (vector<-cspace! s5-0 (-> self control rhand-cspace)) + (vector-average! (-> self control midpoint-of-hands) gp-0 s5-0) + ) + (vector-! (-> self control ctrl-to-hands-offset) (-> self control midpoint-of-hands) (-> self control trans)) + (-> self control impact-ctrl) + ((method-of-type impact-control impact-control-method-10)) + (cond + ((focus-test? self edge-grab) + (target-compute-edge) + ) + ((focus-test? self pole) + (target-compute-pole) + ) + ) + (target-calc-camera-pos) + (set! (-> self control tongue-counter) 0) + (cond + ((focus-test? self indax) + ) + (else + (target-gun-joint-points) + (target-board-joint-points) + ) + ) + 0 + (none) + ) + +(defbehavior do-target-gspot target () + (cond + ((and (logtest? (-> self control status) (collide-status on-surface)) + (!= (-> self control mod-surface mode) 'swim) + (!= (-> self control mod-surface mode) 'dive) + (not (and (-> self next-state) (= (-> self next-state name) 'target-flop))) + (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds))) + ) + (set! (-> self control gspot-pos quad) (-> self control trans quad)) + (set! (-> self control gspot-normal quad) (-> self control ground-poly-normal quad)) + (set! (-> self control gspot-pat-surfce) (-> self control ground-pat)) + ) + (else + (let* ((gp-0 (new 'stack-no-clear 'collide-query)) + (a0-15 (-> self control)) + (t9-0 (method-of-object a0-15 find-ground)) + (a1-0 gp-0) + (a2-1 (if (focus-test? self pilot) + #x64383f7d + (the-as int (logclear (-> self control root-prim prim-core collide-with) (collide-spec water))) + ) + ) + (a3-0 8192.0) + (t0-0 81920.0) + (t1-0 1024.0) + ) + (cond + ((nonzero? (-> self pilot)) + (handle->process (-> self pilot vehicle)) + ) + (else + ) + ) + (if (t9-0 a0-15 a1-0 (the-as collide-spec a2-1) a3-0 t0-0 t1-0) + (set! (-> self control gspot-pat-surfce) (-> gp-0 best-other-tri pat)) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-real-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (if (< (-> self control force-turn-to-strength) 0.0) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> self control cpad stick0-speed))) + ) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (let ((f28-0 (debounce-speed + (-> self control pad-magnitude) + (-> self control last-pad-magnitude) + (-> self control pad-xz-dir) + (-> self control last-pad-xz-dir) + ) + ) + ) + (when (!= (-> self control force-turn-to-strength) 0.0) + (let ((f0-12 (fmin 1.0 (-> self control force-turn-to-strength)))) + (set! (-> self control force-turn-to-strength) f0-12) + (let ((a1-3 (vector-float*! + (new 'stack-no-clear 'vector) + (if (= f28-0 0.0) + *zero-vector* + s5-0 + ) + f28-0 + ) + ) + (a2-2 (vector-float*! + (new 'stack-no-clear 'vector) + (-> self control force-turn-to-direction) + (-> self control force-turn-to-speed) + ) + ) + ) + (vector-lerp! s5-0 a1-3 a2-2 f0-12) + ) + ) + (set! f28-0 (vector-length s5-0)) + (vector-normalize! s5-0 1.0) + ) + (turn-to-vector s5-0 f28-0) + ) + ) + (add-thrust) + (add-gravity) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (set! (-> self control reaction) target-collision-reaction) + (let ((a2-3 (new 'stack-no-clear 'collide-query))) + (let ((v1-32 (-> self control))) + (set! (-> a2-3 collide-with) (-> v1-32 root-prim prim-core collide-with)) + (set! (-> a2-3 ignore-process0) self) + (set! (-> a2-3 ignore-process1) #f) + (set! (-> a2-3 ignore-pat) (-> v1-32 pat-ignore-mask)) + ) + (set! (-> a2-3 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide (-> self control) (-> self control transv) a2-3 (meters 1)) + ) + (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (>= (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + (-> *TARGET-bank* edge-grab-height-off-ground) + ) + ) + (target-method-28 *target* *collide-cache* *collide-edge-spec*) + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +(defbehavior target-post target () + (target-real-post) + (none) + ) + +(defbehavior target-swim-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (turn-to-vector s5-0 (-> self control pad-magnitude)) + ) + (add-thrust) + (add-gravity) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (let ((a2-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-10 (-> self control))) + (set! (-> a2-0 collide-with) (-> v1-10 root-prim prim-core collide-with)) + (set! (-> a2-0 ignore-process0) self) + (set! (-> a2-0 ignore-process1) #f) + (set! (-> a2-0 ignore-pat) (-> v1-10 pat-ignore-mask)) + ) + (set! (-> a2-0 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide (-> self control) (-> self control transv) a2-0 (meters 1)) + ) + (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (>= (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + (-> *TARGET-bank* edge-grab-height-off-ground) + ) + ) + (target-method-28 *target* *collide-cache* *collide-edge-spec*) + ) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +(defbehavior target-no-stick-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (turn-to-vector s5-0 0.0) + ) + (add-thrust) + (add-gravity) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (let ((a2-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-9 (-> self control))) + (set! (-> a2-0 collide-with) (-> v1-9 root-prim prim-core collide-with)) + (set! (-> a2-0 ignore-process0) self) + (set! (-> a2-0 ignore-process1) #f) + (set! (-> a2-0 ignore-pat) (-> v1-9 pat-ignore-mask)) + ) + (set! (-> a2-0 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide (-> self control) (-> self control transv) a2-0 (meters 1)) + ) + (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (>= (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + (-> *TARGET-bank* edge-grab-height-off-ground) + ) + ) + (target-method-28 *target* *collide-cache* *collide-edge-spec*) + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +(defbehavior target-no-move-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (build-conversions (-> self control transv)) + (do-rotations1) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (vector-! + (-> self control cspace-offset) + (-> self control draw-offset) + (-> self control anim-collide-offset-world) + ) + (let ((a1-3 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-3 options) (overlaps-others-options oo0)) + (set! (-> a1-3 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-3 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-3) + ) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (when *debug-segment* + (let ((gp-2 (-> self control))) + (+! (-> gp-2 history-idx) 1) + (let ((v1-25 (clear-record-tags! *history* (history-channel transv) (-> gp-2 history-idx) (the-as uint 2)))) + (set! (-> v1-25 origin quad) (-> gp-2 trans quad)) + (set! (-> v1-25 vector quad) (-> gp-2 transv quad)) + ) + (set! (-> (clear-record-tags! *history* (history-channel trans) (-> gp-2 history-idx) (the-as uint 2)) vector quad) + (-> gp-2 trans quad) + ) + (let ((v1-31 (clear-record-tags! *history* (history-channel collide-status) (-> gp-2 history-idx) (the-as uint 2))) + ) + (set! (-> v1-31 collide-status) (logior (-> gp-2 status) (collide-status no-touch))) + (set! (-> v1-31 vector z) (the-as float (-> gp-2 reaction-flag))) + ) + ) + ) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +(defbehavior target-no-ja-move-post target () + (vector-! + (-> self control cspace-offset) + (-> self control draw-offset) + (-> self control anim-collide-offset-world) + ) + (let ((a1-2 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-2 options) (overlaps-others-options oo0)) + (set! (-> a1-2 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-2 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-2) + ) + (target-calc-camera-pos) + (do-target-gspot) + (target-powerup-process) + (target-board-joint-points) + (none) + ) + +(defbehavior reset-target-state target ((arg0 symbol)) + (when arg0 + (vector-identity! (-> self control scale)) + (quaternion-identity! (-> self control quat)) + (quaternion-identity! (-> self control quat-for-control)) + (quaternion-identity! (-> self control dir-targ)) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + ) + (target-exit) + (target-timed-invulnerable-off self 0) + (target-timed-invulnerable-off self 2) + (set! (-> self control status) (collide-status)) + (set! (-> self control standard-dynamics) *standard-dynamics*) + (set! (-> self control surf) *standard-ground-surface*) + (set! (-> self control bent-gravity-normal quad) (-> self control standard-dynamics gravity-normal quad)) + (quaternion-identity! (-> self control override-quat)) + (set! (-> self control override-quat-alpha) 0.0) + (set-time! (-> self control last-time-on-surface)) + (set! (-> self control bend-amount) 0.0) + (set! (-> self control bend-speed) 32.0) + (set! (-> self cam-user-mode) 'normal) + (set! (-> self control anim-handle) (the-as handle #f)) + (set! (-> self control actor-contact-handle) (the-as handle #f)) + (set! (-> self control yellow-eco-last-use-time) 0) + (buzz-stop! 0) + self + ) + +(defmethod target-init! ((this target) (arg0 continue-point) (arg1 symbol)) + (local-vars (s1-0 int) (s2-0 int) (s3-0 int) (s4-0 int) (sv-16 collide-shape-prim-group)) + (set! (-> *setting-control* user-default kg-primary-target) (process->handle this)) + (set! (-> *setting-control* user-default ff-primary-target) (process->handle this)) + (set! (-> *setting-control* user-default mh-primary-target) (process->handle this)) + (set! (-> *setting-control* user-default sound-ear) (process->handle this)) + (set! (-> this tobot?) arg1) + (set! (-> this tobot-recorder) #f) + (set! (-> this mode-cache) #f) + (set! (-> this color-effect) #f) + (set! (-> this major-mode-exit-hook) #f) + (set! (-> this major-mode-event-hook) #f) + (set! (-> this sub-mode-exit-hook) #f) + (set! (-> this cloth) #t) + (set! (-> this game) *game-info*) + (set! (-> this ext-geo-control) *target-geo-control*) + (set! (-> this pending-ext-geo) + (if (and (logtest? (game-feature feature56) (-> this game features)) + (not (logtest? (game-secrets commentary) (-> *game-info* secrets))) + ) + (target-geo jakc) + (target-geo jakb) + ) + ) + (set! (-> this ext-geo) (target-geo uninitialized)) + (set! (-> this ext-anim-control) *target-anim-control*) + (set! (-> this pending-ext-anim) (target-anim default)) + (set! (-> this ext-anim) (target-anim uninitialized)) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set! (-> *setting-control* cam-default mode-name) 'cam-string) + (apply-settings *setting-control*) + (if (not arg0) + (set! arg0 (get-current-continue-forced *game-info*)) + ) + (set-continue! *game-info* arg0 #f) + (stack-size-set! (-> this main-thread) 2048) + (logior! (-> this mask) (process-mask target)) + (set! (-> this state-hook) (the-as (function none :behavior target) nothing)) + (set! (-> this scarf-interp-old) -1.0) + (set! (-> this goggles-interp-old) -1.0) + (set! (-> this darkjak-interp-old) -1.0) + (cond + ((= (-> this tobot?) 'tobot) + (set! s4-0 #x80000) + (set! s3-0 #x64303f7f) + (set! s2-0 #x80000) + (set! s1-0 #x6430377e) + ) + (else + (set! s4-0 2) + (set! s3-0 #x64383f7d) + (set! s2-0 2) + (set! s1-0 #x6438377c) + ) + ) + (let ((s0-0 (new 'process 'control-info this (collide-list-enum hit-by-others)))) + (set! (-> s0-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s0-0 reaction) target-collision-reaction) + (set! (-> s0-0 no-reaction) target-collision-no-reaction) + (set! sv-16 (new 'process 'collide-shape-prim-group s0-0 (the-as uint 9) 1)) + (set! (-> s0-0 total-prims) (the-as uint 10)) + (set! (-> sv-16 prim-core action) (collide-action solid can-ride)) + (set-vector! (-> sv-16 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 root-prim) sv-16) + (set! (-> sv-16 prim-core collide-as) (the-as collide-spec s4-0)) + (set! (-> sv-16 prim-core collide-with) (the-as collide-spec s3-0)) + (let ((v0-9 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 6)))) + (set! (-> v0-9 prim-core action) (collide-action solid can-ride)) + (set-vector! (-> v0-9 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 0) v0-9) + (set! (-> v0-9 prim-core collide-as) (the-as collide-spec s4-0)) + (set! (-> v0-9 prim-core collide-with) (the-as collide-spec s3-0)) + ) + (let ((v0-10 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 10)))) + (set! (-> v0-10 prim-core action) (collide-action solid)) + (set-vector! (-> v0-10 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 1) v0-10) + (set! (-> v0-10 prim-core collide-as) (the-as collide-spec s4-0)) + (set! (-> v0-10 prim-core collide-with) (the-as collide-spec s3-0)) + ) + (let ((v0-11 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 18)))) + (set! (-> v0-11 prim-core action) (collide-action solid)) + (set-vector! (-> v0-11 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 2) v0-11) + (set! (-> v0-11 prim-core collide-as) (the-as collide-spec s4-0)) + (set! (-> v0-11 prim-core collide-with) (the-as collide-spec s3-0)) + ) + (let ((v0-12 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 34)))) + (set! (-> v0-12 prim-core action) (collide-action solid)) + (set-vector! (-> v0-12 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 3) v0-12) + (set! (-> v0-12 prim-core collide-as) (collide-spec)) + (set! (-> v0-12 prim-core collide-with) (collide-spec)) + ) + (let ((v0-13 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 0)))) + (set! (-> v0-13 prim-core action) (collide-action semi-solid)) + (set! (-> v0-13 transform-index) 6) + (set-vector! (-> v0-13 local-sphere) 0.0 0.0 0.0 2048.0) + (set! (-> s0-0 collision-spheres 4) v0-13) + (set! (-> v0-13 prim-core collide-as) (the-as collide-spec s4-0)) + (set! (-> v0-13 prim-core collide-with) (the-as collide-spec s3-0)) + ) + (let ((v0-14 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 128)))) + (set! (-> v0-14 prim-core action) (collide-action deadly)) + (set-vector! (-> v0-14 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 6) v0-14) + ) + (let ((v0-15 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 256)))) + (set! (-> v0-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v0-15 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 7) v0-15) + ) + (let ((v0-16 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 512)))) + (set! (-> v0-16 prim-core action) (collide-action deadly)) + (set-vector! (-> v0-16 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 8) v0-16) + ) + (let ((v0-17 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 1024)))) + (set! (-> v0-17 prim-core action) (collide-action deadly)) + (set-vector! (-> v0-17 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 9) v0-17) + ) + (set! (-> s0-0 nav-radius) (* 0.75 (-> s0-0 root-prim local-sphere w))) + (let ((v1-93 (-> s0-0 root-prim))) + (set! (-> s0-0 backup-collide-as) (-> v1-93 prim-core collide-as)) + (set! (-> s0-0 backup-collide-with) (-> v1-93 prim-core collide-with)) + ) + (set! (-> s0-0 event-priority) (the-as uint 9)) + (set! (-> this control) s0-0) + ) + (let ((v1-96 (-> this control))) + (set! (-> v1-96 default-collide-as-all) (the-as collide-spec s4-0)) + (set! (-> v1-96 default-collide-with-all) (the-as collide-spec s3-0)) + (set! (-> v1-96 default-collide-as-fgnd) (the-as collide-spec s2-0)) + (set! (-> v1-96 default-collide-with-fgnd) (the-as collide-spec s1-0)) + (set! (-> v1-96 max-iteration-count) (the-as uint 8)) + (set! (-> v1-96 event-self) 'touched) + ) + (move-to-point! (-> this control) (-> arg0 trans)) + (set! (-> this control camera-pos quad) (-> arg0 trans quad)) + (set! (-> this focus-search) (new 'process 'boxed-array collide-shape 128)) + (set! (-> this focus-search length) 0) + (set! (-> this handle-search) (new 'process 'boxed-array handle 128)) + (set! (-> this handle-search length) 0) + (set! (-> this control cpad) (-> *cpad-list* cpads 0)) + (set! (-> this control current-surface) (new 'process 'surface)) + (set! (-> this control current-surface name) 'current) + (set! (-> this control current-surface active-hook) nothing) + (set! (-> this control current-surface touch-hook) nothing) + (set! (-> this control send-attack-dest) (the-as handle #f)) + (dotimes (v1-112 8) + (set! (-> this attack-info-old v1-112 attacker) (the-as handle #f)) + ) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this mirror) (the-as (pointer process-drawable) #f)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this skel effect flags) (effect-control-flag ecf0 ecf1)) + (let ((v1-122 (-> this node-list data))) + (set! (-> v1-122 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-122 0 param1) (the-as basic (-> this control trans))) + (set! (-> v1-122 0 param2) (the-as basic (-> this control cspace-offset))) + ) + (set! (-> this skel override) (new 'process 'boxed-array float 54)) + (set! (-> this draw light-index) (the-as uint 30)) + (set! (-> this beard?) #t) + (set! (-> this draw lod-set max-lod) 0) + (logior! (-> this skel status) (joint-control-status sync-math blend-shape eye-anim)) + (set! (-> this draw shadow-ctrl) *target-shadow-control*) + (set! (-> this shadow-backup) (-> this draw shadow)) + (set! (-> this carry) + (new 'process 'carry-info this 52 (new 'static 'vector :w 1.0) (new 'static 'vector :z 1.0 :w 1.0) 12743.111) + ) + (set! (-> this control lhand-cspace) (-> this node-list data 21)) + (set! (-> this control rhand-cspace) (-> this node-list data 30)) + (set! (-> this control rhand-cspace) (-> this node-list data 30)) + (set! (-> this control sidekick-root parent) (-> this node-list data 34)) + (set! (-> this neck) (new 'process 'joint-mod (joint-mod-mode look-at) this 8)) + (set! (-> this neck parented-scale?) #t) + (set! (-> this neck base-joint) (the-as uint 6)) + (set! (-> this neck ignore-angle) 16384.0) + (set! (-> this head) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 7)) + (set! (-> this head parented-scale?) #t) + (set! (-> this upper-body) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 4)) + (set! (-> this upper-body parented-scale?) #t) + (set! (-> this horns) (new 'process 'joint-mod (joint-mod-mode joint-set) this 15)) + (set! (-> this horns parented-scale?) #t) + (set! (-> this horns track-mode) (track-mode no-trans no-rotate)) + (set! (-> this hair 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 9)) + (set! (-> this hair 0 parented-scale?) #t) + (set! (-> this hair 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 10)) + (set! (-> this hair 1 parented-scale?) #t) + (set! (-> this arm-ik 0) (new 'process 'joint-mod-ik this 18 1228.8)) + (set! (-> this arm-ik 1) (new 'process 'joint-mod-ik this 27 -1228.8)) + (set! (-> this arm-ik 1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this arm-ik 1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this leg-ik 0) (new 'process 'joint-mod-ik this 40 1687.552)) + (set! (-> this leg-ik 0 callback) + (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback) + ) + (set! (-> this leg-ik 0 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this leg-ik 0 elbow-rotation-axis) (the-as uint 0)) + (logior! (-> this leg-ik 0 flags) (joint-mod-ik-flags elbow-trans-neg)) + (set! (-> this leg-ik 1) (new 'process 'joint-mod-ik this 46 -1687.552)) + (set! (-> this leg-ik 1 callback) + (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback) + ) + (set! (-> this leg-ik 1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this leg-ik 1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this foot 0) (new 'process 'joint-mod (joint-mod-mode gun-look-at) this 41)) + (set! (-> this foot 1) (new 'process 'joint-mod (joint-mod-mode gun-look-at) this 47)) + (set! (-> this fact) (new + 'process + 'fact-info-target + this + (pickup-type eco-pill-random) + (-> *FACT-bank* default-eco-pill-green-inc) + ) + ) + (target-gun-setup (logtest? (-> this game features) (game-feature gun))) + (target-board-setup (logtest? (game-feature board) (-> this game features))) + (target-sidekick-setup (logtest? (game-feature sidekick) (-> this game features))) + (target-darkjak-setup (logtest? (game-feature darkjak) (-> this game features))) + (target-lightjak-setup (logtest? (game-feature lightjak) (-> this game features))) + (target-collide-set! 'normal 0.0) + (let ((v1-192 (-> this control root-prim))) + (set! (-> this control backup-collide-as) (-> v1-192 prim-core collide-as)) + (set! (-> this control backup-collide-with) (-> v1-192 prim-core collide-with)) + ) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this control trans) 0.0)) + (set! (-> this control unknown-sound-id04) (new-sound-id)) + (set! (-> this control bubbles-sound) (new-sound-id)) + (set! (-> this control board-jump-and-swim-sound) (new-sound-id)) + (if (and *debug-segment* (!= (-> this tobot?) 'tobot)) + (add-connection *debug-engine* this target-print-stats this *stdcon0* #f) + ) + (activate-hud this) + (set! (-> this fp-hud) (the-as handle #f)) + (set! (-> this burn-proc) (the-as handle #f)) + (set! (-> this water) (new 'process 'water-control this 10 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flag swim-ground part-splash part-drip part-rings part-water find-water)) + (reset-target-state #t) + (set! (-> this control last-trans-any-surf quad) (-> this control trans quad)) + (+! (-> this control last-trans-any-surf y) -819200.0) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this manipy) (the-as (pointer manipy) #f)) + (set! (-> this event-hook) target-generic-event-handler) + (set! (-> this current-level) #f) + (level-setup) + (set! (-> this pre-joint-hook) (the-as (function none :behavior target) nothing)) + (set-time! (-> this init-time)) + (set! (-> this spool-anim) (the-as spool-anim #t)) + (set-time! (-> this ambient-time)) + (let ((v1-220 *edge-grab-info*)) + (set! (-> v1-220 pilot-edge-grab?) #f) + (set! (-> v1-220 pilot-edge-grab handle) (the-as handle #f)) + (set! (-> v1-220 actor-handle) (the-as handle #f)) + ) + (set! (-> this control unknown-handle000) (the-as handle #f)) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior target-init target ((arg0 continue-point)) + (target-init! self arg0 #f) + (set! (-> self event-hook) (-> target-continue event)) + (logior! (-> self focus-status) (focus-status teleporting)) + (go target-continue arg0) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior tobot-init target ((arg0 symbol)) + (target-init! self (the-as continue-point #f) 'tobot) + (set! (-> self name) "tobot") + (set! (-> self tobot-recorder) (the-as basic arg0)) + (send-event *target* 'tobot 'tobot) + (go tobot-stance) + (none) + ) + +(defmethod deactivate ((this target)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) + (if (nonzero? (-> this darkjak)) + (sound-stop (-> this darkjak tone)) + ) + (if (nonzero? (-> this lightjak)) + (sound-stop (the-as sound-id (-> this lightjak tone))) + ) + (if (nonzero? (-> this gun)) + (sound-stop (-> this gun blue-whine-sound-id)) + ) + (when (nonzero? (-> this board)) + (sound-stop (-> this board wind-sound-id)) + (sound-stop (-> this board engine-sound-id)) + (sound-stop (-> this board bank-sound-id)) + (sound-stop (-> this board ride-sound-id)) + (sound-stop (-> this board spin-sound-id)) + ) + (set! (-> *setting-control* cam-default mode-name) #f) + (set-zero! *camera-smush-control*) + (set! (-> *setting-control* user-default kg-primary-target) (the-as handle #f)) + (set! (-> *setting-control* user-default ff-primary-target) (the-as handle #f)) + (set! (-> *setting-control* user-default mh-primary-target) (the-as handle #f)) + (set! (-> *setting-control* user-default sound-ear) (the-as handle #f)) + (call-parent-method this) + (none) + ) + +(defun stop ((arg0 symbol)) + (when *target* + (kill-by-name "target" *active-pool*) + (set! *target* #f) + ) + (set! (-> *game-info* mode) arg0) + 0 + ) + +(defun start ((arg0 symbol) (arg1 continue-point)) + (let ((v1-0 arg0)) + (set! (-> *level* play?) (if (= v1-0 'play) + #t + (-> *setting-control* user-default border-mode) + ) + ) + ) + (set! (-> *setting-control* user-default border-mode) #f) + (set! (-> *setting-control* user-default region-mode) #f) + (apply-settings *setting-control*) + (stop arg0) + (let ((v1-8 (process-spawn + target + :init target-init + arg1 + :name "target" + :from *target-dead-pool* + :to *target-pool* + :stack *kernel-dram-stack* + ) + ) + ) + (if v1-8 + (set! *target* (the-as target (-> v1-8 0 self))) + (set! *target* #f) + ) + ) + *target* + ) + +;; WARN: Return type mismatch (pointer process) vs target. +(defun tobot-start ((arg0 symbol)) + (the-as target (process-spawn + target + :init tobot-init + arg0 + :name "target" + :from *target-dead-pool* + :to *target-pool* + :stack *kernel-dram-stack* + ) + ) + ) + +(defun tobot-stop () + (kill-by-name "tobot" *active-pool*) + 0 + ) + +(kmemopen global "target-geo") + +(define *target-geo-control* (new + 'global + 'external-art-buffer + 0 + (lambda ((arg0 external-art-buffer)) + (let ((gp-0 (-> arg0 heap))) + (set! (-> gp-0 base) (kmalloc global #x26000 (kmalloc-flags) "heap")) + (set! (-> gp-0 current) (-> gp-0 base)) + (set! (-> gp-0 top-base) (&+ (-> gp-0 base) #x26000)) + (set! (-> gp-0 top) (-> gp-0 top-base)) + ) + 0 + (none) + ) + #t + ) + ) + +(let ((gp-0 *target-geo-control*)) + ((-> gp-0 init-heap) gp-0) + (set! (-> gp-0 status) 'inactive) + ) + +(kmemclose) + +(kmemopen global "target-anim") + +(define *target-anim-control* (new + 'global + 'external-art-buffer + 0 + (lambda ((arg0 external-art-buffer)) + (let ((gp-0 (-> arg0 heap))) + (set! (-> gp-0 base) (kmalloc global #x4d000 (kmalloc-flags) "heap")) + (set! (-> gp-0 current) (-> gp-0 base)) + (set! (-> gp-0 top-base) (&+ (-> gp-0 base) #x4d000)) + (set! (-> gp-0 top) (-> gp-0 top-base)) + ) + 0 + (none) + ) + #t + ) + ) + +(let ((gp-1 *target-anim-control*)) + ((-> gp-1 init-heap) gp-1) + (set! (-> gp-1 status) 'inactive) + ) + +(kmemclose) diff --git a/goal_src/jak3/engine/target/mech/carry-h.gc b/goal_src/jak3/engine/target/mech/carry-h.gc index adbb2101395..cc50642c17c 100644 --- a/goal_src/jak3/engine/target/mech/carry-h.gc +++ b/goal_src/jak3/engine/target/mech/carry-h.gc @@ -5,5 +5,537 @@ ;; name in dgo: carry-h ;; dgos: GAME +;; +++carry-mode +(defenum carry-mode + :type uint8 + :bitfield #t + (carry 0) + (mech-carry 1) + (mech-drag 2) + (cm3) + (cm4) + (cm5) + (cm6) + (cm7) + ) +;; ---carry-mode + + ;; DECOMP BEGINS +(deftype carry-info (basic) + ((process (pointer target)) + (pickup-time time-frame) + (other-value float) + (other handle) + (point vector :inline) + (normal vector :inline) + (max-angle degrees) + (max-distance meters) + (max-pull meters) + (min-pull meters) + (grab-trans-blend float) + (carry-radius meters) + (backup-radius meters) + (joint int8) + (mode carry-mode) + (face-dir int8) + (local-point vector :inline) + (local-normal vector :inline) + (grab-quat quaternion :inline) + (grab-trans vector :inline) + (hold-trans vector :inline) + ) + (:methods + (new (symbol type process-drawable int vector vector float) _type_) + (carry-info-method-9 (_type_) none) + (distance-from-destination (_type_ carry-info) float) + (drag! (_type_ carry-info) none) + (drop-impl! (_type_ carry-info) none) + (carry-info-method-13 (_type_) symbol) + (carry! (_type_ carry-info vector vector) none) + (drop! (_type_ carry-info) none) + (translate! (_type_) symbol) + ) + ) + + +(defmethod new carry-info ((allocation symbol) + (type-to-make type) + (arg0 process-drawable) + (arg1 int) + (arg2 vector) + (arg3 vector) + (arg4 float) + ) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 mode) (carry-mode carry)) + (set! (-> gp-0 process) (the-as (pointer target) (process->ppointer arg0))) + (set! (-> gp-0 other) (the-as handle #f)) + (set! (-> gp-0 joint) arg1) + (set! arg4 (cond + ((= arg4 0.0) + 131072.0 + ) + (else + (empty) + arg4 + ) + ) + ) + (set! (-> gp-0 max-angle) arg4) + (set! (-> gp-0 max-distance) 8192.0) + (set! (-> gp-0 local-point quad) (-> arg2 quad)) + (set! (-> gp-0 local-normal quad) (-> arg3 quad)) + (let* ((s5-1 (-> arg0 root)) + (v1-7 (if (type? s5-1 collide-shape) + (the-as collide-shape s5-1) + ) + ) + ) + (when v1-7 + (set! (-> gp-0 backup-radius) (-> v1-7 root-prim local-sphere w)) + (set! (-> gp-0 carry-radius) (-> v1-7 root-prim local-sphere w)) + ) + ) + gp-0 + ) + ) + +(defmethod carry-info-method-9 ((this carry-info)) + (let ((s5-0 (-> this process 0 node-list data (-> this joint) bone transform))) + (vector-rotate*! (-> this normal) (-> this local-normal) s5-0) + (vector-matrix*! (-> this point) (-> this local-point) s5-0) + ) + 0 + (none) + ) + +(defmethod distance-from-destination ((this carry-info) (arg0 carry-info)) + (let* ((f28-0 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> arg0 point) (-> this point)))) + (f30-0 (fabs (deg-diff f28-0 (vector-y-angle (-> this normal))))) + (f28-1 (fabs (deg-diff (+ 32768.0 f28-0) (vector-y-angle (-> arg0 normal))))) + (f26-0 (vector-vector-distance (-> this point) (-> arg0 point))) + ) + (cond + ((or (< (-> this max-distance) f26-0) + (< (-> arg0 max-distance) f26-0) + (< (-> this max-angle) f30-0) + (or (< (-> arg0 max-angle) f28-1) (not (logtest? (-> this mode) (-> arg0 mode)))) + ) + (if (< (-> this max-distance) f26-0) + (format + #t + " ~A ~A failed for this distance ~M ~M~%" + (-> this process 0 name) + (-> arg0 process 0 name) + f26-0 + (-> this max-distance) + ) + ) + (if (< (-> arg0 max-distance) f26-0) + (format + #t + " ~A ~A failed for other distance ~M ~M~%" + (-> this process 0 name) + (-> arg0 process 0 name) + f26-0 + (-> arg0 max-distance) + ) + ) + (if (< (-> this max-angle) f30-0) + (format + #t + " ~A ~A failed for this angle ~R ~R~%" + (-> this process 0 name) + (-> arg0 process 0 name) + f30-0 + (-> this max-angle) + ) + ) + (if (< (-> arg0 max-angle) f28-1) + (format + #t + " ~A ~A failed for other angle ~R ~R~%" + (-> this process 0 name) + (-> arg0 process 0 name) + f28-1 + (-> arg0 max-angle) + ) + ) + (if (not (logtest? (-> this mode) (-> arg0 mode))) + (format + #t + " ~A ~A failed for mode ~X ~X~%" + (-> this process 0 name) + (-> arg0 process 0 name) + (-> this mode) + (-> arg0 mode) + ) + ) + -1.0 + ) + (else + (+ f26-0 (* 409.6 (- 32768.0 f30-0))) + ) + ) + ) + ) + +(defmethod drag! ((this carry-info) (arg0 carry-info)) + (set! (-> this other) (ppointer->handle (-> arg0 process))) + (set! (-> arg0 other) (ppointer->handle (-> this process))) + (set! (-> this pickup-time) (-> this process 0 clock frame-counter)) + (set! (-> arg0 pickup-time) (-> arg0 process 0 clock frame-counter)) + (set! (-> arg0 grab-trans-blend) 1.0) + (let* ((s4-0 (-> arg0 process 0 control)) + (v1-17 (if (type? s4-0 collide-shape) + s4-0 + ) + ) + ) + (if v1-17 + (set! (-> v1-17 root-prim local-sphere w) (-> arg0 carry-radius)) + ) + ) + (quaternion-copy! (-> arg0 grab-quat) (-> arg0 process 0 control quat)) + (quaternion-rotate-y! (-> arg0 grab-quat) (-> arg0 grab-quat) (- (vector-y-angle (-> this normal)))) + (let* ((f30-0 (quaternion-y-angle (-> arg0 grab-quat))) + (f0-8 (the float (the int (* 0.000061035156 (+ 73728.0 (the float (sar (shl (the int f30-0) 48) 48))))))) + (f28-0 (the float (sar (shl (the int (* 16384.0 f0-8)) 48) 48))) + ) + (quaternion-rotate-y! (-> arg0 grab-quat) (-> arg0 grab-quat) (deg-diff f30-0 f28-0)) + (let ((s3-2 + (matrix-4x4-inverse! + (new 'stack-no-clear 'matrix) + (-> arg0 process 0 node-list data (-> arg0 joint) bone transform) + ) + ) + (s4-3 (vector-negate! (new 'stack-no-clear 'vector) (-> this normal))) + ) + (set! (-> s4-3 y) 0.0) + (vector-xz-normalize! s4-3 (-> arg0 max-pull)) + (vector+! s4-3 s4-3 (-> arg0 point)) + (vector-! s4-3 s4-3 (-> arg0 process 0 control trans)) + (vector-rotate-y! s4-3 s4-3 (- (deg-diff f30-0 f28-0))) + (vector+! s4-3 s4-3 (-> arg0 process 0 control trans)) + (vector-matrix*! s4-3 s4-3 s3-2) + (set! (-> arg0 grab-trans quad) (-> s4-3 quad)) + ) + ) + (set! (-> arg0 hold-trans x) + (+ (fmax (fmin (- (-> arg0 grab-trans x) (-> arg0 local-point x)) (-> arg0 min-pull)) (- (-> arg0 min-pull))) + (-> arg0 local-point x) + ) + ) + (set! (-> arg0 hold-trans z) + (+ (fmax (fmin (- (-> arg0 grab-trans z) (-> arg0 local-point z)) (-> arg0 min-pull)) (- (-> arg0 min-pull))) + (-> arg0 local-point z) + ) + ) + (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> this process))) + (let* ((v1-46 (-> arg0 process)) + (v1-49 + (-> (the-as collide-shape (-> (the-as process-drawable (if v1-46 + (the-as process-drawable (-> v1-46 0 self)) + ) + ) + root + ) + ) + root-prim + ) + ) + ) + (let ((a0-30 (-> v1-49 prim-core collide-as)) + (a1-25 (-> arg0 process)) + ) + (set! (-> (the-as collide-shape (-> (the-as process-drawable (if a1-25 + (the-as process-drawable (-> a1-25 0 self)) + ) + ) + root + ) + ) + backup-collide-as + ) + a0-30 + ) + ) + (let ((v1-50 (-> v1-49 prim-core collide-with)) + (a0-31 (-> arg0 process)) + ) + (set! (-> (the-as collide-shape (-> (the-as process-drawable (if a0-31 + (the-as process-drawable (-> a0-31 0 self)) + ) + ) + root + ) + ) + backup-collide-with + ) + v1-50 + ) + ) + ) + (let* ((v1-51 (-> arg0 process)) + (v1-54 + (-> (the-as collide-shape (-> (the-as process-drawable (if v1-51 + (the-as process-drawable (-> v1-51 0 self)) + ) + ) + root + ) + ) + root-prim + ) + ) + ) + (set! (-> v1-54 prim-core collide-as) (collide-spec)) + (set! (-> v1-54 prim-core collide-with) (collide-spec)) + ) + 0 + 0 + (none) + ) + +(defmethod drop-impl! ((this carry-info) (arg0 carry-info)) + (let ((a1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 process 0 control quat)))) + (set! (-> a1-2 y) 0.0) + (set-heading-vec-clear-roll-pitch! (-> arg0 process 0 control) a1-2) + ) + (let* ((s4-0 (-> arg0 process 0 control)) + (v1-9 (if (type? s4-0 collide-shape) + s4-0 + ) + ) + ) + (if v1-9 + (set! (-> v1-9 root-prim local-sphere w) (-> arg0 backup-radius)) + ) + ) + (set! (-> this other) (the-as handle #f)) + (set! (-> arg0 other) (the-as handle #f)) + (change-parent (ppointer->process (-> arg0 process)) *entity-pool*) + (let* ((v1-13 (-> arg0 process)) + (v1-16 + (-> (the-as collide-shape (-> (the-as process-drawable (if v1-13 + (the-as process-drawable (-> v1-13 0 self)) + ) + ) + root + ) + ) + root-prim + ) + ) + ) + (let ((a0-8 (-> arg0 process))) + (set! (-> v1-16 prim-core collide-as) + (-> (the-as process-focusable (if a0-8 + (the-as process-focusable (-> a0-8 0 self)) + ) + ) + root + backup-collide-as + ) + ) + ) + (let ((a0-12 (-> arg0 process))) + (set! (-> v1-16 prim-core collide-with) + (-> (the-as process-focusable (if a0-12 + (the-as process-focusable (-> a0-12 0 self)) + ) + ) + root + backup-collide-with + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod carry-info-method-13 ((this carry-info)) + (with-pp + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'carry-info) + (let* ((s4-0 (the-as carry-info (send-event-function (handle->process (-> this other)) a1-0))) + (s2-0 (-> this process 0 node-list data (-> this joint) bone transform)) + (v1-10 (vector-matrix*! + (new 'stack-no-clear 'vector) + (vector-lerp! + (new 'stack-no-clear 'vector) + (-> this hold-trans) + (-> this grab-trans) + (-> this grab-trans-blend) + ) + s2-0 + ) + ) + (s3-2 (vector-! (new 'stack-no-clear 'vector) v1-10 (-> this process 0 control trans))) + ) + (when s4-0 + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (let* ((a2-3 (-> s4-0 process 0 node-list data (-> s4-0 joint) bone transform)) + (v1-16 (-> a2-3 rvec quad)) + (a0-16 (-> a2-3 uvec quad)) + (a1-3 (-> a2-3 fvec quad)) + (a2-4 (-> a2-3 trans quad)) + ) + (set! (-> s5-1 rvec quad) v1-16) + (set! (-> s5-1 uvec quad) a0-16) + (set! (-> s5-1 fvec quad) a1-3) + (set! (-> s5-1 trans quad) a2-4) + ) + (vector-normalize! (-> s5-1 rvec) 1.0) + (vector-normalize! (-> s5-1 uvec) 1.0) + (vector-normalize! (-> s5-1 fvec) 1.0) + (vector-reset! (-> s5-1 trans)) + (let* ((a1-8 (quaternion-normalize! (matrix->quaternion (new 'stack-no-clear 'quaternion) s5-1))) + (s5-3 (quaternion-normalize! (quaternion*! a1-8 a1-8 (-> this grab-quat)))) + (v1-19 (vector-! (new 'stack-no-clear 'vector) (-> s4-0 point) s3-2)) + (f30-0 (* 0.033333335 (the float (- (current-time) (-> this pickup-time))))) + ) + (cond + ((time-elapsed? (-> this pickup-time) (seconds 1)) + (set! (-> this process 0 control trans quad) (-> v1-19 quad)) + (quaternion-copy! (-> this process 0 control quat) s5-3) + ) + (else + (vector-lerp! + (-> this process 0 control trans) + (-> this process 0 control trans) + v1-19 + (fmin 1.0 (* f30-0 (-> pp clock time-adjust-ratio))) + ) + (quaternion-slerp! + (-> this process 0 control quat) + (-> this process 0 control quat) + s5-3 + (fmin 1.0 (* f30-0 (-> pp clock time-adjust-ratio))) + ) + ) + ) + ) + ) + #t + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod carry! ((this carry-info) (arg0 carry-info) (arg1 vector) (arg2 vector)) + (set! (-> this other) (ppointer->handle (-> arg0 process))) + (set! (-> arg0 other) (ppointer->handle (-> this process))) + (set! (-> this pickup-time) (-> this process 0 clock frame-counter)) + (set! (-> arg0 pickup-time) (-> arg0 process 0 clock frame-counter)) + (set! (-> arg0 grab-trans-blend) 1.0) + (let* ((s2-0 (-> arg0 process 0 control)) + (v1-17 (if (type? s2-0 collide-shape) + s2-0 + ) + ) + ) + (if v1-17 + (set! (-> v1-17 root-prim local-sphere w) (-> arg0 carry-radius)) + ) + ) + (quaternion-copy! (-> arg0 grab-quat) (-> arg0 process 0 control quat)) + (set! (-> arg0 grab-trans quad) (-> arg0 process 0 control trans quad)) + (set! (-> arg0 hold-trans quad) (-> this process 0 control trans quad)) + (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (-> this point) (-> arg0 point)))) + (vector-xz-normalize! s2-2 (-> arg0 max-pull)) + (vector+! s2-2 s2-2 (-> arg0 point)) + (let ((f30-0 (y-angle (-> arg0 process 0 control)))) + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-2 (-> this process 0 control trans))) + (let* ((f0-5 (the float (-> this face-dir))) + (f28-0 (the float (sar (shl (the int (* 16384.0 f0-5)) 48) 48))) + ) + (set-vector! arg2 (sin (+ f30-0 f28-0)) 0.0 (cos (+ f30-0 f28-0)) 1.0) + ) + ) + ) + (vector+float*! arg1 (-> arg0 point) arg2 (- (-> arg0 carry-radius))) + (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> this process))) + (let* ((v1-46 (-> arg0 process)) + (v1-49 (-> (the-as process-focusable (if v1-46 + (the-as process-focusable (-> v1-46 0 self)) + ) + ) + root + root-prim + ) + ) + ) + (let ((a0-32 (-> v1-49 prim-core collide-as)) + (a1-7 (-> arg0 process)) + ) + (set! (-> (the-as process-focusable (if a1-7 + (the-as process-focusable (-> a1-7 0 self)) + ) + ) + root + backup-collide-as + ) + a0-32 + ) + ) + (let ((v1-50 (-> v1-49 prim-core collide-with)) + (a0-33 (-> arg0 process)) + ) + (set! (-> (the-as process-focusable (if a0-33 + (the-as process-focusable (-> a0-33 0 self)) + ) + ) + root + backup-collide-with + ) + v1-50 + ) + ) + ) + (let* ((v1-51 (-> arg0 process)) + (v1-54 (-> (the-as process-focusable (if v1-51 + (the-as process-focusable (-> v1-51 0 self)) + ) + ) + root + root-prim + ) + ) + ) + (set! (-> v1-54 prim-core collide-as) (collide-spec)) + (set! (-> v1-54 prim-core collide-with) (collide-spec)) + ) + 0 + (none) + ) + +(defmethod translate! ((this carry-info)) + (with-pp + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'carry-info) + (let ((a0-6 (the-as carry-info (send-event-function (handle->process (-> this other)) a1-0)))) + (when a0-6 + (let ((v1-6 (vector-! (new 'stack-no-clear 'vector) (-> this grab-trans) (-> this hold-trans)))) + (vector+! (-> this process 0 control trans) (-> a0-6 process 0 control trans) v1-6) + ) + #t + ) + ) + ) + ) + ) + +(defmethod drop! ((this carry-info) (arg0 carry-info)) + (drop-impl! this arg0) + (none) + ) diff --git a/goal_src/jak3/engine/target/mech/mech-h.gc b/goal_src/jak3/engine/target/mech/mech-h.gc index 70148110200..56b4769c2a0 100644 --- a/goal_src/jak3/engine/target/mech/mech-h.gc +++ b/goal_src/jak3/engine/target/mech/mech-h.gc @@ -7,3 +7,78 @@ ;; DECOMP BEGINS +(deftype mech-info (basic) + ((entity entity-actor) + (hud handle 1) + (mech-trans vector :inline) + (mech-quat vector :inline) + (mech-scale vector :inline) + (engine-sound-id sound-id) + (engine-sound-volume float) + (engine-sound-pitch float) + (thrust-sound-id sound-id) + (drag-sound-id sound-id) + (whine-sound-id sound-id) + (shield-sound-id sound-id) + (mech-start-time time-frame) + (mech-time time-frame) + (no-get-off-time time-frame) + (stick-lock basic) + (stick-off basic) + (forward-vel meters) + (jump-thrust meters) + (jump-thrust-fuel float) + (unstuck-time time-frame) + (stuck-count int32) + (back-touch-point vector :inline) + (back-touch-trans vector :inline) + (back-touch-time time-frame) + (attack-id uint32) + (shield-value float) + (shield-max float) + (shield-handle handle) + (walk-anim-leg int32) + (state-impact? symbol 1) + (state-impact impact-control 1 :inline) + (thruster-flame-width meters) + (thruster-flame-length meters) + (thruster-local-pos vector 2 :inline) + (exhaust-local-pos vector 2 :inline) + (exhaust-local-dir vector 2 :inline) + (smoke-local-pos vector 2 :inline) + (smoke-local-vel vector 2 :inline) + (particle-system-2d basic) + (particle-system-3d basic) + (part-thruster sparticle-launch-control) + (part-thruster-scale-x sp-field-init-spec) + (part-thruster-scale-y sp-field-init-spec) + (part-quat quaternion) + (part-vel vector) + ) + ) + + +(defskelgroup skel-mech mech mech-lod0-jg mech-mech-idle-ja + ((mech-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.5) + :shadow mech-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + :global-effects 32 + ) + +(define *mech-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #xa)) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w 81920.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +(defskelgroup skel-mech-explode mech mech-explode-lod0-jg mech-explode-idle-ja + ((mech-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.5) + :shadow-joint-index 3 + ) diff --git a/goal_src/jak3/engine/target/sidekick.gc b/goal_src/jak3/engine/target/sidekick.gc index 9ee3800b98f..c0a5505c420 100644 --- a/goal_src/jak3/engine/target/sidekick.gc +++ b/goal_src/jak3/engine/target/sidekick.gc @@ -5,5 +5,630 @@ ;; name in dgo: sidekick ;; dgos: GAME +(declare-type sidekick process-drawable) +(define-extern init-sidekick (function object :behavior sidekick)) + ;; DECOMP BEGINS +(defskelgroup skel-sidekick daxter daxter-lod0-jg -1 + ((daxter-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :longest-edge (meters 1) + :shadow daxter-shadow-mg + :texture-level 10 + :origin-joint-index 6 + :shadow-joint-index 6 + :light-index 1 + ) + +(defskelgroup skel-sidekick-highres daxter-highres daxter-highres-lod0-jg -1 + ((daxter-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :longest-edge (meters 1) + :shadow daxter-highres-shadow-mg + :origin-joint-index 6 + :shadow-joint-index 6 + :light-index 1 + ) + +(define *sidekick-remap* + '(("run-to-stance-left" "run-to-stance") + ("run-to-stance-loop-left" "run-to-stance-loop") + ("stance-loop-left" "stance-loop") + ("run-to-stance-right" "run-to-stance") + ("run-to-stance-loop-right" "run-to-stance-loop") + ("stance-loop-right" "stance-loop") + ("run-to-stance-up" "run-to-stance") + ("run-to-stance-loop-up" "run-to-stance-loop") + ("stance-loop-up" "stance-loop") + ("run-to-stance-down" "run-to-stance") + ("run-to-stance-loop-down" "run-to-stance-loop") + ("stance-loop-down" "stance-loop") + ("run-right" "run") + ("run-left" "run") + ("walk-right" "walk") + ("walk-left" "walk") + ("gun-hit-elec" "hit-elec") + ("gun-attack-from-stance-end" + "gun-attack-from-stance-end" + "gun-attack-from-stance-end" + "gun-attack-from-stance-end" + "gun-attack-from-stance-end-alt1" + ) + ("gun-attack-butt-end" + "gun-attack-butt-end" + "gun-attack-butt-end" + "gun-attack-butt-end" + "gun-attack-butt-end" + "gun-attack-butt-end-alt1" + ) + ("pole-cycle" "pole-cycle" "pole-cycle2") + ("hit-from-front-alt1" "hit-from-front") + ("board-jump" + ,(lambda :behavior sidekick + ((arg0 object) (arg1 vector) (arg2 int)) + (let ((gp-0 (ppointer->process (-> self parent)))) + (when (time-elapsed? (-> self special-anim-time) (seconds 1)) + (set! (-> self special-anim-interp) 0.0) + (set! (-> self special-anim-frame) 0.0) + ) + (cond + ((or (and (= (-> (the-as target gp-0) control mod-surface name) 'spin) + (!= (-> (the-as target gp-0) board rotyv) 0.0) + ) + (!= (-> self special-anim-interp) 0.0) + ) + (case arg2 + ((1) + (set-time! (-> self special-anim-time)) + (cond + ((= (-> (the-as target gp-0) control mod-surface name) 'spin) + (set! (-> arg1 z) (* (lerp-scale 0.0 5.0 (fabs (-> (the-as target gp-0) board rotyv)) 0.0 182044.44) + (-> self special-anim-interp) + ) + ) + (set! (-> self special-anim-frame) (-> arg1 z)) + (seek! (-> self special-anim-interp) 1.0 (* 8.0 (seconds-per-frame))) + ) + (else + (seek! (-> self special-anim-interp) 0.0 (* 4.0 (seconds-per-frame))) + (set! (-> arg1 z) (* (-> self special-anim-frame) (-> self special-anim-interp))) + ) + ) + ) + ) + (if (>= (-> (the-as target gp-0) board rotyv) 0.0) + "board-spin-ccw" + "board-spin-cw" + ) + ) + (else + "board-jump" + ) + ) + ) + ) + ) + ) + ) + +(defun cspace<-cspace+transformq! ((arg0 cspace) (arg1 cspace) (arg2 transformq)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (-> arg0 bone transform))) + (quaternion->matrix s4-0 (-> arg2 quat)) + (.lvf vf1 (&-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad)) + (.lvf vf2 (&-> (-> arg1 bone) transform trans quad)) + (.lvf vf6 (&-> arg2 trans quad)) + (.lvf vf3 (&-> s4-0 rvec quad)) + (.lvf vf4 (&-> s4-0 uvec quad)) + (.lvf vf5 (&-> s4-0 fvec quad)) + (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + (.wait.vf) + (.mul.vf vf2 vf2 Q :mask #b111) + (.mov.vf vf2 vf0 :mask #b1000) + (.mul.x.vf vf3 vf3 vf1) + (.mul.y.vf vf4 vf4 vf1) + (.mul.z.vf vf5 vf5 vf1) + (.mul.x.vf acc vf3 vf6) + (.add.mul.y.vf acc vf4 vf6 acc) + (.add.mul.z.vf acc vf5 vf6 acc) + (.add.mul.w.vf vf2 vf2 vf0 acc :mask #b111) + (.svf (&-> s4-0 trans quad) vf2) + (.svf (&-> s4-0 rvec quad) vf3) + (.svf (&-> s4-0 uvec quad) vf4) + (.svf (&-> s4-0 fvec quad) vf5) + s4-0 + ) + ) + ) + +(defbehavior target-sidekick-setup target ((arg0 symbol)) + (if (zero? (-> self sidekick)) + (set! (-> self sidekick) (the-as (pointer sidekick) #f)) + ) + (cond + (arg0 + (if (not (-> self sidekick)) + (set! (-> self sidekick) + (process-spawn sidekick :init init-sidekick :name "sidekick" :from *8k-dead-pool* :to self) + ) + ) + ) + ((-> self sidekick) + (deactivate (-> self sidekick 0)) + (set! (-> self sidekick) (the-as (pointer sidekick) #f)) + ) + ) + 0 + (none) + ) + +(defstate sidekick-clone (sidekick) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (case message + (('matrix) + (case (-> block param 0) + (('play-anim) + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-cspace+transformq!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) (the-as basic (-> self parent 0 node-list data))) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) (the-as basic (-> self offset))) + ) + (('copy-parent) + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-cspace!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) (the-as basic (-> self parent 0 node-list data))) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) #f) + ) + (('root) + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-cspace-normalized!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) (the-as basic (-> self parent 0 node-list data))) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) #f) + ) + (('indax) + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-transformq+trans!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) (the-as basic (-> self parent 0 control trans))) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) + (the-as basic (-> self parent 0 control cspace-offset)) + ) + ) + (('board) + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-cspace-normalized!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) (the-as basic (-> self parent 0 node-list data 37))) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) #f) + ) + (else + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-cspace+transformq!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) + (the-as basic (-> self parent 0 control sidekick-root parent)) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) (the-as basic (-> self offset))) + ) + ) + v0-0 + ) + (('shadow) + (set! v0-0 (-> block param 0)) + (set! (-> self shadow-in-movie?) (the-as symbol v0-0)) + v0-0 + ) + (('blend-shape) + (cond + ((-> block param 0) + (set! v0-0 (logior (-> self skel status) (joint-control-status blend-shape))) + (set! (-> self skel status) (the-as joint-control-status v0-0)) + ) + (else + (set! v0-0 (logclear (-> self skel status) (joint-control-status blend-shape))) + (set! (-> self skel status) (the-as joint-control-status v0-0)) + ) + ) + v0-0 + ) + (('cleanup) + (joint-control-cleanup + (-> self skel) + (-> *target-anim-control* heap) + (the-as art-joint-anim daxter-stance-loop-ja) + ) + ) + ) + ) + :code looping-code + :post (behavior () + (local-vars (v1-100 symbol)) + (let ((v1-0 (-> self parent))) + (when (not (and (-> (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) + ) + next-state + ) + (let ((v1-4 (-> self parent))) + (= (-> (the-as target (if v1-4 + (the-as target (-> v1-4 0 self)) + ) + ) + next-state + name + ) + 'process-drawable-art-error + ) + ) + ) + ) + (quaternion-rotate-y! + (-> self control quat) + (-> self parent 0 control quat) + (-> self parent 0 upper-body twist z) + ) + (set! (-> self anim-seed) (-> self parent 0 anim-seed)) + (set! (-> self draw status) (-> self parent 0 draw status)) + (cond + ((logtest? (-> self parent 0 target-effect) 1) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logior! (-> self draw global-effect) (draw-control-global-effect no-textures)) + ) + (else + (logclear! (-> self draw global-effect) (draw-control-global-effect no-textures)) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw-bounds2)) + (let ((gp-0 0)) + (cond + ((and (not (logtest? (-> self parent 0 focus-status) (focus-status edge-grab))) + (> (-> self parent 0 skel float-channels) 0) + ) + (let ((gp-1 (-> self skel))) + (joint-control-copy! gp-1 (-> self parent 0 skel)) + (set! (-> gp-1 root-channel) + (the-as (inline-array joint-control-channel) (-> gp-1 channel (-> gp-1 active-channels))) + ) + (dotimes (s5-0 (the-as int (-> self parent 0 skel float-channels))) + (let ((s4-0 (-> gp-1 channel (+ s5-0 (-> gp-1 active-channels))))) + (mem-copy! + (the-as pointer s4-0) + (the-as pointer (-> self parent 0 skel channel (+ s5-0 (-> self parent 0 skel active-channels)))) + 64 + ) + (set! (-> s4-0 frame-interp 0) (-> s4-0 frame-interp 1)) + (set! (-> s4-0 command) (joint-control-command blend)) + ) + ) + (dotimes (v1-70 (the-as int (-> gp-1 allocated-length))) + (set! (-> gp-1 channel v1-70 parent) gp-1) + ) + (+! (-> gp-1 active-channels) (-> self parent 0 skel float-channels)) + (set! (-> gp-1 float-channels) (the-as uint 0)) + ) + (set! gp-0 1) + ) + (else + (joint-control-copy! (-> self skel) (-> self parent 0 skel)) + ) + ) + (joint-control-remap! + (-> self skel) + (-> self draw art-group) + (-> self parent 0 draw art-group) + *sidekick-remap* + (the-as int (-> self anim-seed)) + "" + ) + (cond + ((zero? gp-0) + (set! (-> self skel effect channel-offset) (-> self parent 0 skel effect channel-offset)) + ) + ((= gp-0 1) + (set! (-> self skel effect channel-offset) 0) + 0 + ) + ) + ) + (let ((v1-97 (-> self parent 0 draw color-mult quad))) + (set! (-> self draw color-mult quad) v1-97) + ) + (let ((v1-98 #x20000) + (a0-27 (-> self parent)) + ) + (cond + ((and (logtest? (the-as focus-status v1-98) (-> (the-as target (if a0-27 + (the-as target (-> a0-27 0 self)) + ) + ) + focus-status + ) + ) + (begin + (let* ((v1-101 #t) + (a0-30 (-> self parent)) + (a0-32 (the-as lightjak-info (-> (the-as target (if a0-30 + (the-as target (-> a0-30 0 self)) + ) + ) + lightjak + ) + ) + ) + ) + (cmove-#f-zero v1-100 a0-32 v1-101) + ) + v1-100 + ) + ) + (set-vector! (-> self draw color-emissive) 0.1 0.4 1.0 0.5) + ) + (else + (let ((a0-37 (-> self parent 0 draw color-emissive quad))) + (set! (-> self draw color-emissive quad) a0-37) + ) + ) + ) + ) + (set! (-> self draw force-fade) (-> self parent 0 draw force-fade)) + (set! (-> self draw death-vertex-skip) (-> self parent 0 draw death-vertex-skip)) + (set! (-> self draw death-effect) (-> self parent 0 draw death-effect)) + (set! (-> self draw death-timer) (-> self parent 0 draw death-timer)) + (set! (-> self draw death-timer-org) (-> self parent 0 draw death-timer-org)) + (set! (-> self draw death-draw-overlap) (-> self parent 0 draw death-draw-overlap)) + (quaternion-copy! (-> self offset quat) (-> self control quat)) + (let ((f0-7 (* (-> self parent 0 darkjak-interp) (-> self parent 0 darkjak-giant-interp)))) + (set! (-> self offset trans x) (* 286.72 f0-7)) + (set! (-> self offset trans y) (* 204.8 f0-7)) + (set! (-> self offset trans z) (* 409.6 f0-7)) + ) + (cond + ((= (-> self parent 0 skel override 0) 0.00001) + (set! (-> self skel override 0) 0.00001) + (set! (-> self skel override 41) 1.0) + (set! (-> self skel override 46) 1.0) + (set! (-> self skel override 52) 1.0) + ) + ((!= (-> self skel override 0) 0.0) + (set! (-> self skel override 0) 0.0) + (set! (-> self skel override 41) 0.0) + ) + ) + (let ((f30-0 (vector-length (-> self parent 0 control transv)))) + (seek! + (-> self ear 0 twist-max z) + (lerp-scale 0.0 5461.3335 f30-0 4096.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! (-> self ear 0 twist-speed-x) (lerp-scale 1.0 8.0 f30-0 4096.0 122880.0) (* 10.0 (seconds-per-frame))) + (let ((f0-26 (+ (-> self ear 0 twist z) (* (-> self ear 0 twist-speed-x) (seconds-per-frame))))) + (set! (-> self ear 0 twist z) (- f0-26 (* (the float (the int (/ f0-26 1.0))) 1.0))) + ) + (trs-set! + (-> self ear 0) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (* (sin (* 32768.0 (-> self ear 0 twist z))) (-> self ear 0 twist-max z)) + ) + (the-as vector #f) + ) + (seek! + (-> self ear 1 twist-max z) + (lerp-scale 0.0 5461.3335 f30-0 4096.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! (-> self ear 1 twist-speed-x) (lerp-scale 1.0 8.0 f30-0 4096.0 122880.0) (* 10.0 (seconds-per-frame))) + (let ((f0-41 (+ (-> self ear 1 twist z) (* (-> self ear 1 twist-speed-x) (seconds-per-frame))))) + (set! (-> self ear 1 twist z) (- f0-41 (* (the float (the int (/ f0-41 1.0))) 1.0))) + ) + (trs-set! + (-> self ear 1) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (* (sin (* 32768.0 (-> self ear 1 twist z))) (-> self ear 1 twist-max z)) + ) + (the-as vector #f) + ) + (seek! + (-> self flap 0 twist-max z) + (lerp-scale 0.0 5461.3335 f30-0 4096.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! (-> self flap 0 twist-speed-x) (lerp-scale 1.0 8.0 f30-0 4096.0 122880.0) (* 10.0 (seconds-per-frame))) + (let ((f0-56 (+ (-> self flap 0 twist z) (* (-> self flap 0 twist-speed-x) (seconds-per-frame))))) + (set! (-> self flap 0 twist z) (- f0-56 (* (the float (the int (/ f0-56 1.0))) 1.0))) + ) + (trs-set! + (-> self flap 0) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (* (sin (* 32768.0 (-> self flap 0 twist z))) (-> self flap 0 twist-max z)) + ) + (the-as vector #f) + ) + (seek! + (-> self flap 1 twist-max z) + (lerp-scale 0.0 5461.3335 f30-0 4096.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! (-> self flap 1 twist-speed-x) (lerp-scale 1.0 8.0 f30-0 4096.0 122880.0) (* 10.0 (seconds-per-frame))) + ) + (let ((f0-71 (+ (-> self flap 1 twist z) (* (-> self flap 1 twist-speed-x) (seconds-per-frame))))) + (set! (-> self flap 1 twist z) (- f0-71 (* (the float (the int (/ f0-71 1.0))) 1.0))) + ) + (trs-set! + (-> self flap 1) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (* (sin (* 32768.0 (-> self flap 1 twist z))) (-> self flap 1 twist-max z)) + ) + (the-as vector #f) + ) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + ) + ) + (when *display-sidekick-stats* + (format *stdcon* "~%") + (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) + (add-debug-sphere + *display-sidekick-stats* + (bucket-id debug-no-zbuf1) + (-> self parent 0 control sidekick-root parent bone transform trans) + (meters 0.1) + (new 'static 'rgba :g #xff :a #x80) + ) + (add-debug-sphere + *display-sidekick-stats* + (bucket-id debug-no-zbuf1) + (-> self node-list data 3 bone transform trans) + (meters 0.1) + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + (add-debug-sphere + *display-sidekick-stats* + (bucket-id debug-no-zbuf1) + (-> self node-list data 0 bone transform trans) + (meters 0.1) + (new 'static 'rgba :r #xff :a #x80) + ) + (add-debug-matrix + *display-sidekick-stats* + (bucket-id debug-no-zbuf1) + (-> self node-list data 0 bone transform) + (meters 2) + ) + ) + (set! (-> self draw shadow) + (the-as + shadow-geo + (if (or (and (movie?) (-> self shadow-in-movie?)) (logtest? (focus-status indax) (-> self parent 0 focus-status))) + daxter-shadow-mg + ) + ) + ) + (let ((a0-84 (-> self skel effect))) + (if a0-84 + (effect-control-method-9 a0-84) + ) + ) + (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) + (merc-blend-shape self) + ) + (if (logtest? (-> self skel status) (joint-control-status eye-anim-valid eye-anim)) + (merc-eye-anim self) + ) + (when (!= (not (-> *setting-control* user-current mirror)) (not (-> self mirror))) + (cond + ((-> self mirror) + (deactivate (-> self mirror 0)) + (set! (-> self mirror) (the-as (pointer process-drawable) #f)) + ) + (else + (let ((gp-14 (process-spawn + manipy + :init manipy-init + (-> self control trans) + (-> self entity) + (art-group-get-by-name *level* "skel-sidekick" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (send-event (ppointer->process gp-14) 'anim-mode 'mirror) + (send-event (ppointer->process gp-14) 'mirror #t) + (set! (-> self mirror) (the-as (pointer process-drawable) gp-14)) + (let ((v0-55 (-> (the-as process-drawable (-> gp-14 0)) node-list data))) + (set! (-> v0-55 0 param0) (the-as (function cspace transformq none) cspace<-cspace!)) + (set! (-> v0-55 0 param1) (the-as basic (-> self node-list data))) + (set! (-> v0-55 0 param2) #f) + ) + ) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch process-drawable vs sidekick. +(defmethod relocate ((this sidekick) (offset int)) + (if (nonzero? (-> this ear 0)) + (&+! (-> this ear 0) offset) + ) + (if (nonzero? (-> this ear 1)) + (&+! (-> this ear 1) offset) + ) + (if (nonzero? (-> this flap 0)) + (&+! (-> this flap 0) offset) + ) + (if (nonzero? (-> this flap 1)) + (&+! (-> this flap 1) offset) + ) + (the-as sidekick ((method-of-type process-drawable relocate) this offset)) + ) + +(defbehavior init-sidekick sidekick () + (logior! (-> self mask) (process-mask sidekick)) + (set! (-> self control) (the-as control-info (new 'process 'trsqv))) + (vector-identity! (-> self control scale)) + (quaternion-identity! (-> self control quat)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-sidekick" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self draw shadow-ctrl) *target-shadow-control*) + (logior! (-> self skel status) (joint-control-status sync-math blend-shape eye-anim)) + (set! (-> self draw light-index) (the-as uint 30)) + (let ((v1-14 (-> self node-list data))) + (set! (-> v1-14 0 param0) (the-as (function cspace transformq none) cspace<-cspace+transformq!)) + (set! (-> v1-14 0 param1) (the-as basic (-> self parent 0 control sidekick-root parent))) + (set! (-> v1-14 0 param2) (the-as basic (-> self offset))) + ) + (set! (-> self ear 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 10)) + (set! (-> self ear 0 parented-scale?) #t) + (set! (-> self ear 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 12)) + (set! (-> self ear 1 parented-scale?) #t) + (set! (-> self flap 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 41)) + (set! (-> self flap 0 parented-scale?) #t) + (set! (-> self flap 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 43)) + (set! (-> self flap 1 parented-scale?) #t) + (set! (-> self shadow-in-movie?) #t) + (set! (-> self mirror) (the-as (pointer process-drawable) #f)) + (set! (-> self skel override) (new 'process 'boxed-array float 54)) + (go sidekick-clone) + ) diff --git a/goal_src/jak3/engine/target/surface-h.gc b/goal_src/jak3/engine/target/surface-h.gc index a4d27e61963..cd5eeb1e0b3 100644 --- a/goal_src/jak3/engine/target/surface-h.gc +++ b/goal_src/jak3/engine/target/surface-h.gc @@ -48,8 +48,8 @@ (declare-type target process-focusable) (define-extern rail-surface-touch (function none :behavior target)) -(define-extern gravel-surface-touch (function none)) -(define-extern mushroom-surface-touch (function none)) +(define-extern gravel-surface-touch (function none :behavior target)) +(define-extern mushroom-surface-touch (function none :behavior target)) (declare-type collide-shape trsqv) (declare-type collide-shape-moving collide-shape) diff --git a/goal_src/jak3/engine/target/target-anim.gc b/goal_src/jak3/engine/target/target-anim.gc index b2e36320891..69184187e6a 100644 --- a/goal_src/jak3/engine/target/target-anim.gc +++ b/goal_src/jak3/engine/target/target-anim.gc @@ -7,3 +7,1842 @@ ;; DECOMP BEGINS +(defbehavior target-land-anim target () + (cond + ((using-gun? self) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-red) (pickup-type eco-dark)) + jakb-gun-jump-land-ja + ) + (else + jakb-gun-jump-land-side-ja + ) + ) + ) + (else + (let ((v1-9 (ja-group))) + (if (and (or (and v1-9 (= v1-9 (-> self draw art-group data 444))) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + ) + (= (-> self ext-anim) (target-anim dark)) + ) + (-> self draw art-group data 445) + jakb-jump-land-ja + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-stance-anim target () + (local-vars (sv-64 int) (sv-72 ground-tween-info)) + (set! sv-64 22) + (set! sv-72 (new 'stack 'ground-tween-info)) + (let ((v1-4 (ja-group))) + (cond + ((and v1-4 (or (= v1-4 jakb-wade-shallow-walk-ja) (= v1-4 jakb-wade-deep-walk-ja))) + (set! sv-64 45) + ) + ((let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 jakb-roll-flip-ja)) + ) + ((lambda :behavior target + () + (cond + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-roll-flip-land-ja) + 0.0 + 0 + 30 + 1.0 + 10.0 + #f + ) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-roll-flip-land-ja) + 0.0 + 0 + 30 + 1.0 + 6.0 + #f + ) + ) + ) + (ja-no-eval :group! jakb-roll-flip-land-ja :num! (seek! (ja-aframe 48.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 48.0 0))) + ) + (ja-channel-push! 1 (seconds 0.05)) + (let ((gp-2 (target-land-anim))) + (ja-no-eval :group! gp-2 :num! (seek!) :frame-num (ja-aframe 64.0 0)) + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-roll-flip-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 55.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (none) + ) + ) + ) + ((let ((v1-18 (ja-group))) + (and v1-18 (or (= v1-18 jakb-gun-attack-from-stance-end-ja) + (= v1-18 jakb-gun-attack-from-stance-blue-end-ja) + (= v1-18 jakb-lightjak-shield-end-ja) + (= v1-18 jakb-attack-from-stance-alt-end-ja) + (= v1-18 jakb-attack-from-stance-end-ja) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-33 (ja-group))) + (and v1-33 + (or (= v1-33 jakb-attack-from-stance-ja) + (= v1-33 jakb-gun-attack-from-stance-ja) + (= v1-33 jakb-gun-attack-from-stance-blue-ja) + (= v1-33 jakb-lightjak-shield-ja) + ) + ) + ) + ((lambda :behavior target + () + (set! (-> self control mod-surface) *attack-end-mods*) + (let ((gp-0 (not (using-gun? self)))) + (let* ((v1-3 (ja-group)) + (a1-0 (cond + ((and v1-3 (= v1-3 jakb-gun-attack-from-stance-ja)) + jakb-gun-attack-from-stance-end-ja + ) + ((let ((v1-10 (ja-group))) + (and v1-10 (= v1-10 jakb-gun-attack-from-stance-blue-ja)) + ) + jakb-gun-attack-from-stance-blue-end-ja + ) + ((and (= (-> self ext-anim) (target-anim light)) (let ((v1-20 (ja-group))) + (and v1-20 (= v1-20 jakb-lightjak-shield-ja)) + ) + ) + jakb-lightjak-shield-end-ja + ) + ((and (rand-vu-percent? 0.3) (zero? (-> self ext-anim))) + jakb-attack-from-stance-alt-end-ja + ) + (else + jakb-attack-from-stance-end-ja + ) + ) + ) + ) + (ja-no-eval :group! a1-0 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (when (nonzero? (-> self gun track-target-hold-time)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (goto cfg-43) + ) + (if (and gp-0 (using-gun? self)) + (goto cfg-43) + ) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek!)) + ) + ) + (quaternion-copy! (-> self control dir-targ) (-> self control unknown-quaternion04)) + (label cfg-43) + (set! (-> self control mod-surface) *walk-mods*) + (let ((v1-73 (ja-group))) + (when (and (and v1-73 (= v1-73 jakb-gun-attack-from-stance-end-ja)) + (and (using-gun? self) (= (gun->eco (-> self gun gun-type)) (pickup-type eco-yellow))) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-gun-front-to-side-hop-ja :num! (seek!) :frame-num (ja-aframe 5.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (none) + ) + ) + ) + ((let ((v1-40 (ja-group))) + (and v1-40 (= v1-40 (-> self draw art-group data 449))) + ) + (ja-no-eval :group! (-> self draw art-group data 450) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-70 (ja-group))) + (and v1-70 (= v1-70 jakb-smack-surface-ja)) + ) + (ja-no-eval :group! jakb-smack-surface-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-100 (ja-group))) + (and v1-100 (or (= v1-100 jakb-powerjak-get-on-ja) (= v1-100 jakb-powerjak-get-on-loop-ja))) + ) + (set! sv-64 60) + ) + ((let ((v1-107 (ja-group))) + (and v1-107 (= v1-107 jakb-darkjak-get-on-fast-ja)) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-122 (ja-group))) + (and v1-122 (or (= v1-122 jakb-attack-punch-ja) + (= v1-122 (-> self draw art-group data 452)) + (= v1-122 (-> self draw art-group data 459)) + (= v1-122 (-> self draw art-group data 454)) + (= v1-122 jakb-darkjak-attack-combo3-ja) + (= v1-122 (-> self draw art-group data 463)) + (= v1-122 (-> self draw art-group data 476)) + ) + ) + ) + ((lambda :behavior target + () + (set! (-> self control bend-target) (-> self control bend-amount)) + (set! (-> self control mod-surface) *walk-no-turn-mods*) + (let ((gp-0 (not (using-gun? self)))) + (let* ((v1-5 (ja-group)) + (a1-0 (cond + ((and v1-5 (= v1-5 (-> self draw art-group data 452))) + (logior! (-> self target-flags) (target-flags lleg-still)) + (-> self draw art-group data 453) + ) + ((let ((v1-14 (ja-group))) + (and v1-14 (= v1-14 (-> self draw art-group data 459))) + ) + (logior! (-> self target-flags) (target-flags lleg-still)) + (-> self draw art-group data 460) + ) + ((let ((v1-23 (ja-group))) + (and v1-23 (= v1-23 (-> self draw art-group data 454))) + ) + (logior! (-> self target-flags) (target-flags lleg-still)) + (-> self draw art-group data 455) + ) + ((let ((v1-32 (ja-group))) + (and v1-32 (= v1-32 jakb-darkjak-attack-combo3-ja)) + ) + (logior! (-> self target-flags) (target-flags lleg-still)) + jakb-darkjak-attack-combo3-end-ja + ) + ((let ((v1-41 (ja-group))) + (and v1-41 (= v1-41 (-> self draw art-group data 463))) + ) + (logior! (-> self target-flags) (target-flags lleg-still)) + (-> self draw art-group data 464) + ) + (else + (let ((v1-50 (ja-group))) + (cond + ((and v1-50 (= v1-50 (-> self draw art-group data 476))) + (logior! (-> self target-flags) (target-flags lleg-still)) + (-> self draw art-group data 477) + ) + ((and (rand-vu-percent? 0.3) (zero? (-> self ext-anim))) + jakb-attack-punch-alt-end-ja + ) + (else + jakb-attack-punch-end-ja + ) + ) + ) + ) + ) + ) + ) + (ja-no-eval :group! a1-0 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (seek! (-> self control bend-target) 0.0 (seconds-per-frame)) + (if (and gp-0 (using-gun? self)) + (goto cfg-59) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (label cfg-59) + (set! (-> self control mod-surface) *walk-mods*) + (set! (-> self control bend-target) 0.0) + (rot->dir-targ! (-> self control)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (none) + ) + ) + ) + ((let ((v1-129 (ja-group))) + (and v1-129 (= v1-129 jakb-gun-attack-butt-ja)) + ) + (set! (-> self control bend-target) (-> self control bend-amount)) + (set! (-> self control mod-surface) *walk-no-turn-mods*) + (let ((a1-22 jakb-gun-attack-butt-end-ja)) + (ja-no-eval :group! a1-22 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (seek! (-> self control bend-target) 0.0 (seconds-per-frame)) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control mod-surface) *walk-mods*) + (set! (-> self control bend-target) 0.0) + (rot->dir-targ! (-> self control)) + ) + ((let ((v1-163 (ja-group))) + (and v1-163 (= v1-163 jakb-gun-attack-butt-blue-ja)) + ) + (set! (-> self control bend-target) (-> self control bend-amount)) + (set! (-> self control mod-surface) *walk-no-turn-mods*) + (let ((a1-25 jakb-gun-attack-butt-blue-end-ja)) + (ja-no-eval :group! a1-25 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (seek! (-> self control bend-target) 0.0 (seconds-per-frame)) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control mod-surface) *walk-mods*) + (set! (-> self control bend-target) 0.0) + (rot->dir-targ! (-> self control)) + ) + ((let ((v1-197 (ja-group))) + (and (and v1-197 (or (= v1-197 jakb-gun-jump-land-ja) (= v1-197 jakb-gun-jump-land-side-ja))) + (not (using-gun? self)) + ) + ) + (set! sv-64 60) + ) + ((let ((v1-205 (ja-group))) + (and v1-205 (or (= v1-205 jakb-duck-stance-ja) + (= v1-205 jakb-duck-walk-ja) + (= v1-205 jakb-gun-duck-walk-ja) + (= v1-205 jakb-duck-roll-ja) + (= v1-205 jakb-gun-duck-roll-ja) + (= v1-205 (-> self draw art-group data 474)) + ) + ) + ) + (let ((t9-27 + (lambda :behavior target + () + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! (-> self draw art-group data 475) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + 12 + ) + ((nonzero? (-> self ext-anim)) + 30 + ) + (else + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! jakb-stance-to-duck-ja :num! (seek! 0.0 1.2) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0 1.2)) + ) + 12 + ) + ) + (none) + ) + ) + ) + (new 'stack-no-clear 'array 'time-frame 4) + (t9-27) + ) + ) + ((let ((v1-212 (ja-group))) + (or (and (and v1-212 (or (= v1-212 jakb-walk-ja) (= v1-212 (-> self draw art-group data 442)))) + (begin (set! sv-64 45) (< 0.5 (-> self skel root-channel 6 frame-interp (-> self skel active-frame-interp)))) + (not (using-gun? self)) + ) + (let ((v1-226 (ja-group))) + (and v1-226 (or (= v1-226 jakb-run-squash-ja) + (= v1-226 jakb-run-squash-weak-ja) + (= v1-226 jakb-attack-from-stance-run-end-ja) + (= v1-226 jakb-attack-from-stance-run-alt-end-ja) + ) + ) + ) + ) + ) + ((lambda :behavior target + ((arg0 (pointer time-frame))) + (cond + ((and (rand-vu-percent? 0.3) (not (and (focus-test? self dark) (nonzero? (-> self darkjak))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-run-to-stance-fast-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (using-gun? self) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (let* ((v1-32 (ja-group)) + (f30-1 (cond + ((and v1-32 (or (= v1-32 jakb-walk-ja) (= v1-32 (-> self draw art-group data 442)))) + (let ((f0-10 (+ 50.0 (* 0.8333333 (+ -25.0 (ja-aframe-num 0)))))) + (- f0-10 (* (the float (the int (/ f0-10 50.0))) 50.0)) + ) + ) + (else + 0.0 + ) + ) + ) + ) + (set! (-> arg0 0) (seconds 0.15)) + (ja-channel-push! 1 (-> arg0 0)) + (ja :group! jakb-run-to-stance-loop-ja :num! (identity (ja-aframe f30-1 0))) + ) + (dotimes (gp-2 3) + (until (ja-done? 0) + (if (using-gun? self) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + (ja :num-func num-func-identity :frame-num 0.0) + ) + (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek! (ja-aframe 82.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 82.0 0))) + ) + (when (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek! (ja-aframe 142.0 0)) :frame-num (ja-aframe 82.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 142.0 0))) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek!) :frame-num (ja-aframe 142.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (none) + ) + (new 'stack-no-clear 'array 'time-frame 4) + ) + ) + ((let ((v1-233 (ja-group))) + (and (and v1-233 (= v1-233 jakb-walk-ja)) (>= (-> self control ctrl-xz-vel) 5734.4)) + ) + (set! sv-64 45) + ) + ((and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (= (-> self ext-anim) (target-anim light)) (let ((v1-250 (ja-group))) + (and v1-250 (= v1-250 jakb-lightjak-get-on-land-ja)) + ) + ) + ) + (set! sv-64 45) + ) + ((and (= (-> self ext-anim) (target-anim light)) (let ((v1-260 (ja-group))) + (and v1-260 (= v1-260 jakb-lightjak-freeze-ja)) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-freeze-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (if (and (using-gun? self) (-> self next-state) (= (-> self next-state name) 'target-stance)) + (go target-gun-stance) + ) + (when (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (= (-> self ext-anim) (target-anim light)) + (zero? (-> self lightjak latch-out-time)) + (let ((v1-306 (ja-group))) + (not (and v1-306 (or (= v1-306 jakb-lightjak-heal-end-ja) + (= v1-306 jakb-lightjak-swoop-land-ja) + (= v1-306 jakb-lightjak-get-on-land-ja) + (= v1-306 jakb-lightjak-shield-end-ja) + (= v1-306 jakb-lightjak-freeze-land-ja) + ) + ) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-stance-to-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (goto cfg-316) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (until #f + (let ((gp-0 (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (= (-> self ext-anim) (target-anim dark)) + (zero? (-> self darkjak latch-out-time)) + (not (using-gun? self)) + ) + ) + (-> self draw art-group data 446) + ) + ((and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (= (-> self ext-anim) (target-anim light)) (zero? (-> self lightjak latch-out-time))) + ) + jakb-lightjak-stance-ja + ) + (else + jakb-stance-loop-ja + ) + ) + ) + ) + (when (not (and (ja-group? gp-0) (= (ja-group-size) 1))) + (ja-channel-push! 1 (the-as time-frame sv-64)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (while (let ((v1-385 (ja-group))) + (cond + ((and (and v1-385 (= v1-385 (-> self draw art-group data 446))) + (not (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (= (-> self ext-anim) (target-anim dark)) + (zero? (-> self darkjak latch-out-time)) + (not (using-gun? self)) + ) + ) + ) + ) + (set! sv-64 60) + #f + ) + (else + #t + ) + ) + ) + (suspend) + (ja :num! (loop!)) + (if (can-play-stance-amibent?) + (go target-stance-ambient) + ) + ) + (label cfg-316) + ) + #f + (none) + ) + +(defbehavior target-stance-push target ((arg0 int)) + (let ((v1-2 (ja-group))) + (cond + ((or (and (and v1-2 (= v1-2 jakb-walk-ja)) + (< 0.5 (-> self skel root-channel 6 frame-interp (-> self skel active-frame-interp))) + ) + (let ((v1-14 (ja-group))) + (and v1-14 (or (= v1-14 jakb-run-squash-ja) + (= v1-14 jakb-run-squash-weak-ja) + (= v1-14 jakb-attack-from-stance-run-end-ja) + (= v1-14 jakb-attack-from-stance-run-alt-end-ja) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! jakb-run-to-stance-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! arg0 (seconds 0.15)) + ) + ((let ((v1-68 (ja-group))) + (and (and v1-68 (or (= v1-68 jakb-jump-short-land-ja) + (= v1-68 jakb-jump-land-ja) + (= v1-68 jakb-gun-jump-land-ja) + (= v1-68 jakb-gun-jump-land-side-ja) + (= v1-68 (-> self draw art-group data 445)) + ) + ) + (not (ja-max? 0)) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! arg0 (seconds 0.075)) + ) + ((let ((v1-84 (ja-group))) + (not (and (and v1-84 (= v1-84 jakb-stance-loop-ja)) (= (ja-group-size) 1))) + ) + (ja-channel-push! arg0 (seconds 0.075)) + ) + ) + ) + (none) + ) + +(defbehavior target-falling-anim target ((arg0 int) (arg1 time-frame)) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 + (or (= v1-2 jakb-jump-loop-ja) (= v1-2 jakb-attack-uppercut-ja) (= v1-2 jakb-gun-attack-upperbutt-ja)) + ) + ) + ((let ((v1-8 (ja-group))) + (and v1-8 (or (= v1-8 jakb-edge-grab-stance0-ja) (= v1-8 jakb-edge-grab-stance1-ja))) + ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! jakb-edge-grab-off-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-37 (ja-group))) + (and v1-37 (= v1-37 jakb-edge-grab-off-ja)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.15)) + ) + (else + (let ((v1-52 (ja-group))) + (cond + ((and v1-52 (= v1-52 jakb-roll-flip-ja)) + (let ((s5-0 (current-time))) + (while (or (= arg0 -1) (not (time-elapsed? s5-0 arg0))) + (when (time-elapsed? s5-0 (seconds 0.01)) + (let ((v1-62 (ja-group))) + (when (not (and v1-62 (= v1-62 jakb-jump-loop-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-jump-loop-ja :num! min) + ) + ) + ) + (let ((v1-71 (new-stack-vector0)) + (f0-12 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-71 (-> self control transv) (vector-float*! v1-71 (-> self control dynam gravity-normal) f0-12)) + (let* ((f2-0 (vector-length v1-71)) + (f1-2 f2-0) + (f2-1 (* 0.9 f2-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-12) + (vector-float*! v1-71 v1-71 (/ f2-1 f1-2)) + ) + ) + ) + (suspend) + (let ((v1-74 (ja-group))) + (if (and v1-74 (= v1-74 jakb-jump-loop-ja)) + (ja :num! (loop!)) + (ja :num! (seek!)) + ) + ) + ) + ) + (return #f) + ) + (else + (ja-channel-push! 1 arg1) + (ja :group! jakb-jump-loop-ja) + (while (!= (-> self skel root-channel 0) (-> self skel channel)) + (suspend) + ) + ) + ) + ) + ) + ) + ) + (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) + (let ((s5-1 (current-time))) + (while (or (= arg0 -1) + (and (not (time-elapsed? s5-1 arg0)) (not (logtest? (-> self control status) (collide-status on-surface)))) + ) + (suspend) + (ja :group! jakb-jump-loop-ja :num! (loop!)) + ) + ) + #f + ) + +(defbehavior target-falling-anim-trans target () + (let ((v1-2 (ja-group))) + (cond + ((not (and v1-2 (or (= v1-2 jakb-jump-loop-ja) + (= v1-2 jakb-jump-land-ja) + (= v1-2 jakb-gun-jump-land-ja) + (= v1-2 jakb-gun-jump-land-side-ja) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.33)) + (ja :group! jakb-jump-loop-ja) + ) + ((and (logtest? (-> self control status) (collide-status on-surface)) + (let ((v1-15 (ja-group))) + (and (not (and v1-15 (= v1-15 jakb-jump-land-ja))) + (not (logtest? (-> self control status) (collide-status on-water))) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.02)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim (target-land-anim))) + ) + ((let ((v1-23 (ja-group))) + (and v1-23 (= v1-23 jakb-jump-loop-ja)) + ) + (ja :num! (loop!)) + ) + ((let ((v1-33 (ja-group))) + (and v1-33 + (or (= v1-33 jakb-jump-land-ja) (= v1-33 jakb-gun-jump-land-ja) (= v1-33 jakb-gun-jump-land-side-ja)) + ) + ) + (ja :num! (seek!)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defbehavior target-walk-anim target ((arg0 int)) + (local-vars (sv-16 float)) + (let ((f24-0 0.0) + (f26-0 (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control ctrl-xz-vel)))))) + (f30-0 0.0) + (f28-0 0.0) + (s5-0 #f) + ) + (let ((v1-6 (ja-group))) + (cond + ((and v1-6 (= v1-6 jakb-turn-around-ja)) + (set! f26-0 1.0) + (ja-channel-push! 7 (seconds 0.05)) + ) + ((let ((v1-12 (ja-group))) + (and v1-12 (or (= v1-12 jakb-duck-roll-ja) (= v1-12 jakb-gun-duck-roll-ja))) + ) + (ja-channel-push! 7 (seconds 0.075)) + (set! f26-0 1.0) + ) + ((let ((v1-19 (ja-group))) + (and v1-19 (= v1-19 jakb-attack-from-stance-ja)) + ) + ((lambda :behavior target + () + (let ((f30-0 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control ctrl-xz-vel)))))) + (cond + ((and (rand-vu-percent? 0.3) (and (< 20480.0 (-> self control ctrl-xz-vel)) (zero? (-> self ext-anim)))) + (ja-no-eval :group! jakb-attack-from-stance-alt-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 29.0 0) f30-0)) + ) + (ja-no-eval :group! jakb-attack-from-stance-run-alt-end-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! jakb-attack-from-stance-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 29.0 0) f30-0)) + ) + (ja-no-eval :group! jakb-attack-from-stance-run-end-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (ja-channel-push! 7 (seconds 0.05)) + (none) + ) + ) + (set! f26-0 1.0) + (set! f24-0 30.0) + ) + ((let ((v1-27 (ja-group))) + (and v1-27 (or (= v1-27 jakb-darkjak-get-off-ja) (= v1-27 (-> self draw art-group data 461)))) + ) + (set! f26-0 1.0) + (ja-channel-push! 7 (seconds 0.3)) + ) + ((let ((v1-33 (ja-group))) + (and v1-33 (or (= v1-33 jakb-attack-punch-ja) + (= v1-33 jakb-attack-punch-end-ja) + (= v1-33 jakb-gun-attack-butt-ja) + (= v1-33 jakb-gun-attack-butt-blue-ja) + (= v1-33 (-> self draw art-group data 453)) + (= v1-33 (-> self draw art-group data 460)) + (= v1-33 (-> self draw art-group data 455)) + (= v1-33 jakb-darkjak-attack-combo3-end-ja) + (= v1-33 (-> self draw art-group data 464)) + ) + ) + ) + (set! f26-0 1.0) + (set! f24-0 30.0) + (ja-channel-push! 7 (seconds 0.15)) + ) + ((let ((v1-40 (ja-group))) + (and (and v1-40 + (or (= v1-40 jakb-walk-ja) (= v1-40 jakb-gun-walk-side-ja) (= v1-40 (-> self draw art-group data 442))) + ) + (= (ja-group-size) 7) + ) + ) + (set! f24-0 (ja-aframe-num 0)) + (set! f26-0 (-> self control unknown-float002)) + (set! f30-0 (-> self control unknown-float-n12iuh3n1)) + (set! f28-0 (-> self control unknown-float-ki1jhbn23hj)) + ) + ((let ((v1-50 (ja-group))) + (and v1-50 (= v1-50 jakb-ice-skate-ja)) + ) + (set! f24-0 (ja-aframe-num 0)) + (ja-channel-push! 7 (seconds 0.1)) + ) + ((let ((v1-55 (ja-group))) + (and v1-55 (= v1-55 jakb-wade-shallow-walk-ja)) + ) + (set! f24-0 (ja-aframe-num 0)) + (ja-channel-push! 7 (seconds 0.05)) + ) + ((let ((v1-60 (ja-group))) + (and (or (and v1-60 + (or (= v1-60 jakb-jump-loop-ja) + (= v1-60 jakb-roll-flip-ja) + (= v1-60 jakb-attack-from-jump-end-ja) + (= v1-60 jakb-attack-uppercut-ja) + (= v1-60 jakb-gun-attack-upperbutt-ja) + (= v1-60 jakb-flop-down-land-ja) + ) + ) + (let ((v1-66 (ja-group))) + (and (and v1-66 (or (= v1-66 jakb-jump-ja) (= v1-66 (-> self draw art-group data 444)))) + (< 30.0 (ja-aframe-num 0)) + ) + ) + ) + (< 12288.0 (-> self control ctrl-xz-vel)) + ) + ) + ((lambda :behavior target + () + (let ((gp-0 (ja-group)) + (f30-0 (-> self control ground-impact-vel)) + ) + (let ((v1-7 (ja-group))) + (if (and v1-7 (or (= v1-7 jakb-roll-flip-ja) (= v1-7 jakb-attack-from-jump-end-ja))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-channel-set! 1) + ) + ) + (cond + ((< (if (= gp-0 jakb-jump-ja) + 77824.0 + 102400.0 + ) + f30-0 + ) + (ja-no-eval :group! jakb-run-squash-ja :num! (seek! (ja-aframe 3.0 0) 1.00001) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 3.0 0) 1.00001)) + ) + ) + ((< (if (= gp-0 jakb-jump-ja) + 61440.0 + 102400.0 + ) + f30-0 + ) + (ja-no-eval :group! jakb-run-squash-ja :num! (seek! (ja-aframe 3.0 0) 1.00001) :frame-num (ja-aframe -1.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 3.0 0) 1.00001)) + ) + ) + (else + (ja-no-eval :group! jakb-run-squash-weak-ja :num! (seek! (ja-aframe 4.0 0) 1.00001) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 4.0 0) 1.00001)) + ) + ) + ) + ) + (when (and (using-gun? self) (not (-> self gun charge-active?))) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-run-blue-ja) 16.0 90 60 1.0 0.0 #f) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-run-ja) + 16.0 + 90 + 60 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (/ (* (fmax 20480.0 (-> self control ctrl-xz-vel)) (seconds-per-frame)) + (/ (-> *TARGET-bank* run-up-cycle-dist) (-> *TARGET-bank* run-cycle-length)) + ) + ) + ) + ) + (ja-channel-push! 7 (seconds 0.1)) + (none) + ) + ) + (set! f24-0 30.0) + (set! f26-0 1.0) + ) + ((let ((v1-78 (ja-group))) + (and v1-78 (or (= v1-78 jakb-jump-ja) (= v1-78 (-> self draw art-group data 444)))) + ) + (ja-channel-push! 7 (seconds 0.05)) + (set! s5-0 #t) + ) + (else + (let ((v1-84 (ja-group))) + (cond + ((and v1-84 (= v1-84 jakb-smack-surface-ja)) + (ja-channel-push! 7 (seconds 0.15)) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (set! f24-0 55.0) + (ja-channel-push! 7 (seconds 0.1)) + ) + (else + (ja-channel-push! 7 (seconds 0.05)) + ) + ) + ) + ) + ) + ) + (set! (-> self skel root-channel 3 command) (joint-control-command push)) + (set! (-> self skel root-channel 6 command) (joint-control-command stack)) + (ja :group! jakb-walk-ja) + (let ((f24-1 (ja-aframe f24-0 0))) + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (= (-> self ext-anim) (target-anim dark)) (not (using-gun? self))) + ) + (let ((s4-0 (-> self skel root-channel 0))) + (let ((f0-3 0.0)) + (set! (-> s4-0 frame-interp 1) f0-3) + (set! (-> s4-0 frame-interp 0) f0-3) + ) + (set! (-> s4-0 dist) 12288.0) + (joint-control-channel-group-eval! + s4-0 + (the-as art-joint-anim (-> self draw art-group data 442)) + num-func-identity + ) + (set! (-> s4-0 frame-num) f24-1) + ) + ) + ((and (using-gun? self) (or (= (gun->eco (-> self gun gun-type)) (pickup-type eco-yellow)) + (= (gun->eco (-> self gun gun-type)) (pickup-type eco-blue)) + ) + ) + (let ((s4-1 (-> self skel root-channel 0))) + (let ((f0-5 0.0)) + (set! (-> s4-1 frame-interp 1) f0-5) + (set! (-> s4-1 frame-interp 0) f0-5) + ) + (set! (-> s4-1 dist) 12288.0) + (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim jakb-gun-walk-side-ja) num-func-identity) + (set! (-> s4-1 frame-num) f24-1) + ) + ) + (else + (let ((s4-2 (-> self skel root-channel 0))) + (let ((f0-7 0.0)) + (set! (-> s4-2 frame-interp 1) f0-7) + (set! (-> s4-2 frame-interp 0) f0-7) + ) + (set! (-> s4-2 dist) (-> *TARGET-bank* walk-cycle-dist)) + (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim jakb-walk-ja) num-func-identity) + (set! (-> s4-2 frame-num) f24-1) + ) + ) + ) + (let ((s4-3 (-> self skel root-channel 1))) + (let ((f0-9 0.0)) + (set! (-> s4-3 frame-interp 1) f0-9) + (set! (-> s4-3 frame-interp 0) f0-9) + ) + (set! (-> s4-3 dist) (-> *TARGET-bank* walk-down-cycle-dist)) + (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim jakb-walk-down-ja) num-func-identity) + (set! (-> s4-3 frame-num) f24-1) + ) + (let ((s4-4 (-> self skel root-channel 2))) + (let ((f0-11 0.0)) + (set! (-> s4-4 frame-interp 1) f0-11) + (set! (-> s4-4 frame-interp 0) f0-11) + ) + (set! (-> s4-4 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (joint-control-channel-group-eval! s4-4 (the-as art-joint-anim jakb-walk-left-ja) num-func-identity) + (set! (-> s4-4 frame-num) f24-1) + ) + (let ((s4-5 (-> self skel root-channel 4))) + (let ((f0-13 0.0)) + (set! (-> s4-5 frame-interp 1) f0-13) + (set! (-> s4-5 frame-interp 0) f0-13) + ) + (set! (-> s4-5 dist) (-> *TARGET-bank* run-down-cycle-dist)) + (joint-control-channel-group-eval! s4-5 (the-as art-joint-anim jakb-run-down-ja) num-func-identity) + (set! (-> s4-5 frame-num) f24-1) + ) + (let ((s4-6 (-> self skel root-channel 5))) + (let ((f0-15 0.0)) + (set! (-> s4-6 frame-interp 1) f0-15) + (set! (-> s4-6 frame-interp 0) f0-15) + ) + (set! (-> s4-6 dist) (-> *TARGET-bank* run-side-cycle-dist)) + (joint-control-channel-group-eval! s4-6 (the-as art-joint-anim jakb-run-left-ja) num-func-identity) + (set! (-> s4-6 frame-num) f24-1) + ) + (cond + ((using-gun? self) + (let ((s4-7 (-> self skel root-channel 3))) + (let ((f0-17 0.0)) + (set! (-> s4-7 frame-interp 1) f0-17) + (set! (-> s4-7 frame-interp 0) f0-17) + ) + (set! (-> s4-7 dist) (-> *TARGET-bank* run-cycle-dist)) + (joint-control-channel-group-eval! s4-7 (the-as art-joint-anim jakb-gun-front-run-ja) num-func-identity) + (set! (-> s4-7 frame-num) f24-1) + ) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (let ((s4-8 (-> self skel root-channel 3))) + (let ((f0-19 0.0)) + (set! (-> s4-8 frame-interp 1) f0-19) + (set! (-> s4-8 frame-interp 0) f0-19) + ) + (set! (-> s4-8 dist) 27033.6) + (joint-control-channel-group-eval! + s4-8 + (the-as art-joint-anim (-> self draw art-group data 443)) + num-func-identity + ) + (set! (-> s4-8 frame-num) f24-1) + ) + ) + (else + (let ((s4-9 (-> self skel root-channel 3))) + (let ((f0-21 0.0)) + (set! (-> s4-9 frame-interp 1) f0-21) + (set! (-> s4-9 frame-interp 0) f0-21) + ) + (set! (-> s4-9 dist) (-> *TARGET-bank* run-cycle-dist)) + (joint-control-channel-group-eval! s4-9 (the-as art-joint-anim jakb-run-ja) num-func-identity) + (set! (-> s4-9 frame-num) f24-1) + ) + ) + ) + ) + (let ((s4-10 (current-time)) + (f24-2 (if (and (using-gun? self) (or (= (gun->eco (-> self gun gun-type)) (pickup-type eco-yellow)) + (= (gun->eco (-> self gun gun-type)) (pickup-type eco-blue)) + ) + ) + 0.0 + 1.0 + ) + ) + ) + (until (and (>= arg0 0) (time-elapsed? s4-10 arg0)) + (let ((f20-0 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control local-slope-z))))) + (f22-1 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) + ) + (set! sv-16 (fabs (deg-diff (quaternion-y-angle (-> self control dir-targ)) (y-angle (-> self control))))) + (set! f26-0 (seek + f26-0 + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control ctrl-xz-vel))))) + (* 2.0 (seconds-per-frame)) + ) + ) + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (set! f26-0 + (seek f26-0 (lerp-scale f26-0 (* 0.7 f26-0) sv-16 1820.4445 3640.889) (* 2.0 (seconds-per-frame))) + ) + ) + (cond + ((< 0.5 f26-0) + (let ((v1-211 (-> self skel effect))) + (set! (-> v1-211 channel-offset) 3) + ) + 0 + (logclear! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + ) + (else + (let ((v1-216 (-> self skel effect))) + (set! (-> v1-216 channel-offset) 0) + ) + 0 + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + ) + ) + (let ((f0-37 (fabs (- f20-0 f30-0)))) + (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-37))))) + ) + (let ((f0-42 (fabs (- f22-1 f28-0)))) + (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (* 0.25 f0-42))))) + ) + ) + (set! (-> self control unknown-float-n12iuh3n1) f30-0) + (set! (-> self control unknown-float-ki1jhbn23hj) f28-0) + (set! (-> self control unknown-float002) f26-0) + (cond + ((>= f30-0 0.0) + (let ((v1-233 (-> self skel root-channel 1))) + (let ((f0-48 (* (fabs f30-0) f24-2))) + (set! (-> v1-233 frame-interp 1) f0-48) + (set! (-> v1-233 frame-interp 0) f0-48) + ) + (set! (-> v1-233 dist) (-> *TARGET-bank* walk-up-cycle-dist)) + (set! (-> v1-233 frame-group) (the-as art-joint-anim jakb-walk-up-ja)) + ) + (let ((v1-236 (-> self skel root-channel 4))) + (let ((f0-50 (fabs f30-0))) + (set! (-> v1-236 frame-interp 1) f0-50) + (set! (-> v1-236 frame-interp 0) f0-50) + ) + (set! (-> v1-236 dist) (-> *TARGET-bank* run-up-cycle-dist)) + (set! (-> v1-236 frame-group) (the-as art-joint-anim jakb-run-up-ja)) + ) + ) + (else + (let ((v1-239 (-> self skel root-channel 1))) + (let ((f0-53 (* (fabs f30-0) f24-2))) + (set! (-> v1-239 frame-interp 1) f0-53) + (set! (-> v1-239 frame-interp 0) f0-53) + ) + (set! (-> v1-239 dist) (-> *TARGET-bank* walk-down-cycle-dist)) + (set! (-> v1-239 frame-group) (the-as art-joint-anim jakb-walk-down-ja)) + ) + (let ((v1-242 (-> self skel root-channel 4))) + (let ((f0-55 (fabs f30-0))) + (set! (-> v1-242 frame-interp 1) f0-55) + (set! (-> v1-242 frame-interp 0) f0-55) + ) + (set! (-> v1-242 dist) (-> *TARGET-bank* run-down-cycle-dist)) + (set! (-> v1-242 frame-group) (the-as art-joint-anim jakb-run-down-ja)) + ) + ) + ) + (cond + ((>= f28-0 0.0) + (let ((v1-245 (-> self skel root-channel 2))) + (let ((f0-59 (* (fabs f28-0) f24-2))) + (set! (-> v1-245 frame-interp 1) f0-59) + (set! (-> v1-245 frame-interp 0) f0-59) + ) + (set! (-> v1-245 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (set! (-> v1-245 frame-group) (the-as art-joint-anim jakb-walk-right-ja)) + ) + (let ((v1-248 (-> self skel root-channel 5))) + (let ((f0-61 (fabs f28-0))) + (set! (-> v1-248 frame-interp 1) f0-61) + (set! (-> v1-248 frame-interp 0) f0-61) + ) + (set! (-> v1-248 dist) (-> *TARGET-bank* run-side-cycle-dist)) + (set! (-> v1-248 frame-group) (the-as art-joint-anim jakb-run-right-ja)) + ) + ) + (else + (let ((v1-251 (-> self skel root-channel 2))) + (let ((f0-64 (* (fabs f28-0) f24-2))) + (set! (-> v1-251 frame-interp 1) f0-64) + (set! (-> v1-251 frame-interp 0) f0-64) + ) + (set! (-> v1-251 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (set! (-> v1-251 frame-group) (the-as art-joint-anim jakb-walk-left-ja)) + ) + (let ((v1-254 (-> self skel root-channel 5))) + (let ((f0-66 (fabs f28-0))) + (set! (-> v1-254 frame-interp 1) f0-66) + (set! (-> v1-254 frame-interp 0) f0-66) + ) + (set! (-> v1-254 dist) (-> *TARGET-bank* run-side-cycle-dist)) + (set! (-> v1-254 frame-group) (the-as art-joint-anim jakb-run-left-ja)) + ) + ) + ) + (let ((v1-257 (-> self skel root-channel 6))) + (set! (-> v1-257 frame-interp 1) f26-0) + (set! (-> v1-257 frame-interp 0) f26-0) + ) + (let* ((f1-14 (* (current-cycle-distance (-> self skel)) (-> self control scale x))) + (f0-70 (/ (-> self control ctrl-xz-vel) (* 60.0 (/ f1-14 (-> *TARGET-bank* run-cycle-length))))) + ) + (ja :num! (loop! f0-70)) + ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (ja :chan 3 :num! (chan 0)) + (ja :chan 4 :num! (chan 0)) + (ja :chan 5 :num! (chan 0)) + (if (and s5-0 (!= (-> self skel root-channel 0) (-> self skel channel))) + (ja-blend-eval) + ) + (suspend) + ) + ) + ) + (none) + ) + +(defbehavior target-hit-ground-flop-anim target ((arg0 symbol) (arg1 symbol)) + (let ((f30-0 (if (= arg0 'swim) + 0.4 + 1.0 + ) + ) + ) + (if (using-gun? self) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-flop-down-land-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-channel-set! 1) + (let ((s5-0 (-> self skel root-channel 0))) + (set! (-> s5-0 frame-group) (the-as art-joint-anim jakb-flop-down-land-ja)) + (set! (-> s5-0 param 0) + (the float (+ (-> (the-as art-joint-anim jakb-flop-down-land-ja) frames num-frames) -1)) + ) + (let ((f30-1 (seek f30-0 1.0 (* 0.5 (seconds-per-frame))))) + (set! (-> s5-0 param 1) f30-1) + (set! (-> s5-0 frame-num) 0.0) + (joint-control-channel-group! s5-0 (the-as art-joint-anim jakb-flop-down-land-ja) num-func-seek!) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (if arg1 + (align-opts adjust-y-vel) + (align-opts adjust-y-vel adjust-xz-vel) + ) + 1.0 + 1.0 + 1.5 + ) + (when (and (>= 25.0 (ja-aframe-num 0)) + (and (>= (ja-aframe-num 0) 21.0) + (and (-> self next-state) (= (-> self next-state name) 'target-flop-hit-ground)) + (!= (-> self tobot?) 'tobot) + (!= (-> self control unknown-spool-anim00) 'stuck) + ) + ) + (when (and (cpad-hold? (-> self control cpad number) x) (can-jump? #f) (!= (-> self control ground-pat event) 7)) + (let ((v1-55 (new-stack-vector0))) + (let ((f0-8 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-55 (-> self control transv) (vector-float*! v1-55 (-> self control dynam gravity-normal) f0-8)) + ) + (let* ((f0-9 (vector-length v1-55)) + (f1-3 f0-9) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-55 v1-55 (/ f0-9 f1-3)) + ) + ) + ) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.4))) + (if (using-gun? self) + (go + target-high-jump + (-> *TARGET-bank* flop-jump-height-min) + (-> *TARGET-bank* flop-jump-height-max) + (if arg1 + 'flop + 'flop-forward + ) + ) + (go + target-duck-high-jump + (-> *TARGET-bank* flop-jump-height-min) + (-> *TARGET-bank* flop-jump-height-max) + (if arg1 + 'flop + 'flop-forward + ) + ) + ) + ) + ) + (suspend) + (let ((s5-1 (-> self skel root-channel 0))) + (set! (-> s5-1 param 0) (the float (+ (-> s5-1 frame-group frames num-frames) -1))) + (set! f30-1 (seek f30-1 1.0 (* 0.5 (seconds-per-frame)))) + (set! (-> s5-1 param 1) f30-1) + (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Function target-hit-ground-anim has a return type of none, but the expression builder found a return statement. +(defbehavior target-hit-ground-anim target ((arg0 symbol) (arg1 symbol)) + (cond + ((logtest? (water-flag swimming) (-> self water flags)) + ) + ((let ((v1-5 (ja-group))) + (and v1-5 (or (= v1-5 jakb-flop-down-ja) + (= v1-5 jakb-flop-down-loop-ja) + (= v1-5 jakb-moving-flop-down-ja) + (= v1-5 jakb-moving-flop-down-loop-ja) + ) + ) + ) + (target-hit-ground-flop-anim arg0 arg1) + ) + ((and (= (-> self control ground-pat material) (pat-material ice)) (< 16384.0 (-> self control ctrl-xz-vel))) + ) + ((and (= (-> self ext-anim) (target-anim light)) (let ((v1-23 (ja-group))) + (and v1-23 (or (= v1-23 jakb-lightjak-swoop1-ja) + (= v1-23 jakb-lightjak-swoop2-ja) + (= v1-23 jakb-lightjak-swoop-fall-ja) + (= v1-23 jakb-lightjak-swoop-fall-loop-ja) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-swoop-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((and (= (-> self ext-anim) (target-anim light)) + (let ((v1-55 (ja-group))) + (and v1-55 (or (= v1-55 jakb-lightjak-freeze-ja) (= v1-55 jakb-lightjak-heal-loop-ja))) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-swoop-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-84 (ja-group))) + (or (and v1-84 + (or (= v1-84 jakb-jump-loop-ja) (= v1-84 (-> self draw art-group data 444)) (= v1-84 jakb-flop-jump-ja)) + ) + (let ((v1-90 (ja-group))) + (and (and v1-90 (= v1-90 jakb-jump-ja)) + (or (>= (ja-aframe-num 0) 38.0) (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + ) + ) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-push! 1 (seconds 0.02)) + (let ((a1-14 (target-land-anim))) + (ja-no-eval :group! a1-14 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (let ((v1-110 (ja-group))) + (if (or (and (and v1-110 (or (= v1-110 jakb-gun-jump-land-ja) (= v1-110 jakb-gun-jump-land-side-ja))) + (not (using-gun? self)) + ) + (let ((v1-117 (ja-group))) + (and (and v1-117 (= v1-117 jakb-jump-land-ja)) (and (>= (ja-aframe-num 0) 60.0) (using-gun? self))) + ) + ) + (goto cfg-108) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (label cfg-108) + ) + ((let ((v1-134 (ja-group))) + (and (and v1-134 (or (= v1-134 jakb-jump-ja) (= v1-134 (-> self draw art-group data 444)))) + (>= (ja-aframe-num 0) 35.0) + (not (using-gun? self)) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-set! 1) + (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 50.0 0)) + (until (ja-done? 0) + (if (and (using-gun? self) (>= (ja-aframe-num 0) 60.0)) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-196 (ja-group))) + (and v1-196 + (or (= v1-196 jakb-jump-ja) (= v1-196 jakb-duck-high-jump-ja) (= v1-196 (-> self draw art-group data 444))) + ) + ) + ((lambda :behavior target + () + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-set! 1) + (cond + ((using-gun? self) + (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek! (ja-aframe 41.0 0)) :frame-num (ja-aframe 38.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 41.0 0))) + ) + (ja-no-eval :num! (seek! 0.0)) + (ja-channel-push! 1 (seconds 0.1)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-red) (pickup-type eco-dark)) + (ja-no-eval :group! jakb-gun-jump-land-ja :num! (seek!) :frame-num (ja-aframe 64.0 0)) + (until (ja-done? 0) + (ja-blend-eval) + (if (not (using-gun? self)) + (goto cfg-19) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-gun-jump-land-side-ja :num! (seek!) :frame-num (ja-aframe 64.0 0)) + (until (ja-done? 0) + (ja-blend-eval) + (if (not (using-gun? self)) + (goto cfg-19) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (label cfg-19) + ) + (else + (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek!) :frame-num (ja-aframe 38.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 50.0 0)) + (until (ja-done? 0) + (if (and (using-gun? self) (>= (ja-aframe-num 0) 60.0)) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (none) + ) + ) + ) + ((let ((v1-202 (ja-group))) + (and v1-202 + (or (= v1-202 jakb-hit-from-front-ja) (= v1-202 jakb-hit-from-front-alt1-ja) (= v1-202 jakb-hit-from-back-ja)) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (let* ((v1-210 (ja-group)) + (f30-0 (if (and v1-210 (= v1-210 jakb-hit-from-back-ja)) + 24576.0 + -24576.0 + ) + ) + ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek!) :frame-num (ja-aframe 38.0 0)) + (until (ja-done? 0) + (set-forward-vel f30-0) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 50.0 0)) + (until (ja-done? 0) + (if (and (using-gun? self) (>= (ja-aframe-num 0) 60.0)) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-267 (ja-group))) + (and v1-267 + (or (= v1-267 jakb-jump-ja) + (= v1-267 (-> self draw art-group data 444)) + (= v1-267 jakb-attack-from-jump-ja) + (= v1-267 jakb-attack-from-jump-loop-ja) + (= v1-267 jakb-attack-from-jump-end-ja) + (= v1-267 jakb-flop-down-land-ja) + (= v1-267 jakb-attack-uppercut-ja) + (= v1-267 jakb-gun-attack-upperbutt-ja) + (= v1-267 jakb-gun-attack-upperbutt-blue-ja) + (= v1-267 jakb-board-get-off-ja) + ) + ) + ) + ((lambda :behavior target + () + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-push! 1 (seconds 0.04)) + (cond + ((using-gun? self) + (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek! (ja-aframe 41.0 0)) :frame-num (ja-aframe 38.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 41.0 0))) + ) + (ja-no-eval :num! (seek! 0.0)) + (ja-channel-push! 1 (seconds 0.1)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-red) (pickup-type eco-dark)) + (ja-no-eval :group! jakb-gun-jump-land-ja :num! (seek!) :frame-num (ja-aframe 64.0 0)) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-gun-jump-land-side-ja :num! (seek!) :frame-num (ja-aframe 64.0 0)) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-no-eval :group! (-> self draw art-group data 445) :num! (seek!) :frame-num (ja-aframe 42.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 42.0 0)) + (until (ja-done? 0) + (if (and (using-gun? self) (>= (ja-aframe-num 0) 60.0)) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (none) + ) + ) + ) + ((let ((v1-273 (ja-group))) + (and v1-273 (or (= v1-273 jakb-carry-jump-ja) (= v1-273 jakb-carry-jump-loop-ja))) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! jakb-carry-jump-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-304 (ja-group))) + (and v1-304 (or (= v1-304 jakb-jump-land-ja) + (= v1-304 jakb-gun-jump-land-ja) + (= v1-304 jakb-gun-jump-land-side-ja) + (= v1-304 jakb-carry-jump-land-ja) + (= v1-304 jakb-mech-jump-land-ja) + (= v1-304 jakb-mech-carry-jump-land-ja) + ) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-320 (ja-group))) + (and v1-320 + (or (= v1-320 jakb-mech-jump-ja) (= v1-320 jakb-mech-jump-loop-ja) (= v1-320 jakb-mech-hit-front-ja)) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-push! 1 (seconds 0.017)) + (ja-no-eval :group! jakb-mech-jump-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-351 (ja-group))) + (and v1-351 (or (= v1-351 jakb-mech-carry-jump-ja) (= v1-351 jakb-mech-carry-jump-loop-ja))) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (let ((v1-358 (ja-group))) + (if (and v1-358 (= v1-358 jakb-mech-carry-jump-loop-ja)) + (ja-channel-set! 1) + (ja-channel-push! 1 (seconds 0.04)) + ) + ) + (ja-no-eval :group! jakb-mech-carry-jump-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defbehavior target-attack-air-anim target () + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-ja) + 0.0 + 30 + 30 + 0.6 + 0.0 + #f + ) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-ja) + 3.0 + 30 + 30 + 0.5 + 0.0 + #f + ) + ) + ) + ) + (set! (-> self control unknown-float41) 0.0) + (set! (-> self control unknown-float42) 0.0) + (ja-channel-push! 1 (seconds 0.075)) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + (ja-no-eval :group! jakb-attack-from-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + (ja :group! jakb-attack-from-jump-loop-ja :num! min) + (let ((f30-0 -393216.0)) + (let ((f0-11 (target-height-above-ground)) + (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (while (not (or (and (< (fabs (/ f0-11 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (time-elapsed? (-> self state-time) (seconds 1.7)) + ) + ) + (quaternion-rotate-y! + (-> self control quat-for-control) + (-> self control quat-for-control) + (* f30-0 (seconds-per-frame)) + ) + (suspend) + (ja :num! (loop!)) + (set! f0-11 (target-height-above-ground)) + (set! f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + ) + (ja-no-eval :group! jakb-attack-from-jump-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (cond + ((< (ja-aframe-num 0) 32.0) + (quaternion-rotate-y! + (-> self control quat-for-control) + (-> self control quat-for-control) + (* f30-0 (seconds-per-frame)) + ) + ) + (else + (let ((f0-25 + (deg-diff + (quaternion-y-angle (-> self control quat-for-control)) + (quaternion-y-angle (-> self control dir-targ)) + ) + ) + ) + (quaternion-rotate-y! + (-> self control quat-for-control) + (-> self control quat-for-control) + (* -0.2 (fabs f0-25)) + ) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-edge-grab-anim target ((arg0 float)) + (ja-channel-push! 1 (seconds 0.15)) + (ja :group! jakb-falling-to-edge-grab-ja :num! min) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-set! 1) + (until #f + (ja-no-eval :group! jakb-edge-grab-stance0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (can-play-stance-amibent?) + (suspend) + (ja :num! (seek!)) + ) + (+! (-> self anim-seed) 1) + (ja-no-eval :group! jakb-edge-grab-stance1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (can-play-stance-amibent?) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) diff --git a/goal_src/jak3/engine/target/target-death.gc b/goal_src/jak3/engine/target/target-death.gc index 6a1382d1a44..ec14863c6aa 100644 --- a/goal_src/jak3/engine/target/target-death.gc +++ b/goal_src/jak3/engine/target/target-death.gc @@ -7,3 +7,3088 @@ ;; DECOMP BEGINS +(define *auto-continue* #f) + +;; WARN: Return type mismatch object vs continue-point. +(defun next-continue ((arg0 continue-point)) + (let* ((v1-0 #f) + (a1-0 *level-load-list*) + (a2-0 (car a1-0)) + ) + (while (not (null? a1-0)) + (let* ((a2-2 (-> (the-as level-load-info (-> (the-as symbol a2-0) value)) continues)) + (a3-0 (car a2-2)) + ) + (while (not (null? a2-2)) + (if (and v1-0 (logtest? (continue-flags continue-flag-16) (-> (the-as continue-point a3-0) flags))) + (return (the-as continue-point a3-0)) + ) + (if (= a3-0 arg0) + (set! v1-0 #t) + ) + (set! a2-2 (cdr a2-2)) + (set! a3-0 (car a2-2)) + ) + ) + (set! a1-0 (cdr a1-0)) + (set! a2-0 (car a1-0)) + ) + ) + (the-as continue-point #f) + ) + +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +(defbehavior arrive-at-continue target ((arg0 continue-point)) + (cond + ((logtest? (-> arg0 flags) (continue-flags title)) + enter-state + #t + (go target-title) + ) + ((logtest? (-> arg0 flags) (continue-flags title-movie)) + enter-state + (go target-title) + ) + ((logtest? (-> arg0 flags) (continue-flags intro)) + (pre-intro-play) + ) + ((logtest? (-> arg0 flags) (continue-flags hero-mode)) + (when (string= (-> arg0 name) "intro-start-hero") + (logior! (-> self game secrets) (game-secrets hero-mode)) + (logior! (-> self game purchase-secrets) (game-secrets hero-mode)) + ) + (intro-play) + ) + ((logtest? (-> arg0 flags) (continue-flags warp-gate)) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 0.05)) + (suspend) + ) + ) + (let ((s5-1 (new 'static 'vector)) + (a2-0 (find-nearest-entity (-> arg0 trans) warp-gate)) + ) + (when a2-0 + (set! (-> s5-1 quad) (-> a2-0 extra trans quad)) + (+! (-> s5-1 y) 9011.2) + (go target-warp-in s5-1 (-> arg0 trans)) + ) + ) + ) + ((logtest? (continue-flags pilot-dax) (-> arg0 flags)) + (go target-indax-start (the-as handle #f) (if (logtest? (continue-flags cf27) (-> arg0 flags)) + 'hang + #t + ) + ) + ) + ((logtest? (continue-flags cf23) (-> arg0 flags)) + (go target-flut-start (the-as handle #f) 'normal -1) + ) + ((logtest? (continue-flags cf24) (-> arg0 flags)) + (go target-flut-start (the-as handle #f) 'racer -1) + ) + ((logtest? (continue-flags cf28) (-> arg0 flags)) + (go target-flut-start (the-as handle #f) 'fight -1) + ) + ((logtest? (continue-flags cf31) (-> arg0 flags)) + (send-event self 'get-pickup (pickup-type eco-pill-light) 100.0) + (case (-> arg0 vehicle-type) + ((38) + (go target-lightjak-get-on (lightjak-stage ls0 ls2 swoop ls7)) + ) + (else + (go target-lightjak-get-on (lightjak-stage ls0 ls2 ls7)) + ) + ) + ) + ((logtest? (-> arg0 flags) (continue-flags demo-movie)) + (send-event self 'get-pickup (pickup-type eco-pill-dark) 100.0) + (go target-darkjak-get-on (darkjak-stage force-on bomb0 ds9)) + ) + ((logtest? (continue-flags cf25) (-> arg0 flags)) + (label cfg-39) + (let* ((v1-77 (-> arg0 vehicle-type)) + (s5-2 + (cond + ((= v1-77 7) + (process->handle (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 bt-gun-manager)))) + ) + ((= v1-77 14) + (process->handle + (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 scorpion-gun-manager))) + ) + ) + (else + (process->handle (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 target-turret)))) + ) + ) + ) + ) + (when (not (handle->process s5-2)) + (suspend) + (goto cfg-39) + ) + (suspend) + (case (-> arg0 vehicle-type) + ((14) + (send-event (handle->process s5-2) 'restart) + ) + ) + (send-event (handle->process s5-2) 'pickup) + ) + ) + ((logtest? (continue-flags cf30) (-> arg0 flags)) + (label cfg-84) + (let ((gp-1 (process->handle + (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 scorpion-gun-manager))) + ) + ) + ) + (when (not (handle->process gp-1)) + (suspend) + (goto cfg-84) + ) + (suspend) + (send-event (handle->process gp-1) 'restart) + (when (not (send-event (handle->process gp-1) 'pickup)) + (suspend) + 0 + ) + ) + ) + ((logtest? (continue-flags cf29) (-> arg0 flags)) + (label cfg-114) + (let ((gp-2 (process->handle (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 htorpedo)))))) + (when (not (handle->process gp-2)) + (suspend) + (goto cfg-114) + ) + (suspend) + (set-blackout-frames (seconds 10)) + (send-event self 'change-mode 'pilot-daxter (handle->process gp-2)) + ) + ) + ((logtest? (continue-flags record-sig) (-> arg0 flags)) + (go target-mech-start (the-as handle #f) 100.0 #t) + ) + ((logtest? (continue-flags test) (-> arg0 flags)) + ) + ((logtest? (continue-flags pilot) (-> arg0 flags)) + (case (-> arg0 vehicle-type) + ((41) + (go target-credits 1) + ) + ((42) + (go target-credits 2) + ) + ((43) + (go target-credits 3) + ) + (else + (go target-credits 0) + ) + ) + ) + ((and (logtest? (continue-flags record-path) (-> arg0 flags)) (!= (-> arg0 vehicle-type) 27)) + (set! (-> self mode-cache) (the-as basic 'pilot)) + (set! (-> self mode-param1) (the-as handle #f)) + (set! (-> self mode-param2) (-> arg0 vehicle-type)) + (when (= (-> arg0 vehicle-type) 28) + (let ((v1-172 (cond + ((have-vehicle-v-type? (the-as int (-> self game current-vehicle))) + (the-as int (-> self game current-vehicle)) + ) + ((have-vehicle-v-type? 13) + 13 + ) + ((have-vehicle-v-type? 12) + 12 + ) + ((have-vehicle-v-type? 14) + 14 + ) + ((have-vehicle-v-type? 15) + 15 + ) + ) + ) + ) + (set! (-> self mode-param2) (the-as uint v1-172)) + ) + ) + (set! (-> self mode-param3) (the-as uint #t)) + ) + ((logtest? (-> arg0 flags) (continue-flags demo-end)) + (go target-grab 'stance) + ) + (else + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 0.05)) + (suspend) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior apply-pos-from-entity target ((arg0 continue-point)) + (local-vars (sv-1328 collide-query)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s1-0 (entity-by-name (the-as string (-> arg0 on-goto))))) + (cond + (s1-0 + (entity-birth-no-kill s1-0) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'apply-pos-from-entity) + (let ((t9-2 send-event-function) + (v1-2 s1-0) + ) + (t9-2 + (if v1-2 + (-> v1-2 extra process) + ) + a1-0 + ) + ) + ) + (let ((s0-0 (-> s1-0 extra perm))) + (logior! (-> s0-0 status) (entity-perm-status bit-5)) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'matrix)) + ) + (set! (-> s2-0 x) (* 4096.0 (the float (-> s0-0 user-int16 0)))) + (set! (-> s2-0 y) (-> s1-0 extra trans y)) + (set! (-> s2-0 z) (* 4096.0 (the float (-> s0-0 user-int16 1)))) + (set! sv-1328 (new 'stack-no-clear 'collide-query)) + (set-vector! (-> sv-1328 move-dist) 0.0 -204800.0 0.0 1.0) + (set! (-> sv-1328 start-pos quad) (-> s2-0 quad)) + (+! (-> sv-1328 start-pos y) 102400.0) + (let ((v1-20 sv-1328)) + (set! (-> v1-20 radius) 409.6) + (set! (-> v1-20 collide-with) (collide-spec backgnd)) + (set! (-> v1-20 ignore-process0) #f) + (set! (-> v1-20 ignore-process1) #f) + (set! (-> v1-20 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-20 action-mask) (collide-action solid)) + ) + (let ((f0-12 (fill-and-probe-using-line-sphere *collide-cache* sv-1328))) + (cond + ((>= f0-12 0.0) + (let ((v1-22 s2-0)) + (let ((a0-15 (-> sv-1328 start-pos))) + (let ((a1-3 (-> sv-1328 move-dist))) + (let ((a2-0 f0-12)) + (.mov vf7 a2-0) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> a0-15 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-22 quad) vf6) + ) + (set! (-> s2-0 y) (+ 4096.0 (-> s2-0 y))) + ) + (else + (format 0 "failed to find gem ground on pos-from-entity~%") + ) + ) + ) + (set! (-> s3-0 x) (* 4096.0 (the float (-> s0-0 user-int16 2)))) + (set! (-> s3-0 y) (-> s1-0 extra trans y)) + (set! (-> s3-0 z) (* 4096.0 (the float (-> s0-0 user-int16 3)))) + (let ((s1-1 (new 'stack-no-clear 'collide-query))) + (set-vector! (-> s1-1 move-dist) 0.0 -204800.0 0.0 1.0) + (set! (-> s1-1 start-pos quad) (-> s3-0 quad)) + (+! (-> s1-1 start-pos y) 102400.0) + (let ((v1-33 s1-1)) + (set! (-> v1-33 radius) 409.6) + (set! (-> v1-33 collide-with) (collide-spec backgnd)) + (set! (-> v1-33 ignore-process0) #f) + (set! (-> v1-33 ignore-process1) #f) + (set! (-> v1-33 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-33 action-mask) (collide-action solid)) + ) + (let ((f0-27 (fill-and-probe-using-line-sphere *collide-cache* s1-1))) + (cond + ((>= f0-27 0.0) + (let ((a0-26 s3-0)) + (let ((v1-35 (-> s1-1 start-pos))) + (let ((a1-6 (-> s1-1 move-dist))) + (let ((a2-1 f0-27)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-6 quad)) + ) + (.lvf vf4 (&-> v1-35 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-26 quad) vf6) + ) + (set! (-> s3-0 y) (+ 4096.0 (-> s3-0 y))) + ) + (else + (format 0 "failed to find jak ground on pos-from-entity~%") + ) + ) + ) + ) + (set! (-> arg0 trans quad) (-> s3-0 quad)) + (vector-! s4-0 s3-0 s2-0) + (set! (-> s4-0 y) 16384.0) + (vector+! (-> arg0 camera-trans) s4-0 s3-0) + (vector-negate! s4-0 s4-0) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (let ((s3-1 (new 'stack-no-clear 'quaternion))) + (quaternion-from-two-vectors! s3-1 (new 'static 'vector :z 1.0) s4-0) + (quaternion->matrix s5-0 s3-1) + (set-vector! + (-> arg0 quat) + (the int (* 32767.0 (-> s3-1 x))) + (the int (* 32767.0 (-> s3-1 y))) + (the int (* 32767.0 (-> s3-1 z))) + (the int (* 32767.0 (-> s3-1 w))) + ) + ) + (set! (-> arg0 camera-rot 0) (the int (* 32767.0 (-> s5-0 rvec x)))) + (set! (-> arg0 camera-rot 1) (the int (* 32767.0 (-> s5-0 rvec y)))) + (set! (-> arg0 camera-rot 2) (the int (* 32767.0 (-> s5-0 rvec z)))) + (set! (-> arg0 camera-rot 3) (the int (* 32767.0 (-> s5-0 uvec x)))) + (set! (-> arg0 camera-rot 4) (the int (* 32767.0 (-> s5-0 uvec y)))) + (set! (-> arg0 camera-rot 5) (the int (* 32767.0 (-> s5-0 uvec z)))) + (set! (-> arg0 camera-rot 6) (the int (* 32767.0 (-> s5-0 fvec x)))) + (set! (-> arg0 camera-rot 7) (the int (* 32767.0 (-> s5-0 fvec y)))) + (set! (-> arg0 camera-rot 8) (the int (* 32767.0 (-> s5-0 fvec z)))) + ) + ) + (let ((t9-11 quaternion-copy!) + (a0-46 (-> self control quat-for-control)) + (a1-12 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> a1-12 x) (* 0.00003051851 (the float (-> arg0 quat x)))) + (set! (-> a1-12 y) (* 0.00003051851 (the float (-> arg0 quat y)))) + (set! (-> a1-12 z) (* 0.00003051851 (the float (-> arg0 quat z)))) + (set! (-> a1-12 w) (* 0.00003051851 (the float (-> arg0 quat w)))) + (t9-11 a0-46 a1-12) + ) + (move-to-point! (-> self control) (-> arg0 trans)) + (rot->dir-targ! (-> self control)) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + ) + (else + (format 0 "ERROR: failed to find '~S' for pos-from-entity~%" (-> arg0 on-goto)) + ) + ) + ) + (none) + ) + ) + +(defbehavior target-continue-init-art target () + (let ((a1-0 (target-skel-group)) + (gp-0 (new 'stack-no-clear 'lod-set)) + ) + (setup-lods! gp-0 a1-0 (-> self draw art-group) (-> self entity)) + (lods-assign! (-> self draw) gp-0) + ) + (let ((gp-1 (target-skel-group))) + (when (-> gp-1 clothing) + (when (not (-> self draw cloth-instances)) + (set! (-> self draw cloth-instances) (new 'process 'boxed-array cloth-on-skeleton (-> gp-1 clothing length))) + (set! (-> self draw cloth-instances length) (-> self draw cloth-instances allocated-length)) + (dotimes (s5-0 (-> gp-1 clothing length)) + (set! (-> self draw cloth-instances s5-0) (new 'process 'cloth-on-skeleton)) + ) + ) + (case (-> self ext-geo) + (((target-geo jakc)) + (dotimes (s5-1 (-> gp-1 clothing length)) + (cloth-base-method-10 (-> self draw cloth-instances s5-1) (-> gp-1 clothing s5-1) (process->handle self)) + (logior! (-> self draw cloth-instances s5-1 flags) (cloth-flag need-reset active)) + ) + ) + (else + (dotimes (v1-41 (-> gp-1 clothing length)) + (logclear! (-> self draw cloth-instances v1-41 flags) (cloth-flag active)) + ) + ) + ) + ) + ) + (case (-> self ext-geo) + (((target-geo jakc)) + (set! (-> self draw shadow) + (the-as + shadow-geo + (-> self + draw + art-group + data + (-> (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar-c" (the-as (pointer level) #f))) shadow) + ) + ) + ) + ) + (((target-geo jakb)) + (set! (-> self draw shadow) + (the-as + shadow-geo + (-> self + draw + art-group + data + (-> (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar-normal" (the-as (pointer level) #f))) + shadow + ) + ) + ) + ) + ) + (else + (set! (-> self draw shadow) #f) + ) + ) + 0 + (none) + ) + +(defstate target-continue (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (case message + (('change-mode) + (case (-> block param 0) + (('grab 'look-around) + #f + ) + (else + (set! (-> self mode-cache) (the-as basic (-> block param 0))) + (set! (-> self mode-param1) (if (>= argc 2) + (process->handle (the-as process (-> block param 1))) + (the-as handle #f) + ) + ) + (set! (-> self mode-param2) (-> block param 2)) + (set! v0-0 (-> block param 3)) + (set! (-> self mode-param3) (the-as uint v0-0)) + v0-0 + ) + ) + ) + (('want-continue) + (set! v0-0 (-> block param 0)) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :exit (behavior () + (set! (-> *level* camera-pos 0 quad) (-> (camera-pos) quad)) + (set! (-> *level* camera-pos 1 quad) (-> *level* camera-pos 0 quad)) + (set! (-> *level* target-pos 0 quad) (-> (target-pos 0) quad)) + (set! (-> *level* target-pos 1 quad) (-> *level* target-pos 0 quad)) + (set! (-> *setting-control* user-default border-mode) (-> *level* play?)) + (set! (-> *setting-control* user-default region-mode) #t) + (kill-persister *setting-control* (the-as engine-pers 'title-control) 'render) + (let ((v1-16 (-> self control root-prim))) + (set! (-> v1-16 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-16 prim-core collide-with) (-> self control backup-collide-with)) + ) + (remove-setting! 'allow-pause) + (remove-setting! 'allow-progress) + (remove-setting! 'allow-timeout) + (remove-setting! 'bg-a) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) + (remove-setting! 'ambient-volume) + (remove-setting! 'music) + (remove-setting! 'region-mode) + (remove-setting! 'border-mode) + (remove-setting! 'allow-continue) + (remove-setting! 'level-trans-time) + (remove-setting! 'speech-control) + (apply-settings *setting-control*) + (logclear! (-> self focus-status) (focus-status teleporting)) + (set! (-> self mode-cache) #f) + (set-time! (-> self teleport-time)) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (set! (-> self game kiosk-timeout) (-> *display* game-clock frame-counter)) + 0 + ) + :code (behavior ((arg0 continue-point)) + (local-vars (v1-126 symbol)) + (set! (-> self control mod-surface) *empty-mods-allow-gun*) + (let ((v1-2 (-> self control root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (set! *spawn-actors* #f) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self mode-cache) #f) + (set-time! (-> self state-time)) + (logior! (-> self focus-status) (focus-status teleporting)) + (let ((a0-4 (get-continue-by-name (-> self game) (-> arg0 name)))) + (cond + (a0-4 + (set! (-> self game last-continue) a0-4) + ) + ((string= (-> arg0 name) "default") + ) + (else + (format 0 "ERROR: TARGET: attempting to goto continue ~A which is not in level-info~%" (-> arg0 name)) + ) + ) + ) + (if (-> *art-control* reserve-buffer) + (reserve-free *art-control* (-> *art-control* reserve-buffer heap)) + ) + (kill-persister *setting-control* (the-as engine-pers 'fail) 'bg-a) + (kill-persister *setting-control* (the-as engine-pers 'fail-sfx-volume) 'sfx-volume) + (kill-persister *setting-control* (the-as engine-pers 'fail-dialog-volume) 'dialog-volume) + (kill-persister *setting-control* (the-as engine-pers 'fail-music-volume) 'music-volume) + (when (-> *setting-control* user-current render) + (when (not (logtest? (continue-flags no-blackout cf26) (-> arg0 flags))) + (add-setting! 'bg-a 'abs 1.0 0) + (set! (-> *setting-control* user-current bg-a) 1.0) + ) + ) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + (set-setting! 'dialog-volume 'abs 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'region-mode #f 0.0 0) + (set-setting! 'border-mode #f 0.0 0) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'speech-control #f 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'level-trans-time #f 0.0 0) + (kill-persister *setting-control* (the-as engine-pers 'speech-control) 'speech-control) + (when (logtest? (continue-flags cf27) (-> arg0 flags)) + (set-setting! 'head-offset 'abs (meters 1) 0) + (set-setting! 'foot-offset 'abs (meters -1) 0) + (set-setting! 'target-height 'abs (meters 1.5) 0) + (logior! (-> self target-flags) (target-flags tf26)) + ) + (set! (-> *setting-control* user-default border-mode) #f) + (apply-settings *setting-control*) + (reset-target-state #t) + (target-exit) + (logior! (-> self focus-status) (focus-status teleporting)) + (ja-channel-set! 0) + (set! (-> self control mod-surface) *empty-mods-allow-gun*) + (let ((t9-29 quaternion-copy!) + (a0-39 (-> self control quat-for-control)) + (a1-25 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> a1-25 x) (* 0.00003051851 (the float (-> arg0 quat x)))) + (set! (-> a1-25 y) (* 0.00003051851 (the float (-> arg0 quat y)))) + (set! (-> a1-25 z) (* 0.00003051851 (the float (-> arg0 quat z)))) + (set! (-> a1-25 w) (* 0.00003051851 (the float (-> arg0 quat w)))) + (t9-29 a0-39 a1-25) + ) + (move-to-point! (-> self control) (-> arg0 trans)) + (rot->dir-targ! (-> self control)) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-reset! (-> self control transv)) + (if (not (string= (-> arg0 name) "default")) + (set! *external-cam-mode* #f) + ) + (if (not (logtest? (-> arg0 flags) (continue-flags no-blackout))) + (cam-stop) + ) + (suspend) + (let ((a0-47 (lookup-level-info (-> arg0 vis-nick)))) + (set! (-> *load-state* vis-nick) (if a0-47 + (-> a0-47 name) + ) + ) + ) + (dotimes (v1-104 10) + (cond + ((< v1-104 (-> arg0 want-count)) + (set! (-> *load-state* want v1-104 name) (-> arg0 want v1-104 name)) + (set! (-> *load-state* want v1-104 display?) (-> arg0 want v1-104 display?)) + ) + (else + (set! (-> *load-state* want v1-104 name) #f) + (set! (-> *load-state* want v1-104 display?) #f) + ) + ) + (set! (-> *load-state* want v1-104 force-vis?) #f) + (set! (-> *load-state* want v1-104 force-inside?) #f) + ) + (dotimes (v1-107 3) + (set! (-> *load-state* want-sound v1-107 name) (-> arg0 want-sound v1-107)) + (set! (-> *load-state* want-sound v1-107 mode) (the-as uint 1)) + ) + (load-state-method-21 *load-state*) + (when (not (string= (-> arg0 name) "default")) + (while (begin + (dotimes (s5-0 (-> arg0 want-count)) + (when (not (or (not (-> arg0 want s5-0 name)) + (not (-> arg0 want s5-0 display?)) + (let* ((a0-73 *level*) + (t9-37 (method-of-object a0-73 level-group-method-26)) + (a1-44 (-> arg0 want s5-0 name)) + ) + (= (t9-37 a0-73 a1-44) 'active) + ) + ) + ) + (set! v1-126 #t) + (goto cfg-53) + ) + ) + (let ((s5-1 *load-state*)) + (dotimes (s4-0 10) + (when (not (or (not (-> s5-1 want s4-0 name)) + (not (-> s5-1 want s4-0 display?)) + (let* ((a0-75 *level*) + (t9-38 (method-of-object a0-75 level-group-method-26)) + (a1-45 (-> s5-1 want s4-0 name)) + ) + (= (t9-38 a0-75 a1-45) 'active) + ) + ) + ) + (set! v1-126 #t) + (goto cfg-53) + ) + ) + ) + (set! v1-126 #f) + (label cfg-53) + v1-126 + ) + (suspend) + ) + ) + (if (logtest? (-> arg0 flags) (continue-flags copy-entity-pos)) + (apply-pos-from-entity arg0) + ) + (while (!= (-> self ext-geo) (-> self pending-ext-geo)) + (let ((s5-2 (-> self ext-geo-control))) + (when (not (or (= (-> s5-2 status) 'initialize) (= (-> self ext-geo) (target-geo none)))) + (unload-from-heap *anim-manager* (-> s5-2 heap)) + (unlink-shaders-in-heap *texture-page-dir* (-> s5-2 heap)) + ) + (case (-> self pending-ext-geo) + (((target-geo jakb) (target-geo jakb-old) (target-geo jakc)) + (set-pending-file s5-2 "jak-external" (the-as int (-> self pending-ext-geo)) (process->handle self) 0.0) + ) + (else + (set-pending-file s5-2 (the-as string #f) 0 (process->handle self) 0.0) + ) + ) + (if (= (-> s5-2 status) 'active) + (set! (-> self ext-geo) (the-as target-geo (-> s5-2 load-file-part))) + (set! (-> self ext-geo) (target-geo none)) + ) + (update s5-2) + ) + (suspend) + 0 + ) + (when (logtest? (continue-flags pilot-dax) (-> arg0 flags)) + (while (!= (-> self ext-anim) (-> self pending-ext-anim)) + (suspend) + ) + ) + (target-continue-init-art) + (remove-setting! 'music) + (remove-setting! 'music-volume) + (let ((s5-3 (-> *level* border?))) + (set! (-> *level* border?) (-> *level* play?)) + (set-setting! 'allow-continue #t 0.0 0) + (set-setting! 'border-mode #t 0.0 0) + (apply-settings *setting-control*) + (script-eval '(teleport)) + (script-eval (the-as pair (-> arg0 on-goto))) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'border-mode #f 0.0 0) + (apply-settings *setting-control*) + (set! (-> *level* border?) s5-3) + ) + (set! (-> *ACTOR-bank* birth-max) 1000) + (when (not (logtest? (-> arg0 flags) (continue-flags no-blackout))) + (new 'stack 'transformq) + (cam-start #t) + (suspend) + (when (not (string= (-> arg0 name) "default")) + (set! (-> *camera-combiner* trans quad) (-> arg0 camera-trans quad)) + (let ((s5-4 (-> *camera-combiner* inv-camera-rot)) + (s4-1 (-> arg0 camera-rot)) + ) + (matrix-identity! s5-4) + (set! (-> s5-4 rvec x) (* 0.00003051851 (the float (-> s4-1 0)))) + (set! (-> s5-4 rvec y) (* 0.00003051851 (the float (-> s4-1 1)))) + (set! (-> s5-4 rvec z) (* 0.00003051851 (the float (-> s4-1 2)))) + (set! (-> s5-4 uvec x) (* 0.00003051851 (the float (-> s4-1 3)))) + (set! (-> s5-4 uvec y) (* 0.00003051851 (the float (-> s4-1 4)))) + (set! (-> s5-4 uvec z) (* 0.00003051851 (the float (-> s4-1 5)))) + (set! (-> s5-4 fvec x) (* 0.00003051851 (the float (-> s4-1 6)))) + (set! (-> s5-4 fvec y) (* 0.00003051851 (the float (-> s4-1 7)))) + (set! (-> s5-4 fvec z) (* 0.00003051851 (the float (-> s4-1 8)))) + ) + ) + (cam-master-activate-slave #t) + ) + (send-event self 'level-enter (-> arg0 level)) + (dotimes (v1-242 (-> *level* length)) + (let ((a0-120 (-> *level* level v1-242))) + (if (= (-> a0-120 status) 'active) + (set! (-> a0-120 all-visible?) 'loading) + ) + ) + ) + (let ((s5-5 (level-get *level* (-> arg0 level)))) + (when s5-5 + (while (and (-> *level* vis?) (-> s5-5 vis-info 0) (= (-> s5-5 all-visible?) 'loading)) + (suspend) + ) + ) + ) + (set! *spawn-actors* #t) + (set! *teleport* #t) + (set! (-> *ACTOR-bank* birth-max) 1000) + (if (not (logtest? (continue-flags no-blackout cf26) (-> arg0 flags))) + (set-blackout-frames (seconds 0.1)) + ) + (let* ((a0-128 *game-info*) + (t9-66 (method-of-object a0-128 set-continue!)) + (a1-70 (the-as basic (-> self control unknown-spool-anim00))) + ) + (set! a1-70 (cond + ((the-as spool-anim a1-70) + (empty) + a1-70 + ) + (else + arg0 + ) + ) + ) + (t9-66 a0-128 a1-70 #f) + ) + (arrive-at-continue arg0) + (let* ((a0-130 *game-info*) + (t9-68 (method-of-object a0-130 set-continue!)) + (a1-71 (the-as basic (-> self control unknown-spool-anim00))) + ) + (set! a1-71 (cond + ((the-as spool-anim a1-71) + (empty) + a1-71 + ) + (else + arg0 + ) + ) + ) + (t9-68 a0-130 a1-71 #f) + ) + (when *auto-continue* + (let ((gp-1 (next-continue arg0))) + (when gp-1 + (format 0 "~A ~A ~A~%" (-> gp-1 level) (-> gp-1 name) gp-1) + (inspect global) + (process-spawn-function process (lambda ((arg0 continue-point)) (start 'play arg0)) gp-1) + ) + ) + ) + (when (not (-> *setting-control* user-current render)) + (set-setting! 'bg-a 'abs 1.0 0) + (apply-settings *setting-control*) + (while (!= (-> *setting-control* user-current bg-a) 1.0) + (suspend) + ) + (set-blackout-frames (seconds 0.1)) + (kill-persister *setting-control* (the-as engine-pers 'title-control-scene) 'render) + ) + (ja-channel-set! 1) + (ja :group! jakb-stance-loop-ja) + (suspend) + (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (when (-> self mode-cache) + (set! (-> self event-hook) target-standard-event-handler) + (send-event + self + 'change-mode + (-> self mode-cache) + (handle->process (-> self mode-param1)) + (-> self mode-param2) + (-> self mode-param3) + ) + (set! (-> self mode-cache) #f) + ) + (go target-stance) + ) + :post target-no-move-post + ) + +(define *smack-mods* (new 'static 'surface + :name 'jump + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 131072.0 + :tiltvvf 15.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (when (= arg3 1) + (let ((f30-0 (-> self control unknown-floatiujh1bnb2n3i1)) + (f28-0 (-> self control force-turn-to-strength)) + ) + (set! (-> arg0 seek0) (lerp (-> arg0 seek0) 409600.0 f28-0)) + (set! (-> arg0 seek90) (lerp (-> arg0 seek90) 409600.0 f28-0)) + (set! (-> arg0 seek180) (lerp (-> arg0 seek180) 409600.0 f28-0)) + (set! (-> arg0 target-speed) (lerp (-> arg0 target-speed) f30-0 f28-0)) + (set! (-> arg0 transv-max) (lerp (-> arg0 transv-max) f30-0 f28-0)) + ) + ) + ) + :mode 'air + :flags (surface-flag air gun-inactive gun-no-twist) + ) + ) + +(define *smack-up-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvf 30.0 + :turnvv 32768.0 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 131072.0 + :tiltvvf 15.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (when (= arg3 1) + (let ((f30-0 (-> self control unknown-floatiujh1bnb2n3i1)) + (f28-0 (-> self control force-turn-to-strength)) + ) + (set! (-> arg0 seek0) (lerp (-> arg0 seek0) 409600.0 f28-0)) + (set! (-> arg0 seek90) (lerp (-> arg0 seek90) 409600.0 f28-0)) + (set! (-> arg0 seek180) (lerp (-> arg0 seek180) 409600.0 f28-0)) + (set! (-> arg0 target-speed) (lerp (-> arg0 target-speed) f30-0 f28-0)) + (set! (-> arg0 transv-max) (lerp (-> arg0 transv-max) f30-0 f28-0)) + ) + ) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad air gun-inactive gun-no-twist) + ) + ) + +(defbehavior velocity-set-to-target! target ((arg0 vector) (arg1 float) (arg2 attack-info)) + (let* ((v1-1 (-> self control trans)) + (gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 v1-1)) + ) + (set! (-> gp-1 y) 0.0) + (set! (-> self control force-turn-to-direction quad) (-> gp-1 quad)) + (vector-xz-normalize! (-> self control force-turn-to-direction) 1.0) + (set! (-> self control force-turn-to-speed) 1.0) + (set! (-> self control unknown-floatiujh1bnb2n3i1) arg1) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> arg2 control))) + gp-1 + ) + ) + +(defbehavior target-hit-effect target ((arg0 attack-info)) + (cond + ((logtest? (-> *part-group-id-table* 10 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) + (-> (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) + (-> arg0 intersection) + (the-as vector (-> self control root-prim prim-core)) + ) + ) + quad + ) + ) + (let ((s5-0 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-0 + (let ((t9-1 (method-of-type part-tracker-subsampler activate))) + (t9-1 (the-as part-tracker-subsampler s5-0) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-2 run-function-in-process) + (a0-9 s5-0) + (a1-2 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 10)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-2) a0-9 a1-2 *part-tracker-subsampler-params-default*) + ) + (-> s5-0 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) + (-> (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) + (-> arg0 intersection) + (the-as vector (-> self control root-prim prim-core)) + ) + ) + quad + ) + ) + (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-1 + (let ((t9-4 (method-of-type part-tracker activate))) + (t9-4 (the-as part-tracker s5-1) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-5 run-function-in-process) + (a0-18 s5-1) + (a1-5 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 10)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-5) a0-18 a1-5 *part-tracker-params-default*) + ) + (-> s5-1 ppointer) + ) + ) + ) + ) + (let ((v1-32 (-> arg0 mode))) + (cond + ((or (= v1-32 'endlessfall) (= v1-32 'instant-death) (= v1-32 'crush) (= v1-32 'tentacle)) + ) + ((begin + (target-timed-invulnerable (-> arg0 invinc-time) self 1) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.5)) + (focus-test? self indax) + ) + (let* ((v1-38 (rand-vu-int-count 4)) + (t0-0 (cond + ((zero? v1-38) + "ds176" + ) + ((= v1-38 1) + "ds177" + ) + ((= v1-38 2) + "ds178" + ) + (else + "ds179" + ) + ) + ) + ) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) t0-0 -99.0 0) + ) + ) + (sound-params-set! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2 -1.0) + ) + (else + (case (-> arg0 angle) + (('up) + (sound-play "hit-up") + ) + (else + (sound-play "oof") + ) + ) + ) + ) + ) + (let ((v1-50 (-> arg0 mode))) + (cond + ((or (= v1-50 'burn) (or (= v1-50 'burnup) (= v1-50 'lava) (= v1-50 'melt) (= v1-50 'fry) (= v1-50 'slime))) + (if (not (handle->process (-> self burn-proc))) + (set! (-> self burn-proc) (ppointer->handle (process-spawn-function + process + process-drawable-burn-effect + 1200 + :to (if (focus-test? self indax) + (ppointer->process (-> self sidekick)) + self + ) + ) + ) + ) + ) + ) + ((= v1-50 'tar) + (sound-play "get-burned") + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-hit-push target ((arg0 vector) (arg1 matrix) (arg2 float) (arg3 float) (arg4 attack-info)) + (case (-> arg4 mode) + (('shock 'shockup 'shock-red 'shock-green) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.03)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (send-event self 'color-effect 'shock (seconds 0.2)) + (case (-> arg4 mode) + (('shock-red) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 3) + lightning-probe-callback + (the-as sparticle-launcher #f) + 0 + 0 + 40960.0 + ) + ) + (('shock-green) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 4) + lightning-probe-callback + (the-as sparticle-launcher #f) + 0 + 0 + 40960.0 + ) + ) + (else + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) + ) + ) + ) + (case (-> arg4 angle) + (('jump 'up 'up-forward) + (when (and (not (focus-test? self flut pilot mech indax)) + (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health)))) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #f)) + (go target-attack-air #f) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) + (and (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + ) + (go + target-flop + 65502.96 + -163840.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + 'flop + ) + ) + ) + ) + ) + (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (and (time-elapsed? (-> self state-time) (the-as time-frame (-> *TARGET-bank* stuck-time))) + (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) + ) + ) + #t + ) + (logior! (-> self control status) (collide-status on-surface)) + (return 'stuck) + ) + (let ((s1-0 (new-stack-vector0))) + (set! (-> s1-0 z) arg2) + (vector-matrix*! s1-0 s1-0 arg1) + (vector+! s1-0 s1-0 arg0) + (cond + ((< (vector-vector-distance arg0 s1-0) (fabs (-> arg4 dist))) + (velocity-set-to-target! s1-0 (fabs arg3) arg4) + #t + ) + (else + (set! (-> self control unknown-floatiujh1bnb2n3i1) 0.0) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> arg4 control))) + #f + ) + ) + ) + ) + +(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) (attack-mask vector)) + (!= (-> arg0 shove-back) 0.0) + ) + (forward-up-nopitch->quaternion (-> self control dir-targ) arg1 (-> self control dynam gravity-normal)) + ) + (case (-> arg0 angle) + (('back 'air) + (set! s5-0 #t) + ) + (('up-forward) + (set! (-> self control mod-surface) *smack-up-mods*) + ) + (('front) + (if (and (logtest? (-> arg0 mask) (attack-mask vector)) (!= (-> arg0 shove-back) 0.0)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-negate! (new 'stack-no-clear 'vector) arg1) + (-> self control dynam gravity-normal) + ) + ) + (set! s5-0 #t) + ) + (('jump) + (set! s5-0 #t) + (set! (-> self control mod-surface) *forward-high-jump-mods*) + ) + ) + s5-0 + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior target-hit-setup-anim target ((arg0 attack-info)) + (let ((v1-0 (-> arg0 angle))) + (cond + ((= v1-0 'back) + (let ((v1-3 (ja-group))) + (when (not (and v1-3 (= v1-3 jakb-hit-from-back-ja))) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-hit-from-back-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-from-back-ja :num! min) + ) + ) + ) + ((= v1-0 'lava) + (let ((v1-19 (ja-group))) + (when (not (and v1-19 (= v1-19 jakb-hit-elec-ja))) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-elec-ja :num! min) + ) + ) + ) + ((or (= v1-0 'up) (= v1-0 'up-forward) (= v1-0 'lava)) + (let ((v1-28 (ja-group))) + (when (not (and v1-28 (= v1-28 jakb-hit-up-ja))) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-up-ja :num! min) + ) + ) + ) + ((or (= v1-0 'air) (= v1-0 'jump)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-jump-ja :num! (seek!) :frame-num 0.0) + (when (= (-> arg0 angle) 'air) + (sound-play "smack-surface") + (do-effect (-> self skel effect) (the-as symbol "group-smack-surface") 0.0 6) + (do-effect (-> self skel effect) (the-as symbol "group-smack-surface-dizzy") 0.0 9) + ) + ) + ((= v1-0 'shove) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-smack-surface-ja :num! (seek!) :frame-num 0.0) + (sound-play "smack-surface") + ) + ((rand-vu-percent? 0.5) + (let ((v1-77 (ja-group))) + (when (not (and v1-77 (= v1-77 jakb-hit-from-front-alt1-ja))) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-hit-from-front-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-from-front-alt1-ja :num! min) + ) + ) + ) + (else + (let ((v1-93 (ja-group))) + (when (not (and v1-93 (= v1-93 jakb-hit-from-front-ja))) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-hit-from-front-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-from-front-ja :num! min) + ) + ) + ) + ) + ) + (none) + ) + +(defbehavior target-hit-move target ((arg0 attack-info) (arg1 symbol) (arg2 (function none :behavior target)) (arg3 float)) + (local-vars (v1-29 symbol) (s1-1 symbol)) + (vector-identity! (-> self control transv)) + (let ((v1-1 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-1 (-> self control transv) (vector-float*! v1-1 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f0-2 (vector-length v1-1)) + (f1-1 f0-2) + (f2-1 (+ 2048.0 (sqrtf (* 491520.0 (-> arg0 shove-up))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) + (vector-float*! v1-1 v1-1 (/ f0-2 f1-1)) + ) + ) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> self control trans quad)) + (let ((s2-1 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (+ 32768.0 (vector-y-angle (-> arg0 vector))))) + (f30-1 0.0) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + #t + (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (ja-group) frames num-frames) -1)) (ja-step 0)))))) + (until v1-29 + (+! f30-1 (* (-> arg0 shove-back) f28-1 (seconds-per-frame))) + (set! s1-1 (target-hit-push s3-0 s2-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) + (suspend) + (ja :num! (seek!)) + (set! v1-29 (or (ja-done? 0) (and arg1 (logtest? (-> self control status) (collide-status on-surface))))) + ) + (while (and (or (not (logtest? (-> self control status) (collide-status on-surface))) s1-1) (!= s1-1 'stuck)) + (arg2) + (+! f30-1 (* (-> arg0 shove-back) f28-1 (seconds-per-frame))) + (set! s1-1 (target-hit-push s3-0 s2-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) + (if (not s1-1) + (logclear! (-> self focus-status) (focus-status hit)) + ) + (suspend) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate target-hit (target) + :event target-standard-event-handler + :exit (behavior () + (let ((v1-0 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-0 (-> self control transv) (vector-float*! v1-0 (-> self control dynam gravity-normal) f0-1)) + (let* ((f2-0 (vector-length v1-0)) + (f1-2 f2-0) + ) + (if (< 40960.0 f2-0) + (set! f2-0 40960.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-1) + (vector-float*! v1-0 v1-0 (/ f2-0 f1-2)) + ) + ) + ) + (when (not (and (-> self next-state) (let ((v1-4 (-> self next-state name))) + (or (= v1-4 'target-death) (= v1-4 'target-hit)) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status dead hit)) + (logclear! (-> self target-flags) (target-flags disable-attacks)) + ) + ((method-of-type focus clear-focused) (the-as focus (-> self gun track-target))) + (target-exit) + ) + :trans (behavior () + (when (= *cheat-mode* 'debug) + (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) + (set-time! (-> self control time-of-last-debug-heal)) + (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) + (go target-stance) + ) + ) + ) + :code (behavior ((arg0 symbol) (arg1 attack-info)) + (local-vars (sv-32 attack-info) (sv-36 vector)) + (logclear! (-> self water flags) (water-flag jump-out)) + (set-time! (-> self state-time)) + (set! (-> self neck flex-blend) 0.0) + (set! sv-32 (-> self attack-info)) + (set! sv-36 (new 'stack-no-clear 'vector)) + (let ((v1-7 sv-32)) + (set! (-> v1-7 attacker) (the-as handle #f)) + (set! (-> v1-7 mode) 'generic) + (set! (-> v1-7 shove-back) 6144.0) + (set! (-> v1-7 shove-up) 4915.2) + (set! (-> v1-7 angle) #f) + (set! (-> v1-7 trans quad) (-> self control trans quad)) + (set! (-> v1-7 control) 0.0) + (set! (-> v1-7 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout)) + (set! (-> v1-7 damage) (-> *FACT-bank* health-default-inc)) + ) + (case arg0 + (('shove) + (let ((v1-10 sv-32)) + (set! (-> v1-10 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-10 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-10 angle) 'shove) + ) + ) + ) + (let ((v1-13 (if (logtest? (-> arg1 mask) (attack-mask mode)) + (-> arg1 mode) + 'generic + ) + ) + ) + (when (or (= v1-13 'lava) (or (= v1-13 'melt) (= v1-13 'fry) (= v1-13 'slime))) + (let ((v1-16 sv-32)) + (set! (-> v1-16 shove-up) 32768.0) + (set! (-> v1-16 angle) 'lava) + (set! (-> v1-16 control) 1.0) + (set! (-> v1-16 damage) 4.0) + ) + ) + ) + (combine! sv-32 arg1 self) + (when (not (logtest? (-> sv-32 mask) (attack-mask vector))) + (vector-z-quaternion! (-> sv-32 vector) (-> self control quat-for-control)) + (vector-xz-normalize! (-> sv-32 vector) (- (fabs (-> sv-32 shove-back)))) + (set! (-> sv-32 vector y) (-> sv-32 shove-up)) + ) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (set! (-> sv-32 damage) (fmax 1.0 (ceil (* 0.5 (-> sv-32 damage))))) + 0 + ) + (set! (-> sv-36 quad) (-> sv-32 vector quad)) + (let ((f0-19 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) sv-36 1.0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-19) + 'front + 'back + ) + ) + ) + ) + (cond + ((= arg0 'attack) + (send-event (handle->process (-> self notify)) 'notify 'hit (-> sv-32 mode)) + (logior! (-> self focus-status) (focus-status hit)) + (set-time! (-> self game hit-time)) + (case (-> sv-32 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((gp-1 (new-stack-vector0))) + (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) + (ja-channel-set! 0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 1)) + (suspend) + ) + ) + (move-to-point! (-> self control) gp-1) + ) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-stance) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (go target-death (-> sv-32 mode)) + ) + ) + ) + (('fry) + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> sv-32 damage)) (the-as handle #f)) + (cond + ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (go target-death (-> sv-32 mode)) + ) + (else + (sound-play "death-melt") + (cond + ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-3 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-3 + (let ((t9-18 (method-of-type part-tracker-subsampler activate))) + (t9-18 + (the-as part-tracker-subsampler gp-3) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-19 run-function-in-process) + (a0-66 gp-3) + (a1-13 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 64)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-19) a0-66 a1-13 *part-tracker-subsampler-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-4 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-4 + (let ((t9-21 (method-of-type part-tracker activate))) + (t9-21 (the-as part-tracker gp-4) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-22 run-function-in-process) + (a0-72 gp-4) + (a1-16 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 64)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-22) a0-72 a1-16 *part-tracker-params-default*) + ) + (-> gp-4 ppointer) + ) + ) + ) + ) + ) + ) + ) + (('lava 'melt 'slime) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (cond + ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (go target-death (-> sv-32 mode)) + ) + (else + (sound-play "death-melt") + (cond + ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-6 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-6 + (let ((t9-28 (method-of-type part-tracker-subsampler activate))) + (t9-28 + (the-as part-tracker-subsampler gp-6) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-29 run-function-in-process) + (a0-89 gp-6) + (a1-23 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 64)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-29) a0-89 a1-23 *part-tracker-subsampler-params-default*) + ) + (-> gp-6 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-7 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-7 + (let ((t9-31 (method-of-type part-tracker activate))) + (t9-31 (the-as part-tracker gp-7) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-32 run-function-in-process) + (a0-95 gp-7) + (a1-26 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 64)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-32) a0-95 a1-26 *part-tracker-params-default*) + ) + (-> gp-7 ppointer) + ) + ) + ) + ) + ) + ) + ) + (('drown-death + 'sharkey + 'dark-eco-pool + 'instant-death + 'crush + 'death + 'grenade + 'bot + 'turret + 'centipede + 'big-explosion + 'tentacle + ) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (if (= (-> self game mode) 'play) + (go target-death (-> sv-32 mode)) + ) + ) + (('explode) + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> sv-32 damage)) (the-as handle #f)) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (go target-death (-> sv-32 mode)) + ) + ) + (('smush) + (case (-> sv-32 angle) + (('front) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-negate! (new 'stack-no-clear 'vector) sv-36) + (-> self control dynam gravity-normal) + ) + ) + (else + (forward-up-nopitch->quaternion (-> self control dir-targ) sv-36 (-> self control dynam gravity-normal)) + ) + ) + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> sv-32 damage)) (the-as handle #f)) + (go target-hit-ground-hard (-> *TARGET-bank* fall-far)) + ) + (('shock 'shock-red 'shock-green) + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> sv-32 damage)) (the-as handle #f)) + (let* ((v1-211 (-> sv-32 mode)) + (gp-9 (cond + ((= v1-211 'shock-red) + (-> *part-group-id-table* 69) + ) + ((= v1-211 'shock-green) + (-> *part-group-id-table* 68) + ) + (else + (-> *part-group-id-table* 67) + ) + ) + ) + ) + (cond + ((logtest? (-> gp-9 flags) (sp-group-flag sp13)) + (let ((s5-5 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-5 + (let ((t9-44 (method-of-type part-tracker-subsampler activate))) + (t9-44 (the-as part-tracker-subsampler s5-5) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-45 run-function-in-process) + (a0-133 s5-5) + (a1-49 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) gp-9) + (set! (-> *part-tracker-subsampler-params-default* duration) (seconds 1)) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 6) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-45) a0-133 a1-49 *part-tracker-subsampler-params-default*) + ) + (-> s5-5 ppointer) + ) + ) + ) + (else + (let ((s5-6 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-6 + (let ((t9-47 (method-of-type part-tracker activate))) + (t9-47 (the-as part-tracker s5-6) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-48 run-function-in-process) + (a0-136 s5-6) + (a1-52 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) gp-9) + (set! (-> *part-tracker-params-default* duration) (seconds 1)) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 6) + ((the-as (function object object object none) t9-48) a0-136 a1-52 *part-tracker-params-default*) + ) + (-> s5-6 ppointer) + ) + ) + ) + ) + ) + (let ((gp-10 (-> self post-hook))) + (set! (-> self control mod-surface) *turn-around-mods*) + (set! (-> self post-hook) target-no-stick-post) + (if (using-gun? self) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-hit-elec-ja) 0.0 30 0 1.0 0.0 #f) + ) + (let ((v1-247 (new-stack-vector0))) + (let ((f0-36 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-247 + (-> self control transv) + (vector-float*! v1-247 (-> self control dynam gravity-normal) f0-36) + ) + ) + (let* ((f0-37 (vector-length v1-247)) + (f1-6 f0-37) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-247 v1-247 (/ f0-37 f1-6)) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-hit-elec-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((v1-263 (new-stack-vector0)) + (f0-44 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-263 + (-> self control transv) + (vector-float*! v1-263 (-> self control dynam gravity-normal) f0-44) + ) + (let* ((f1-9 (vector-length v1-263)) + (f2-1 f1-9) + (f0-45 (+ f0-44 (* 286720.0 (seconds-per-frame)))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-45) + (vector-float*! v1-263 v1-263 (/ f1-9 f2-1)) + ) + ) + ) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.03)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (send-event self 'color-effect 'shock (seconds 0.2)) + (case (-> sv-32 mode) + (('shock-red) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 3) + lightning-probe-callback + (the-as sparticle-launcher #f) + 0 + 0 + 40960.0 + ) + ) + (('shock-green) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 4) + lightning-probe-callback + (the-as sparticle-launcher #f) + 0 + 0 + 40960.0 + ) + ) + (else + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> sv-32 angle) 'back) + (set! (-> self post-hook) gp-10) + ) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> sv-32 damage)) (the-as handle #f)) + ) + ) + (target-hit-effect sv-32) + ) + (else + (case (-> sv-32 mode) + (('burn 'burnup) + (sound-play "get-burned") + ) + ) + ) + ) + (when (and (= (-> self game mode) 'play) (and (>= 0.0 (-> self fact health)) (using-gun? self))) + (send-event (ppointer->process (-> self gun gun)) 'notice 'die) + (target-gun-end-mode #f) + ) + (set! (-> self control mod-surface) *smack-mods*) + (target-hit-setup-anim sv-32) + (target-hit-move sv-32 (target-hit-orient sv-32 sv-36) target-falling-anim-trans 1.0) + (cond + ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (go target-death (-> sv-32 mode)) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (>= 1.0 (-> self fact health))) + (go target-darkjak-get-off) + ) + ((and (and (focus-test? self light) (nonzero? (-> self lightjak))) (>= 1.0 (-> self fact health))) + (go target-lightjak-get-off) + ) + (else + (go target-hit-ground #f) + ) + ) + ) + :post target-post + ) + +(define *death-spool-array* + (new 'static 'boxed-array :type spool-anim + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-06" :anim-name "daxter-death-06" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-13" :anim-name "daxter-death-13" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-14" :anim-name "daxter-death-14" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-16" :anim-name "daxter-death-16" :parts 2 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-17" :anim-name "daxter-death-17" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-20" :anim-name "daxter-death-20" :parts 2 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-21" :anim-name "daxter-death-21" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-24" :anim-name "daxter-death-24" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-31" :anim-name "daxter-death-31" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-35" :anim-name "daxter-death-35" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-38" :anim-name "daxter-death-38" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-57" :anim-name "daxter-death-57" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-58" :anim-name "daxter-death-58" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-61" :anim-name "daxter-death-61" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-07" :anim-name "daxter-death-07" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-10" :anim-name "daxter-death-10" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-12" :anim-name "daxter-death-12" :parts 2 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-18" :anim-name "daxter-death-18" :parts 1 :command-list '()) + ) + ) + +(defun death-movie-remap ((arg0 int) (arg1 int)) + (let ((v1-0 (/ arg0 arg1))) + (mod + (if (not (logtest? v1-0 1)) + (logxor v1-0 arg0) + (logand #xfffffff (- (logxor v1-0 arg0))) + ) + arg1 + ) + ) + ) + +(deftype kill-nearby-enemies-info (basic) + ((dist float) + (pos vector :inline) + ) + ) + + +(define *kill-nearby-enemies-info* (new 'static 'kill-nearby-enemies-info)) + +(defun kill-nearby-enemies ((arg0 vector) (arg1 float)) + (let ((v1-0 *kill-nearby-enemies-info*)) + (set! (-> v1-0 dist) arg1) + (set! (-> v1-0 pos quad) (-> arg0 quad)) + ) + (iterate-process-tree + *entity-pool* + (lambda ((arg0 process-drawable)) + (if (and (logtest? (process-mask enemy) (-> arg0 mask)) + (type? arg0 process-drawable) + (nonzero? (-> arg0 root)) + (>= (-> *kill-nearby-enemies-info* dist) + (vector-vector-distance (-> arg0 root trans) (-> *kill-nearby-enemies-info* pos)) + ) + ) + (process-entity-status! arg0 (entity-perm-status bit-9) #t) + ) + ) + *null-kernel-context* + ) + ) + +(defbehavior target-death-anim-trans target () + (send-event *camera* 'joystick 0.0 -1.0) + (compute-alignment! (-> self align)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (when (not (logtest? (-> self align flags) (align-flags disabled))) + (vector-matrix*! gp-0 (the-as vector (-> self align delta)) (-> self control c-R-w)) + (vector-float*! (-> self control transv) gp-0 (-> self clock frames-per-second)) + ) + ) + 0 + (none) + ) + +(defbehavior target-death-anim target ((arg0 spool-anim)) + (set! (-> self control mod-surface) *neutral-mods*) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-deatha-ja :num! (seek! (ja-aframe 30.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (if arg0 + (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> arg0 name) + 0 + -99.0 + (new 'static 'sound-id) + ) + ) + (target-death-anim-trans) + (suspend) + (ja :num! (seek! (ja-aframe 30.0 0))) + ) + 0 + (none) + ) + +(defbehavior target-death-main target ((arg0 symbol)) + (local-vars (sv-96 level) (sv-112 vector)) + (let ((v1-0 arg0)) + (if (= v1-0 'tar) + (sound-play "death-drown") + ) + ) + (+! (-> *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)) + ) + (+! (-> *game-info* death-movie-tick) 1) + ) + (let ((gp-2 + (-> *death-spool-array* (death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length))) + ) + ) + (if (= arg0 'bot) + (set! gp-2 (the-as spool-anim #f)) + ) + (set-setting! 'allow-progress #f 0.0 0) + (target-death-anim gp-2) + (cond + ((or (not gp-2) + (or (or (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self control status) (collide-status on-water)) + ) + (or (-> *setting-control* user-current spooling) + (let ((v1-31 (file-status *art-control* (-> gp-2 name) 0))) + (or (not (or (= v1-31 'locked) (= v1-31 'active))) + (and (string-prefix= "daxter" (-> gp-2 name)) + (or (not (art-group-get-by-name *level* "daxter-highres" (the-as (pointer level) #f))) + (not (logtest? (logand (game-feature sidekick) (-> *setting-control* user-current features)) + (-> self game features) + ) + ) + (= (-> self control ground-pat material) (pat-material snow)) + (= (-> self control ground-pat material) (pat-material deepsnow)) + ) + ) + ) + ) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (target-death-anim-trans) + (suspend) + (ja-eval) + ) + ) + ((string-prefix= "jak" (-> gp-2 name)) + (set! (-> self spool-anim) gp-2) + (set! (-> self post-hook) (lambda :behavior target () (target-death-anim-trans) (target-no-stick-post))) + (ja-play-spooled-anim + gp-2 + (the-as art-joint-anim jakb-stance-loop-ja) + (the-as art-joint-anim #f) + (the-as (function process-drawable symbol) false-func) + (spooler-flags) + ) + (set-blackout-frames (seconds 0.1)) + (set! (-> self spool-anim) #f) + ) + (else + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> gp-2 name) + 0 + -99.0 + (new 'static 'sound-id) + ) + (target-death-anim-trans) + (suspend) + (ja-eval) + ) + (kill-nearby-enemies (-> *target* control trans) 61440.0) + (set! (-> *ACTOR-bank* birth-max) 1000) + (set! (-> self trans-hook) #f) + (let ((t1-3 #x100000)) + (set-setting! 'features 'clear (shr t1-3 32) t1-3) + ) + (send-event self 'blend-shape #t) + (apply-settings *setting-control*) + (flag-setup) + (set! sv-96 (the-as level #f)) + (art-group-get-by-name *level* "daxter-highres" (new 'stack-no-clear 'array 'level 1)) + (let ((s4-1 (if (and sv-96 (nonzero? (-> sv-96 entity)) (> (-> sv-96 entity length) 0)) + (-> sv-96 entity data 0 entity) + ) + ) + ) + (when s4-1 + (let ((s5-2 (ppointer->handle (process-spawn + pov-camera + (-> self control trans) + (art-group-get-by-name *level* "skel-scenecamera" (the-as (pointer level) #f)) + gp-2 + 12 + self + '() + :name "pov-camera" + :to *target-pool* + ) + ) + ) + ) + (when (handle->process s5-2) + (let* ((s2-1 (get-process *default-dead-pool* manipy #x20000 1)) + (s3-1 + (when s2-1 + (let ((t9-33 (method-of-type manipy activate))) + (t9-33 (the-as manipy s2-1) (handle->process s5-2) "sidekick-highres" (the-as pointer #x70004000)) + ) + (let ((s3-2 run-function-in-process) + (s1-1 s2-1) + (s0-1 manipy-init) + ) + (set! sv-112 (-> self control trans)) + (let ((t0-6 (art-group-get-by-name *level* "skel-sidekick-highres" (the-as (pointer level) #f))) + (t1-5 #f) + (t2-3 0) + ) + ((the-as (function object object object object object object object none) s3-2) + s1-1 + s0-1 + sv-112 + s4-1 + t0-6 + t1-5 + t2-3 + ) + ) + ) + (-> s2-1 ppointer) + ) + ) + ) + (process-spawn-function + process + (lambda :behavior target ((arg0 handle)) (suspend) (send-event (handle->process arg0) 'light-index 240)) + (ppointer->handle s3-1) + :to self + ) + (send-event (ppointer->process s3-1) 'anim-mode 'clone-anim) + (send-event (ppointer->process s3-1) 'blend-shape #t) + ) + (send-event (handle->process s5-2) 'music-movie-volume 0.0) + (send-event (handle->process s5-2) 'sfx-movie-volume 0.5) + (send-event (handle->process s5-2) 'ambient-movie-volume 0.5) + (set! (-> self post-hook) target-no-ja-move-post) + (ja-channel-set! 0) + (while (handle->process s5-2) + (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> gp-2 name) + 0 + -99.0 + (new 'static 'sound-id) + ) + (suspend) + ) + (set-blackout-frames (seconds 0.2)) + (let ((a0-83 (handle->process s5-2))) + (if a0-83 + (deactivate a0-83) + ) + ) + ) + ) + ) + ) + (suspend) + (remove-setting! 'features) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-death-reset target ((arg0 symbol) (arg1 symbol)) + (let ((v1-1 (-> *task-manager-engine* alive-list next0))) + *task-manager-engine* + (let ((s4-0 (-> v1-1 next0))) + (while (!= v1-1 (-> *task-manager-engine* alive-list-end)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'target) + (set! (-> a1-1 param 0) (the-as uint 'die)) + (set! (-> a1-1 param 1) (the-as uint arg0)) + (let ((v1-2 (send-event-function (the-as process-tree (-> (the-as connection v1-1) param1)) a1-1))) + (case v1-2 + (('wait) + (set! arg1 (the-as symbol v1-2)) + ) + ) + ) + ) + (set! v1-1 s4-0) + *task-manager-engine* + (set! s4-0 (-> s4-0 next0)) + ) + ) + ) + (cond + ((= (the-as object arg1) 'wait) + (set! (-> self trans-hook) #f) + (set! (-> self control unknown-word04) (the-as uint #f)) + (when (not (focus-test? self pilot)) + (set! (-> self post-hook) target-no-ja-move-post) + (ja-post) + ) + (while (not (-> self control unknown-spool-anim00)) + (send-event *camera* 'joystick 0.0 -1.0) + (suspend) + ) + ) + (else + (suspend) + 0 + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (initialize! (-> self game) 'life (the-as game-save #f) (the-as string #f) (-> self death-resetter)) + (set-time! (-> self state-time)) + (sleep-code) + 0 + (none) + ) + +(defstate target-death (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (case (-> block param 0) + (('bot 'grab) + (set! (-> self control unknown-word04) (the-as uint #t)) + (if (>= argc 2) + (mem-copy! (the-as pointer (-> self death-resetter)) (the-as pointer (-> block param 1)) 16) + ) + ) + ) + ) + (('change-mode) + (case (-> block param 0) + (('grab) + (case (-> block param 1) + (('dead) + #t + ) + (else + #f + ) + ) + ) + ) + ) + (('notify) + (when (type? proc pov-camera) + (case (-> block param 0) + (('die 'abort-request) + (set! (-> self control unknown-word04) (the-as uint #t)) + (set-blackout-frames (seconds 0.2)) + ) + ) + ) + ) + (('get-pickup) + #f + ) + (('touched) + #f + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :exit (behavior () + (let ((a0-0 (-> self spool-anim))) + (when (and a0-0 (= (-> *setting-control* user-current spooling) (process->ppointer self))) + (ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1) + (ja-channel-set! 1) + (ja :group! jakb-stance-loop-ja :num! min) + ) + ) + (logclear! (-> self focus-status) (focus-status dead hit)) + (logclear! (-> self target-flags) (target-flags disable-attacks)) + (target-exit) + (remove-setting! 'process-mask) + (remove-setting! 'allow-progress) + (remove-setting! 'mode-name) + (let ((v1-20 (-> self control root-prim))) + (set! (-> v1-20 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-20 prim-core collide-with) (-> self control backup-collide-with)) + ) + (set! (-> self control pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :board #x1) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (send-event (ppointer->process (-> self gun gun)) 'reset) + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + :trans (-> target-hit trans) + :code (behavior ((arg0 symbol)) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self control did-move-to-pole-or-max-jump-height) + (the-as float (send-event (handle->process (-> self attack-info attacker)) 'target 'die arg0)) + ) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noendlessfall #x1)) + (target-timed-invulnerable-off self 0) + (let ((s5-0 (-> self child))) + (while s5-0 + (send-event (ppointer->process s5-0) 'notice 'die) + (set! s5-0 (-> s5-0 0 brother)) + ) + ) + (cond + ((-> *setting-control* user-current death-info) + (mem-copy! + (the-as pointer (-> self death-resetter)) + (&-> (-> *setting-control* user-current death-info) node) + 16 + ) + ) + (else + (set! (-> self death-resetter continue) #f) + (set! (-> self death-resetter node) (game-task-node none)) + (set! (-> self death-resetter reset-mode) 'life) + (set! (-> self death-resetter execute) #f) + ) + ) + (let ((v1-29 arg0)) + (cond + ((or (= v1-29 'bot) (or (= v1-29 'centipede) (= v1-29 'tentacle))) + (set-setting! 'process-mask 'set 0.0 (process-mask platform projectile death)) + ) + ((= v1-29 'endlessfall) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy projectile death guard)) + ) + ((or (= v1-29 'instant-death) + (= v1-29 'lava) + (= v1-29 'fry) + (= v1-29 'slime) + (= v1-29 'dark-eco-pool) + (= v1-29 'melt) + (= v1-29 'explode) + (= v1-29 'grenade) + (= v1-29 'big-explosion) + (= v1-29 'turret) + ) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + ) + (else + (let ((v1-38 (-> self water flags))) + (if (or (and (logtest? (water-flag touch-water) v1-38) + (logtest? (water-flag under-water swimming) v1-38) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + (= (-> self control cur-pat material) (pat-material waterbottom)) + ) + (set! arg0 'drown) + ) + ) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death guard)) + (if (using-gun? self) + (target-gun-end-mode #f) + ) + ) + ) + ) + (apply-settings *setting-control*) + (set! (-> self control transv quad) (the-as uint128 0)) + (logior! (-> self focus-status) (focus-status dead)) + (logior! (-> self target-flags) (target-flags disable-attacks)) + (let ((v1-61 arg0)) + (cond + ((or (= v1-61 'none) (= v1-61 'instant-death)) + ) + (else + (b! + (not (or (= v1-61 'dark-eco-pool) (= v1-61 'explode) (= v1-61 'grenade) (= v1-61 'big-explosion))) + cfg-138 + :delay (nop!) + ) + (let ((s5-1 (handle->process (-> self attack-info attacker)))) + (when (if (type? s5-1 water-vol) + s5-1 + ) + (logior! (-> self target-flags) (target-flags tf14)) + (set! (-> self alt-cam-pos y) (+ 4096.0 (-> self water height))) + ) + ) + (set! (-> self control mod-surface) *neutral-mods*) + (case arg0 + (('dark-eco-pool) + (sound-play "death-darkeco") + (cond + ((logtest? (-> *part-group-id-table* 62 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-3 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-3 + (let ((t9-15 (method-of-type part-tracker-subsampler activate))) + (t9-15 + (the-as part-tracker-subsampler s5-3) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-16 run-function-in-process) + (a0-66 s5-3) + (a1-29 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 62)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-16) a0-66 a1-29 *part-tracker-subsampler-params-default*) + ) + (-> s5-3 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-4 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-4 + (let ((t9-18 (method-of-type part-tracker activate))) + (t9-18 (the-as part-tracker s5-4) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-19 run-function-in-process) + (a0-72 s5-4) + (a1-32 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 62)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-19) a0-72 a1-32 *part-tracker-params-default*) + ) + (-> s5-4 ppointer) + ) + ) + ) + ) + (let ((v1-110 (-> self control root-prim))) + (set! (-> v1-110 prim-core collide-as) (collide-spec)) + (set! (-> v1-110 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self post-hook) target-no-ja-move-post) + (ja-channel-set! 0) + (ja-post) + (let ((s5-5 (current-time))) + (until (time-elapsed? s5-5 (seconds 2)) + (suspend) + ) + ) + ) + (('grenade 'big-explosion 'explode) + (set! (-> self post-hook) target-no-stick-post) + (set! (-> self control dynam gravity-max) 294912.0) + (set! (-> self control dynam gravity-length) 294912.0) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (case arg0 + (('big-explosion) + (sound-play "jak-explode") + ) + (else + (sound-play "explosion") + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 65 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-8 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-8 + (let ((t9-27 (method-of-type part-tracker-subsampler activate))) + (t9-27 + (the-as part-tracker-subsampler s5-8) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-28 run-function-in-process) + (a0-92 s5-8) + (a1-41 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 65)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-28) a0-92 a1-41 *part-tracker-subsampler-params-default*) + ) + (-> s5-8 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-9 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-9 + (let ((t9-30 (method-of-type part-tracker activate))) + (t9-30 (the-as part-tracker s5-9) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-31 run-function-in-process) + (a0-98 s5-9) + (a1-44 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 65)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-31) a0-98 a1-44 *part-tracker-params-default*) + ) + (-> s5-9 ppointer) + ) + ) + ) + ) + (set-vector! (-> self control transv) 0.0 65502.96 0.0 1.0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-hit-from-front-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (and (logtest? (-> self control status) (collide-status on-surface)) + (>= 409.6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (goto cfg-122) + ) + (suspend) + (ja :num! (seek!)) + ) + (while (not (or (logtest? (-> self control status) (collide-status on-surface)) + (time-elapsed? (-> self state-time) (seconds 2)) + ) + ) + (suspend) + ) + (label cfg-122) + (when (logtest? (-> self control status) (collide-status on-surface)) + (let ((v1-220 (-> self water flags))) + (b! + (or (and (logtest? (water-flag touch-water) v1-220) + (logtest? (water-flag under-water swimming) v1-220) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + (= (-> self control cur-pat material) (pat-material waterbottom)) + ) + cfg-168 + :delay (nop!) + ) + ) + (set! (-> self post-hook) target-no-move-post) + (let ((v1-232 (-> self control root-prim))) + (set! (-> v1-232 prim-core collide-as) (collide-spec)) + (set! (-> v1-232 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-death-painful-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self control transv quad) (the-as uint128 0)) + (vector-seek! + (-> self draw color-mult) + (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0) + (* 5.0 (seconds-per-frame)) + ) + (suspend) + (ja :num! (seek!)) + ) + (let ((s5-10 (current-time))) + (until (time-elapsed? s5-10 (seconds 2)) + (suspend) + ) + ) + ) + ) + ) + (b! #t cfg-206 :delay (nop!)) + (label cfg-138) + (cond + ((= v1-61 'turret) + (let ((v1-269 (-> self control root-prim))) + (set! (-> v1-269 prim-core collide-as) (collide-spec)) + (set! (-> v1-269 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self post-hook) target-no-ja-move-post) + (ja-channel-set! 0) + (ja-post) + (let ((s5-11 (current-time))) + (until (time-elapsed? s5-11 (seconds 1.2)) + (suspend) + ) + ) + ) + ((= v1-61 'endlessfall) + ((lambda :behavior target + () + (local-vars (v1-24 symbol)) + (sound-play "death-fall") + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) + ) + (sound-params-set! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2 -1.0) + (set-setting! 'mode-name 'cam-endlessfall 0.0 0) + (logclear! (-> self water flags) (water-flag swim-ground)) + (let ((f0-1 (fmin -4096.0 (- (-> self control ground-impact-vel))))) + (set! (-> self control unknown-word04) (the-as uint f0-1)) + (let ((v1-13 (new-stack-vector0))) + (let ((f1-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-13 (-> self control transv) (vector-float*! v1-13 (-> self control dynam gravity-normal) f1-3)) + ) + (let* ((f1-4 (vector-length v1-13)) + (f2-1 f1-4) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-1) + (vector-float*! v1-13 v1-13 (/ f1-4 f2-1)) + ) + ) + ) + ) + (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) + (set! v1-24 'target-hit-ground-hard) + (goto cfg-17) + ) + (target-falling-anim 30 (seconds 0.33)) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.8)) + (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) + (set! v1-24 'target-hit-ground-hard) + (goto cfg-17) + ) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((v1-49 (new-stack-vector0)) + (f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + ) + 0.0 + (vector-! + v1-49 + (-> self control transv) + (vector-float*! v1-49 (-> self control dynam gravity-normal) (the-as float f0-7)) + ) + (let* ((f1-7 (vector-length v1-49)) + (f2-2 f1-7) + ) + (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-7)) + (set! f0-7 (-> self control unknown-word04)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-7)) + (vector-float*! v1-49 v1-49 (/ f1-7 f2-2)) + ) + ) + ) + (ja :group! jakb-launch-jump-loop-ja :num! (loop! 0.5)) + (suspend) + ) + ) + (set! v1-24 #f) + (label cfg-17) + (when (= v1-24 'target-hit-ground-hard) + (set-action! + *gui-control* + (gui-action fade) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> self control mod-surface) *neutral-mods*) + (set! (-> self post-hook) target-no-move-post) + (set! (-> self control transv quad) (the-as uint128 0)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-death-painful-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (vector-seek! (-> self draw color-mult) *identity-vector* (seconds-per-frame)) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 2)) + (suspend) + ) + ) + ) + (remove-setting! 'mode-name) + ) + ) + ) + ((or (= v1-61 'burn) (= v1-61 'burnup)) + (cond + ((logtest? (-> *part-group-id-table* 66 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-12 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-12 + (let ((t9-45 (method-of-type part-tracker-subsampler activate))) + (t9-45 + (the-as part-tracker-subsampler s5-12) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-46 run-function-in-process) + (a0-130 s5-12) + (a1-56 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 66)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-46) a0-130 a1-56 *part-tracker-subsampler-params-default*) + ) + (-> s5-12 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-13 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-13 + (let ((t9-48 (method-of-type part-tracker activate))) + (t9-48 (the-as part-tracker s5-13) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-49 run-function-in-process) + (a0-136 s5-13) + (a1-59 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 66)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-49) a0-136 a1-59 *part-tracker-params-default*) + ) + (-> s5-13 ppointer) + ) + ) + ) + ) + (target-death-anim (the-as spool-anim #f)) + ) + ((or (= v1-61 'lava) (= v1-61 'melt) (= v1-61 'fry) (= v1-61 'slime)) + ((lambda :behavior target + ((arg0 symbol)) + (local-vars (gp-2 vector)) + (sound-play "death-melt") + (let ((gp-1 (if (= arg0 'slime) + (-> *part-group-id-table* 63) + (-> *part-group-id-table* 64) + ) + ) + ) + (cond + ((logtest? (-> gp-1 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-1 + (let ((t9-3 (method-of-type part-tracker-subsampler activate))) + (t9-3 + (the-as part-tracker-subsampler s5-1) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-4 run-function-in-process) + (a0-9 s5-1) + (a1-3 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) gp-1) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-4) a0-9 a1-3 *part-tracker-subsampler-params-default*) + ) + (-> s5-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-2 + (let ((t9-6 (method-of-type part-tracker activate))) + (t9-6 (the-as part-tracker s5-2) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-7 run-function-in-process) + (a0-15 s5-2) + (a1-6 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) gp-1) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-7) a0-15 a1-6 *part-tracker-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + ) + ) + (let ((f30-0 (-> self control trans y))) + (logior! (-> self target-flags) (target-flags tf6)) + (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (logclear! (-> self water flags) (water-flag swim-ground)) + (let ((v1-38 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-38 (-> self control transv) (vector-float*! v1-38 (-> self control dynam gravity-normal) f0-2)) + ) + (let* ((f0-3 (vector-length v1-38)) + (f1-1 f0-3) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-38 v1-38 (/ f0-3 f1-1)) + ) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (set! (-> self control mod-surface) *dive-mods*) + (set! (-> self control dynam gravity-max) 409.6) + (set! (-> self control dynam gravity-length) 409.6) + (cond + ((and (logtest? (-> self control status) (collide-status on-surface)) + (and (= (-> self ext-anim) (target-anim default)) + (begin + (set! gp-2 (new 'stack-no-clear 'vector)) + (find-collision-below + gp-2 + (vector+! (new 'stack-no-clear 'vector) (-> self control trans) (new 'static 'vector :y -409.6 :w 1.0)) + 40960.0 + ) + ) + (< (+ -8192.0 (-> self control trans y)) (-> gp-2 y)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-death-lava-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (target-death-anim-trans) + (if (< (+ -409.6 f30-0) (-> self control trans y)) + (seek! (-> self control trans y) (+ -409.6 f30-0) (* 81920.0 (seconds-per-frame))) + ) + (suspend) + (ja :num! (seek!)) + ) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-death-swim-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (< (+ -10240.0 f30-0) (-> self control trans y)) + (seek! (-> self control trans y) (+ -10240.0 f30-0) (* 81920.0 (seconds-per-frame))) + ) + (suspend) + (ja :num! (seek!)) + ) + (dotimes (gp-3 1) + (ja-no-eval :group! jakb-death-swim-loop-ja :num! (seek! max 0.75) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.75)) + ) + ) + (ja-no-eval :group! jakb-death-swim-end-ja :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + #f + ) + ) + ) + ) + arg0 + ) + ) + ((or (= v1-61 'drown) (= v1-61 'drown-death)) + (label cfg-168) + ((lambda :behavior target + () + (logior! (-> self target-flags) (target-flags tf14)) + (set! (-> self alt-cam-pos y) (+ -8192.0 (-> self water height))) + (sound-play "death-drown") + (logclear! (-> self water flags) (water-flag swim-ground)) + (set! (-> self control mod-surface) *dive-mods*) + (set! (-> self control dynam gravity-max) 6144.0) + (set! (-> self control dynam gravity-length) 6144.0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-death-swim-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (< (+ -10240.0 (-> self water height)) (-> self control trans y)) + (seek! (-> self control trans y) (+ -10240.0 (-> self water height)) (* 81920.0 (seconds-per-frame))) + ) + (suspend) + (ja :num! (seek!)) + ) + (dotimes (gp-1 1) + (ja-no-eval :group! jakb-death-swim-loop-ja :num! (seek! max 0.75) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.75)) + ) + ) + (ja-no-eval :group! jakb-death-swim-end-ja :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + #f + ) + ) + ) + ((or (= v1-61 'target-hit-ground-hard) (= v1-61 'smush)) + (set! (-> self control mod-surface) *neutral-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-death-painful-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((s5-14 (current-time))) + (until (time-elapsed? s5-14 (seconds 2)) + (suspend) + ) + ) + ) + ((= v1-61 'centipede) + (set! (-> self trans-hook) #f) + (set! (-> self control mod-surface) *neutral-mods*) + (set! (-> self post-hook) target-no-move-post) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-from-back-ja :num! min) + (while (not (-> self control unknown-spool-anim00)) + (suspend) + (ja :num! (loop!)) + ) + ) + ((= v1-61 'tentacle) + (set! (-> self trans-hook) #f) + (let ((s5-16 (-> self attack-info attacker))) + (target-darkjak-end-mode #f) + (set! (-> self post-hook) target-no-ja-move-post) + (while (and (handle->process s5-16) + (not (-> self control unknown-spool-anim00)) + (-> self control did-move-to-pole-or-max-jump-height) + ) + (handle->process s5-16) + (clone-anim-once s5-16 #t "") + (suspend) + 0 + ) + ) + ) + ((= v1-61 'bot) + ((lambda :behavior target + () + (set! (-> self trans-hook) #f) + (let ((gp-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! gp-0 (- (current-time) (-> self clock old-frame-counter))) + (if (-> self control unknown-spool-anim00) + (return (the-as object #f)) + ) + (suspend) + ) + (if (or (> gp-0 0) + (let ((v1-14 (ja-group))) + (and v1-14 (or (= v1-14 jakb-jump-ja) (= v1-14 jakb-jump-loop-ja) (= v1-14 jakb-duck-high-jump-ja))) + ) + ) + (target-hit-ground-anim #f (are-still?)) + ) + ) + (target-stance-push 1) + (until #f + (ja-no-eval :group! jakb-stance-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (-> self control unknown-spool-anim00) + (return (the-as object #f)) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + ) + (else + (target-death-main arg0) + ) + ) + ) + ) + ) + (label cfg-206) + (target-death-reset arg0 #f) + ) + :post target-no-stick-post + ) diff --git a/goal_src/jak3/engine/target/target-gun.gc b/goal_src/jak3/engine/target/target-gun.gc index a93da0889a7..c9621e86bd2 100644 --- a/goal_src/jak3/engine/target/target-gun.gc +++ b/goal_src/jak3/engine/target/target-gun.gc @@ -7,3 +7,3531 @@ ;; DECOMP BEGINS +(define *gun-walk-mods* + (new 'static 'surface + :name 'run + :turnv 18204.445 + :turnvf 60.0 + :turnvv 72817.78 + :turnvvf 300.0 + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (let* ((f0-0 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) + (f30-0 (lerp-scale 0.0 1.0 (fabs f0-0) 1820.4445 6371.5557)) + ) + (cond + ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (>= (-> self gun track-turnv-range) + (vector-vector-distance (-> self control trans) (-> self gun track-trans)) + ) + ) + (let* ((s5-1 (-> self control)) + (s3-0 (-> self gun track-trans)) + (f0-4 + (deg-diff (y-angle s5-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s3-0 (-> s5-1 trans)))) + ) + ) + (set! (-> self control unknown-float003) (lerp-scale 0.0 2.0 (fabs f0-4) 0.0 3640.889)) + ) + #t + ) + ((< (-> self control unknown-float003) f30-0) + (seek! (-> self control unknown-float003) f30-0 (* 4.0 (seconds-per-frame))) + ) + (else + (seek! (-> self control unknown-float003) f30-0 (seconds-per-frame)) + ) + ) + ) + (let ((f30-1 131072.0) + (f0-15 30.0) + ) + (when (< 1.0 (-> self control unknown-float003)) + (set! f30-1 (lerp-scale 131072.0 291271.12 (-> self control unknown-float003) 1.0 2.0)) + (set! f0-15 (lerp-scale 30.0 15.0 (-> self control unknown-float003) 1.0 2.0)) + (set! (-> arg0 turnvv) f30-1) + (set! (-> arg0 turnvvf) f0-15) + ) + (set! (-> arg0 turnv) f30-1) + (set! (-> arg0 turnvf) f0-15) + ) + (cond + ((and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) + (set! (-> arg0 turnvv) 0.0) + (set! (-> arg0 turnvvf) 0.0) + (set! (-> arg0 seek0) 0.0) + (set! (-> arg0 seek90) 0.0) + (set! (-> arg0 seek180) 0.0) + (set! (-> arg0 transv-max) 0.0) + ) + ((and (-> self next-state) (= (-> self next-state name) 'target-gun-stance)) + (set! (-> arg0 turnv) 364088.88) + (set! (-> arg0 turnvf) 30.0) + arg0 + ) + ) + ) + ) + ) + :flags (surface-flag look-around no-turn-around) + ) + ) + +(defbehavior want-to-gun? process ((arg0 target) (arg1 symbol)) + (local-vars (v1-43 symbol)) + (and (logtest? (-> arg0 game features) (game-feature gun)) + (time-elapsed? (-> arg0 gun gun-time) (seconds 0.1)) + (not (focus-test? arg0 dead hit board mech dark teleporting)) + (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> arg0 control current-surface flags))) + (not (logtest? (target-flags prevent-gun invisible) (-> arg0 target-flags))) + (logtest? (logand (game-feature + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + ) + (-> *setting-control* user-current features) + ) + (-> arg0 game features) + ) + (-> *setting-control* user-current gun) + (or (not (logtest? (-> arg0 control current-surface flags) (surface-flag duck))) (can-exit-duck? arg0)) + (or (not (focus-test? arg0 pilot)) (-> arg0 pilot gun?)) + (not (and (-> arg0 next-state) (let ((v1-29 (-> arg0 next-state name))) + (or (= v1-29 'target-powerjak-get-on) (= v1-29 'target-lightjak-get-on)) + ) + ) + ) + (zero? (-> arg0 lightjak shield-start-time)) + (or arg1 + (nonzero? (-> arg0 gun using-gun-type)) + (begin + (set! v1-43 (and (cpad-hold? (-> arg0 control cpad number) r1) + (not (focus-test? arg0 grabbed)) + (begin (set! v1-43 #t) (set! (-> arg0 gun latch?) v1-43) v1-43) + ) + ) + v1-43 + ) + (-> arg0 gun latch?) + ) + (not (-> arg0 skel top-anim frame-group)) + (time-elapsed? (-> arg0 control time-of-last-debug-float) (seconds 0.1)) + (not (-> arg0 board latch?)) + ) + ) + +(defbehavior target-gun-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'gun + ) + (else + (case arg2 + (('change-mode) + (case (-> arg3 param 0) + (('grab) + (when (not (focus-test? self dead)) + (if (not (-> arg3 param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + (('gun) + (let ((v1-9 (-> arg3 param 2))) + (when (nonzero? v1-9) + (set! (-> self gun using-gun-type) (the-as pickup-type v1-9)) + v1-9 + ) + ) + ) + (('falling) + (go target-falling #f) + ) + (('look-around) + (go target-look-around) + ) + (('normal 'board 'pilot) + (if (and (using-gun? self) (target-gun-end-mode #f)) + (go target-stance) + ) + ) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +(defbehavior target-gun-setup target ((arg0 symbol)) + (when (zero? (-> self gun)) + (if (= (-> self game gun-type) (pickup-type none)) + (set! (-> self game gun-type) (pickup-type gun-red-1)) + ) + (set! (-> self gun) (new 'process 'gun-info)) + (set! (-> self gun process) (the-as (pointer target) (process->ppointer self))) + (set! (-> self gun strip) #f) + (set! (-> self gun uv-slide) 0.0) + (set! (-> self gun gun) (the-as (pointer gun) #f)) + (set! (-> self gun active?) #f) + (set! (-> self gun latch?) #f) + (set! (-> self gun put-away?) #f) + (set! (-> self gun charge-active?) (the-as handle #f)) + (set! (-> self gun mode-sound-bank) #f) + (set! (-> self skel top-anim) (new 'process 'top-anim-joint-control self)) + (set! (-> self skel interp-select 0) 0) + (set! (-> self skel interp-select 1) 0) + (quaternion-identity! (the-as quaternion (-> self gun top-anim-twist))) + (set! (-> self gun combo-window-state) #f) + ((method-of-type focus reset-to-collide-spec) + (the-as focus (-> self gun track-target)) + (collide-spec jak player-list) + ) + (reset-to-collide-spec (-> self gun track-target 1) (collide-spec jak player-list)) + (add-connection *pad-engine* self target-gun-marking-menu self #f #f) + ) + (if (not arg0) + (target-gun-end-mode #f) + ) + (when (-> self gun gun) + (deactivate (-> self gun gun 0)) + (set! (-> self gun gun) (the-as (pointer gun) #f)) + ) + (if arg0 + (set! (-> self gun gun) (process-spawn gun :init gun-init :name "gun" :from *8k-dead-pool* :to self)) + ) + 0 + (none) + ) + +(defbehavior target-gun-init target ((arg0 pickup-type)) + (target-darkjak-end-mode #f) + (let ((gp-0 (-> self gun))) + (if (zero? (-> gp-0 hips)) + (set! (-> gp-0 hips) (new 'process 'joint-mod (joint-mod-mode rotate) self 38)) + ) + (if (zero? (-> gp-0 upper-body)) + (set! (-> gp-0 upper-body) (-> self upper-body)) + ) + (mode-set! (-> gp-0 hips) (joint-mod-mode rotate)) + (set! (-> gp-0 gun-roty) (y-angle (-> self control))) + (reset (-> self skel top-anim)) + (set! (-> self skel top-anim interp) 1.0) + (quaternion-identity! (the-as quaternion (-> self gun top-anim-twist))) + (quaternion-identity! (the-as quaternion (-> self gun top-anim-twist-targ))) + (set! (-> self gun top-anim-twist-reset) (the-as uint 0)) + (set! (-> gp-0 gun-type) (pickup-type gun-yellow-1)) + (target-gun-type-set! arg0) + (set-time! (-> gp-0 gun-get-on-time)) + ) + (set! (-> self board latch?) #f) + (set! (-> self gun put-away?) #f) + (set! (-> self gun active?) #f) + (set! (-> self gun surpress-time) 0) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) + (set! (-> self gun track-turn) 0.0) + (set! (-> self gun track-tilt) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (set! (-> self gun turn-fast-hold-time) 0) + (set! (-> self gun gun-delay-fire) 0.0) + ((method-of-type focus reset-to-collide-spec) + (the-as focus (-> self gun track-target)) + (collide-spec jak player-list) + ) + (set! (-> self gun fire-dir-rot) 0.0) + (set! (-> self control unknown-float003) 0.0) + (set! (-> self gun blue-whine-volume) 0.0) + (if (zero? (-> self gun blue-whine-sound-id)) + (set! (-> self gun blue-whine-sound-id) (new-sound-id)) + ) + (sound-play "gun-takeout") + (set! (-> self gun charge-ammo) 0.0) + (set! (-> self gun charge-start-time) 0) + (set! (-> self gun top-anim-tilt-up) 0.0) + (let ((f30-0 + (if (or (nonzero? (-> self gun fire-pending)) (cpad-hold? (-> self control cpad number) r1) (-> self gun latch?)) + 2.0 + 1.0 + ) + ) + ) + (cond + ((focus-test? self pilot-riding) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-red)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-dark)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-dark-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + ) + ) + (else + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-yellow-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-red)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-dark)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-dark-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + ) + ) + ) + ) + (if (= (-> self control collide-mode) 'duck) + (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) + (target-collide-set! 'gun 0.0) + ) + 0 + (none) + ) + +(defun target-gun-exit () + #f + ) + +(defbehavior target-gun-end-mode target ((arg0 symbol)) + (let ((s5-0 #f)) + (when (using-gun? self) + (set! (-> self gun fire-pending) 0) + (mode-set! (-> self gun hips) (joint-mod-mode flex-blend)) + (send-event *camera* 'clear-slave-option (cam-slave-options STICKY_ANGLE BLOCK_RIGHT_STICK GUN_CAM)) + (send-event *camera* 'set-dist #f #f) + (send-event *camera* 'yes-follow) + (let ((v1-17 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-17 command) (sound-command set-param)) + (set! (-> v1-17 id) (-> self gun blue-whine-sound-id)) + (set! (-> v1-17 params volume) -4) + (set! (-> v1-17 auto-time) 120) + (set! (-> v1-17 auto-from) 2) + (set! (-> v1-17 params mask) (the-as uint 17)) + (-> v1-17 id) + ) + (set! (-> self gun active?) #f) + (cond + ((and (not (logtest? (surface-flag gun-fast-exit) (-> self control current-surface flags))) + (not (focus-test? self dead)) + (!= arg0 'fast-exit) + ) + (sound-play "gun-putaway") + (cond + ((focus-test? self pilot-riding) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-red)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-dark)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-dark-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (else + (set! (-> self skel top-anim interp) 0.0) + ) + ) + ) + (else + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-yellow-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-red)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-takeout-ja) + 14.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-dark)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-dark-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (else + (set! (-> self skel top-anim interp) 0.0) + ) + ) + ) + ) + ) + (else + (set! (-> self skel top-anim interp) 0.0) + ) + ) + (set! (-> self gun gun-delay-fire) 0.0) + (set! (-> self gun gun-type) (pickup-type none)) + (setting-control-method-14 *setting-control* (-> self gun mode-sound-bank)) + (set! (-> self gun mode-sound-bank) #f) + (remove-setting! 'sound-flava) + (if (= (-> self control collide-mode) 'duck) + (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) + (target-collide-set! 'normal 0.0) + ) + (set! s5-0 #t) + ) + (when arg0 + (set! (-> self gun using-gun-type) (pickup-type none)) + (set! (-> self gun latch?) #f) + (set! (-> self gun put-away?) #f) + ) + s5-0 + ) + ) + +(defun quat<-gun! ((arg0 quaternion) (arg1 quaternion)) + (gun->eco (the-as pickup-type arg1)) + (quaternion-copy! arg0 (the-as quaternion *null-vector*)) + ) + +(defbehavior target-gun-ammo-out-pick target () + (cond + ((and (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow-1 gun-yellow-2 gun-yellow-3)) + (-> self game features) + ) + ) + (< 0.0 (-> self game gun-ammo 0)) + ) + 29 + ) + ((and (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red-1 gun-red-2 gun-red-3)) + (-> self game features) + ) + ) + (< 0.0 (-> self game gun-ammo 1)) + ) + 26 + ) + ((and (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue-1 gun-blue-2 gun-blue-3)) + (-> self game features) + ) + ) + (< 0.0 (-> self game gun-ammo 2)) + ) + 32 + ) + ((and (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (game-feature gun-dark-1 gun-dark-2 gun-dark-3) (-> *setting-control* user-current features)) + (-> self game features) + ) + ) + (< 0.0 (-> self game gun-ammo 3)) + ) + 35 + ) + (else + 0 + ) + ) + ) + +(defbehavior target-gun-type-set! target ((arg0 pickup-type)) + (if (= arg0 (pickup-type none)) + (set! arg0 (-> self game gun-type)) + ) + (when (not (logtest? (the-as game-feature (ash 1 (+ (the-as int arg0) -20))) + (logand (-> self game features) (-> *setting-control* user-current features)) + ) + ) + (when (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow-1)) + (-> self game features) + ) + ) + (set! arg0 (pickup-type gun-yellow-1)) + (goto cfg-39) + ) + (when (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red-1)) + (-> self game features) + ) + ) + (set! arg0 (pickup-type gun-red-1)) + (goto cfg-39) + ) + (when (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue-1)) + (-> self game features) + ) + ) + (set! arg0 (pickup-type gun-blue-1)) + (goto cfg-39) + ) + (when (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark-1)) + (-> self game features) + ) + ) + (set! arg0 (pickup-type gun-dark-1)) + (goto cfg-39) + ) + (set! arg0 (pickup-type none)) + (label cfg-39) + (cond + ((zero? (the-as int arg0)) + (set! arg0 (the-as pickup-type arg0)) + (goto cfg-116) + ) + (else + (empty) + ) + ) + ) + (set! (-> self game gun-type) (the-as pickup-type arg0)) + (set! (-> self gun track-turnv-range) 81920.0) + (set! (-> self gun track-tilt-range) 0.0) + (set! (-> self gun track-turn-range) 0.0) + (set! (-> self gun track-turn-max) 1820.4445) + (set! (-> self gun track-tilt-max) 16019.911) + (set! (-> self gun gun-control) (the-as uint 1)) + (set! (-> self gun fire-spin) 0.0) + (set! (-> self gun fire-spinv) 0.0) + (set! (-> self gun fire-time) 0) + (set! (-> self gun laser-active?) #t) + (set! (-> self gun top-anim-gun-height) 5283.84) + (set! (-> self gun top-anim-low-high) 0.0) + (set! (-> self gun gun-delay-fire) 0.0) + (set! (-> self skel top-anim frame-speed) 1.0) + (set! (-> self skel top-anim frame-targ) #f) + (truncate-player-ammo (pickup-type ammo-red)) + (truncate-player-ammo (pickup-type ammo-yellow)) + (truncate-player-ammo (pickup-type ammo-blue)) + (truncate-player-ammo (pickup-type ammo-dark)) + (when (using-gun? self) + (let ((s5-0 (gun->eco (-> self gun gun-type)))) + (-> self gun gun-type) + (set! (-> self gun gun-type) (the-as pickup-type arg0)) + (set! (-> self gun using-gun-type) (the-as pickup-type arg0)) + (setting-control-method-14 *setting-control* (-> self gun mode-sound-bank)) + (set! (-> self gun mode-sound-bank) #f) + ((lambda :behavior target + ((arg0 pickup-type)) + (case arg0 + (((pickup-type gun-yellow-1)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modeguy1 0.0 0))) + ) + (((pickup-type gun-yellow-2)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modeguy2 0.0 0))) + ) + (((pickup-type gun-yellow-3)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modeguy3 0.0 0))) + ) + (((pickup-type gun-red-1)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegur1 0.0 0))) + ) + (((pickup-type gun-red-2)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegur2 0.0 0))) + ) + (((pickup-type gun-red-3)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegur3 0.0 0))) + ) + (((pickup-type gun-blue-1)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegub1 0.0 0))) + ) + (((pickup-type gun-blue-2)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegub2 0.0 0))) + ) + (((pickup-type gun-blue-3)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegub3 0.0 0))) + ) + (((pickup-type gun-dark-1)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegud1 0.0 0))) + ) + (((pickup-type gun-dark-2)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegud2 0.0 0))) + ) + (((pickup-type gun-dark-3)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegud3 0.0 0))) + ) + ) + (none) + ) + (the-as pickup-type arg0) + ) + (case (the-as int arg0) + ((32 29 35 26) + (set! (-> self gun ammo-required) 1.0) + ) + ((27) + (set! (-> self gun ammo-required) 1.0) + ) + ((28) + (set! (-> self gun ammo-required) (if (logtest? (game-secrets gun-upgrade-red-3) (-> *game-info* secrets)) + 8.0 + 10.0 + ) + ) + ) + ((36) + (set! (-> self gun ammo-required) 1.0) + ) + ((37) + (set! (-> self gun ammo-required) (if (logtest? (game-secrets gun-upgrade-dark-3) (-> *game-info* secrets)) + 8.0 + 10.0 + ) + ) + ) + ((33) + (set! (-> self gun ammo-required) 1.0) + ) + ((34) + (set! (-> self gun ammo-required) 1.0) + ) + ((30) + (set! (-> self gun ammo-required) 1.0) + ) + ((31) + (set! (-> self gun ammo-required) 10.0) + ) + ) + (case (the-as int arg0) + ((32 33 34) + (set! (-> self gun gun-control) (the-as uint 4)) + (set! (-> self gun fire-range) 327680.0) + (set! (-> self gun track-find-range) 327680.0) + (set! (-> self gun track-turn-range) 327680.0) + (set! (-> self gun track-turn-max) 910.2222) + (set! (-> self gun track-tilt-range) 327680.0) + (set! (-> self gun track-angle-mult) 1.75) + (set! (-> self gun track-require) (the-as uint 26)) + (set! (-> self gun fire-delay) (the-as uint 15)) + (set! (-> self gun combo-fire-delay) (the-as uint 30)) + (set! (-> self gun track-beam-size) 2457.6) + (remove-setting! 'gun-min-height) + (remove-setting! 'gun-max-height) + ) + ((29 30) + (set! (-> self gun fire-range) 409600.0) + (set! (-> self gun track-find-range) 286720.0) + (set! (-> self gun track-tilt-range) 409600.0) + (set! (-> self gun track-turn-range) 409600.0) + (set! (-> self gun track-angle-mult) 1.75) + (set! (-> self gun track-require) (the-as uint 26)) + (set! (-> self gun fire-delay) (the-as uint 96)) + (set! (-> self gun combo-fire-delay) (the-as uint 30)) + (set! (-> self gun track-beam-size) 819.2) + (remove-setting! 'gun-min-height) + (remove-setting! 'gun-max-height) + ) + ((31) + (set! (-> self gun fire-delay) (the-as uint 0)) + (set! (-> self gun laser-active?) #f) + (set! (-> self gun fire-range) 0.0) + (set! (-> self gun track-find-range) 0.0) + (set! (-> self gun track-tilt-range) 0.0) + (set! (-> self gun track-turn-range) 0.0) + (set! (-> self gun track-turn-max) 0.0) + (set! (-> self gun track-angle-mult) 0.0) + (set! (-> self gun track-require) (the-as uint 0)) + 0 + ) + ((26 28) + (set! (-> self gun fire-range) 61440.0) + (set! (-> self gun track-find-range) 81920.0) + (set! (-> self gun track-tilt-range) 61440.0) + (set! (-> self gun track-turn-range) 61440.0) + (set! (-> self gun track-turn-max) 910.2222) + (set! (-> self gun track-angle-mult) 0.0) + (set! (-> self gun track-require) (the-as uint 26)) + (if (or (and (logtest? (game-secrets gun-upgrade-red-1) (-> *game-info* secrets)) (= (the-as int arg0) 26)) + (and (logtest? (game-secrets gun-upgrade-red-3) (-> *game-info* secrets)) (= (the-as int arg0) 28)) + ) + (set! (-> self gun fire-delay) (the-as uint 180)) + (set! (-> self gun fire-delay) (the-as uint 330)) + ) + (set! (-> self gun combo-fire-delay) (the-as uint 150)) + (set! (-> self gun track-beam-size) 1228.8) + (remove-setting! 'gun-min-height) + (set-setting! 'gun-max-height 'abs (meters 6) 0) + ) + ((27) + (set! (-> self gun fire-delay) (the-as uint 240)) + (set! (-> self gun gun-control) (the-as uint 2)) + (set! (-> self gun laser-active?) #f) + (set! (-> self gun fire-range) 0.0) + (set! (-> self gun track-find-range) 0.0) + (set! (-> self gun track-tilt-range) 0.0) + (set! (-> self gun track-turn-range) 0.0) + (set! (-> self gun track-turn-max) 0.0) + (set! (-> self gun track-angle-mult) 0.0) + (set! (-> self gun track-require) (the-as uint 0)) + 0 + ) + ((35 36 37) + (set! (-> self gun gun-control) (the-as uint 2)) + (set! (-> self gun fire-range) 1638400.0) + (set! (-> self gun track-tilt-range) 1638400.0) + (set! (-> self gun track-turn-range) 1638400.0) + (set! (-> self gun track-find-range) 1638400.0) + (set! (-> self gun track-angle-mult) 1.75) + (set! (-> self gun fire-delay) (the-as uint 255)) + (set! (-> self gun combo-fire-delay) (the-as uint 150)) + (set! (-> self gun track-beam-size) 1228.8) + (set! (-> self gun track-require) (the-as uint 24)) + (remove-setting! 'gun-min-height) + (remove-setting! 'gun-max-height) + ) + ) + (quat<-gun! (the-as quaternion (-> self gun top-anim-twist-targ)) (the-as quaternion arg0)) + (set! (-> self skel top-anim frame-post-blend) 0.1333333) + ((lambda :behavior target + ((arg0 pickup-type) (arg1 pickup-type)) + (cond + ((focus-test? self pilot-riding) + (let ((v1-2 (gun->eco arg0))) + (cond + ((or (and (= arg1 (pickup-type eco-red)) (= v1-2 (pickup-type eco-dark))) + (and (= arg1 v1-2) (or (= v1-2 (pickup-type eco-red)) (= v1-2 (pickup-type eco-dark)))) + ) + (if (rand-vu-percent? 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-dark-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-yellow-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ) + ((and (= arg1 (pickup-type eco-dark)) (= v1-2 (pickup-type eco-red))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-dark-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((or (and (= arg1 (pickup-type eco-red)) (= v1-2 (pickup-type eco-yellow))) + (and (= arg1 v1-2) (= v1-2 (pickup-type eco-yellow))) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-yellow-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-2 (pickup-type eco-red))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-yellow-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-red)) (= v1-2 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-blue-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-2 (pickup-type eco-red))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-blue-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-2 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-blue-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 v1-2) (= v1-2 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-blue-ja) + 0.0 + 30 + 0 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-2 (pickup-type eco-yellow))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-blue-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-dark)) (= v1-2 (pickup-type eco-yellow))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-yellow-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-dark)) (= v1-2 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-blue-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-2 (pickup-type eco-dark))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-blue-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-2 (pickup-type eco-dark))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-yellow-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ) + ) + ) + (else + (let ((v1-60 (gun->eco arg0))) + (cond + ((and (= arg1 (pickup-type eco-red)) (= v1-60 (pickup-type eco-dark))) + (if (rand-vu-percent? 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-front-hop-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-transformation-twirl-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-2" :group 1)) + ) + ) + ) + ((or (and (= arg1 (pickup-type eco-dark)) (= v1-60 (pickup-type eco-red))) + (and (= arg1 v1-60) + (or (= v1-60 (pickup-type eco-red)) (= v1-60 (pickup-type eco-dark)) (= v1-60 (pickup-type eco-yellow))) + ) + ) + (if (rand-vu-percent? 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-front-hop-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-transformation-twirl-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-2" :group 1)) + ) + ) + ) + ((and (= arg1 v1-60) (= v1-60 (pickup-type eco-blue))) + (if (or (rand-vu-percent? 0.5) (nonzero? (-> self ext-anim))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-side-hop-1-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-side-hop-2-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ) + ((and (= arg1 (pickup-type eco-dark)) (= v1-60 (pickup-type eco-yellow))) + (if (rand-vu-percent? 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-transformation-twirl-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-2" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-to-side-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-3" :group 1)) + ) + ) + ) + ((and (= arg1 (pickup-type eco-red)) (= v1-60 (pickup-type eco-yellow))) + (if (rand-vu-percent? 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-transformation-twirl-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-2" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-to-side-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-3" :group 1)) + ) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-60 (pickup-type eco-red))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-front-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-60 (pickup-type eco-dark))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-front-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-red)) (= v1-60 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-to-blue-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-4" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-dark)) (= v1-60 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-to-blue-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-4" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-60 (pickup-type eco-red))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-to-front-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-5" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-60 (pickup-type eco-dark))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-to-front-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-5" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-60 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-to-blue-hop-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-4" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-60 (pickup-type eco-yellow))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-to-yellow-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-6" :group 1)) + ) + ) + ) + ) + ) + ) + (none) + ) + (the-as pickup-type arg0) + s5-0 + ) + ) + ) + (set! (-> self gun upper-body twist-max x) (-> self gun track-tilt-max)) + (set! (-> self gun upper-body twist-max y) (-> self gun track-turn-max)) + (set! (-> self gun upper-body twist-max z) (-> self gun track-tilt-range)) + (set! (-> self gun upper-body twist-max w) (-> self gun track-turn-range)) + (set! (-> self gun upper-body max-dist) (fmax (-> self gun track-tilt-range) (-> self gun track-turn-range))) + (label cfg-116) + (none) + ) + +(defun target-gun-marking-menu ((arg0 target)) + (local-vars (v1-64 int) (v1-102 int) (v1-140 int)) + (update (-> arg0 ext-anim-control)) + (when (and (not (paused?)) + (not (and (focus-test? arg0 dark) (nonzero? (-> arg0 darkjak)))) + (or (not (logtest? (surface-flag sf29) (-> arg0 control current-surface flags))) + (-> *setting-control* user-current change-gun) + ) + (-> *setting-control* user-current gun) + ) + (let ((s5-0 (the-as int (-> arg0 gun using-gun-type)))) + (cond + ((cpad-pressed? (-> arg0 control cpad number) down) + (set! (-> arg0 gun gun-select-time 1) (-> *display* real-clock frame-counter)) + (set! s5-0 + (cond + ((= (gun->eco (the-as pickup-type s5-0)) (pickup-type eco-yellow)) + (dotimes (v1-26 3) + (+! s5-0 1) + (if (< 31 s5-0) + (set! s5-0 29) + ) + (when (logtest? (the-as game-feature (ash 1 (+ s5-0 -20))) + (logand (-> arg0 game features) (-> *setting-control* user-current features)) + ) + (set! s5-0 s5-0) + (goto cfg-49) + ) + ) + 29 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow-1)) + (-> arg0 game features) + ) + ) + 29 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow-2)) + (-> arg0 game features) + ) + ) + 30 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow-3)) + (-> arg0 game features) + ) + ) + 31 + ) + (else + (empty) + s5-0 + ) + ) + ) + (label cfg-49) + ) + ((cpad-pressed? (-> arg0 control cpad number) up) + (set! (-> arg0 gun gun-select-time 0) (-> *display* real-clock frame-counter)) + (set! v1-64 + (cond + ((= (gun->eco (the-as pickup-type s5-0)) (pickup-type eco-red)) + (dotimes (v1-63 3) + (set! s5-0 (+ s5-0 1)) + (if (< 28 s5-0) + (set! s5-0 26) + ) + (when (logtest? (the-as game-feature (ash 1 (+ s5-0 -20))) + (logand (-> arg0 game features) (-> *setting-control* user-current features)) + ) + (set! v1-64 s5-0) + (goto cfg-86) + ) + ) + 26 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red-1)) + (-> arg0 game features) + ) + ) + 26 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red-2)) + (-> arg0 game features) + ) + ) + 27 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red-3)) + (-> arg0 game features) + ) + ) + 28 + ) + (else + s5-0 + ) + ) + ) + (label cfg-86) + (set! s5-0 v1-64) + ) + ((cpad-pressed? (-> arg0 control cpad number) left) + (set! (-> arg0 gun gun-select-time 2) (-> *display* real-clock frame-counter)) + (set! v1-102 + (cond + ((= (gun->eco (the-as pickup-type s5-0)) (pickup-type eco-blue)) + (dotimes (v1-101 3) + (set! s5-0 (+ s5-0 1)) + (if (< 34 s5-0) + (set! s5-0 32) + ) + (when (logtest? (the-as game-feature (ash 1 (+ s5-0 -20))) + (logand (-> arg0 game features) (-> *setting-control* user-current features)) + ) + (set! v1-102 s5-0) + (goto cfg-123) + ) + ) + 32 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue-1)) + (-> arg0 game features) + ) + ) + 32 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue-2)) + (-> arg0 game features) + ) + ) + 33 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue-3)) + (-> arg0 game features) + ) + ) + 34 + ) + (else + s5-0 + ) + ) + ) + (label cfg-123) + (set! s5-0 v1-102) + ) + ((cpad-pressed? (-> arg0 control cpad number) right) + (set! (-> arg0 gun gun-select-time 3) (-> *display* real-clock frame-counter)) + (set! v1-140 + (cond + ((= (gun->eco (the-as pickup-type s5-0)) (pickup-type eco-dark)) + (dotimes (v1-139 3) + (set! s5-0 (+ s5-0 1)) + (if (< 37 s5-0) + (set! s5-0 35) + ) + (when (logtest? (the-as game-feature (ash 1 (+ s5-0 -20))) + (logand (-> arg0 game features) (-> *setting-control* user-current features)) + ) + (set! v1-140 s5-0) + (goto cfg-160) + ) + ) + 35 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark-1)) + (-> arg0 game features) + ) + ) + 35 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (game-feature gun-dark-2) (-> *setting-control* user-current features)) + (-> arg0 game features) + ) + ) + 36 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (game-feature gun-dark-3) (-> *setting-control* user-current features)) + (-> arg0 game features) + ) + ) + 37 + ) + (else + s5-0 + ) + ) + ) + (label cfg-160) + (set! s5-0 v1-140) + ) + ) + (when (and (nonzero? s5-0) + (logtest? (the-as game-feature (ash 1 (+ s5-0 -20))) + (logand (-> arg0 game features) (-> *setting-control* user-current features)) + ) + (or (not (focus-test? arg0 pilot)) (and (nonzero? (-> arg0 pilot)) (-> arg0 pilot gun?))) + (begin (set! (-> arg0 gun using-gun-type) (the-as pickup-type s5-0)) s5-0) + (!= s5-0 (-> arg0 gun gun-type)) + (let ((v1-179 (-> arg0 skel top-anim frame-targ))) + (or (not v1-179) + (= v1-179 (-> arg0 draw art-group data 342)) + (= v1-179 (-> arg0 draw art-group data 338)) + (= v1-179 (-> arg0 draw art-group data 343)) + (= v1-179 (-> arg0 draw art-group data 339)) + (= v1-179 (-> arg0 draw art-group data 296)) + (= v1-179 (-> arg0 draw art-group data 238)) + ) + ) + (not (handle->process (-> arg0 gun charge-active?))) + ) + (cond + ((using-gun? arg0) + (sound-play "select-option") + (send-event arg0 'gun-type s5-0) + ) + ((want-to-gun? arg0 #t) + (send-event arg0 'change-mode 'gun #f s5-0) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-gun-build-track-list target () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (-> self gun track-dir))) + (set! (-> s4-0 quad) + (-> (if (and (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + ) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + ) + (-> self gun fire-dir) + (-> self control to-target-pt-xz) + ) + quad + ) + ) + (vector-flatten! s4-0 s4-0 (-> self control c-R-w uvec)) + (vector-normalize! s4-0 1.0) + (+! (-> gp-0 y) 6144.0) + (vector+float*! gp-0 gp-0 s4-0 -32768.0) + (vector+float*! s5-0 gp-0 s4-0 (+ 32768.0 (-> self gun track-find-range))) + ) + (let ((s4-1 (-> self focus-search)) + (s3-0 (vector-average! (new 'stack-no-clear 'vector) gp-0 s5-0)) + ) + (set! (-> s3-0 w) (* 0.5 (vector-vector-distance gp-0 s5-0))) + (set! (-> s4-1 length) + (fill-actor-list-for-box *actor-hash* (the-as bounding-box s3-0) (-> s4-1 data) (-> s4-1 allocated-length)) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-gun-find-track target () + (if (logtest? (-> self gun upper-body track-mode) (track-mode lock-on)) + (logior! (-> self gun track?) (gun-track-flags gutflags-3)) + (logclear! (-> self gun track?) (gun-track-flags gutflags-3)) + ) + (let ((gp-0 (the-as process-focusable #f))) + (when (and (or (not (time-elapsed? (-> self control time-of-last-nonzero-input) (seconds 0.2))) + (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (or (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) + (= (gun->eco (-> self gun gun-type)) (pickup-type eco-dark)) + ) + ) + (>= (current-time) (-> self gun track-target-hold-time)) + ) + (target-gun-build-track-list) + (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg neckB)))) + (+! (-> gp-1 y) 2048.0) + (cond + ((logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + (set! gp-0 (find-nearest-focusable + (-> self focus-search) + (-> self control trans) + (+ 32768.0 (-> self gun track-find-range)) + (search-info-flag crate attackable enemy cull-angle probe prefer-center) + (the-as search-info-flag (-> self gun track-require)) + (-> self gun track-dir) + gp-1 + 10922.667 + ) + ) + ) + ((or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) + ) + (set! gp-0 (find-nearest-focusable + (-> self focus-search) + (-> self control trans) + (fmin 122880.0 (+ 32768.0 (-> self gun track-find-range))) + (search-info-flag crate attackable enemy cull-angle probe) + (the-as search-info-flag (-> self gun track-require)) + (-> self gun track-dir) + gp-1 + 16384.0 + ) + ) + ) + ((= (gun->eco (-> self gun gun-type)) (pickup-type eco-dark)) + (set! gp-0 (find-nearest-focusable + (-> self focus-search) + (-> self control trans) + (+ 32768.0 (-> self gun track-find-range)) + (search-info-flag crate attackable enemy cull-angle prefer-center) + (the-as search-info-flag (-> self gun track-require)) + (-> self gun track-dir) + gp-1 + 5461.3335 + ) + ) + ) + (else + (set! gp-0 (find-nearest-focusable + (-> self focus-search) + (-> self control trans) + (+ 32768.0 (-> self gun track-find-range)) + (search-info-flag crate attackable enemy cull-angle probe prefer-center) + (the-as search-info-flag (-> self gun track-require)) + (-> self gun track-dir) + gp-1 + 5461.3335 + ) + ) + ) + ) + ) + ) + (cond + (gp-0 + (set! (-> self gun track-target-hold-time) 0) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) + (set! (-> self gun track-trans quad) (-> (get-trans gp-0 3) quad)) + (when ((method-of-type focus try-update-focus) (the-as focus (-> self gun track-target)) gp-0) + (set-time! (-> self gun track-start-time)) + (if (not (time-elapsed? (-> self control time-of-last-nonzero-input) (seconds 0.2))) + (set-time! (-> self gun track-press-start-time)) + ) + ) + (if (logtest? (process-mask->search-info-flag gp-0) (search-info-flag guard enemy attackable-priority)) + (try-update-focus (-> self gun track-target 1) gp-0) + ) + ) + (else + (let ((s5-2 (handle->process (-> self gun track-target 0 handle)))) + (cond + ((or (not s5-2) + (or (and (focus-test? (the-as process-focusable s5-2) dead) (zero? (-> self gun track-target-hold-time))) + (and (not (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) + ) + (and (not (logtest? (surface-flag spin) (-> self control current-surface flags))) + (let ((f30-0 21845.334) + (s4-1 (-> self control)) + (s2-0 (-> self gun track-trans)) + ) + (< f30-0 + (fabs + (deg-diff (y-angle s4-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-1 trans)))) + ) + ) + ) + ) + ) + (or (and (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) + ) + (< 102400.0 (vector-vector-distance (-> self control trans) (-> self gun track-trans))) + (< (vector-dot + (-> self gun track-dir) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + 1.0 + ) + ) + 0.5 + ) + ) + (logtest? (process-mask->search-info-flag (the-as process-focusable s5-2)) (search-info-flag abort)) + ) + ) + ) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) + (set! (-> self gun track-target-hold-time) 0) + ((method-of-type focus clear-focused) (the-as focus (-> self gun track-target))) + ) + (else + (let ((a0-67 (process-mask->search-info-flag (the-as process-focusable s5-2)))) + (cond + ((and (not (not (or (zero? a0-67) (logtest? a0-67 (search-info-flag abort))))) + (zero? (-> self gun track-target-hold-time)) + ) + (logclear! (-> self gun track?) (gun-track-flags gutflags-2)) + (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) + ) + (else + (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((s5-3 (handle->process (-> self gun track-target 1 handle)))) + (cond + ((logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + (send-event *camera* 'set-slave-option (cam-slave-options STICKY_ANGLE)) + ) + (s5-3 + (let ((s4-7 (get-trans (the-as process-focusable s5-3) 3))) + (let ((s3-1 (new 'stack-no-clear 'vector4w))) + (cond + ((and (logtest? (process-mask->search-info-flag (the-as process-focusable s5-3)) + (search-info-flag guard enemy attackable-priority) + ) + (transform-point-qword! s3-1 s4-7) + ) + (let ((v1-171 (+ (/ (-> s3-1 x) 16) -2048))) + (+ (/ (-> s3-1 y) 16) -2048) + (let ((a0-90 (abs v1-171))) + (cond + ((< a0-90 65) + (send-event *camera* 'set-slave-option (cam-slave-options STICKY_ANGLE)) + ) + ((let ((a0-94 120)) + (set! v1-171 (abs v1-171)) + (< a0-94 v1-171) + ) + (send-event *camera* 'clear-slave-option (cam-slave-options STICKY_ANGLE)) + ) + ) + ) + ) + ) + (else + (send-event *camera* 'clear-slave-option (cam-slave-options STICKY_ANGLE)) + ) + ) + ) + (if (and s5-3 *gun-marks* (!= gp-0 s5-3)) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) s4-7 (-> s4-7 w) (new 'static 'rgba :g #x80 :b #xff :a #x40)) + ) + ) + ) + (else + (send-event *camera* 'clear-slave-option (cam-slave-options STICKY_ANGLE)) + ) + ) + ) + ) + (when (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (if *gun-marks* + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> self gun track-trans) + (-> self gun track-trans w) + (new 'static 'rgba :r #xff :g #xff :a #x40) + ) + ) + (send-event (handle->process (-> self gun track-target 0 handle)) 'tracked) + ) + 0 + (none) + ) + +(defbehavior target-top-anim-base-mode target ((arg0 int)) + (cond + ((focus-test? self pilot-riding) + (case (-> self gun gun-type) + (((pickup-type gun-yellow-1) (pickup-type gun-yellow-2) (pickup-type gun-yellow-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-idle-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-blue-1) (pickup-type gun-blue-2) (pickup-type gun-blue-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-idle-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-red-1) (pickup-type gun-red-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-idle-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-dark-1) (pickup-type gun-red-2) (pickup-type gun-dark-2) (pickup-type gun-dark-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-dark-idle-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (else + (case (-> self gun gun-type) + (((pickup-type gun-yellow-1) (pickup-type gun-yellow-2)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-stance-yellow-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + (set! (-> self gun top-anim-low-high) 1.0) + (if (zero? (-> self gun fire-pending)) + (set-time! (-> self gun fire-time)) + ) + ) + (((pickup-type gun-yellow-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-stance-yellow-low-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-blue-1) (pickup-type gun-blue-2) (pickup-type gun-blue-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-stance-blue-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-red-1) (pickup-type gun-red-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-stance-dark-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-dark-1) (pickup-type gun-red-2) (pickup-type gun-dark-2) (pickup-type gun-dark-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-stance-dark-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-gun-combo-start target ((arg0 int) (arg1 time-frame)) + (target-top-anim-base-mode arg0) + (set! (-> self gun surpress-time) (+ (current-time) arg0)) + (set! (-> self gun track-target-hold-time) (+ (current-time) arg1)) + 0 + (none) + ) + +(defbehavior target-gun-joint-pre0 target () + (if (!= (not (logtest? (-> self game features) (game-feature gun))) (not (-> self gun gun))) + (target-gun-setup (logtest? (-> self game features) (game-feature gun))) + ) + (if (and (time-elapsed? (-> self gun combo-window-start) (seconds 0.7)) (zero? (-> self gun fire-pending))) + (set! (-> self gun combo-window-state) #f) + ) + (cond + ((and (cpad-pressed? (-> self control cpad number) r1) + (not (time-elapsed? (-> self gun combo-window-start) (seconds 0.7))) + (not (focus-test? self mech dark)) + (not (logtest? (surface-flag gun-off) (-> self control current-surface flags))) + (not (logtest? (target-flags prevent-gun invisible) (-> self target-flags))) + (zero? (-> self gun track-target-hold-time)) + ) + (when (send-event self 'gun-combo #f) + (let ((gp-0 (combo-tracker-method-13 + (-> self gun attack-combo) + (the-as handle #f) + (-> self control trans) + 61440.0 + (-> self control c-R-w fvec) + 65536.0 + ) + ) + ) + (when gp-0 + (if (not (using-gun? self)) + (send-event self 'change-mode 'gun #f (pickup-type none)) + ) + (combo-tracker-method-12 + (-> self gun attack-combo) + (-> self control trans) + (get-trans gp-0 3) + gp-0 + (current-time) + ) + ((method-of-type focus try-update-focus) (the-as focus (-> self gun track-target)) gp-0) + (try-update-focus (-> self gun track-target 1) gp-0) + (set! (-> self gun track-trans quad) (-> (get-trans gp-0 3) quad)) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set-time! (-> self gun fire-pending-time)) + (target-gun-combo-start 20 (seconds 0.4)) + (send-event self 'gun-combo #t) + (case (-> self gun combo-window-state) + (('target-attack 'target-running-attack) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-red) (pickup-type eco-dark)) + ) + (else + (+! (-> self gun fire-pending) 2) + ) + ) + ) + ) + ) + ) + ) + ) + ((and (cpad-pressed? (-> self control cpad number) r1) + (not (focus-test? self mech dark)) + (using-gun? self) + (logtest? (surface-flag gun-turn-fast) (-> self control current-surface flags)) + (not (logtest? (target-flags prevent-gun invisible) (-> self target-flags))) + (zero? (-> self gun track-target-hold-time)) + (or (zero? (-> self gun turn-fast-hold-time)) (>= (current-time) (-> self gun turn-fast-hold-time))) + ) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set-time! (-> self gun fire-pending-time)) + (target-top-anim-base-mode 60) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) + (set! (-> self gun turn-fast-hold-time) (+ (current-time) (seconds 0.2))) + (send-event self 'gun-combo #t) + ) + ) + (when (and (not (using-gun? self)) (want-to-gun? self #f)) + (let ((gp-2 (nonzero? (-> self gun using-gun-type)))) + (send-event self 'change-mode 'gun #f (-> self gun using-gun-type)) + (when (and (not gp-2) (or (cpad-hold? (-> self control cpad number) r1) (-> self gun latch?))) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set-time! (-> self gun fire-pending-time)) + ) + ) + ) + (cond + ((using-gun? self) + (when (and (nonzero? (-> self gun top-anim-twist-reset)) + (< (the-as time-frame (-> self gun top-anim-twist-reset)) (current-time)) + ) + (quat<-gun! (the-as quaternion (-> self gun top-anim-twist-targ)) (the-as quaternion (-> self gun gun-type))) + (set! (-> self gun top-anim-twist-reset) (the-as uint 0)) + 0 + ) + (cond + ((and (= (-> self control collide-mode) 'normal) (!= (-> self control collide-mode) 'duck)) + (target-collide-set! 'gun 0.0) + ) + ((= (-> self control collide-mode) 'gun) + (cond + ((or (and (not (logtest? (-> self control status) (collide-status on-surface))) + (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (< 2048.0 (target-height-above-ground)) + ) + ) + (focus-test? self edge-grab) + (-> *setting-control* user-current doorway) + ) + (if (!= (-> self control duck-gun-tube-transision) 0.0) + (target-collide-set! 'gun 0.0) + ) + ) + (else + (when (!= (-> self control duck-gun-tube-transision) 1.0) + (when (= (-> self control collide-mode) 'gun) + (let ((gp-3 (new 'stack-no-clear 'collide-query)) + (s5-2 (new 'stack-no-clear 'inline-array 'sphere 1)) + ) + (dotimes (s4-1 1) + ((method-of-type sphere new) (the-as symbol (-> s5-2 s4-1)) sphere) + ) + (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (set! (-> s5-2 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) + (set! (-> s5-2 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-1 0.0 1.0)) + (let ((v1-214 gp-3)) + (set! (-> v1-214 spheres) s5-2) + (set! (-> v1-214 best-other-prim) (the-as collide-shape-prim 1)) + (set! (-> v1-214 collide-with) (-> self control root-prim prim-core collide-with)) + (set! (-> v1-214 ignore-process0) #f) + (set! (-> v1-214 ignore-process1) #f) + (set! (-> v1-214 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-214 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-214 action-mask) (collide-action solid)) + ) + (if (not (fill-and-probe-using-spheres *collide-cache* gp-3)) + (target-collide-set! 'gun f30-1) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (target-gun-find-track) + (cond + ((and (= (gun->eco (-> self gun gun-type)) (pickup-type eco-blue)) + (not (logtest? (-> self gun track?) (gun-track-flags gutflags-0))) + ) + (let ((f0-8 (vector-vector-distance (-> self gun fire-point) (-> self gun laser-hit-point)))) + (cond + ((< f0-8 122880.0) + (seek! + (-> self gun top-anim-tilt-up) + (lerp-scale -1820.4445 0.0 f0-8 61440.0 122880.0) + (* 5461.3335 (seconds-per-frame)) + ) + ) + ((!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (seek! (-> self gun top-anim-tilt-up) 0.0 (* 1820.4445 (seconds-per-frame))) + ) + ) + ) + (quaternion-rotate-x! + (the-as quaternion (-> self gun top-anim-twist-targ)) + (the-as quaternion *null-vector*) + (-> self gun top-anim-tilt-up) + ) + ) + (else + (set! (-> self gun top-anim-tilt-up) 0.0) + (quat<-gun! (the-as quaternion (-> self gun top-anim-twist-targ)) (the-as quaternion (-> self gun gun-type))) + ) + ) + (quaternion-slerp! + (the-as quaternion (-> self gun top-anim-twist)) + (the-as quaternion (-> self gun top-anim-twist)) + (the-as quaternion (-> self gun top-anim-twist-targ)) + 0.1 + ) + (trs-set! + (-> self upper-body) + (the-as vector #f) + (the-as quaternion (-> self gun top-anim-twist)) + (the-as vector #f) + ) + (cond + ((or (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) + (and (nonzero? (-> self gun turn-fast-hold-time)) (< (current-time) (-> self gun turn-fast-hold-time))) + (and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (logtest? (-> self gun track?) (gun-track-flags gutflags-2)) + ) + (or (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + (focus-test? self pilot-riding) + ) + ) + (seek! (-> self upper-body twist z) 0.0 (* 65536.0 (seconds-per-frame))) + ) + ((logtest? (surface-flag gun-no-twist) (-> self control current-surface flags)) + (seek! (-> self upper-body twist z) 0.0 (* 16384.0 (seconds-per-frame))) + ) + ((and (< 0.0 (-> self control turn-to-magnitude)) + (not (logtest? (-> self control current-surface flags) (surface-flag duck))) + ) + (let* ((f0-28 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) + (f0-30 (fmax -5461.3335 (fmin 5461.3335 f0-28))) + ) + (seek! (-> self upper-body twist z) f0-30 (fabs (* 0.2 f0-30))) + ) + ) + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> self control trans quad)) + (if (logtest? (surface-flag gun-no-twist) (-> self control current-surface flags)) + (set! (-> self upper-body flex-blend) 0.0) + (seek! (-> self upper-body flex-blend) 1.0 (* 8.0 (seconds-per-frame))) + ) + (when (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (set! (-> self gun top-anim-look-at quad) (-> self gun track-trans quad)) + (let ((gp-6 (new 'stack-no-clear 'vector))) + (set! (-> gp-6 quad) (-> self gun top-anim-look-at quad)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (+! (-> gp-6 y) -409.6) + ) + (((pickup-type eco-blue)) + (+! (-> gp-6 y) 2457.6) + ) + (else + (+! (-> gp-6 y) -1638.4) + ) + ) + (if (not (logtest? (surface-flag gun-no-twist) (-> self control current-surface flags))) + (target-set! (-> self upper-body) gp-6) + ) + (when *gun-marks* + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> self gun top-anim-look-at) + (meters 0.2) + (the-as rgba (new 'static 'rgba :r #xff :a #x80)) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + gp-6 + (meters 0.1) + (the-as rgba (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + ) + ) + (let ((v1-341 (-> self neck))) + (set! (-> v1-341 blend) 0.0) + ) + ) + (cond + ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (logtest? (process-mask->search-info-flag + (the-as process-focusable (handle->process (-> self gun track-target 0 handle))) + ) + (search-info-flag guard enemy attackable-priority) + ) + ) + (if (and (not (time-elapsed? (-> self gun track-press-start-time) (seconds 0.5))) + (< (-> self control time-between-zero-inputs) (seconds 0.5)) + (and (= (-> self control turn-to-magnitude) 0.0) + (not (logtest? (-> self control current-surface flags) (surface-flag air attack))) + (-> self gun active?) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + ) + (cond + ((or (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) + (and (nonzero? (-> self gun turn-fast-hold-time)) (< (current-time) (-> self gun turn-fast-hold-time))) + ) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) + (set! (-> self gun upper-body twist-max y) 21845.334) + (set! (-> self gun upper-body twist-speed-y) 0.2) + (set! (-> self gun upper-body twist-speed-x) 0.6) + ) + ((and (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) + ) + (< (vector-vector-distance (-> self control trans) (-> self gun track-trans)) 81920.0) + ) + (set! (-> self gun upper-body twist-max y) 16384.0) + (set! (-> self gun upper-body twist-speed-y) 0.2) + (set! (-> self gun upper-body twist-speed-x) 0.1) + ) + ((or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (let ((f30-2 10922.667) + (gp-10 deg-diff) + (v1-424 (-> self control)) + (a1-49 (-> self gun track-trans)) + ) + (>= f30-2 + (gp-10 + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) a1-49 (-> v1-424 trans))) + (vector-y-angle (-> self control to-target-pt-xz)) + ) + ) + ) + ) + (set! (-> self gun upper-body twist-max y) + (lerp-scale + 10922.667 + (-> self gun track-turn-max) + (vector-vector-distance (-> self control trans) (-> self gun track-trans)) + 20480.0 + 61440.0 + ) + ) + (set! (-> self gun upper-body twist-speed-y) + (lerp-scale + 0.3 + 0.1 + (vector-vector-distance (-> self control trans) (-> self gun track-trans)) + 16384.0 + 40960.0 + ) + ) + (set! (-> self gun upper-body twist-speed-x) 0.1) + ) + (else + (set! (-> self gun upper-body twist-max y) (-> self gun track-turn-max)) + (set! (-> self gun upper-body twist-speed-y) 0.1) + (set! (-> self gun upper-body twist-speed-x) 0.1) + ) + ) + ) + (else + (set! (-> self gun upper-body twist-max y) (-> self gun track-turn-max)) + (set! (-> self gun upper-body twist-speed-y) 0.1) + (set! (-> self gun upper-body twist-speed-x) 0.1) + ) + ) + (set! (-> self gun upper-body track-mode) (the-as track-mode (-> self gun track?))) + (when (not (time-elapsed? (-> self gun fire-time) (seconds 1.5))) + (let ((v1-466 (-> self neck))) + (set! (-> v1-466 blend) 0.0) + ) + ) + ) + (else + (seek! (-> self upper-body flex-blend) 0.0 (* 16.0 (seconds-per-frame))) + (seek! (-> self upper-body twist z) 0.0 (* 65536.0 (seconds-per-frame))) + ) + ) + 0 + (none) + ) + +(defbehavior target-gun-joint-pre target () + (local-vars (gp-0 art-element)) + (target-gun-joint-pre0) + (cond + ((focus-test? self pilot-riding) + (let ((v1-3 (gun->eco (-> self gun gun-type)))) + (set! (-> self skel top-anim base-anim) (cond + ((= v1-3 (pickup-type eco-yellow)) + jakb-pilot-gun-yellow-idle-ja + ) + ((= v1-3 (pickup-type eco-red)) + jakb-pilot-gun-red-idle-ja + ) + ((= v1-3 (pickup-type eco-blue)) + jakb-pilot-gun-blue-idle-ja + ) + (else + jakb-pilot-gun-dark-idle-ja + ) + ) + ) + ) + ) + (else + (let ((v1-14 (gun->eco (-> self gun gun-type)))) + (set! gp-0 + (cond + ((= v1-14 (pickup-type eco-yellow)) + (let ((v1-17 (ja-group))) + (cond + ((and (and v1-17 (or (= v1-17 self) (= v1-17 jakb-gun-walk-side-ja) (= v1-17 jakb-wade-shallow-walk-ja))) + (< (-> self gun top-anim-low-high) 0.5) + ) + (let ((s5-0 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 (if (< 0.9 (-> self control unknown-float002)) + jakb-gun-front-run-ja + jakb-gun-front-walk-ja + ) + ) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-0 (= (-> s5-0 frame-group) gp-0)) + (set! (-> s5-0 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + ((let ((v1-42 (ja-group))) + (and (and v1-42 (or (= v1-42 self) (= v1-42 jakb-gun-duck-walk-ja))) (< (-> self gun top-anim-low-high) 0.5)) + ) + (let ((s5-1 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 jakb-gun-duck-walk-ja) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-1 (= (-> s5-1 frame-group) gp-0)) + (set! (-> s5-1 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + ((< (-> self gun top-anim-low-high) 0.5) + jakb-gun-stance-yellow-low-ja + ) + (else + (when (and (or (time-elapsed? (-> self gun fire-time) (seconds 1.5)) + (= (-> self gun gun-type) (pickup-type gun-yellow-3)) + ) + (let ((v1-74 (-> self skel top-anim frame-group))) + (or (= v1-74 jakb-gun-yellow-highlow-ja) (= v1-74 jakb-gun-stance-yellow-ja)) + ) + (not (logtest? (focus-status pilot) (-> self focus-status))) + ) + (seek! (-> self gun top-anim-low-high) 0.0 (* 6.0 (seconds-per-frame))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-yellow-highlow-ja) + 0.0 + 0 + 60 + (if (< 20480.0 (-> self control ctrl-xz-vel)) + 2.0 + 1.0 + ) + 0.0 + #f + ) + ) + jakb-gun-stance-yellow-ja + ) + ) + ) + ) + ((= v1-14 (pickup-type eco-red)) + (let ((v1-92 (ja-group))) + (cond + ((and v1-92 (or (= v1-92 self) (= v1-92 jakb-walk-ja) (= v1-92 jakb-wade-shallow-walk-ja))) + (let ((s5-2 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 (if (< 0.9 (-> self control unknown-float002)) + jakb-gun-front-run-ja + jakb-gun-front-walk-ja + ) + ) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-2 (= (-> s5-2 frame-group) gp-0)) + (set! (-> s5-2 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + (else + (let ((v1-114 (ja-group))) + (cond + ((and v1-114 (or (= v1-114 self) (= v1-114 jakb-gun-duck-walk-ja))) + (let ((s5-3 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 jakb-gun-duck-walk-ja) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-3 (= (-> s5-3 frame-group) gp-0)) + (set! (-> s5-3 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + ((or (< (-> self gun top-anim-low-high) 0.5) (nonzero? (-> self ext-anim))) + jakb-gun-stance-ja + ) + (else + (when (and (or (time-elapsed? (-> self gun fire-time) (seconds 2.5)) + (= (-> self gun gun-type) (pickup-type gun-red-2)) + (and (< 4096.0 (-> self control ctrl-xz-vel)) (time-elapsed? (-> self gun fire-time) (seconds 1.25))) + ) + (let ((v1-153 (-> self skel top-anim frame-group))) + (or (= v1-153 jakb-gun-stance-red-sideways-ja) + (= v1-153 jakb-gun-red-from-sideways-ja) + (= v1-153 jakb-gun-stance-ja) + ) + ) + ) + (seek! (-> self gun top-anim-low-high) 0.0 (* 6.0 (seconds-per-frame))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-from-sideways-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + jakb-gun-stance-red-sideways-ja + ) + ) + ) + ) + ) + ) + ) + ((= v1-14 (pickup-type eco-blue)) + (let ((v1-168 (ja-group))) + (cond + ((and (and v1-168 (or (= v1-168 self) (= v1-168 jakb-gun-walk-side-ja) (= v1-168 jakb-wade-shallow-walk-ja))) + (< (-> self gun top-anim-low-high) 0.5) + (or (time-elapsed? (-> self gun fire-time) (seconds 0.2)) + (and (= (-> self gun gun-type) (pickup-type gun-blue-2)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-gun-stance))) + ) + ) + ) + (let ((s5-4 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 (if (< 0.9 (-> self control unknown-float002)) + jakb-gun-run-blue-ja + jakb-gun-walk-blue-ja + ) + ) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-4 (= (-> s5-4 frame-group) gp-0)) + (set! (-> s5-4 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + ((and (= (-> self gun gun-type) (pickup-type gun-blue-2)) + (not (time-elapsed? (-> self gun fire-time) (seconds 0.05))) + (-> self next-state) + (= (-> self next-state name) 'target-gun-stance) + ) + jakb-gun-blue-stance-2-ja + ) + (else + jakb-gun-stance-blue-ja + ) + ) + ) + ) + ((let ((v1-218 (ja-group))) + (and v1-218 (or (= v1-218 self) (= v1-218 jakb-walk-ja) (= v1-218 jakb-wade-shallow-walk-ja))) + ) + (let ((s5-5 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 (if (< 0.9 (-> self control unknown-float002)) + jakb-gun-front-run-ja + jakb-gun-front-walk-ja + ) + ) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-5 (= (-> s5-5 frame-group) gp-0)) + (set! (-> s5-5 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + (else + (let ((v1-240 (ja-group))) + (cond + ((and v1-240 (or (= v1-240 self) (= v1-240 jakb-gun-duck-walk-ja))) + (let ((s5-6 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 jakb-gun-duck-walk-ja) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-6 (= (-> s5-6 frame-group) gp-0)) + (set! (-> s5-6 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + (else + jakb-gun-stance-dark-ja + ) + ) + ) + ) + ) + ) + ) + (set! (-> self skel top-anim base-anim) gp-0) + ) + ) + 0 + (none) + ) + +(defbehavior target-gun-compute-pos target () + (let ((a1-0 (-> self node-list data 36 bone transform)) + (a2-0 (if (-> self sidekick) + (-> self sidekick 0 node-list data 28 bone transform) + (-> self node-list data 36 bone transform) + ) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (matrix-lerp! gp-0 a1-0 a2-0 (-> self gun gun-daxter)) + (matrix->transformq (-> self gun gun-pos) gp-0) + (set! (-> self gun gun-pos scale quad) (-> self control scale quad)) + (when (and (using-gun? self) + (and (focus-test? self edge-grab) (let ((v1-18 (ja-group))) + (and v1-18 (or (= v1-18 jakb-jump-loop-ja) + (= v1-18 jakb-falling-to-edge-grab-ja) + (= v1-18 jakb-edge-grab-stance0-ja) + (= v1-18 jakb-edge-grab-stance1-ja) + ) + ) + ) + ) + ) + (let ((s4-0 (new 'static 'vector :y 491.52 :w 1.0)) + (a1-5 (new 'static 'vector :x -16384.0 :z -16384.0 :w 1.0)) + (s5-0 (new 'stack-no-clear 'quaternion)) + ) + (matrix-rotate-xyz! gp-0 a1-5) + (matrix->quaternion s5-0 gp-0) + (vector+! (the-as vector (-> self gun gun-pos)) (-> *edge-grab-info* center-hold) s4-0) + (vector+float*! + (the-as vector (-> self gun gun-pos)) + (the-as vector (-> self gun gun-pos)) + (-> self node-list data 0 bone transform fvec) + 778.24 + ) + (quaternion-normalize! (quaternion*! (-> self gun gun-pos quat) (-> self control quat) s5-0)) + ) + ) + gp-0 + ) + ) + +(defbehavior target-gun-joint-points target () + (when (-> self gun gun) + (set! (-> self gun gun-daxter) + (if (and (focus-test? self pilot-riding) + (nonzero? (-> self skel float-channels)) + (= (-> (get-channel (-> self skel top-anim) (the-as int (+ (-> self skel float-channels) -1))) frame-interp 1) + 1.0 + ) + ) + 1.0 + 0.0 + ) + ) + (cond + ((using-gun? self) + (set! (-> self gun gun-roty-targ) (y-angle (-> self control))) + (set! (-> self gun gun-roty) (-> self gun gun-roty-targ)) + (set! (-> self gun gun-roty-rel) 0.0) + (let ((v1-24 (get-channel (-> self skel top-anim) 0))) + (cond + ((not v1-24) + ) + ((handle->process (-> self gun charge-active?)) + (cond + ((and (= (-> v1-24 frame-group) jakb-gun-dark-fire-ja) (>= (-> v1-24 frame-num) 8.5)) + (set! (-> v1-24 frame-num) 5.0) + ) + ((and (= (-> v1-24 frame-group) jakb-pilot-gun-dark-fire-ja) (>= (-> v1-24 frame-num) 8.0)) + (set! (-> v1-24 frame-num) 3.0) + ) + ((and (= (-> v1-24 frame-group) jakb-gun-red-fire-2-ja) (>= (-> v1-24 frame-num) 8.5)) + (set! (-> v1-24 frame-num) 5.0) + ) + ((not (-> self skel top-anim frame-targ)) + (case (-> self gun gun-type) + (((pickup-type gun-red-2)) + (if (!= (-> v1-24 frame-group) jakb-gun-red-fire-2-ja) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-fire-2-ja) + 0.0 + 30 + 15 + 1.0 + 0.0 + #f + ) + ) + ) + (((pickup-type gun-dark-1) (pickup-type gun-dark-2) (pickup-type gun-dark-3)) + (if (!= (-> v1-24 frame-group) jakb-gun-dark-fire-ja) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-dark-fire-ja) 0.0 30 15 1.0 0.0 #f) + ) + ) + ) + ) + ) + ) + ((and (= (-> v1-24 frame-group) jakb-gun-dark-fire-ja) (< (-> v1-24 frame-num) 9.0)) + (set! (-> v1-24 frame-num) 10.0) + ) + ((and (= (-> v1-24 frame-group) jakb-pilot-gun-dark-fire-ja) (< (-> v1-24 frame-num) 9.0)) + (set! (-> v1-24 frame-num) 9.0) + ) + ((and (= (-> v1-24 frame-group) jakb-gun-red-fire-2-ja) (< (-> v1-24 frame-num) 9.0)) + (let ((a0-65 (new-stack-vector0))) + (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! a0-65 (-> self control transv) (vector-float*! a0-65 (-> self control dynam gravity-normal) f0-17)) + ) + (let* ((f0-18 (vector-length a0-65)) + (f1-8 f0-18) + (f2-0 65502.96) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! a0-65 a0-65 (/ f0-18 f1-8)) + ) + ) + ) + (set! (-> v1-24 frame-num) 10.0) + ) + ((and (= (-> v1-24 frame-group) jakb-gun-yellow-fire-3-ja) + (!= (-> self gun gun-delay-fire) 0.0) + (< (-> self gun gun-delay-fire) (-> v1-24 frame-num)) + ) + (target-gun-fire-yellow (-> self gun gun-type)) + (set! (-> self gun gun-delay-fire) 0.0) + ) + ) + ) + (set! (-> self gun active?) + (and (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> self control current-surface flags))) + (and (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) + (>= (current-time) (-> self gun surpress-time)) + (let ((v1-48 (-> self skel top-anim frame-group)) + (f0-24 (-> self skel top-anim frame-num)) + ) + (and (not (and v1-48 + (or (= v1-48 jakb-gun-red-takeout-ja) + (= v1-48 jakb-gun-blue-takeout-ja) + (= v1-48 jakb-gun-yellow-takeout-ja) + (= v1-48 jakb-gun-dark-takeout-ja) + (and jakb-pilot-gun-red-takeout-ja + (or (= v1-48 jakb-pilot-gun-red-takeout-ja) + (= v1-48 jakb-pilot-gun-blue-takeout-ja) + (= v1-48 jakb-pilot-gun-yellow-takeout-ja) + (= v1-48 jakb-pilot-gun-dark-takeout-ja) + (= v1-48 jakb-pilot-gun-red-dark-ja) + (= v1-48 jakb-pilot-gun-red-yellow-ja) + (= v1-48 jakb-pilot-gun-red-blue-ja) + (= v1-48 jakb-pilot-gun-yellow-blue-ja) + ) + ) + (and (= v1-48 jakb-gun-attack-butt-end-ja) (>= 6.8 f0-24)) + (or (and (= v1-48 jakb-gun-attack-butt-blue-end-ja) (>= 6.8 f0-24)) + (and jakb-gun-dark-fire-twirl-ja + (or (= v1-48 jakb-gun-dark-fire-twirl-ja) (= v1-48 jakb-gun-yellow-fire-twirl-ja)) + ) + (= v1-48 jakb-gun-transformation-twirl-ja) + (= v1-48 jakb-gun-front-to-side-hop-ja) + (= v1-48 jakb-gun-side-to-front-hop-ja) + (= v1-48 jakb-gun-side-to-side-hop-1-ja) + (= v1-48 jakb-gun-side-to-side-hop-2-ja) + (= v1-48 jakb-gun-blue-to-front-hop-ja) + (= v1-48 jakb-gun-front-to-blue-hop-ja) + (= v1-48 jakb-gun-hit-from-front-ja) + (= v1-48 jakb-gun-hit-from-back-ja) + ) + ) + ) + ) + (let ((v1-53 (-> self skel top-anim frame-group-push))) + (not (and v1-53 + (or (= v1-53 jakb-gun-red-takeout-ja) + (= v1-53 jakb-gun-blue-takeout-ja) + (= v1-53 jakb-gun-yellow-takeout-ja) + (= v1-53 jakb-gun-dark-takeout-ja) + (and jakb-pilot-gun-red-takeout-ja + (or (= v1-53 jakb-pilot-gun-red-takeout-ja) + (= v1-53 jakb-pilot-gun-blue-takeout-ja) + (= v1-53 jakb-pilot-gun-yellow-takeout-ja) + (= v1-53 jakb-pilot-gun-dark-takeout-ja) + (= v1-53 jakb-pilot-gun-red-dark-ja) + (= v1-53 jakb-pilot-gun-red-yellow-ja) + (= v1-53 jakb-pilot-gun-red-blue-ja) + (= v1-53 jakb-pilot-gun-yellow-blue-ja) + ) + ) + (and jakb-gun-dark-fire-twirl-ja + (or (= v1-53 jakb-gun-dark-fire-twirl-ja) (= v1-53 jakb-gun-yellow-fire-twirl-ja)) + ) + (= v1-53 jakb-gun-transformation-twirl-ja) + (= v1-53 jakb-gun-front-to-side-hop-ja) + (= v1-53 jakb-gun-side-to-front-hop-ja) + (= v1-53 jakb-gun-side-to-side-hop-1-ja) + (= v1-53 jakb-gun-side-to-side-hop-2-ja) + (= v1-53 jakb-gun-blue-to-front-hop-ja) + (= v1-53 jakb-gun-front-to-blue-hop-ja) + (= v1-53 jakb-gun-hit-from-front-ja) + (= v1-53 jakb-gun-hit-from-back-ja) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (if (-> self gun active?) + (set-time! (-> self gun active-time)) + ) + (set! (-> self gun laser-active?) + (not (logtest? (surface-flag gun-inactive gun-hide gun-off laser-hide) (-> self control current-surface flags)) + ) + ) + (when (and (not (and (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> self control current-surface flags))) + (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) + (>= (current-time) (-> self gun surpress-time)) + ) + ) + (and (time-elapsed? (-> self gun fire-pending-time) (seconds 0.2)) + (time-elapsed? (-> self gun active-time) (seconds 0.2)) + (= (-> self gun fire-pending) 1) + ) + ) + (set! (-> self gun fire-pending) 0) + 0 + ) + (if (and (or (logtest? (surface-flag gun-hide gun-off) (-> self control current-surface flags)) + (logtest? (target-flags prevent-gun invisible) (-> self target-flags)) + (and (or (and (cpad-hold? (-> self control cpad number) up) + (>= (- (-> *display* real-clock frame-counter) (-> self gun gun-select-time 0)) (seconds 0.8)) + ) + (and (cpad-hold? (-> self control cpad number) down) + (>= (- (-> *display* real-clock frame-counter) (-> self gun gun-select-time 1)) (seconds 0.8)) + ) + (and (cpad-hold? (-> self control cpad number) left) + (>= (- (-> *display* real-clock frame-counter) (-> self gun gun-select-time 2)) (seconds 0.8)) + ) + (and (cpad-hold? (-> self control cpad number) right) + (>= (- (-> *display* real-clock frame-counter) (-> self gun gun-select-time 3)) (seconds 0.8)) + ) + ) + (not (cpad-hold? (-> self control cpad number) r1)) + (not (logtest? (surface-flag gun-inactive) (-> self control current-surface flags))) + (not (logtest? (-> self focus-status) (focus-status grabbed))) + ) + (or (-> self gun put-away?) + (not (logtest? (-> self game features) (game-feature gun))) + (not (logtest? (the-as game-feature (ash 1 (+ (the-as int (-> self gun gun-type)) -20))) + (logand (-> self game features) (-> *setting-control* user-current features)) + ) + ) + (not (-> *setting-control* user-current gun)) + (focus-test? self dead dark) + (-> self board latch?) + ) + ) + (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) + (let ((v1-170 (-> self skel top-anim frame-targ))) + (or (not v1-170) + (= v1-170 jakb-gun-side-jump-ja) + (= v1-170 jakb-gun-front-jump-ja) + (= v1-170 jakb-gun-side-jump-land-ja) + (= v1-170 jakb-gun-front-jump-land-ja) + (= v1-170 jakb-gun-front-run-ja) + (= v1-170 jakb-gun-front-walk-ja) + (= v1-170 jakb-gun-run-blue-ja) + (= v1-170 jakb-gun-walk-blue-ja) + (logtest? (surface-flag gun-fast-exit) (-> self control current-surface flags)) + ) + ) + ) + (target-gun-end-mode (not (logtest? (surface-flag gun-hide) (-> self control current-surface flags)))) + ) + ) + (else + (set! (-> self gun active?) #f) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defbehavior target-gun-fire target ((arg0 pickup-type)) + (when (using-gun? self) + (set! (-> self gun gun-delay-fire) 0.0) + (let ((gp-0 (-> self gun)) + (s5-0 (gun->ammo arg0)) + ) + #t + (let* ((v1-2 (gun->eco (-> gp-0 gun-type))) + (v1-3 (cond + ((= v1-2 (pickup-type eco-yellow)) + (target-gun-can-fire-yellow? arg0) + ) + ((= v1-2 (pickup-type eco-red)) + (target-gun-can-fire-red? arg0) + ) + ((= v1-2 (pickup-type eco-blue)) + (target-gun-can-fire-blue? arg0) + ) + ((= v1-2 (pickup-type eco-dark)) + (target-gun-can-fire-dark? arg0) + ) + ) + ) + (f0-1 (-> self game gun-ammo (+ s5-0 -15))) + ) + (cond + ((and v1-3 (or (>= f0-1 (-> self gun ammo-required)) + (logtest? (target-flags tf16) (-> self target-flags)) + (logtest? (game-secrets endless-ammo) (-> self game secrets)) + ) + ) + (send-event (handle->process (-> self gun track-target 0 handle)) 'tracked-fire (-> gp-0 gun-type)) + (case (-> gp-0 gun-type) + (((pickup-type gun-blue-1) + (pickup-type gun-yellow-1) + (pickup-type gun-dark-1) + (pickup-type gun-red-1) + (pickup-type gun-red-3) + (pickup-type gun-yellow-2) + (pickup-type gun-dark-2) + (pickup-type gun-dark-3) + ) + (pickup-collectable! (-> self fact) s5-0 (- (-> self gun ammo-required)) (the-as handle #f)) + (if (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (not (logtest? (-> self lightjak stage) (lightjak-stage ls1))) + ) + (pickup-collectable! (-> self fact) (pickup-type eco-pill-light) -1.0 (the-as handle #f)) + ) + ) + ) + (case (-> gp-0 gun-type) + (((pickup-type gun-blue-1) (pickup-type gun-blue-3)) + (cond + ((focus-test? self pilot-riding) + (let ((v1-39 (get-channel (-> self skel top-anim) 0))) + (when (not (or (= (-> self skel top-anim frame-group) jakb-pilot-gun-blue-fire-ja) + (and v1-39 (= (-> v1-39 frame-group) jakb-pilot-gun-blue-fire-ja)) + ) + ) + (if (< 4096.0 (-> self control ctrl-xz-vel)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-fire-single-ja) + 1.0 + 9 + 9 + 1.0 + 0.0 + #f + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-fire-single-ja) + 1.0 + 6 + 6 + 1.0 + 0.0 + #f + ) + ) + ) + ) + ) + (else + (let ((v1-56 (get-channel (-> self skel top-anim) 0))) + (when (not (or (= (-> self skel top-anim frame-group) jakb-gun-blue-fire-ja) + (and v1-56 (= (-> v1-56 frame-group) jakb-gun-blue-fire-ja)) + ) + ) + (if (< 4096.0 (-> self control ctrl-xz-vel)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-fire-single-ja) + 1.0 + 9 + 9 + 1.0 + 0.0 + #f + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-fire-single-ja) + 1.0 + 6 + 6 + 1.0 + 0.0 + #f + ) + ) + ) + ) + ) + ) + (target-gun-fire-blue (-> self gun gun-type)) + ) + (((pickup-type gun-blue-2)) + (let ((v1-75 (get-channel (-> self skel top-anim) 0))) + (if (not (or (= (-> self skel top-anim frame-group) jakb-gun-blue-fire-2-ja) + (and v1-75 (= (-> v1-75 frame-group) jakb-gun-blue-fire-2-ja)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-gun-stance))) + ) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-fire-2-ja) + 0.0 + (cond + ((and v1-75 + (or (= (-> v1-75 frame-group) jakb-gun-blue-fire-2-ja) (= (-> v1-75 frame-group) jakb-gun-blue-stance-2-ja)) + ) + 0 + ) + ((not (time-elapsed? (-> self gun fire-time) (seconds 0.05))) + 75 + ) + (else + 15 + ) + ) + 15 + 1.0 + 0.0 + #f + ) + ) + ) + (target-gun-fire-blue (-> self gun gun-type)) + ) + (((pickup-type gun-yellow-1) (pickup-type gun-yellow-2)) + (cond + ((focus-test? self pilot-riding) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-fire-ja) + 0.0 + 15 + 0 + 1.0 + 0.0 + #f + ) + ) + ((< (-> self gun top-anim-low-high) 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-yellow-fire-low-ja) + 0.0 + 15 + 0 + 1.0 + 0.0 + #f + ) + (set! (-> self gun top-anim-low-high) 1.0) + ) + (else + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-yellow-fire-ja) 0.0 0 0 1.0 0.0 #f) + ) + ) + (target-gun-fire-yellow (-> self gun gun-type)) + ) + (((pickup-type gun-yellow-3)) + (cond + ((focus-test? self pilot-riding) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-fire-ja) + 0.0 + 15 + 0 + 1.0 + 0.0 + #f + ) + (target-gun-fire-yellow (-> self gun gun-type)) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-yellow-fire-3-ja) + 0.0 + 0 + 15 + 1.0 + 0.0 + #f + ) + (set! (-> self gun gun-delay-fire) 2.5) + ) + ) + ) + (((pickup-type gun-red-1) (pickup-type gun-red-3)) + 1.0 + (let* ((s5-1 600) + (s4-1 (or (and (logtest? (game-secrets gun-upgrade-red-1) (-> *game-info* secrets)) + (= (-> gp-0 gun-type) (pickup-type gun-red-1)) + ) + (and (logtest? (game-secrets gun-upgrade-red-3) (-> *game-info* secrets)) + (= (-> gp-0 gun-type) (pickup-type gun-red-3)) + ) + ) + ) + (f30-0 (if s4-1 + 1.4 + 1.0 + ) + ) + ) + (cond + ((focus-test? self pilot-riding) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-fire-ja) + 0.0 + 15 + 0 + (if (= f30-0 1.0) + f30-0 + (* 1.05 f30-0) + ) + 0.0 + #f + ) + ) + ((and (< 0.5 (-> self gun top-anim-low-high)) (zero? (-> self ext-anim))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-fire-from-sideways-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + (set! (-> self gun top-anim-low-high) 0.0) + ) + ((and (rand-vu-percent? 0.2) + (not (time-elapsed? (-> self gun fire-time) s5-1)) + (= (-> self ext-anim) (target-anim default)) + (= (-> gp-0 gun-type) (pickup-type gun-red-1)) + (not (logtest? (game-secrets gun-upgrade-red-1) (-> self game secrets))) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-dark-fire-twirl-ja) + 0.0 + 0 + 15 + (if (logtest? (game-feature feature21) (-> self game features)) + 1.7 + 1.0 + ) + 0.0 + #f + ) + ) + ((and (or (rand-vu-percent? 0.2) (= (-> self skel top-anim frame-targ) jakb-gun-red-fire-ja)) + (and (not (time-elapsed? (-> self gun fire-time) s5-1)) (zero? (-> self ext-anim))) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-fire-to-sideways-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + (set! (-> self gun top-anim-low-high) 1.0) + ) + (s4-1 + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-fire-fast-ja) + 0.0 + 0 + 15 + 1.0 + 0.0 + #f + ) + ) + (else + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-red-fire-ja) 1.0 0 15 f30-0 0.0 #f) + ) + ) + ) + (target-gun-fire-red (-> self gun gun-type)) + ) + (((pickup-type gun-dark-1) (pickup-type gun-dark-2) (pickup-type gun-dark-3)) + (if (focus-test? self pilot-riding) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-dark-fire-ja) + 0.0 + 30 + 15 + 1.0 + 0.0 + #f + ) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-dark-fire-ja) 0.0 30 15 1.0 0.0 #f) + ) + (target-gun-fire-dark (-> self gun gun-type)) + ) + (((pickup-type gun-red-2)) + (if (focus-test? self pilot-riding) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-dark-fire-ja) + 0.0 + 30 + 15 + 1.0 + 0.0 + #f + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-fire-2-ja) + 0.0 + 30 + 15 + 1.0 + 0.0 + #f + ) + ) + (target-gun-fire-red (-> self gun gun-type)) + ) + ) + #t + ) + (else + (let ((v1-231 (target-gun-ammo-out-pick))) + (cond + ((nonzero? v1-231) + (if (nonzero? v1-231) + (set! (-> self gun using-gun-type) (the-as pickup-type v1-231)) + ) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + ) + (else + (sound-play "walk-san1") + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defbehavior target-gun-check target () + (when (using-gun? self) + (let ((gp-0 (-> self gun))) + (cond + ((and (focus-test? self pilot-riding) (nonzero? (-> self skel float-channels))) + (set! (-> self skel top-anim interp-select 0) (the-as uint (shl 8 32))) + (set! (-> self skel top-anim interp-select 1) (the-as uint 0)) + 0 + ) + (else + (set! (-> self skel top-anim interp-select 0) (the-as uint #x3ff0001bffffbff0)) + (set! (-> self skel top-anim interp-select 1) (the-as uint 0)) + 0 + ) + ) + (if (not (or (focus-test? self in-head) (= (gun->eco (-> self gun gun-type)) (pickup-type eco-red)))) + (gun-info-method-9 gp-0) + ) + (if (and (logtest? (surface-flag spin) (-> self control current-surface flags)) + (logtest? (-> self control current-surface flags) (surface-flag air)) + ) + (set! (-> gp-0 combo-window-state) 'target-attack-air) + ) + (if (cpad-pressed? (-> self control cpad number) r1) + (set-time! (-> gp-0 fire-start-time)) + ) + (case (-> gp-0 gun-control) + ((1) + (when (and (cpad-pressed? (-> self control cpad number) r1) + (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) + ) + (set-time! (-> gp-0 fire-pending-time)) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set! (-> gp-0 fire-charge) 0.5) + ) + (when (and (or (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) + (case (-> gp-0 combo-window-state) + (('target-attack-air 'target-attack 'target-running-attack) + (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 combo-fire-delay))) + ) + ) + ) + (> (-> gp-0 fire-pending) 0) + (-> self gun active?) + ) + (seekl! (-> self gun fire-pending) 0 1) + (cond + ((send-event self 'gun (-> gp-0 gun-type)) + (set-time! (-> self gun fire-time)) + ) + (else + (set! (-> self gun fire-time) 0) + 0 + ) + ) + #t + ) + ) + ((2) + (when (and (cpad-hold? (-> self control cpad number) r1) + (and (not (handle->process (-> self gun charge-active?))) + (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) + ) + ) + (set-time! (-> gp-0 fire-pending-time)) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set! (-> gp-0 fire-charge) 0.5) + ) + (when (and (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) + (> (-> gp-0 fire-pending) 0) + (-> self gun active?) + ) + (seekl! (-> self gun fire-pending) 0 1) + (cond + ((send-event self 'gun (-> gp-0 gun-type)) + (set-time! (-> self gun fire-time)) + ) + (else + (set! (-> self gun fire-time) 0) + 0 + ) + ) + #t + ) + ) + ((4) + (cond + ((and (cpad-hold? (-> self control cpad number) r1) (-> gp-0 active?)) + (seek! (-> gp-0 fire-spinv) 218453.33 (* 145635.56 (seconds-per-frame))) + (if (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) + (set! (-> gp-0 fire-spinv) 218453.33) + ) + ) + (else + (seek! (-> gp-0 fire-spinv) 0.0 (* 109226.664 (seconds-per-frame))) + ) + ) + (set! (-> gp-0 fire-spin) + (the float (sar (shl (the int (+ (-> gp-0 fire-spin) (* (-> gp-0 fire-spinv) (seconds-per-frame)))) 48) 48)) + ) + (cond + ((= (-> gp-0 gun-type) (pickup-type gun-blue-2)) + (set! (-> gp-0 fire-delay) (the-as uint 0)) + 0 + ) + (else + (set! (-> gp-0 fire-delay) (the-as uint (the int (lerp-scale 120.0 30.0 (-> gp-0 fire-spinv) 0.0 218453.33)))) + ) + ) + (when (and (>= (-> gp-0 fire-spinv) 218453.33) + (and (or (< 0.0 (-> self game gun-ammo 2)) + (logtest? (target-flags tf16) (-> self target-flags)) + (logtest? (game-secrets endless-ammo) (-> self game secrets)) + ) + (and (-> gp-0 active?) + (or (= (-> gp-0 gun-type) (pickup-type gun-blue-1)) (= (-> gp-0 gun-type) (pickup-type gun-blue-3))) + (not (or (= (-> self skel top-anim frame-group) jakb-gun-blue-fire-ja) + (= (-> self skel top-anim frame-group) jakb-pilot-gun-blue-fire-ja) + ) + ) + ) + ) + ) + (let* ((f0-23 (+ (-> self gun top-anim-blue-cycle) (the float (rand-vu-int-range 1 3)))) + (f0-24 (- f0-23 (* (the float (the int (/ f0-23 4.0))) 4.0))) + ) + (set! (-> self gun top-anim-blue-cycle) f0-24) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim (if (focus-test? self pilot-riding) + jakb-pilot-gun-blue-fire-ja + jakb-gun-blue-fire-ja + ) + ) + (* 6.0 f0-24) + 0 + 5 + 1.0 + (- 18.0 (* 6.0 f0-24)) + #f + ) + ) + ) + (when (and (cpad-hold? (-> self control cpad number) r1) + (-> self gun active?) + (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) + ) + (set-time! (-> gp-0 fire-pending-time)) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set! (-> gp-0 fire-charge) 0.5) + ) + (when (and (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) + (> (-> gp-0 fire-pending) 0) + (-> self gun active?) + ) + (seekl! (-> self gun fire-pending) 0 1) + (cond + ((send-event self 'gun (-> gp-0 gun-type)) + (set-time! (-> self gun fire-time)) + ) + (else + (set! (-> self gun fire-time) 0) + 0 + ) + ) + #t + ) + ) + ) + (case (gun->eco (-> gp-0 gun-type)) + (((pickup-type eco-blue)) + (set! (-> gp-0 blue-whine-volume) (* 0.000004577637 (-> gp-0 fire-spinv))) + (sound-play-by-name + (static-sound-name "blue-gun-whine") + (-> gp-0 blue-whine-sound-id) + (the int (* 1024.0 (fmin 1.0 (* 2.0 (-> gp-0 blue-whine-volume))))) + (the int (* 1524.0 (lerp-scale -0.9 0.5 (-> gp-0 blue-whine-volume) 0.0 1.0))) + 0 + (sound-group) + #t + ) + ) + (else + (when (!= (-> gp-0 blue-whine-volume) 0.0) + (let ((v1-253 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-253 command) (sound-command set-param)) + (set! (-> v1-253 id) (-> gp-0 blue-whine-sound-id)) + (set! (-> v1-253 params volume) -4) + (set! (-> v1-253 auto-time) 120) + (set! (-> v1-253 auto-from) 2) + (set! (-> v1-253 params mask) (the-as uint 17)) + (-> v1-253 id) + ) + (set! (-> gp-0 blue-whine-volume) 0.0) + ) + ) + ) + (set-time! (-> gp-0 gun-time)) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defun camera-rotate-to-vector ((arg0 vector) (arg1 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg0 quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> (camera-matrix) fvec quad)) + (vector-flatten! s5-0 s5-0 arg1) + (vector-normalize! s5-0 1.0) + (vector-flatten! s4-0 s4-0 arg1) + (vector-normalize! s4-0 1.0) + (let ((f30-0 (vector-y-angle s5-0)) + (f0-0 (vector-y-angle s4-0)) + ) + (send-event *camera* 'joystick (fmax -1.0 (fmin 1.0 (* 0.00018310547 (deg-diff f0-0 f30-0)))) 1.0) + ) + ) + ) + (none) + ) + +(defbehavior target-gun-real-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s4-0 (new-stack-vector0))) + (read-pad s4-0) + (turn-to-vector s4-0 (debounce-speed + (-> self control pad-magnitude) + (-> self control last-pad-magnitude) + (-> self control pad-xz-dir) + (-> self control last-pad-xz-dir) + ) + ) + ) + (add-thrust) + (add-gravity) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (let ((a2-1 (new 'stack-no-clear 'collide-query)) + (v1-13 (-> self control)) + ) + (set! (-> a2-1 collide-with) (-> v1-13 root-prim prim-core collide-with)) + (set! (-> a2-1 ignore-process0) self) + (set! (-> a2-1 ignore-process1) #f) + (set! (-> a2-1 ignore-pat) (-> v1-13 pat-ignore-mask)) + (set! (-> a2-1 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-13 (-> v1-13 transv) a2-1 (meters 1)) + ) + (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (>= (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + (-> *TARGET-bank* edge-grab-height-off-ground) + ) + ) + (target-method-28 *target* *collide-cache* *collide-edge-spec*) + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +(defbehavior target-gun-post target () + (target-gun-real-post) + (none) + ) diff --git a/goal_src/jak3/engine/target/target-h.gc b/goal_src/jak3/engine/target/target-h.gc index f29f16c69a8..6edc52720bb 100644 --- a/goal_src/jak3/engine/target/target-h.gc +++ b/goal_src/jak3/engine/target/target-h.gc @@ -12,7 +12,7 @@ (tf0 0) (tf1 1) (tf2 2) - (tf3 3) + (tinvuln1 3) (tf4 4) (tf5 5) (tf6 6) @@ -28,16 +28,16 @@ (tf16 16) (prevent-board 17) (prevent-gun 18) - (tf19 19) - (tf20 20) - (tf21 21) - (tf22 22) + (lleg-still 19) + (rleg-still 20) + (lleg-no-ik 21) + (rleg-no-ik 22) (prevent-double-jump 23) - (tf24 24) - (tf25 25) + (disable-attacks 24) + (tinvuln2 25) (tf26 26) (tf27 27) - (tf28 28) + (invisible 28) (tf29 29) (tf30 30) (tf31 31) @@ -45,6 +45,25 @@ ;; ---target-flags +;; +++darkjak-stage +(defenum darkjak-stage + :bitfield #t + :type uint32 + (force-on) + (active) + (bomb0) + (bomb1) + (invinc) + (giant) + (no-anim) + (disable-force-on) + (ds8 8) + (ds9 9) + ) +;; ---darkjak-stage + + +(declare-type rigid-body-impact structure) (declare-type sidekick process-drawable) (declare-type racer-info basic) (declare-type tube-info basic) @@ -59,26 +78,155 @@ (declare-type darkjak-info basic) (declare-type lightjak-info basic) +;; target-util (define-extern target-pos (function int vector)) +(define-extern can-exit-duck? (function target symbol)) +(define-extern target-collide-set! (function symbol float int :behavior target)) +(define-extern target-move-dist (function time-frame float :behavior target)) +(define-extern get-intersect-point (function vector touching-prims-entry collide-shape touching-shapes-entry vector)) +(define-extern target-update-segs (function process-drawable none)) + +;; logic-target +(define-extern target-darkjak-setup (function symbol none :behavior target)) +(define-extern target-lightjak-setup (function symbol none :behavior target)) +(define-extern target-sidekick-setup (function symbol none :behavior target)) +(define-extern target-board-setup (function symbol none :behavior target)) +(define-extern target-board-joint-points (function none :behavior target)) +(define-extern target-gun-setup (function symbol none :behavior target)) +(define-extern target-gun-joint-pre (function none :behavior target)) +(define-extern target-gun-joint-points (function none :behavior target)) +(define-extern target-powerup-process (function none :behavior target)) +(define-extern target-generic-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-exit (function none :behavior target)) +(define-extern activate-hud (function target none)) +(define-extern *target-geo-control* external-art-buffer) +(define-extern *target-anim-control* external-art-buffer) + +;; target-handler +(define-extern target-gun-end-mode (function symbol symbol :behavior target)) +(define-extern target-powerup-effect (function symbol none :behavior target)) +(define-extern target-gun-type-set! (function pickup-type none :behavior target)) +(define-extern vehicle-spawn (function process type traffic-object-spawn-params process-drawable)) +(define-extern target-gun-init (function pickup-type none :behavior target)) +(define-extern target-invisible-stop (function none :behavior target)) +(define-extern target-gun-fire (function pickup-type none :behavior target)) + +;; target-anim +(define-extern *attack-end-mods* surface) + +;; target +(define-extern want-to-powerjak? (function symbol :behavior target)) +(define-extern target-invisible-start (function time-frame none :behavior target)) +(define-extern target-top-anim-base-mode (function int none :behavior target)) +(define-extern target-land-effect (function none :behavior target)) +(define-extern *attack-find-mods* surface) +(define-extern *uppercut-mods* surface) +(define-extern *uppercut-jump-mods* surface) + +;; target2 +(define-extern *trip-mods* surface) +(define-extern *look-around-mods* surface) +(define-extern target-gun-check (function none :behavior target)) +(define-extern target-darkjak-end-mode (function symbol none :behavior target)) +(define-extern target-lightjak-end-mode (function symbol none :behavior target)) +(define-extern want-to-gun? (function target symbol symbol :behavior process)) +(define-extern *hit-ground-hard-mods* surface) +(define-extern *float-mods* surface) +(define-extern *blast-recover-mods* surface) + +;; target-death +(define-extern pre-intro-play (function none)) +(define-extern intro-play (function none)) +(define-extern find-nearest-entity (function vector type entity)) +(define-extern have-vehicle-v-type? (function int symbol)) +(define-extern entity-birth-no-kill (function entity process)) +(define-extern process-drawable-burn-effect (function time-frame rgbaf :behavior target)) +(define-extern warp-gate type) +(define-extern htorpedo type) +(define-extern target-turret type) +(define-extern scorpion-gun-manager type) +(define-extern bt-gun-manager type) + +;; target-gun +(declare-type gun process-drawable) +(define-extern target-gun-marking-menu (function target none)) +(define-extern gun-init (function none :behavior gun)) +(define-extern truncate-player-ammo (function pickup-type none)) +(define-extern target-gun-can-fire-yellow? (function pickup-type symbol :behavior target)) +(define-extern target-gun-fire-yellow (function pickup-type (pointer process) :behavior target)) +(define-extern target-gun-can-fire-red? (function pickup-type symbol :behavior target)) +(define-extern target-gun-fire-red (function pickup-type (pointer process) :behavior target)) +(define-extern target-gun-can-fire-blue? (function pickup-type symbol :behavior target)) +(define-extern target-gun-fire-blue (function pickup-type (pointer process) :behavior target)) +(define-extern target-gun-can-fire-dark? (function pickup-type symbol :behavior target)) +(define-extern target-gun-fire-dark (function pickup-type (pointer process) :behavior target)) + +;; +++lightjak-stage +(defenum lightjak-stage + :bitfield #t + :type uint32 + (ls0 0) + (ls1 1) + (ls2 2) + (regen 3) + (swoop 4) + (freeze 5) + (ls6 6) + (ls7 7) + (ls8 8) + (ls9 9) + (ls10 10) + (ls11 11) + (ls12 12) + (ls13 13) + (ls14 14) + (ls15 15) + ) +;; ---lightjak-stage + + +;; +++target-geo +(defenum target-geo + :type int32 + (uninitialized -2) + (none -1) + (jakb 4) ;; jak 2 model + (jakb-old 5) ;; weird broken jak 2 model + (jakc 6) ;; jak 3 model + ) +;; ---target-geo + + +;; +++target-anim +(defenum target-anim + :type int32 + (uninitialized -2) + (default 0) + (board 1) + (dark 2) + (light 3) + ) +;; ---target-anim ;; DECOMP BEGINS (deftype target (process-focusable) - ((control control-info :overlay-at root) + ((fact fact-info-target :override) + (control control-info :overlay-at root) (skel2 joint-control) (shadow-backup shadow-geo) - (target-flags target-flags :overlay-at state-flags) + (target-flags target-flags :overlay-at state-flags) (game game-info) (neck joint-mod) (head joint-mod) (upper-body joint-mod) (horns joint-mod) - (hair joint-mod 2) - (arm-ik joint-mod-ik 2) - (leg-ik joint-mod-ik 2) - (foot joint-mod 2) - (cloth basic) + (hair joint-mod 2) + (arm-ik joint-mod-ik 2) + (leg-ik joint-mod-ik 2) + (foot joint-mod 2) + (cloth symbol) (init-time time-frame) (teleport-time time-frame) (state-hook-time time-frame) @@ -87,15 +235,15 @@ (sidekick (pointer sidekick)) (manipy (pointer manipy)) (mirror (pointer process-drawable)) - (attack-info attack-info :inline) - (attack-info-rec attack-info :inline) - (attack-info-old attack-info 8 :inline) + (attack-info attack-info :inline) + (attack-info-rec attack-info :inline) + (attack-info-old attack-info 8 :inline) (anim-seed uint64) - (alt-cam-pos vector :inline) + (alt-cam-pos vector :inline) (current-level level) - (saved-pos transformq :inline) + (saved-pos transformq :inline) (saved-owner handle) - (alt-neck-pos vector :inline) + (alt-neck-pos vector :inline) (focus-search (array collide-shape)) (handle-search (array handle)) (excitement float) @@ -109,20 +257,20 @@ (burn-proc handle) (pre-joint-hook (function none :behavior target)) (notify handle) - (death-resetter resetter-spec :inline) + (death-resetter resetter-spec :inline) (mode-cache basic) - (mode-param1 uint64) + (mode-param1 handle) (mode-param2 uint64) (mode-param3 uint64) (major-mode-exit-hook basic) (major-mode-event-hook basic) (sub-mode-exit-hook basic) - (ext-geo-control basic) - (pending-ext-geo int32) - (ext-geo int32) - (ext-anim-control basic) - (pending-ext-anim int32) - (ext-anim int32) + (ext-geo-control external-art-buffer) + (pending-ext-geo target-geo) + (ext-geo target-geo) + (ext-anim-control external-art-buffer) + (pending-ext-anim target-anim) + (ext-anim target-anim) (tobot-state state) (tobot? symbol) (tobot-recorder basic) @@ -156,64 +304,66 @@ (invisible-interp float) (invisible-start-time time-frame) (invisible-duration time-frame) - (invisible-shadow-dir-backup vector :inline) + (invisible-shadow-dir-backup vector :inline) ) (:methods - (target-method-28 () none) - (target-method-29 () none) + (target-method-28 (_type_ collide-cache collide-edge-spec) none) + (target-init! (_type_ continue-point symbol) none) ) (:states target-attack - target-attack-air - target-attack-uppercut - target-attack-uppercut-jump - target-blast-recover - target-board-clone-anim + (target-attack-air symbol) + (target-attack-uppercut float float) + (target-attack-uppercut-jump float float) + (target-blast-recover rigid-body-impact) + (target-board-clone-anim handle) target-board-duck-stance target-board-falling - target-board-flip - target-board-get-off + (target-board-flip float float symbol) + (target-board-get-off handle symbol) target-board-get-on - target-board-grab - target-board-grenade + (target-board-grab symbol) + (target-board-grenade handle) target-board-halfpipe - target-board-hit + (target-board-hit symbol attack-info) target-board-hit-ground - target-board-hold - target-board-jump + (target-board-hold float float symbol) + (target-board-jump meters meters symbol) target-board-jump-kick - target-board-ride-edge + (target-board-ride-edge symbol) target-board-stance - target-board-start - target-board-trickx - target-board-tricky + (target-board-start handle) + (target-board-trickx float float symbol) + (target-board-tricky float float symbol) target-board-turn-around - target-board-turn-to - target-board-wall-kick - target-clone-anim - target-continue - target-credits + (target-board-turn-to vector time-frame) + (target-board-wall-kick vector float) + target-carry-pickup + (target-clone-anim handle) + (target-continue continue-point) + (target-credits int) target-darkjak-bomb0 target-darkjak-bomb1 target-darkjak-get-off - target-darkjak-get-on + (target-darkjak-get-on darkjak-stage) target-darkjak-running-attack target-darkjak-smack target-darkjak-smack-charge - target-death - target-double-jump - target-duck-high-jump - target-duck-high-jump-jump - target-duck-stance - target-duck-walk - target-eco-powerup + (target-death symbol) + target-demo + (target-double-jump float float) + (target-duck-high-jump float float symbol) + (target-duck-high-jump-jump float float symbol) + (target-duck-stance symbol) + (target-duck-walk symbol) + (target-eco-powerup int float) target-edge-grab - target-edge-grab-jump + (target-edge-grab-jump float float symbol) target-edge-grab-off - target-falling + (target-falling symbol) target-float - target-flop - target-flop-hit-ground + (target-flop float float float object) + (target-flop-hit-ground symbol) target-flut-air-attack target-flut-air-attack-hit-ground target-flut-clone-anim @@ -231,17 +381,19 @@ target-flut-kanga-catch target-flut-running-attack target-flut-stance - target-flut-start + (target-flut-start handle symbol int) target-flut-walk - target-grab - target-grab-ride + (target-grab symbol) + (target-grab-ride handle) target-gun-stance target-gun-walk target-hide - target-high-jump - target-hit - target-hit-ground - target-hit-ground-hard + (target-high-jump float float object) + (target-hit symbol attack-info) + (target-hit-ground symbol) + (target-hit-ground-hard float) + target-ice-stance + target-ice-walk target-indax-attack target-indax-attack-air target-indax-death @@ -255,23 +407,24 @@ target-indax-jump target-indax-running-attack target-indax-stance - target-indax-start + (target-indax-start handle object) target-indax-trip target-indax-walk - target-invisible-get-on - target-jump - target-jump-forward + (target-invisible-get-on handle time-frame) + (target-jump float float surface) + (target-jump-forward float float) target-ladder - target-launch + (target-ladder-start handle) + (target-launch float symbol vector int) target-launch-dir target-lightjak-freeze target-lightjak-get-off - target-lightjak-get-on - target-lightjak-regen + (target-lightjak-get-on lightjak-stage) + (target-lightjak-regen int) target-lightjak-shield - target-lightjak-swoop - target-lightjak-swoop-again - target-lightjak-swoop-falling + (target-lightjak-swoop float) + (target-lightjak-swoop-again float) + (target-lightjak-swoop-falling symbol) target-load-wait target-look-around target-mech-carry-drag @@ -296,44 +449,58 @@ target-mech-punch target-mech-shield target-mech-stance - target-mech-start + (target-mech-start handle float symbol) target-mech-walk target-pilot-clone-anim target-pilot-daxter-perch target-pilot-death - target-pilot-edge-grab + (target-pilot-edge-grab pilot-edge-grab-info) target-pilot-get-off target-pilot-get-on target-pilot-grab target-pilot-hit target-pilot-impact target-pilot-stance - target-pilot-start - target-play-anim - target-pole-cycle - target-pole-flip-forward - target-pole-flip-forward-jump - target-pole-flip-up - target-pole-flip-up-jump + (target-pilot-start handle symbol symbol) + (target-play-anim string handle) + (target-pole-cycle handle) + (target-pole-flip-forward float float float) + (target-pole-flip-forward-jump float float) + (target-pole-flip-up float float float) + (target-pole-flip-up-jump float float) target-powerjak-get-on + (target-racing-start handle) target-roll - target-roll-flip + (target-roll-flip float float) target-running-attack target-slide-down target-slide-down-to-ground target-stance target-stance-ambient target-stance-look-around + target-startup target-swim - target-swim-jump + target-swim-down + (target-swim-jump float float) + (target-swim-jump-jump float float surface) + target-swim-stance + target-swim-up + target-swim-walk target-title target-tube + (target-tube-start handle) target-turn-around + target-turret-get-off + (target-turret-get-on handle) + (target-turret-stance handle) + target-turret-stance-fire target-wade-stance target-wade-walk target-walk - target-warp-in + (target-warp-in vector vector) target-warp-out + target-yellow-jump-blast + tobot-stance ) ) @@ -341,16 +508,17 @@ (define-perm *target* target #f) (deftype sidekick (process-drawable) - ((control control-info :overlay-at root) - (anim-seed uint64 :offset 208) + ((parent (pointer target) :override) + (control control-info :overlay-at root) + (anim-seed uint64 :offset 208) (shadow-in-movie? symbol) (special-anim-time time-frame) (special-anim-interp float) (special-anim-frame float) - (offset transformq :inline) + (offset transformq :inline) (mirror (pointer process-drawable)) - (ear joint-mod 2) - (flap joint-mod 2) + (ear joint-mod 2) + (flap joint-mod 2) ) (:states sidekick-clone diff --git a/goal_src/jak3/engine/target/target-handler.gc b/goal_src/jak3/engine/target/target-handler.gc index 928039c80d7..51bc9edadd1 100644 --- a/goal_src/jak3/engine/target/target-handler.gc +++ b/goal_src/jak3/engine/target/target-handler.gc @@ -7,3 +7,2129 @@ ;; DECOMP BEGINS +(defbehavior target-shoved target ((arg0 meters) (arg1 meters) (arg2 process) (arg3 (state object object target))) + (let ((s5-0 (new 'static 'attack-info))) + (set! (-> s5-0 attacker) (process->handle arg2)) + (set! (-> s5-0 shove-back) arg0) + (set! (-> s5-0 shove-up) arg1) + (set! (-> s5-0 angle) + (if (not (logtest? (logior (-> self control status) (-> self control old-status)) (collide-status on-surface))) + 'air + 'shove + ) + ) + (set! (-> s5-0 mask) (attack-mask attacker shove-back shove-up angle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (go arg3 'shove s5-0) + ) + ) + +(defun attack-mode-is-invinc ((arg0 symbol) (arg1 symbol)) + (case arg1 + (('dark-eco-pool + 'endlessfall + 'melt + 'lava + 'fry + 'slime + 'bot + 'instant-death + 'grenade + 'drill-mech-master + 'centipede + 'drown-death + 'crush + 'death + 'tentacle + ) + #t + ) + ) + ) + +(defbehavior target-attacked target ((arg0 symbol) + (arg1 attack-info) + (arg2 process) + (arg3 touching-shapes-entry) + (arg4 (state symbol attack-info target)) + ) + (let ((s4-0 (if (logtest? (-> arg1 mask) (attack-mask mode)) + (-> arg1 mode) + ) + ) + (s2-0 arg0) + ) + (when (or (and (not (focus-test? self hit)) (not (logtest? (target-flags disable-attacks) (-> self target-flags)))) + (= s4-0 'endlessfall) + ) + (case s4-0 + (('endlessfall) + (if (not (-> *setting-control* user-current endlessfall)) + (return #f) + ) + ) + ) + (cond + ((or (logtest? (target-flags tf2 tinvuln1 tinvuln2) (-> self target-flags)) + (and (or (logtest? (-> self target-flags) (target-flags tf4)) + (logtest? (game-secrets invulnerable) (-> self game secrets)) + ) + (not (attack-mode-is-invinc 'normal s4-0)) + ) + (or (when (< 0.0 (-> self fact shield-level)) + (send-event (ppointer->process (-> self lightjak shield)) 'hit) + #t + ) + (and (-> *setting-control* user-current board-trail) + (focus-test? self board) + (< 0.0 (-> self fact eco-green)) + ) + (and (= s4-0 'darkeco) + (and (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (or (logtest? (-> self target-flags) (target-flags tf15)) (focus-test? self dangerous)) + ) + ) + ) + ) + (case arg0 + (('attack-or-shove) + ) + (('attack-invinc) + (set! arg0 'attack) + ) + (else + (return #f) + ) + ) + ) + (else + (case arg0 + (('attack-or-shove 'attack-invinc) + (set! arg0 'attack) + ) + ) + ) + ) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer arg1) 168) + (compute-intersect-info (-> self attack-info-rec) arg1 self arg2 arg3) + (when (not (focus-test? self mech)) + (if (and (not (target-log-attack (-> self attack-info-rec) (if (logtest? (attack-mask test) (-> arg1 mask)) + 'test + 'log + ) + ) + ) + (!= s2-0 'attack-invinc) + ) + (return #f) + ) + ) + (if (logtest? (attack-mask test) (-> arg1 mask)) + (return #t) + ) + (set! (-> self control attacked-by-id) (the-as int (-> self attack-info-rec id))) + (cond + ((and (logtest? (-> self attack-info-rec mask) (attack-mask mode)) + (or (= (-> self attack-info-rec mode) 'damage) (= (-> self attack-info-rec mode) 'shock-no-interrupt)) + (not (and (= (-> self game mode) 'play) (>= 0.0 (- (-> self fact health) (-> self attack-info-rec damage))))) + ) + (pickup-collectable! + (-> self fact) + (pickup-type health) + (if (logtest? (attack-mask damage) (-> self attack-info-rec mask)) + (- (-> self attack-info-rec damage)) + (- (-> *FACT-bank* health-single-inc)) + ) + (the-as handle #f) + ) + (cond + ((logtest? (-> *part-group-id-table* 10 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) + (-> (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) + (-> self attack-info-rec intersection) + (the-as vector (-> self control root-prim prim-core)) + ) + ) + quad + ) + ) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-7 (method-of-type part-tracker-subsampler activate))) + (t9-7 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-8 run-function-in-process) + (a0-39 gp-1) + (a1-14 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 10)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-8) a0-39 a1-14 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) + (-> (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) + (-> self attack-info-rec intersection) + (the-as vector (-> self control root-prim prim-core)) + ) + ) + quad + ) + ) + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-10 (method-of-type part-tracker activate))) + (t9-10 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-11 run-function-in-process) + (a0-48 gp-2) + (a1-17 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 10)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-11) a0-48 a1-17 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + (target-timed-invulnerable + (if (logtest? (-> self attack-info-rec mask) (attack-mask invinc-time)) + (-> self attack-info-rec invinc-time) + (-> *TARGET-bank* hit-invulnerable-timeout) + ) + self + 1 + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.5)) + (case (-> self attack-info-rec mode) + (('damage) + (sound-play "oof") + ) + (else + (cond + ((logtest? (-> *part-group-id-table* 67 flags) (sp-group-flag sp13)) + (let ((gp-4 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-4 + (let ((t9-17 (method-of-type part-tracker-subsampler activate))) + (t9-17 (the-as part-tracker-subsampler gp-4) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-18 run-function-in-process) + (a0-55 gp-4) + (a1-23 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 67)) + (set! (-> *part-tracker-subsampler-params-default* duration) (seconds 1)) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 6) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-18) a0-55 a1-23 *part-tracker-subsampler-params-default*) + ) + (-> gp-4 ppointer) + ) + ) + ) + (else + (let ((gp-5 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-5 + (let ((t9-20 (method-of-type part-tracker activate))) + (t9-20 (the-as part-tracker gp-5) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-21 run-function-in-process) + (a0-58 gp-5) + (a1-26 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 67)) + (set! (-> *part-tracker-params-default* duration) (seconds 1)) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 6) + ((the-as (function object object object none) t9-21) a0-58 a1-26 *part-tracker-params-default*) + ) + (-> gp-5 ppointer) + ) + ) + ) + ) + (process-spawn-function + process + (lambda :behavior target + () + (let ((gp-0 (current-time)) + (s5-0 (current-time)) + ) + (until (time-elapsed? s5-0 (seconds 1)) + (when (time-elapsed? gp-0 (seconds 0.03)) + (set! gp-0 (current-time)) + (process-drawable-shock-effect + *target* + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + (suspend) + ) + ) + (none) + ) + :to self + ) + ) + ) + #t + ) + (else + (logior! (-> self focus-status) (focus-status ignore hit)) + (when (and (= (-> self game mode) 'play) + (and (or (and (>= 0.0 (- (-> self fact health) (-> self attack-info-rec damage))) + (and (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (not (and (focus-test? self flut) (= (-> self flut mode) 'normal))) + ) + ) + (attack-mode-is-invinc 'normal s4-0) + ) + (= arg0 'attack) + ) + ) + (logior! (-> self focus-status) (focus-status dead)) + (logior! (-> self target-flags) (target-flags disable-attacks)) + ) + (go arg4 arg0 (-> self attack-info-rec)) + ) + ) + ) + ) + ) + +(defbehavior target-got-impact-impulse target ((arg0 rigid-body-impact)) + (when (< 20480.0 (-> arg0 impulse)) + (let ((v1-1 (new 'stack-no-clear 'vector))) + (let ((f0-2 (fmin 81920.0 (* 0.333 (-> arg0 impulse))))) + (vector-float*! v1-1 (-> arg0 normal) f0-2) + (set! (-> v1-1 y) f0-2) + ) + (send-event + self + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (vector v1-1)) + ) + ) + ) + (logior! (-> self control penetrated-by) (penetrate vehicle)) + #t + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior target-darkjak-effect-trans target ((arg0 handle) (arg1 (pointer process-drawable)) (arg2 (pointer time-frame)) (arg3 time-frame)) + (local-vars (sv-112 vector) (sv-128 matrix)) + (let ((s2-0 sp-launch-particles-var) + (s1-0 *sp-particle-system-2d*) + (s0-0 (-> *part-id-table* 173)) + ) + (set! sv-128 *launch-matrix*) + (set! sv-112 (-> sv-128 trans)) + (let ((v1-6 (-> (process-drawable-random-point! + (the-as process-drawable (ppointer->process arg1)) + (new 'stack-no-clear 'vector) + ) + quad + ) + ) + ) + (set! (-> sv-112 quad) v1-6) + ) + (let ((a3-1 #f) + (t0-0 #f) + (t1-0 1.0) + ) + (s2-0 s1-0 s0-0 sv-128 (the-as sparticle-launch-state a3-1) (the-as sparticle-launch-control t0-0) t1-0) + ) + ) + (send-event (ppointer->process arg1) 'color-effect 'dark (seconds 0.2)) + (when (time-elapsed? (-> arg2 0) (seconds 0.05)) + (set-time! (-> arg2 0)) + (cond + ((and *target* (>= (-> *target* darkjak lightning-count) 10)) + ) + ((and (not (time-elapsed? arg3 (seconds 0.5))) (handle->process arg0)) + (if *target* + (+! (-> *target* darkjak lightning-count) 2) + ) + (process-drawable2-shock-effect + (the-as process-drawable (handle->process arg0)) + (the-as process-drawable (ppointer->process arg1)) + (-> *lightning-spec-id-table* 10) + lightning-probe-callback + (-> *part-id-table* 187) + ) + ) + (else + (if *target* + (+! (-> *target* darkjak lightning-count) 2) + ) + (send-event (handle->process arg0) 'color-effect 'shock (seconds 0.2)) + (process-drawable-shock-effect + (the-as process-drawable (ppointer->process arg1)) + (-> *lightning-spec-id-table* 10) + lightning-probe-callback + (-> *part-id-table* 187) + 0 + 0 + 40960.0 + ) + ) + ) + ) + (none) + ) + +(defbehavior target-send-attack target ((arg0 process) (arg1 symbol) (arg2 touching-shapes-entry) (arg3 int) (arg4 int) (arg5 penetrate)) + (local-vars (sv-96 symbol) (sv-128 vector) (sv-132 touching-prims-entry) (sv-136 int) (sv-144 int)) + (set! sv-144 arg3) + (let ((s1-0 arg4) + (s0-0 arg5) + ) + (if (and (= arg1 'bomb) + (logtest? (process-mask guard) (-> arg0 mask)) + (not (-> *setting-control* user-current gun-target-guards?)) + ) + (return #f) + ) + 2.0 + 0.0 + (let* ((f30-0 (penetrate-using->damage s0-0)) + (s2-0 arg0) + (s5-0 (if (type? s2-0 process-focusable) + (the-as process-focusable s2-0) + ) + ) + (s2-1 (and s5-0 (focus-test? s5-0 dead hit))) + ) + (set! sv-96 + (the-as symbol (send-event + arg0 + 'attack + arg2 + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint sv-144)) + (damage f30-0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode arg1) + (count (the-as uint s1-0)) + (penetrate-using s0-0) + ) + ) + ) + ) + ) + (when sv-96 + (let ((v1-17 (new 'stack-no-clear 'vector))) + (set! (-> v1-17 quad) (-> self control trans quad)) + (set! sv-128 v1-17) + ) + (set! sv-132 (if arg2 + (prims-touching? arg2 (-> self control) (the-as uint 256)) + ) + ) + (set! sv-136 -1) + (cond + ((not arg2) + ) + (sv-132 + (set! sv-136 1) + (get-intersect-point sv-128 sv-132 (-> self control) arg2) + ) + ((let ((v0-6 (prims-touching? arg2 (-> self control) (the-as uint 128)))) + (set! sv-132 v0-6) + v0-6 + ) + (set! sv-136 0) + (get-intersect-point sv-128 sv-132 (-> self control) arg2) + ) + ) + (set! (-> self control send-attack-dest) (process->handle arg0)) + (set-time! (-> self control send-attack-time)) + (send-event self 'hit arg1 arg0 arg2 sv-128) + ;; og:preserve-this process cast + (set! arg0 (the process (and (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage bomb0)) + ) + arg0 + ) + ) + ) + (when arg0 + (when (and s5-0 (not s2-1) (-> self control danger-mode) (not (logtest? (-> s5-0 mask) (process-mask dark-effect)))) + (logior! (-> s5-0 mask) (process-mask dark-effect)) + (process-spawn-function + process + (lambda :behavior target + ((arg0 handle)) + (local-vars (sv-16 int)) + (let ((gp-0 (-> self parent))) + (let ((s4-0 (current-time))) + (set! sv-16 0) + (+! (-> self clock ref-count) -1) + (+! (-> gp-0 0 clock ref-count) 1) + (set! (-> self clock) (-> gp-0 0 clock)) + (while (let ((v1-10 gp-0)) + (and (or (focus-test? + (the-as process-focusable (if v1-10 + (the-as process-focusable (-> v1-10 0 self)) + ) + ) + dead + hit + ) + (let ((v1-15 gp-0)) + (and (-> (the-as process (if v1-15 + (the-as process (-> v1-15 0 self)) + ) + ) + next-state + ) + (let ((v1-18 gp-0)) + (= (-> (the-as process (if v1-18 + (the-as process (-> v1-18 0 self)) + ) + ) + next-state + name + ) + 'knocked + ) + ) + ) + ) + ) + (not (time-elapsed? s4-0 (seconds 15))) + (not (logtest? (-> (the-as process-focusable (-> gp-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) + ) + ) + ) + (target-darkjak-effect-trans + arg0 + (the-as (pointer process-drawable) gp-0) + (the-as (pointer time-frame) (& sv-16)) + s4-0 + ) + (suspend) + ) + ) + (logclear! (-> gp-0 0 mask) (process-mask dark-effect)) + (send-event (ppointer->process gp-0) 'color-effect #f 0) + ) + (none) + ) + (process->handle self) + :to s5-0 + ) + ) + ) + (let ((v1-57 arg1)) + (cond + ((or (= v1-57 'spin) (= v1-57 'spin-air) (= v1-57 'board-spin) (= v1-57 'board-zap)) + (case sv-136 + ((1) + (cond + ((logtest? (-> *part-group-id-table* 11 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-1 + (let ((t9-13 (method-of-type part-tracker-subsampler activate))) + (t9-13 (the-as part-tracker-subsampler s5-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-14 run-function-in-process) + (a0-46 s5-1) + (a1-16 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 11)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-14) a0-46 a1-16 *part-tracker-subsampler-params-default*) + ) + (-> s5-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-2 + (let ((t9-16 (method-of-type part-tracker activate))) + (t9-16 (the-as part-tracker s5-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-17 run-function-in-process) + (a0-51 s5-2) + (a1-19 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 11)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-17) a0-51 a1-19 *part-tracker-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + ) + ) + (else + (do-effect (-> self skel effect) (the-as symbol "group-spin-hit") -1.0 49) + ) + ) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 49 + (the-as basic #f) + (cond + ((= arg1 'board-spin) + (static-sound-name "board-impact") + ) + ((= arg1 'board-zap) + (static-sound-name "board-zap-hit") + ) + ((using-gun? self) + (static-sound-name "gun-spin-hit") + ) + (else + (static-sound-name "spin-hit") + ) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.2)) + ) + ((or (= v1-57 'get-on) (= v1-57 'darkjak)) + (let ((v1-105 sv-136)) + (when (or (zero? v1-105) (= v1-105 1)) + (cond + ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-23 (method-of-type part-tracker-subsampler activate))) + (t9-23 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-24 run-function-in-process) + (a0-71 gp-1) + (a1-26 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-24) a0-71 a1-26 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-26 (method-of-type part-tracker activate))) + (t9-26 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-27 run-function-in-process) + (a0-76 gp-2) + (a1-29 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-27) a0-76 a1-29 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + ) + ) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 3 + (the-as basic #f) + (static-sound-name "get-on-hit") + ) + ) + ((= v1-57 'shield) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 3 + (the-as basic #f) + (static-sound-name "shield-attack") + ) + ) + ((or (= v1-57 'punch) (= v1-57 'dark-smack) (= v1-57 'mech-punch)) + (let ((v1-147 sv-136)) + (when (or (zero? v1-147) (= v1-147 1)) + (cond + ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((s5-4 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-4 + (let ((t9-31 (method-of-type part-tracker-subsampler activate))) + (t9-31 (the-as part-tracker-subsampler s5-4) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-32 run-function-in-process) + (a0-91 s5-4) + (a1-36 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-32) a0-91 a1-36 *part-tracker-subsampler-params-default*) + ) + (-> s5-4 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((s5-5 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-5 + (let ((t9-34 (method-of-type part-tracker activate))) + (t9-34 (the-as part-tracker s5-5) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-35 run-function-in-process) + (a0-96 s5-5) + (a1-39 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-35) a0-96 a1-39 *part-tracker-params-default*) + ) + (-> s5-5 ppointer) + ) + ) + ) + ) + ) + ) + (cond + ((= arg1 'mech-punch) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 28 + (the-as basic #f) + (static-sound-name "mech-punch-hit") + ) + ) + (else + (let ((name (if (using-gun? self) + (the-as sound-name (static-sound-name "gun-punch-hit")) + (the-as sound-name (static-sound-name "punch-hit")) + ) + ) + ) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 28 + (the-as basic #f) + (the-as sound-name name) + ) + ) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) + ) + ((= v1-57 'flip) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 49 + (the-as basic #f) + (static-sound-name "punch-hit") + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.1)) + ) + ((= v1-57 'uppercut) + (let ((v1-199 sv-136)) + (when (or (zero? v1-199) (= v1-199 1)) + (cond + ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((gp-3 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-3 + (let ((t9-43 (method-of-type part-tracker-subsampler activate))) + (t9-43 (the-as part-tracker-subsampler gp-3) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-44 run-function-in-process) + (a0-116 gp-3) + (a1-47 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-44) a0-116 a1-47 *part-tracker-subsampler-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((gp-4 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-4 + (let ((t9-46 (method-of-type part-tracker activate))) + (t9-46 (the-as part-tracker gp-4) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-47 run-function-in-process) + (a0-121 gp-4) + (a1-50 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-47) a0-121 a1-50 *part-tracker-params-default*) + ) + (-> gp-4 ppointer) + ) + ) + ) + ) + ) + ) + (do-effect (-> self skel effect) (the-as symbol "group-uppercut-hit") -1.0 28) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 28 + (the-as basic #f) + (static-sound-name "uppercut-hit") + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) + ) + ((or (= v1-57 'flop) (= v1-57 'flop-down)) + (do-effect (-> self skel effect) (the-as symbol "group-flop-hit") -1.0 28) + (do-effect (-> self skel effect) (the-as symbol "group-flop-hit") -1.0 19) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 28 + (the-as basic #f) + (static-sound-name "flop-hit") + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) + ) + ((= v1-57 'flut-attack) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 28 + (the-as basic #f) + (static-sound-name "flut-punch-hit") + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.2)) + ) + ((= v1-57 'darkjak) + (set-time! (-> self darkjak attack-time)) + (let* ((v1-256 *game-info*) + (a0-141 (+ (-> v1-256 attack-id) 1)) + ) + (set! (-> v1-256 attack-id) a0-141) + (set! (-> self darkjak attack-id) a0-141) + a0-141 + ) + ) + ((= v1-57 'lightjak) + (set-time! (-> self darkjak attack-time)) + (let* ((v1-260 *game-info*) + (a0-145 (+ (-> v1-260 attack-id) 1)) + ) + (set! (-> v1-260 attack-id) a0-145) + (set! (-> self darkjak attack-id) a0-145) + a0-145 + ) + ) + ) + ) + ) + ) + ) + sv-96 + ) + +(defbehavior target-generic-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object) (a0-35 level-load-info) (a1-13 level-load-info)) + (case arg2 + (('get-pickup) + (when (not (focus-test? self dead)) + (let ((s4-1 (-> arg3 param 0)) + (f28-0 (the-as float (-> arg3 param 1))) + ) + (if (!= (pickup-collectable! (-> self fact) (the-as pickup-type s4-1) 0.0 (the-as handle #f)) + (pickup-collectable! (-> self fact) (the-as pickup-type s4-1) f28-0 (process->handle arg0)) + ) + #t + 'full + ) + ) + ) + ) + (('test-pickup) + (let ((a1-6 (-> arg3 param 0))) + (pickup-collectable! (-> self fact) (the-as pickup-type a1-6) 0.0 (the-as handle #f)) + ) + ) + (('reset-pickup) + (reset! (-> self fact) (the-as symbol (-> arg3 param 0))) + ) + (('reset-collide) + (cond + ((-> self control collide-mode) + (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) + ) + ((-> self control danger-mode) + (target-danger-set! (-> self control danger-mode) #f) + ) + ) + ) + (('level-deactivate) + (cond + ((and (focus-test? self pilot) (let ((a0-19 (lookup-level-info (the-as symbol (-> arg3 param 0))))) + (or (and a0-19 (logtest? (-> a0-19 level-flags) (level-flags lf7))) + (and (= (-> arg3 param 0) 'lctypatk) (-> self pilot as-daxter?)) + (= (-> arg3 param 0) 'desliz) + ) + ) + ) + (ja-channel-set! 0) + (target-gun-end-mode #t) + (set! (-> self skel top-anim interp) 0.0) + (let ((v1-34 (get-channel (-> self skel top-anim) 0))) + (if v1-34 + (set! (-> v1-34 frame-interp 1) 0.0) + ) + ) + (update (-> self skel top-anim)) + (cond + ((focus-test? self teleporting) + #f + ) + ((focus-test? self grabbed) + (set! (-> self event-hook) #f) + (go target-grab 'stance) + ) + (else + (set! (-> self event-hook) #f) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + ) + ) + ((and (focus-test? self flut) + (begin (set! a0-35 (lookup-level-info (the-as symbol (-> arg3 param 0)))) a0-35) + (logtest? (-> a0-35 level-flags) (level-flags lf8)) + ) + (ja-channel-set! 0) + (target-gun-end-mode #t) + (when (not (focus-test? self grabbed teleporting)) + (set! (-> self event-hook) #f) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + ) + ((and (focus-test? self mech) + (begin (set! a1-13 (lookup-level-info (the-as symbol (-> arg3 param 0)))) a1-13) + (logtest? (level-flags lf16) (-> a1-13 level-flags)) + ) + (ja-channel-set! 0) + (when (not (focus-test? self grabbed teleporting)) + (set! (-> self event-hook) #f) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + ) + ) + ) + (('level-enter) + (let ((s5-1 (level-get *level* (the-as symbol (-> arg3 param 0))))) + (when s5-1 + (let ((v1-66 (-> s5-1 info))) + (set! (-> self fact buzzer) 0.0) + (if (zero? (-> self game task-enter-times (-> v1-66 task-level))) + (set! (-> self game task-enter-times (-> v1-66 task-level)) (-> *display* game-clock frame-counter)) + ) + ) + (let ((s4-2 (-> *game-info* sub-task-list))) + (dotimes (s3-1 (-> s4-2 length)) + (when (nonzero? s3-1) + (let ((s2-0 (-> s4-2 s3-1))) + (when (and (= (-> s5-1 info taskname) (-> s2-0 level)) + (zero? (-> self game task-start-time (-> s2-0 task))) + (= s3-1 (-> *game-info* play-list (-> s2-0 task) play-node)) + (or (logtest? (-> s2-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 s2-0)) + (not (task-complete? (-> self game) (-> s2-0 task))) + (not (logtest? (-> s2-0 flags) (game-task-node-flag utility-node))) + ) + (when (zero? (-> self game task-start-time (-> s2-0 task))) + (format #t "--------------> set task start time for ~A~%" (-> s2-0 name)) + (set! (-> self game task-start-time (-> s2-0 task)) (-> *display* game-clock frame-counter)) + ) + ) + ) + ) + ) + ) + (update-task-masks 'level) + (format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0)) + ) + ) + ) + (('get-attack-count) + (set! v0-0 (+ (-> self control attack-count) (-> arg3 param 0))) + (set! (-> self control attack-count) (the-as uint v0-0)) + v0-0 + ) + (('continue) + (when (not (focus-test? self dead)) + (logior! (-> self focus-status) (focus-status teleporting)) + (go target-continue (the-as continue-point (-> arg3 param 0))) + ) + ) + (('query) + (case (-> arg3 param 0) + (('powerup) + (and (= (-> self fact eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact eco-level))) + ) + (('pickup) + (pickup-collectable! (-> self fact) (the-as pickup-type (-> arg3 param 1)) 0.0 (the-as handle #f)) + ) + (('ground-height) + (target-height-above-ground) + ) + (('gun-type) + (-> self gun gun-type) + ) + ) + ) + (('release) + (when (and (nonzero? (-> self gun)) (handle->process (-> self gun charge-active?))) + (set! (-> self gun charge-active?) (the-as handle #f)) + (set! v0-0 (current-time)) + (set! (-> self gun fire-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + (('trans) + (case (-> arg3 param 0) + (('save) + (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (logior! (-> self target-flags) (target-flags tf12)) + (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) + ) + (('restore) + (logclear! (-> self target-flags) (target-flags tf12)) + (let ((gp-1 (-> arg3 param 1))) + (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) + (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) + ) + (rot->dir-targ! (-> self control)) + (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! v0-0 (current-time)) + (set! (-> self control last-time-on-surface) (the-as time-frame v0-0)) + v0-0 + ) + (('reset) + (set! v0-0 (logclear (-> self target-flags) (target-flags tf12))) + (set! (-> self target-flags) (the-as target-flags v0-0)) + v0-0 + ) + ) + ) + (('effect) + (target-powerup-effect (the-as symbol (-> arg3 param 0))) + ) + (('color-effect) + (set! (-> self color-effect) (the-as basic (-> arg3 param 0))) + (set-time! (-> self color-effect-start-time)) + (set! v0-0 (-> arg3 param 1)) + (set! (-> self color-effect-duration) (the-as time-frame v0-0)) + v0-0 + ) + (('do-effect) + (do-effect (-> self skel effect) (the-as symbol (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1) + (if (-> self sidekick) + (do-effect + (-> self sidekick 0 skel effect) + (the-as symbol (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + -1 + ) + ) + ) + (('effect-control) + #f + ) + (('neck) + (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) + (cond + ((-> arg3 param 1) + (logior! (-> self target-flags) (target-flags tf13)) + (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (look-at! (-> self neck) (-> self alt-neck-pos) 'force arg0) + ) + (else + (set! v0-0 (logclear (-> self target-flags) (target-flags tf13))) + (set! (-> self target-flags) (the-as target-flags v0-0)) + v0-0 + ) + ) + ) + (('sidekick) + (cond + ((and (-> arg3 param 0) (not (-> self sidekick))) + (let ((gp-2 (get-process *default-dead-pool* sidekick #x4000 1))) + (set! v0-0 (when gp-2 + (let ((t9-38 (method-of-type sidekick activate))) + (t9-38 (the-as sidekick gp-2) self "sidekick" (the-as pointer #x70004000)) + ) + (run-now-in-process gp-2 init-sidekick) + (-> gp-2 ppointer) + ) + ) + ) + (set! (-> self sidekick) (the-as (pointer sidekick) v0-0)) + v0-0 + ) + ((and (not (-> arg3 param 0)) (-> self sidekick)) + (deactivate (-> self sidekick 0)) + (set! (-> self sidekick) (the-as (pointer sidekick) #f)) + #f + ) + ) + ) + (('manipy) + (let ((v1-176 (get-continue-by-name (-> self game) (the-as string (-> arg3 param 1))))) + (when (and v1-176 (not (-> self manipy))) + (let ((t9-42 external-target-spawn) + (a0-150 (-> v1-176 trans)) + (a1-38 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> a1-38 x) (* 0.00003051851 (the float (-> v1-176 quat x)))) + (set! (-> a1-38 y) (* 0.00003051851 (the float (-> v1-176 quat y)))) + (set! (-> a1-38 z) (* 0.00003051851 (the float (-> v1-176 quat z)))) + (set! (-> a1-38 w) (* 0.00003051851 (the float (-> v1-176 quat w)))) + (let ((a2-23 self) + (a3-10 (-> arg3 param 2)) + (v1-178 (-> arg3 param 0)) + ) + (set! v0-0 (t9-42 a0-150 a1-38 a2-23 (the-as symbol a3-10) (cond + ((= v1-178 'manual) + (manipy-options mo0) + ) + ((= v1-178 'auto) + (manipy-options mo1) + ) + (else + (manipy-options) + ) + ) + ) + ) + ) + ) + (set! (-> self manipy) (the-as (pointer manipy) v0-0)) + v0-0 + ) + ) + ) + (('blend-shape) + (if (-> arg3 param 0) + (logior! (-> self skel status) (joint-control-status blend-shape)) + (logclear! (-> self skel status) (joint-control-status blend-shape)) + ) + (let ((a1-39 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-39 from) (process->ppointer arg0)) + (set! (-> a1-39 num-params) arg1) + (set! (-> a1-39 message) arg2) + (set! (-> a1-39 param 0) (-> arg3 param 0)) + (set! (-> a1-39 param 1) (-> arg3 param 1)) + (set! (-> a1-39 param 2) (-> arg3 param 2)) + (set! (-> a1-39 param 3) (-> arg3 param 3)) + (set! (-> a1-39 param 4) (-> arg3 param 4)) + (set! (-> a1-39 param 5) (-> arg3 param 5)) + (send-event-function (ppointer->process (-> self sidekick)) a1-39) + ) + ) + (('shadow) + (cond + ((-> arg3 param 0) + (let ((v1-196 (-> self draw shadow-ctrl))) + (logclear! (-> v1-196 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (else + (let ((v1-198 (-> self draw shadow-ctrl))) + (logior! (-> v1-198 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + ) + (('rotate-y-angle) + (quaternion-rotate-y! + (-> self control quat-for-control) + (-> self control quat-for-control) + (the-as float (-> arg3 param 0)) + ) + (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (rot->dir-targ! (-> self control)) + ) + ) + (('touched) + (cond + ((< 0.0 (-> self fact shield-level)) + (let ((s4-3 (-> self control penetrate-using))) + (set! (-> self control penetrate-using) (penetrate touch shield)) + (set! v0-0 (target-send-attack + arg0 + 'shield + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self fact shield-attack-id)) + 0 + (-> self control penetrate-using) + ) + ) + (set! (-> self control penetrate-using) s4-3) + ) + v0-0 + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (or (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage disable-force-on)) + ) + (logtest? (process-mask crate) (-> arg0 mask)) + ) + ) + (target-send-attack + arg0 + 'darkjak + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self darkjak attack-id)) + 0 + (penetrate touch dark-skin) + ) + ) + (else + (send-event arg0 'touch (-> arg3 param 0)) + ) + ) + ) + (('dry) + (set! (-> self water drip-wetness) 0.0) + ) + (('reset-height) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + #f + ) + (('draw) + (cond + ((-> arg3 param 0) + (when (logtest? (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (process-drawable-reset-all-cloth self) + ) + ) + (else + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + ) + (let ((a1-46 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-46 from) (process->ppointer arg0)) + (set! (-> a1-46 num-params) arg1) + (set! (-> a1-46 message) arg2) + (set! (-> a1-46 param 0) (-> arg3 param 0)) + (set! (-> a1-46 param 1) (-> arg3 param 1)) + (set! (-> a1-46 param 2) (-> arg3 param 2)) + (set! (-> a1-46 param 3) (-> arg3 param 3)) + (set! (-> a1-46 param 4) (-> arg3 param 4)) + (set! (-> a1-46 param 5) (-> arg3 param 5)) + (send-event-function (ppointer->process (-> self manipy)) a1-46) + ) + ) + (('draw-vehicle) + (when (nonzero? (-> self pilot)) + (if (-> arg3 param 0) + (send-event (handle->process (-> self pilot vehicle)) 'unhide) + (send-event (handle->process (-> self pilot vehicle)) 'hide) + ) + ) + ) + (('no-load-wait) + (set! v0-0 (+ (current-time) (the-as time-frame (-> arg3 param 0)))) + (set! (-> self no-load-wait) (the-as uint v0-0)) + v0-0 + ) + (('no-look-around) + (set! (-> self no-look-around-wait) (the-as uint (+ (current-time) (the-as time-frame (-> arg3 param 0))))) + (if (and (-> self next-state) (= (-> self next-state name) 'target-look-around)) + (send-event self 'end-mode 'in-head) + ) + ) + (('change-state) + (go + (the-as (state object object object object target) (-> arg3 param 0)) + (-> arg3 param 1) + (-> arg3 param 2) + (-> arg3 param 3) + (-> arg3 param 4) + ) + ) + (('tobot) + (set! v0-0 (-> arg3 param 0)) + (set! (-> self tobot?) (the-as symbol v0-0)) + v0-0 + ) + (('carry-info) + (-> self carry) + ) + (('gun-type) + (cond + ((-> arg3 param 0) + (target-gun-type-set! (the-as pickup-type (-> arg3 param 0))) + ) + (else + (set! v0-0 #t) + (set! (-> self gun put-away?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + (('kill-vehicle) + (if (nonzero? (-> self pilot)) + (send-event (handle->process (-> self pilot vehicle)) 'go-die) + ) + ) + (('get-notify) + (set! v0-0 (process->handle (the-as process (-> arg3 param 0)))) + (set! (-> self notify) (the-as handle v0-0)) + v0-0 + ) + (('invulnerable) + (target-timed-invulnerable (the-as time-frame (-> arg3 param 0)) self 2) + #t + ) + ) + ) + +(defbehavior target-standard-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (at-0 int) (v1-317 object) (a2-5 symbol)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg2)) + (b! (not (or (= v1-0 'attack) (= v1-0 'attack-or-shove) (= v1-0 'attack-invinc))) cfg-7 :delay (nop!)) + (let ((v0-0 + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-hit + ) + ) + ) + (b! #t cfg-435 :delay (nop!)) + (label cfg-7) + (b! (!= v1-0 'shove) cfg-21 :delay (nop!)) + (set! v0-0 (when (not (and (-> self next-state) (= (-> self next-state name) 'target-hit))) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 168) + (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) + (set! (-> self attack-info-rec attacker) (process->handle arg0)) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) + ) + (go target-hit 'shove (-> self attack-info-rec)) + ) + ) + (b! #t cfg-435 :delay (nop!)) + (label cfg-21) + (set! v0-0 + (cond + ((= v1-0 'push-trans) + (let ((v1-15 (-> self control additional-decaying-velocity))) + (.lvf vf1 (&-> (the-as vector (-> arg3 param 0)) quad)) + (let ((f0-0 (-> self clock frames-per-second))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-15 quad) vf1) + ) + (set-time! (-> self control additional-decaying-velocity-end-time)) + (set! (-> self control additional-decaying-velocity-decay-start-time) + (+ (current-time) (the-as time-frame (-> arg3 param 1))) + ) + #t + ) + ((= v1-0 'push-transv) + (set! (-> self control additional-decaying-velocity quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set-time! (-> self control additional-decaying-velocity-end-time)) + (set! (-> self control additional-decaying-velocity-decay-start-time) + (+ (current-time) (the-as time-frame (-> arg3 param 1))) + ) + #t + ) + ((= v1-0 'launch) + (set! (-> self control transv quad) (-> (the-as vector (-> arg3 param 3)) quad)) + (go + target-jump + (the-as float (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + (the-as surface (-> arg3 param 2)) + ) + ) + ((= v1-0 'launch-dir) + (when (not (focus-test? self board)) + (set! (-> self control unknown-vector37 quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> self control sliding-start-time) (the-as time-frame (-> arg3 param 1))) + (set! (-> self control unknown-word04) (the-as uint (the-as float (-> arg3 param 2)))) + (go target-launch-dir) + ) + ) + ((= v1-0 'powerup) + (if (and (and (-> self next-state) + (let ((v1-42 (-> self next-state name))) + (or (= v1-42 'target-stance) (= v1-42 'target-walk) (= v1-42 'target-stance-look-around)) + ) + ) + (zero? (-> self ext-anim)) + ) + (go target-eco-powerup (the-as int (-> arg3 param 0)) (the-as float (-> arg3 param 1))) + ) + ) + ((= v1-0 'loading) + (if (not (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (or (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self control status) (collide-status on-water)) + ) + (or (logtest? (-> self target-flags) (target-flags tf1)) + (focus-test? self dead dangerous hit grabbed in-head edge-grab pole flut tube board pilot mech) + (>= (the-as time-frame (-> self no-load-wait)) (current-time)) + ) + ) + ) + (go target-load-wait) + ) + ) + ((begin + (b! (!= v1-0 'gun-combo) cfg-66 :delay (nop!)) + (set! v0-0 #t) + (b! #t cfg-435 :delay (nop!)) + (label cfg-66) + (b! (!= v1-0 'change-mode) cfg-283 :delay (nop!)) + (let ((v1-63 (-> arg3 param 0))) + (b! (!= v1-63 'grab) cfg-73 :delay (empty-form)) + (set! v0-0 (when (not (focus-test? self dead)) + (if (not (-> arg3 param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + (b! #t cfg-282 :delay (nop!)) + (label cfg-73) + (b! (!= v1-63 'grab-ride) cfg-84 :delay (empty-form)) + (set! v0-0 (when (not (focus-test? self dead)) + (if (not (-> arg3 param 1)) + #t + (go target-grab-ride (process->handle arg0)) + ) + ) + ) + (b! #t cfg-282 :delay (nop!)) + (label cfg-84) + (b! (!= v1-63 'look-around) cfg-86 :delay (empty-form)) + (set! v0-0 (go target-look-around)) + (b! #t cfg-282 :delay (nop!)) + (label cfg-86) + (b! (!= v1-63 'falling) cfg-88 :delay (empty-form)) + (set! v0-0 (go target-falling #f)) + (b! #t cfg-282 :delay (nop!)) + (label cfg-88) + (b! (!= v1-63 'racer) cfg-97 :delay (empty-form)) + (if *debug-segment* + (load-package "racerp" global) + ) + (set! v0-0 (go target-racing-start (process->handle (the-as process (-> arg3 param 1))))) + (b! #t cfg-282 :delay (nop!)) + (label cfg-97) + (b! (!= v1-63 'flut) cfg-110 :delay (empty-form)) + (set! v0-0 (go + target-flut-start + (process->handle (the-as process (-> arg3 param 1))) + (the-as symbol (if (>= arg1 3) + (-> arg3 param 2) + 'normal + ) + ) + (if (>= arg1 4) + (the-as int (-> arg3 param 3)) + -1 + ) + ) + ) + (b! #t cfg-282 :delay (nop!)) + (label cfg-110) + (set! v0-0 + (cond + ((= v1-63 'board) + (if (logtest? (logand (game-feature board) (-> *setting-control* user-current features)) (-> self game features)) + (go target-board-start (process->handle (the-as process (-> arg3 param 1)))) + ) + ) + ((begin (set! a2-5 (= v1-63 'pilot)) (or a2-5 + (begin (set! a2-5 (= v1-63 'pilot-race)) a2-5) + (begin (set! a2-5 (= v1-63 'pilot-daxter)) a2-5) + (= v1-63 'pilot-race-daxter) + ) + ) + (let ((s5-1 (the-as object (-> arg3 param 1)))) + (when (not (the-as uint s5-1)) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 behavior) (the-as uint 4)) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 nav-mesh) #f) + (set! (-> s4-0 nav-branch) #f) + (set! (-> s4-0 proc) #f) + (set! (-> s4-0 handle) (the-as handle #f)) + (set! (-> s4-0 user-data) (the-as uint 0)) + (set! (-> s4-0 flags) (traffic-spawn-flags tsf5 tsf6)) + (set! (-> s4-0 guard-type) (the-as uint 11)) + (set! (-> s4-0 entity) #f) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> self control trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> self control quat)) + (set! (-> s4-0 id) (the-as uint 0)) + (let ((v1-101 (vehicle-spawn + (the-as process (-> arg3 param 2)) + (the-as type s4-0) + (the-as traffic-object-spawn-params a2-5) + ) + ) + ) + (if v1-101 + (set! s5-1 v1-101) + ) + ) + ) + ) + (when s5-1 + (let* ((v1-102 (-> arg3 param 0)) + (a2-6 (if (or (= v1-102 'pilot-daxter) (= v1-102 'pilot-race-daxter)) + #t + #f + ) + ) + ) + (go target-pilot-start (process->handle s5-1) (the-as symbol (-> arg3 param 3)) a2-6) + ) + ) + ) + ) + ((= v1-63 'mech) + (go + target-mech-start + (process->handle (the-as process (-> arg3 param 1))) + (the-as float (if (>= arg1 2) + (the-as int (-> arg3 param 2)) + #x42c80000 + ) + ) + #f + ) + ) + ((= v1-63 'indax) + (go target-indax-start (process->handle (the-as process (-> arg3 param 1))) (-> arg3 param 2)) + ) + ((= v1-63 'gun) + (when (logtest? (-> self game features) (game-feature gun)) + (let ((gp-1 (-> arg3 param 2))) + (cond + ((using-gun? self) + (when (nonzero? gp-1) + (set! (-> self gun using-gun-type) (the-as pickup-type gp-1)) + gp-1 + ) + ) + (else + (target-gun-init (the-as pickup-type gp-1)) + ) + ) + ) + ) + ) + ((= v1-63 'tube) + (if (and (logtest? (-> self control status) (collide-status on-surface)) + (not (or (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self control status) (collide-status on-water)) + ) + ) + ) + (go target-tube-start (process->handle (the-as process (-> arg3 param 1)))) + ) + ) + ((= v1-63 'turret) + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-turret-get-on (process->handle (the-as process (-> arg3 param 1)))) + ) + ) + ((= v1-63 'darkjak) + (cond + ((focus-test? self dead) + #f + ) + ((and (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (and (logtest? (the-as game-feature (logand (game-feature darkjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (-> *setting-control* user-current darkjak) + ) + ) + (go target-darkjak-get-on (the-as darkjak-stage (-> arg3 param 2))) + ) + ((logtest? (-> arg3 param 2) 1024) + (logclear! (-> self darkjak stage) (darkjak-stage force-on)) + (set! v0-0 (+ (- (seconds 20) (-> self fact darkjak-start-time)) (current-time))) + (set! (-> self fact darkjak-effect-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ((= v1-63 'lightjak) + (cond + ((focus-test? self dead) + #f + ) + ((and (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (and (logtest? (the-as game-feature (logand (game-feature lightjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (-> *setting-control* user-current lightjak) + ) + ) + (go target-lightjak-get-on (the-as lightjak-stage (-> arg3 param 2))) + ) + ((logtest? (-> arg3 param 2) 256) + (logclear! (-> self lightjak stage) (lightjak-stage ls0)) + (set! v0-0 (+ (- (seconds 20) (-> self fact lightjak-start-time)) (current-time))) + (set! (-> self fact lightjak-effect-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ((= v1-63 'invisible) + (let ((a1-17 (if (>= arg1 2) + (the-as int (-> arg3 param 2)) + (the-as int (-> *TARGET-bank* invisible-duration)) + ) + ) + ) + (cond + ((focus-test? self dead) + #f + ) + ((and (not (logtest? (target-flags invisible) (-> self target-flags))) + (logtest? (the-as game-feature (logand (game-feature artifact-invis) (-> *setting-control* user-current features))) + (-> self game features) + ) + (zero? (-> self ext-anim)) + ) + (go target-invisible-get-on (process->handle arg0) (the-as time-frame a1-17)) + ) + ) + ) + ) + ((= v1-63 'hide) + (go target-hide) + ) + ((= v1-63 'blast-recover) + (if (= (-> self ext-anim) (target-anim default)) + (go target-blast-recover (the-as rigid-body-impact (-> arg3 param 1))) + ) + ) + ((= v1-63 'normal) + (b! + (not (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) + ) + ) + ) + cfg-266 + :delay (empty-form) + ) + (set! v0-0 (go target-darkjak-get-off)) + (b! #t cfg-282 :delay (nop!)) + (label cfg-266) + (cond + ((and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-lightjak-get-off))) + ) + ) + (go target-lightjak-get-off) + ) + ((logtest? (target-flags invisible) (-> self target-flags)) + (target-invisible-stop) + ) + ) + ) + ) + ) + ) + (label cfg-282) + (b! #t cfg-435 :delay (nop!)) + (label cfg-283) + (b! (!= v1-0 'end-mode) cfg-337 :delay (nop!)) + (let ((v1-224 (-> arg3 param 0))) + (b! (!= v1-224 'gun) cfg-291 :delay (empty-form)) + (set! v0-0 (if (and (using-gun? self) (target-gun-end-mode #t)) + (go target-stance) + ) + ) + (b! #t cfg-336 :delay (nop!)) + (label cfg-291) + (b! (!= v1-224 'darkjak) cfg-307 :delay (empty-form)) + (set! v0-0 + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) + ) + ) + (go target-darkjak-get-off) + ) + ) + (b! #t cfg-336 :delay (nop!)) + (label cfg-307) + (set! v0-0 + (cond + ((= v1-224 'lightjak) + (if (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-lightjak-get-off))) + ) + ) + (go target-lightjak-get-off) + ) + ) + ((= v1-224 'freeze) + (if (nonzero? (-> self lightjak)) + (send-event (handle->process (-> self lightjak freeze-control)) 'die (-> arg3 param 1)) + ) + ) + ((= v1-224 'invisible) + (target-invisible-stop) + ) + ) + ) + ) + (label cfg-336) + (b! #t cfg-435 :delay (nop!)) + (label cfg-337) + (= v1-0 'gun) + ) + (target-gun-fire (the-as pickup-type (-> arg3 param 0))) + ) + ((= v1-0 'darkjak) + (when (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (zero? (-> self darkjak want-stage))) + (let ((v1-266 (-> arg3 param 0))) + (when (logtest? v1-266 16) + (set! (-> self darkjak want-stage) (the-as darkjak-stage v1-266)) + (go target-darkjak-bomb0) + ) + ) + ) + ) + (else + (b! (!= v1-0 'play-anim) cfg-352 :delay (nop!)) + (set! v0-0 (go target-play-anim (the-as string (-> arg3 param 0)) (the-as handle arg1))) + (b! #t cfg-435 :delay (nop!)) + (label cfg-352) + (cond + ((= v1-0 'clone-anim) + (go target-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + ((= v1-0 'edge-grab) + (if (not (focus-test? self dead hit grabbed)) + (go target-edge-grab) + ) + ) + ((= v1-0 'pilot-edge-grab) + (if (not (focus-test? self dead hit grabbed)) + (go target-pilot-edge-grab (the-as pilot-edge-grab-info (-> arg3 param 0))) + ) + ) + ((= v1-0 'pole-grab) + (if (and (not (focus-test? self dead hit grabbed pole)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 2) + ) + jakb-pole-cycle-ja + ) + (go target-pole-cycle (process->handle arg0)) + ) + ) + ((= v1-0 'ladder) + (if (and (not (focus-test? self dead hit grabbed pole)) + (or (not (-> arg3 param 0)) ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 2) + ) + ) + jakb-ladder-stance-ja + ) + (go target-ladder-start (process->handle arg0)) + ) + ) + ((= v1-0 'swim) + (if (not (or (= (-> self control mod-surface mode) 'swim) + (= (-> self control mod-surface mode) 'dive) + (and (-> self next-state) (= (-> self next-state name) 'target-hit)) + (focus-test? self dead hit grabbed) + ) + ) + (go target-swim-stance) + ) + ) + (else + (b! (!= v1-0 'wade) cfg-428 :delay (nop!)) + (set! v0-0 + (if (and (!= (-> self control mod-surface mode) 'wade) + (begin + (let ((v1-316 (-> self next-state))) + (b! (not v1-316) cfg-422 :likely-delay (set! v1-317 v1-316)) + ) + (let ((v1-319 (-> self next-state name))) + (set! v1-317 (or (= v1-319 'target-stance) (= v1-319 'target-walk) (= v1-319 'target-stance-look-around))) + ) + (label cfg-422) + (and v1-317 (not (logtest? (-> self focus-status) (focus-status dead hit grabbed)))) + ) + ) + (go target-wade-stance) + ) + ) + (b! #t cfg-435 :delay (nop!)) + (label cfg-428) + (cond + ((= v1-0 'slide) + (if (not (focus-test? self dead hit grabbed on-water under-water)) + (go target-slide-down-to-ground) + ) + ) + ((= v1-0 'impact-impulse) + (let ((a0-286 (-> arg3 param 0))) + (target-got-impact-impulse (the-as rigid-body-impact a0-286)) + ) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + ) + ) + (label cfg-435) + v0-0 + ) + ) + ) + ) + +(defbehavior target-dangerous-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (cond + ((< 0.0 (-> self fact shield-level)) + (let ((s4-1 (-> self control penetrate-using))) + (set! (-> self control penetrate-using) (penetrate touch shield)) + (let ((v0-0 (the-as object (target-send-attack + arg0 + 'shield + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self fact shield-attack-id)) + 0 + (-> self control penetrate-using) + ) + ) + ) + ) + (set! (-> self control penetrate-using) s4-1) + v0-0 + ) + ) + ) + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + (target-send-attack + arg0 + (-> self control danger-mode) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-hit + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + +(defbehavior target-bonk-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (cond + ((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) + ) + (< (* 16384.0 (-> self clock time-adjust-ratio)) + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control transv) (-> self control last-transv)) + ) + ) + (begin + (vector-normalize! + (vector-! + s4-0 + (the-as vector (-> self control collision-spheres 0 prim-core)) + (-> self control actor-contact-pt) + ) + 1.0 + ) + (< 0.01 (-> s4-0 y)) + ) + ) + (if (< 0.75 (-> s4-0 y)) + (send-event + arg0 + 'bonk + (-> arg3 param 0) + (fmax + (-> self control ground-impact-vel) + (- (vector-dot (-> self control transv) (-> self control dynam gravity-normal))) + ) + ) + ) + (let ((f0-7 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control highest-jump-mark) (-> self control trans)) + ) + ) + ) + (when (< (-> *TARGET-bank* fall-far) f0-7) + (when (and (target-send-attack + arg0 + 'bonk + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + (not (logtest? (-> self focus-status) (focus-status dead hit))) + ) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (target-timed-invulnerable (seconds 0.1) self 1) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + ) + ) + #f + ) + ((= arg2 'jump) + (sound-play "jump-long") + (go + target-jump + (the-as float (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + (the-as surface (-> arg3 param 2)) + ) + ) + ) + ) + ) + +(defbehavior target-jump-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (and (= arg2 'swim) (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (return #f) + ) + (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) + (cond + (v0-0 + (empty) + v0-0 + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +(defbehavior target-walk-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) + (cond + (v0-0 + (empty) + v0-0 + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +(defbehavior target-exit target () + (set! (-> self control mod-surface) *walk-mods*) + (set! (-> self control anim-collide-offset-local quad) (the-as uint128 0)) + (set! (-> self control anim-collide-offset-world quad) (the-as uint128 0)) + (set! (-> self control old-anim-collide-offset-world quad) (the-as uint128 0)) + (set! (-> self control draw-offset quad) (the-as uint128 0)) + (set! (-> self control force-turn-to-strength) 0.0) + (set! (-> self control bend-target) 0.0) + (set! (-> self control bomb-scale) 0.0) + (logclear! + (-> self target-flags) + (target-flags tf1 tf5 tf13 tf14 tf15 lleg-still rleg-still lleg-no-ik rleg-no-ik) + ) + (logclear! (-> self focus-status) (focus-status hit grabbed in-head teleporting)) + (target-danger-set! 'harmless #f) + (logior! (-> self water flags) (water-flag swim-ground)) + (logclear! (-> self water flags) (water-flag jump-out)) + (set! (-> self water drip-mult) 1.0) + (set! (-> self neck flex-blend) 1.0) + (set! (-> self neck base-joint) (the-as uint 6)) + (set! (-> self control duck-gun-tube-transision) 0.0) + (logclear! (-> self skel status) (joint-control-status valid-spooled-frame)) + (logclear! (-> self control status) (collide-status touch-ceiling-sticky)) + (initialize (-> self control impact-ctrl) self -1 0.0 (collide-spec)) + (combo-tracker-method-12 + (-> self control unknown-combo-tracker00) + *null-vector* + *null-vector* + (the-as process #f) + 0 + ) + 0 + (none) + ) + +;; WARN: Return type mismatch (function none) vs none. +(defbehavior target-state-hook-exit target () + (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) + (none) + ) + +;; WARN: Return type mismatch target-flags vs none. +(defbehavior target-effect-exit target () + (let ((v1-1 (-> self skel effect))) + (set! (-> v1-1 channel-offset) 0) + ) + 0 + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (none) + ) diff --git a/goal_src/jak3/engine/target/target-invisible.gc b/goal_src/jak3/engine/target/target-invisible.gc index 2cb6edf5681..50e06259261 100644 --- a/goal_src/jak3/engine/target/target-invisible.gc +++ b/goal_src/jak3/engine/target/target-invisible.gc @@ -7,3 +7,577 @@ ;; DECOMP BEGINS +(defpart 659 + :init-specs ((:num 0.1) + (:rot-x 5) + (:r 4096.0) + (:g 4096.0) + (:b 4096.0) + (:fade-g 1.3653333) + (:accel-y (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 660) + ) + ) + +(defpart 660 + :init-specs ((:fade-g -1.3653333)) + ) + +(defbehavior target-invisible-start target ((arg0 time-frame)) + (logior! (-> self target-flags) (target-flags invisible)) + (set-time! (-> self invisible-start-time)) + (set! (-> self invisible-duration) arg0) + (set-setting! 'cloth #f 0.0 0) + (target-gun-end-mode #f) + (if (and (focus-test? self light) (nonzero? (-> self lightjak))) + (send-event self 'end-mode 'lightjak) + ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (send-event self 'end-mode 'lightjak) + ) + (set! (-> self invisible-shadow-dir-backup quad) (-> self draw shadow-ctrl settings shadow-dir quad)) + 0 + (none) + ) + +(defpartgroup group-idol-activate + :id 182 + :duration (seconds 0.035) + :linger-duration (seconds 10) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 661 :flags (sp3)) (sp-item 662 :flags (sp3)) (sp-item 663 :flags (sp3 sp7))) + ) + +(defpart 661 + :init-specs ((:texture (new 'static 'texture-id :index #x4b :page #x4)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 2250)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters -0.125)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.375) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409600.0) + ) + ) + +(defpart 662 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 200.0) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.225)) + (:vel-x (meters 0.06666667) (meters 0.006666667)) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.94 0.04) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-z (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 663 + :init-specs ((:texture (new 'static 'texture-id :index #xa0 :page #x4)) + (:num 30.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.42666668) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 60) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defbehavior target-invisible-stop target () + (logclear! (-> self target-flags) (target-flags invisible)) + (remove-setting! 'cloth) + 0 + (none) + ) + +(deftype invis-particle-joint (structure) + ((joint int16) + (distance float) + (size float) + (spawn? symbol) + ) + ) + + +(define *invis-joint-list* + (new 'static 'boxed-array :type invis-particle-joint + (new 'static 'invis-particle-joint :joint 4 :distance 819.2 :size 1638.4 :spawn? #t) + (new 'static 'invis-particle-joint :joint 5 :distance 819.2 :size 1638.4 :spawn? #t) + (new 'static 'invis-particle-joint :joint 6 :distance 1228.8 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 8 :distance 1228.8 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 9 :distance 1638.4 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 17 :distance 1228.8 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 18 :distance 819.2 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 19 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 24 :distance 409.6 :size 409.6 :spawn? #t) + (new 'static 'invis-particle-joint :joint 26 :distance 1228.8 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 27 :distance 819.2 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 28 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 33 :distance 409.6 :size 409.6 :spawn? #t) + (new 'static 'invis-particle-joint :joint 39 :distance 614.4 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 40 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 41 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 42 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 45 :distance 614.4 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 46 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 47 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 48 :distance 409.6 :size 819.2 :spawn? #t) + ) + ) + +(defbehavior target-invisible-process target () + (cond + ((logtest? (target-flags invisible) (-> self target-flags)) + (seek! (-> self invisible-interp) 1.0 (* 2.0 (seconds-per-frame))) + (if (time-elapsed? (-> self invisible-start-time) (-> self invisible-duration)) + (target-invisible-stop) + ) + (when (= (-> self invisible-interp) 1.0) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> (math-camera-pos) quad)) + (dotimes (s5-0 (-> *invis-joint-list* length)) + (when (-> *invis-joint-list* s5-0 spawn?) + (let ((v1-22 (-> *invis-joint-list* s5-0 joint)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector<-cspace! s4-0 (-> self node-list data v1-22)) + (vector-! s3-0 gp-0 s4-0) + (vector-normalize! s3-0 (-> *invis-joint-list* s5-0 distance)) + (vector+! s4-0 s4-0 s3-0) + ) + (set! (-> *part-id-table* 659 init-specs 2 initial-valuef) (-> *invis-joint-list* s5-0 size)) + (set! (-> *part-id-table* 659 init-specs 3 initial-valuef) (* 0.5 (-> *invis-joint-list* s5-0 size))) + (set! (-> *part-id-table* 659 init-specs 4 initial-valuef) (* 0.5 (-> *invis-joint-list* s5-0 size))) + (launch-particles (-> *part-id-table* 659) s4-0) + ) + ) + ) + ) + ) + (vector-lerp! + (-> self draw shadow-ctrl settings shadow-dir) + (-> self invisible-shadow-dir-backup) + (new 'static 'vector :y -1.0 :w 1.0) + (-> self invisible-interp) + ) + (set! (-> self draw shadow-ctrl settings shadow-dir w) (-> self invisible-shadow-dir-backup w)) + (logand! (-> self target-effect) -2) + (if (= (-> self invisible-interp) 1.0) + (logior! (-> self target-effect) 1) + ) + (if (and (time-elapsed? (-> self invisible-start-time) (+ (-> self invisible-duration) (seconds -2))) + (< (mod (- (current-time) (-> self invisible-start-time)) 60) 30) + ) + (logand! (-> self target-effect) -2) + ) + ) + ((!= (-> self invisible-interp) 0.0) + (logand! (-> self target-effect) -2) + (seek! (-> self invisible-interp) 0.0 (* 0.5 (seconds-per-frame))) + ) + ) + (cond + ((= (-> self invisible-interp) 0.0) + (logclear! (-> self draw status) (draw-control-status force-fade)) + ) + (else + (logior! (-> self draw status) (draw-control-status force-fade)) + (set! (-> self draw force-fade) + (the-as uint (the int (lerp-scale 128.0 16.0 (-> self invisible-interp) 0.0 1.0))) + ) + ) + ) + 0 + (none) + ) + +(defstate target-invisible-get-on (target) + :event target-standard-event-handler + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (remove-setting! 'gun) + (persist-with-delay *setting-control* 'gun (seconds 0.5) 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-gun-end-mode #t) + ) + :code (behavior ((arg0 handle) (arg1 time-frame)) + (set-time! (-> self state-time)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *grab-mods*) + (target-gun-end-mode #f) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + (set-forward-vel 0.0) + (let ((s4-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! s4-0 (- (current-time) (-> self clock old-frame-counter))) + (if (>= s4-0 300) + (go target-falling #f) + ) + (suspend) + ) + ) + (when (= (-> self ext-anim) (target-anim default)) + (let* ((s5-1 (handle->process arg0)) + (v1-24 (if (type? s5-1 process-drawable) + (the-as process-drawable s5-1) + ) + ) + ) + (when v1-24 + (let ((s4-1 (-> v1-24 root trans)) + (v1-27 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg main))) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) s4-1 v1-27) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-stance-to-invisible-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-invisible-loop-ja :num! (seek! (ja-aframe 20.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + (target-invisible-start arg1) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self trans-hook) (lambda :behavior target () (if (move-legs?) + (go target-stance) + ) + ) + ) + (dotimes (gp-1 1) + (ja-no-eval :group! jakb-invisible-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja-no-eval :group! jakb-invisible-to-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (go target-stance) + ) + :post (-> target-grab post) + ) + +(deftype dark-maker-idol (process-drawable) + ((root collide-shape :override) + (humming-sound ambient-sound) + ) + (:state-methods + idle + active + ) + ) + + +(defskelgroup skel-dark-maker-idol dark-maker-idol dark-maker-idol-lod0-jg dark-maker-idol-idle-ja + ((dark-maker-idol-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2) + :shadow-joint-index 3 + ) + +(defstate idle (dark-maker-idol) + :virtual #t + :trans (behavior () + (when (and *target* + (logtest? (the-as game-feature (logand (game-feature artifact-invis) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + (and (and *target* (and (>= 24576.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (not (focus-test? *target* dead ignore hit in-head pole flut light board dark teleporting)) + (can-display-query? self "idol" -99.0) + (-> *target* current-level) + (zero? (-> *target* ext-anim)) + ) + ) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((v1-21 gp-0)) + (set! (-> v1-21 width) (the float 340)) + ) + (let ((v1-22 gp-0)) + (set! (-> v1-22 height) (the float 80)) + ) + (let ((v1-23 gp-0) + (a0-16 (-> *setting-control* user-default language)) + ) + (set! (-> v1-23 scale) (if (or (= a0-16 (language-enum korean)) (= a0-16 (language-enum russian))) + 0.9 + 0.7 + ) + ) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text (lookup-text! *common-text* (text-id text-0083) #f) gp-0 #f 44 (bucket-id bucket579)) + ) + (if (and (cpad-pressed? 0 triangle) + (send-event + *target* + 'change-mode + 'invisible + self + (the int (* 300.0 (res-lump-float + (-> self entity) + 'duration + :default (* 0.0033333334 (the float (-> *TARGET-bank* invisible-duration))) + ) + ) + ) + ) + ) + (go-virtual active) + ) + 3 + ) + (if *target* + (look-at! + (-> *target* neck) + (vector+! + (new 'stack-no-clear 'vector) + (the-as vector (-> self root root-prim prim-core)) + (new 'static 'vector :y 2048.0 :w 1.0) + ) + 'nothing-special + self + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (let ((gp-0 (and *target* (logtest? (target-flags invisible) (-> *target* target-flags))))) + (let ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 5324.8)) + (a1-2 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) + ) + (set! (-> a1-2 trans quad) (-> s5-1 quad)) + (if (and (nonzero? (-> self part)) (not gp-0)) + (sparticle-launch-control-method-17 (-> self part) a1-2) + ) + ) + (update-vol! (-> self humming-sound) (if gp-0 + 0.0 + 0.8 + ) + ) + ) + (update! (-> self humming-sound)) + (ja-post) + ) + ) + +(defstate active (dark-maker-idol) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.66)) + (suspend) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 182 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-1 (method-of-type part-tracker-subsampler activate))) + (t9-1 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-2 run-function-in-process) + (a0-5 gp-1) + (a1-2 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 182)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-2) a0-5 a1-2 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-4 (method-of-type part-tracker activate))) + (t9-4 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-5 run-function-in-process) + (a0-11 gp-2) + (a1-5 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 182)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-5) a0-11 a1-5 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + (if *target* + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 5) + 300 + #f + *target* + 19 + 4 + :name "lightning-tracker" + :to self + :unk 0 + ) + ) + (sound-play "dark-maker") + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 2)) + (suspend) + ) + ) + (go-virtual idle) + ) + :post (behavior () + (update-vol! + (-> self humming-sound) + (lerp-clamp 0.8 0.0 (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + ) + (update! (-> self humming-sound)) + (when (nonzero? (-> self part)) + (let ((gp-2 (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 5324.8)) + (a1-4 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) + ) + (set! (-> a1-4 trans quad) (-> gp-2 quad)) + (sparticle-launch-control-method-17 (-> self part) a1-4) + ) + ) + (ja-post) + ) + ) + +(defmethod init-from-entity! ((this dark-maker-idol) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 0) + (set-vector! (-> v1-2 local-sphere) 0.0 4096.0 0.0 8192.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-maker-idol" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (task-node-closed? (game-task-node volcano-darkeco-resolution)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 82) this)) + ) + (set! (-> this humming-sound) (new 'process 'ambient-sound "dark-maker-amb" (-> this root trans) 0.0)) + (set-falloff-far! (-> this humming-sound) 122880.0) + (update-vol! (-> this humming-sound) 0.8) + (update-pitch-mod! (-> this humming-sound) 0.0) + (go (method-of-object this idle)) + ) + +(defmethod relocate ((this dark-maker-idol) (offset int)) + (if (nonzero? (-> this humming-sound)) + (&+! (-> this humming-sound) offset) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this dark-maker-idol)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this humming-sound)) + (stop! (-> this humming-sound)) + ) + (call-parent-method this) + (none) + ) diff --git a/goal_src/jak3/engine/target/target-lightjak.gc b/goal_src/jak3/engine/target/target-lightjak.gc index ce227152a6c..02e331c9a36 100644 --- a/goal_src/jak3/engine/target/target-lightjak.gc +++ b/goal_src/jak3/engine/target/target-lightjak.gc @@ -7,3 +7,3521 @@ ;; DECOMP BEGINS +(defpartgroup group-lightjak-get-on-charge + :id 174 + :duration (seconds 2) + :linger-duration (seconds 2) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 630 :flags (is-3d)) + (sp-item 631 :flags (is-3d)) + (sp-item 632 :flags (is-3d)) + (sp-item 633 :flags (is-3d)) + (sp-item 634) + ) + ) + +(defpart 630 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -2)) + (:scale-x (meters 3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 80)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 90.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 631 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -2)) + (:scale-x (meters 3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 124.99999)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 90.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 632 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -2)) + (:scale-x (meters 3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 35)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 90.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 633 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -2)) + (:scale-x (meters 3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 170)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 90.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 634 + :init-specs ((:texture (new 'static 'texture-id :index #x96 :page #x4)) + (:num 1.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters 8)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.1) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters -0.00083333335) (meters -0.00083333335)) + (:fade-a 2.56) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.167)) + (:next-launcher 635) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 635 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpartgroup group-lightjak-get-on + :id 175 + :duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 636 :period (seconds 5) :length (seconds 0.017))) + ) + +(defpart 636 + :init-specs ((:texture (new 'static 'texture-id :index #x93 :page #x4)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 12)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g -1.6) + (:fade-b -1.6) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-lightjak-get-off + :id 176 + :duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 637 :period (seconds 5) :length (seconds 0.017)) + (sp-item 638 :period (seconds 5) :length (seconds 0.017)) + (sp-item 639 :period (seconds 5) :length (seconds 0.085)) + ) + ) + +(defpart 637 + :init-specs ((:texture (new 'static 'texture-id :index #x93 :page #x4)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 12)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g -1.6) + (:fade-b -1.6) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 638 + :init-specs ((:texture (new 'static 'texture-id :index #x94 :page #x4)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:fade-b -0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 639 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 60.0) + (:y (meters -1.5) (meters 3)) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 32.0 64.0) + (:g :copy r) + (:b 128.0) + (:a 128.0 128.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:accel-y (meters 0.00016666666) (meters 0.00066666666)) + (:friction 0.95 0.05) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.5)) + (:next-launcher 640) + (:conerot-x (degrees 90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 640 + :init-specs ((:scalevel-x (meters -0.00016666666) (meters -0.00016666666)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.425 -0.425) + (:friction 0.99) + (:next-time (seconds 0.017)) + (:next-launcher 641) + ) + ) + +(defpart 641 + :init-specs ((:accel-x (meters -0.0013333333) (meters 0.0026666666)) + (:accel-z (meters -0.0013333333) (meters 0.0026666666)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 641) + ) + ) + +(defpartgroup group-lightjak-regen + :id 177 + :duration (seconds 2) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 642 :flags (is-3d)) + (sp-item 643 :flags (is-3d)) + (sp-item 644 :flags (is-3d)) + (sp-item 645 :flags (is-3d)) + (sp-item 646) + (sp-item 647 :period (seconds 5) :length (seconds 1.5)) + ) + ) + +(defpart 642 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -5) (meters -1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 80)) + (:scale-y (meters 6)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 648) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 648 + :init-specs ((:fade-a -1.28)) + ) + +(defpart 643 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -5) (meters -1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 124.99999)) + (:scale-y (meters 6)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 648) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 644 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -5) (meters -1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 35)) + (:scale-y (meters 6)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 648) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 645 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -5) (meters -1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 170)) + (:scale-y (meters 6)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 648) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 646 + :init-specs ((:texture (new 'static 'texture-id :index #x96 :page #x4)) + (:num 0.5 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters 8)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.1) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters -0.00083333335) (meters -0.00083333335)) + (:fade-a 0.85333335) + (:timer (seconds 1) (seconds 1.665)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.5)) + (:next-launcher 649) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 649 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpart 647 + :init-specs ((:texture (new 'static 'texture-id :index #x64 :page #x4)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 10) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters -0.033333335) (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667 0.10666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 650 + :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x4)) + (:num 1.0) + (:y (meters -0.025)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 651 + :init-specs ((:texture (new 'static 'texture-id :index #xd :page #x4)) + (:num 1.0) + (:scale-x (meters 10.5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-lightjak-shield-start + :id 178 + :duration (seconds 0.5) + :linger-duration (seconds 1) + :flags (sp0 sp4 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + ) + ) + +(defpart 653 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 1.0) + (:y (meters -1) (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:timer (seconds -0.005)) + (:func 'spt-func-relative-pos) + ) + ) + +(defpart 652 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 1.0 3.0) + (:z (meters 2) (meters 1)) + (:scale-x (meters 0.05) (meters 0.05)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.013333334) (meters -0.013333334)) + (:vel-y (meters 0.053333335)) + (:fade-a -0.42666668 -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 ready-to-launch left-multiply-quat)) + ) + ) + +(defpartgroup group-lightjak-shield-hit + :id 179 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 654)) + ) + +(defpart 654 + :init-specs ((:texture (new 'static 'texture-id :index #x19 :page #x4)) + (:num 1.0) + (:scale-x (meters 6.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:func 'sparticle-track-root) + ) + ) + +(defpartgroup group-lightjak-freeze-hands + :id 180 + :duration (seconds 0.5) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 655)) + ) + +(defpart 655 + :init-specs ((:texture (new 'static 'texture-id :index #xe :page #x4)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.64) + (:fade-g -0.21333334) + (:fade-b -0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-lightjak-freeze-burst + :id 181 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 656 :flags (sp3)) (sp-item 657 :flags (sp3)) (sp-item 658 :flags (sp3 sp7))) + ) + +(defpart 658 + :init-specs ((:texture (new 'static 'texture-id :index #x4b :page #x4)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 2250)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters -0.125)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.375) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409600.0) + ) + ) + +(defpart 657 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 100.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.45)) + (:vel-y (meters 0.06666667) (meters 0.006666667)) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.94 0.04) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 80) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 656 + :init-specs ((:texture (new 'static 'texture-id :index #xa0 :page #x4)) + (:num 30.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 40.0 40.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.53333336) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.93 0.02) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 60) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun point-off-screen ((arg0 vector)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! s3-0 0.0 -280.0 0.0 1.0) + (vector-! s4-0 (camera-pos) (target-pos 0)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (set! (-> s5-0 quad) (-> (target-pos 0) quad)) + (reverse-transform-point! arg0 s5-0 s4-0 s3-0) + ) + arg0 + ) + +(let ((v1-39 (copy *walk-mods* 'global))) + (set! (-> v1-39 name) 'lightjak) + (set! (-> v1-39 flags) (surface-flag gun-off)) + (set! *lightjak-trans-mods* v1-39) + ) + +(defbehavior want-to-powerjak? target () + (and (or (cpad-hold? (-> self control cpad number) l2) (nonzero? (-> self lightjak get-on-latch))) + (and (not *pause-lock*) + (not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (and (or (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (not (logtest? (target-flags invisible) (-> self target-flags))) + ) + (or (and (-> *setting-control* user-current darkjak) + (logtest? (the-as game-feature (logand (game-feature darkjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (not (focus-test? + self + dead + hit + grabbed + in-head + under-water + edge-grab + pole + flut + tube + light + board + pilot + mech + carry + indax + teleporting + ) + ) + (time-elapsed? (-> self fact darkjak-start-time) (seconds 0.05)) + ) + (and (-> *setting-control* user-current lightjak) + (logtest? (the-as game-feature (logand (game-feature lightjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (not (focus-test? + self + dead + hit + grabbed + in-head + under-water + edge-grab + pole + flut + tube + board + pilot + mech + dark + carry + indax + teleporting + ) + ) + (time-elapsed? (-> self fact lightjak-start-time) (seconds 0.05)) + ) + ) + ) + ) + ) + ) + +(defstate target-powerjak-get-on (target) + :event target-standard-event-handler + :exit (behavior () + (set! (-> self lightjak get-on-latch) (the-as uint 0)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (logclear! (-> self target-flags) (target-flags tf4)) + (remove-setting! 'gun) + (persist-with-delay *setting-control* 'gun (seconds 0.5) 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-gun-end-mode #t) + ) + :code (behavior () + (logior! (-> self target-flags) (target-flags tf4)) + (set-time! (-> self state-time)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *lightjak-trans-mods*) + (set! (-> self lightjak get-on-latch) (the-as uint 0)) + (set! (-> self control unknown-word04) + (the-as uint (and (focus-test? self light) (nonzero? (-> self lightjak)))) + ) + (target-gun-end-mode #f) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + (let ((gp-0 + (lambda :behavior target + ((arg0 symbol)) + (show-hud 'hud-health) + (cond + ((and (or (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + ) + (not (cpad-hold? (-> self control cpad number) l2)) + (zero? (-> self lightjak get-on-latch)) + ) + (cond + ((-> self lightjak get-off-lock) + (go target-stance) + ) + ((and (focus-test? self light) (nonzero? (-> self lightjak))) + (go target-lightjak-get-off) + ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (go target-darkjak-get-off) + ) + ) + ) + ((and (time-elapsed? (-> self state-time) (seconds 0.1)) + (not (-> self lightjak get-off-lock)) + (not (cpad-hold? (-> self control cpad number) l2)) + (zero? (-> self lightjak get-on-latch)) + (want-to-darkjak?) + ) + (set! (-> self lightjak get-on-latch) (the-as uint 512)) + ) + ((and (or (not (want-to-powerjak?)) + (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2)) + (cpad-pressed? (-> self control cpad number) r2) + ) + (time-elapsed? (-> self state-time) (seconds 0.05)) + ) + (go target-stance) + ) + ((and (cpad-pressed? (-> self control cpad number) triangle) + (let ((v1-77 #t)) + (set! (-> self lightjak get-off-lock) v1-77) + v1-77 + ) + (logtest? (the-as game-feature (logand (game-feature lightjak-regen) (-> *setting-control* user-current features))) + (-> self game features) + ) + (and (< (-> self fact health) (-> self fact health-max)) (want-to-lightjak?)) + ) + (set! (-> self lightjak get-on-latch) (the-as uint 8)) + ) + ((and (cpad-pressed? (-> self control cpad number) x) + (let ((v1-96 #t)) + (set! (-> self lightjak get-off-lock) v1-96) + v1-96 + ) + (logtest? (the-as game-feature (logand (game-feature lightjak-swoop) (-> *setting-control* user-current features))) + (-> self game features) + ) + (>= (-> self game eco-pill-light) (-> *FACT-bank* lightjak-swoop-inc)) + (= (-> self fact shield-level) 0.0) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-feet))) + (and (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) (want-to-lightjak?)) + ) + (set! (-> self lightjak get-on-latch) (the-as uint 16)) + ) + ((and (cpad-pressed? (-> self control cpad number) square) + (let ((v1-126 #t)) + (set! (-> self lightjak get-off-lock) v1-126) + v1-126 + ) + (logtest? (the-as game-feature (logand (game-feature lightjak-freeze) (-> *setting-control* user-current features))) + (-> self game features) + ) + (>= (-> self game eco-pill-light) (-> *FACT-bank* lightjak-freeze-min)) + (and (not (handle->process (-> self lightjak freeze-control))) (want-to-lightjak?)) + ) + (set! (-> self lightjak get-on-latch) (the-as uint 32)) + ) + ((and (cpad-pressed? (-> self control cpad number) circle) + (let ((v1-149 #t)) + (set! (-> self lightjak get-off-lock) v1-149) + v1-149 + ) + (logtest? (game-feature lightjak-shield) (-> self game features)) + (>= (-> self game eco-pill-light) (-> *FACT-bank* lightjak-shield-inc)) + (and (not (handle->process (-> self lightjak freeze-control))) (want-to-lightjak?)) + ) + (set! (-> self lightjak get-on-latch) (the-as uint 64)) + ) + ) + (cond + ((or (!= (-> self skel root-channel 0) (-> self skel channel)) + (!= (-> self skel top-anim interp) 0.0) + (not arg0) + ) + #f + ) + ((and (nonzero? (-> self lightjak get-on-latch)) (or (want-to-lightjak?) (want-to-darkjak?))) + (set! (-> self lightjak lightjak-before-powerjak) (the-as symbol (-> self control unknown-spool-anim00))) + (case (-> self lightjak get-on-latch) + ((512) + (go target-darkjak-get-on (darkjak-stage bomb0)) + ) + ((8) + (if (and (focus-test? self light) (nonzero? (-> self lightjak))) + (go target-lightjak-regen 0) + (go target-lightjak-get-on (lightjak-stage ls2 regen)) + ) + ) + ((16) + (cond + ((and (focus-test? self light) (nonzero? (-> self lightjak))) + (logior! (-> self lightjak stage) (lightjak-stage swoop)) + (if (not (-> self lightjak wings)) + (set! (-> self lightjak wings) (process-spawn wings :init wings-init 'open :name "wings" :to self)) + ) + (go target-stance) + ) + (else + (go target-lightjak-get-on (lightjak-stage ls2 swoop)) + ) + ) + ) + ((32) + (if (and (focus-test? self light) (nonzero? (-> self lightjak))) + (go target-lightjak-freeze) + (go target-lightjak-get-on (lightjak-stage ls2 freeze)) + ) + ) + ((64) + (if (and (focus-test? self light) (nonzero? (-> self lightjak))) + (go target-stance) + (go target-lightjak-get-on (lightjak-stage ls2 ls6)) + ) + ) + ) + ) + ((nonzero? (-> self lightjak get-on-latch)) + (set! (-> self lightjak get-on-latch) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + (set-forward-vel 0.0) + (let ((s5-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! s5-0 (- (current-time) (-> self clock old-frame-counter))) + (if (>= s5-0 300) + (go target-falling #f) + ) + (gp-0 #f) + (suspend) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-powerjak-get-on-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-0 #t) + (suspend) + (ja :num! (seek!)) + ) + (logclear! (-> self target-flags) (target-flags tf4)) + (until #f + (ja-no-eval :group! jakb-powerjak-get-on-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-0 #t) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + #f + (go target-stance) + ) + :post (-> target-grab post) + ) + +(defbehavior target-lightjak-setup target ((arg0 symbol)) + (when (zero? (-> self lightjak)) + (set! (-> self lightjak) (new 'process 'lightjak-info)) + (set! (-> self lightjak process) (the-as (pointer target) (process->ppointer self))) + (let* ((v1-4 (-> self game)) + (a0-5 (+ (-> v1-4 attack-id) 1)) + ) + (set! (-> v1-4 attack-id) a0-5) + (set! (-> self lightjak attack-id) a0-5) + ) + (set! (-> self lightjak tone) (the-as uint (new-sound-id))) + (set! (-> self lightjak freeze-control) (the-as handle #f)) + (set! (-> self lightjak freeze-screen) (the-as handle #f)) + (set! (-> self lightjak wings) (the-as (pointer wings) #f)) + (set! (-> self lightjak shield) (the-as (pointer lightjak-shield) #f)) + (set! (-> self lightjak latch-out-time) 0) + (set! (-> self lightjak mode-sound-bank) #f) + (set! (-> self lightjak get-off-lock) #f) + (set! (-> self lightjak lightjak-before-powerjak) #f) + ) + 0 + (none) + ) + +(defbehavior want-to-lightjak? target () + (and (not *pause-lock*) + (-> *setting-control* user-current lightjak) + (logtest? (the-as game-feature (logand (game-feature lightjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (not (focus-test? + self + dead + hit + grabbed + in-head + under-water + edge-grab + pole + flut + tube + board + pilot + mech + dark + carry + indax + teleporting + ) + ) + (not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (and (and (time-elapsed? (-> self fact lightjak-start-time) (seconds 0.05)) (< 0.0 (-> self game eco-pill-light))) + (zero? (-> self lightjak latch-out-time)) + (time-elapsed? (-> self lightjak regen-time) (seconds 0.3)) + ) + ) + ) + +(defbehavior target-lightjak-end-mode target ((arg0 symbol)) + (when (and (focus-test? self light) (nonzero? (-> self lightjak))) + (cond + (arg0 + (set! (-> self lightjak get-off-lock) #f) + (set! (-> self lightjak lightjak-before-powerjak) #f) + (logclear! (-> self focus-status) (focus-status light)) + (send-event self 'reset-collide) + (logclear! (-> self target-flags) (target-flags tf4)) + (remove-setting! 'sound-flava) + (remove-setting! 'string-min-length) + (remove-setting! 'string-max-length) + (remove-setting! 'string-spline-max-move) + (remove-setting! 'string-spline-accel) + (remove-setting! 'string-spline-max-move-player) + (remove-setting! 'string-spline-accel-player) + (setting-control-method-14 *setting-control* (-> self lightjak mode-sound-bank)) + (set! (-> self lightjak mode-sound-bank) #f) + (let ((v1-33 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-33 command) (sound-command set-param)) + (set! (-> v1-33 id) (the-as sound-id (-> self lightjak tone))) + (set! (-> v1-33 params volume) -4) + (set! (-> v1-33 auto-time) 120) + (set! (-> v1-33 auto-from) 2) + (set! (-> v1-33 params mask) (the-as uint 17)) + (-> v1-33 id) + ) + (case (get-status *gui-control* (the-as sound-id (-> self lightjak on-off))) + (((gui-status pending) (gui-status ready) (gui-status unknown)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + (set! (-> self pending-ext-anim) (target-anim default)) + (if (< (-> self game eco-pill-light) 1.0) + (send-event self 'get-pickup (pickup-type eco-pill-light) -1.0) + ) + (let ((v1-53 (ja-group))) + (when (not (and (and v1-53 (or (= v1-53 jakb-lightjak-get-off-ja) (= v1-53 jakb-lightjak-get-on-ja))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + (joint-control-cleanup + (-> self skel) + (-> self ext-anim-control heap) + (the-as art-joint-anim jakb-stance-loop-ja) + ) + (send-event (ppointer->process (-> self sidekick)) 'cleanup) + ) + ) + (let ((a0-39 (ppointer->process (-> self lightjak wings)))) + (when a0-39 + (deactivate a0-39) + (set! (-> self lightjak wings) (the-as (pointer wings) #f)) + ) + ) + (let ((a0-40 (ppointer->process (-> self lightjak shield)))) + (when a0-40 + (deactivate a0-40) + (set! (-> self lightjak shield) (the-as (pointer lightjak-shield) #f)) + ) + ) + (remove-setting! 'attack) + (set! (-> self fact shield-level) 0.0) + (set! (-> self lightjak shield-start-time) 0) + (remove-from-process *part-engine* self) + (set! (-> self lightjak latch-out-time) 0) + 0 + ) + ((zero? (-> self lightjak latch-out-time)) + (when (!= (-> self lightjak-interp) 0.0) + (case (get-status *gui-control* (the-as sound-id (-> self lightjak on-off))) + (((gui-status pending) (gui-status ready) (gui-status active)) + ) + (else + (set! (-> self lightjak on-off) + (the-as + uint + (add-process *gui-control* self (gui-channel jak-effect-1) (gui-action queue) "jak-onof" -99.0 0) + ) + ) + ) + ) + ) + (set-time! (-> self lightjak latch-out-time)) + (send-event (ppointer->process (-> self lightjak wings)) 'end-mode) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-lightjak-do-effect target () + (let ((f30-0 (-> self lightjak-interp))) + (cond + ((< 0.0 f30-0) + (logior! (-> self target-effect) 2) + (logior! (-> self target-effect) 16) + (sound-play-by-name + (static-sound-name "ltjak-chill") + (the-as sound-id (-> self lightjak tone)) + (the int (* 1024.0 f30-0)) + 0 + 0 + (sound-group) + (-> self control trans) + ) + ) + (else + (when (logtest? (-> self target-effect) 2) + (let ((v1-14 (get-status *gui-control* (the-as sound-id (-> self lightjak on-off))))) + (cond + ((= v1-14 (gui-status ready)) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ((and (= (-> *setting-control* user-current mode-sound-bank) 'modelit) + (= (-> *setting-control* user-target mode-sound-bank) 'modelit) + (not (or (focus-test? self board) (-> self board latch?))) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (sound-play "ljak-off") + ) + ((= v1-14 (gui-status pending)) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (else + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (add-process *gui-control* self (gui-channel jak-effect-2) (gui-action play) "jak-onof" -99.0 0) + ) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 176 flags) (sp-group-flag sp13)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-10 (method-of-type part-tracker-subsampler activate))) + (t9-10 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-11 run-function-in-process) + (a0-23 gp-1) + (a1-15 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 176)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 6) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-11) a0-23 a1-15 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-13 (method-of-type part-tracker activate))) + (t9-13 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-14 run-function-in-process) + (a0-26 gp-2) + (a1-18 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 176)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 6) + ((the-as (function object object object none) t9-14) a0-26 a1-18 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + ) + (logand! (-> self target-effect) -3) + (logand! (-> self target-effect) -17) + ) + ) + (when (and (< 0.0 f30-0) (and (not (focus-test? self in-head)) + (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp))) + (not (movie?)) + (< (-> *setting-control* user-current slow-time) 1.0) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'vector)) + (f30-1 (fmin 1.0 (-> self clock clock-ratio))) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 623) (sp-field-id spt-a)) initial-valuef) + (* 16.0 (- 1.0 (-> *setting-control* user-current slow-time))) + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg main)) :rate f30-1) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg upper_body)) + :rate f30-1 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg chest)) :rate f30-1) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg neckA)) :rate f30-1) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg MhairA)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg MhairB)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Lshould)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rshould)) + :rate f30-1 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Larm)) :rate f30-1) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rarm)) :rate f30-1) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Lforarm)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rforarm)) + :rate f30-1 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg hips)) :rate f30-1) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Lthigh)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rthigh)) + :rate f30-1 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Lknee)) :rate f30-1) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rknee)) :rate f30-1) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Lankle)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rankle)) + :rate f30-1 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Ltoes)) :rate f30-1) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rtoes)) :rate f30-1) + ) + ) + ) + (none) + ) + +(defbehavior target-lightjak-process target () + (if (and (not (cpad-hold? (-> self control cpad number) l2)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-powerjak-get-on))) + ) + (set! (-> self lightjak get-off-lock) #f) + ) + (cond + ((nonzero? (-> self lightjak latch-out-time)) + (if (time-elapsed? (-> self lightjak latch-out-time) (seconds 0.4)) + (target-lightjak-end-mode #t) + ) + ) + ((and (focus-test? self light) (nonzero? (-> self lightjak))) + (let ((a1-0 'eco-red)) + (target-danger-set! (-> self control danger-mode) a1-0) + ) + (update-transforms (-> self control)) + (let ((a1-1 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-1 options) (overlaps-others-options)) + (set! (-> a1-1 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-1 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-1) + ) + (target-danger-set! (-> self control danger-mode) #f) + (update-transforms (-> self control)) + (when (and (or (< (-> self game eco-pill-light) 1.0) + (not (-> *setting-control* user-current lightjak)) + (not (logtest? (the-as game-feature (logand (game-feature lightjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + ) + ) + (and (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) + (let ((v1-50 (-> self next-state name))) + (or (= v1-50 'target-lightjak-get-on) + (= v1-50 'target-lightjak-get-off) + (= v1-50 'target-lightjak-swoop) + (= v1-50 'target-lightjak-swoop-again) + (= v1-50 'target-lightjak-swoop-falling) + (= v1-50 'target-lightjak-freeze) + (= v1-50 'target-lightjak-regen) + ) + ) + ) + ) + (or (not (logtest? (-> self lightjak stage) (lightjak-stage ls0 ls1))) + (not (-> *setting-control* user-current lightjak)) + (not (logtest? (the-as game-feature (logand (game-feature lightjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + ) + ) + ) + ) + (if (and (and (-> self next-state) (let ((v1-61 (-> self next-state name))) + (or (= v1-61 'target-stance) (= v1-61 'target-hit-ground)) + ) + ) + (not (handle->process (-> self lightjak freeze-control))) + ) + (go target-lightjak-get-off) + (target-lightjak-end-mode #f) + ) + ) + ) + (else + (set! (-> self lightjak-interp) 0.0) + ) + ) + (when (nonzero? (-> self lightjak shield-start-time)) + (set-time! (-> self fact shield-use-time)) + (set-time! (-> self water distort-time)) + (target-gun-end-mode #t) + (if (-> self lightjak shield) + (send-event (ppointer->process (-> self lightjak shield)) 'open) + (set! (-> self lightjak shield) + (process-spawn lightjak-shield :init lightjak-shield-init :name "lightjak-shield" :to self) + ) + ) + (when (time-elapsed? (-> self lightjak shield-count-time) (seconds 0.33)) + (let* ((v1-93 (-> self game)) + (a0-46 (+ (-> v1-93 attack-id) 1)) + ) + (set! (-> v1-93 attack-id) a0-46) + (set! (-> self fact shield-attack-id) a0-46) + ) + (if (not (logtest? (-> self lightjak stage) (lightjak-stage ls1))) + (send-event + self + 'get-pickup + (pickup-type eco-pill-light) + (* -0.33333334 (-> *FACT-bank* lightjak-shield-inc)) + ) + ) + (set-time! (-> self lightjak shield-count-time)) + ) + (when (not (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (logtest? (game-feature lightjak-shield) (-> self game features)) + (or (cpad-hold? (-> self control cpad number) circle) + (and (and (focus-test? self light) + (nonzero? (-> self lightjak)) + (logtest? (-> self lightjak stage) (lightjak-stage ls6)) + ) + (not (time-elapsed? (-> self lightjak start-time) (seconds 3))) + ) + ) + (>= (-> self game eco-pill-light) (-> *FACT-bank* lightjak-shield-inc)) + (not (handle->process (-> self lightjak freeze-control))) + ) + ) + ) + (send-event (ppointer->process (-> self lightjak shield)) 'close) + (set! (-> self fact shield-level) 0.0) + (set! (-> self lightjak shield-start-time) 0) + (remove-setting! 'attack) + (apply-settings *setting-control*) + ) + ) + (when (and (zero? (-> self lightjak shield-start-time)) + (zero? (-> self lightjak latch-out-time)) + (logtest? (game-feature lightjak-shield) (-> self game features)) + (and (focus-test? self light) (nonzero? (-> self lightjak))) + (or (cpad-hold? (-> self control cpad number) circle) + (and (and (focus-test? self light) + (nonzero? (-> self lightjak)) + (logtest? (-> self lightjak stage) (lightjak-stage ls6)) + ) + (not (time-elapsed? (-> self lightjak start-time) (seconds 3))) + ) + ) + (>= (-> self game eco-pill-light) 1.0) + (not (and (-> self next-state) + (let ((v1-189 (-> self next-state name))) + (or (= v1-189 'target-flop) + (= v1-189 'target-lightjak-freeze) + (= v1-189 'target-lightjak-shield) + (= v1-189 'target-lightjak-regen) + (= v1-189 'target-lightjak-get-off) + ) + ) + ) + ) + (and (not (handle->process (-> self lightjak freeze-control))) + (= (-> self ext-anim) (target-anim light)) + (time-elapsed? (-> self lightjak regen-time) (seconds 0.5)) + ) + ) + (set-time! (-> self lightjak shield-start-time)) + (set! (-> self lightjak shield-count-time) 0) + (set! (-> self fact shield-level) 1.0) + (let* ((v1-205 (-> self game)) + (a0-94 (+ (-> v1-205 attack-id) 1)) + ) + (set! (-> v1-205 attack-id) a0-94) + (set! (-> self fact shield-attack-id) a0-94) + ) + (set-setting! 'attack #f 0.0 0) + (apply-settings *setting-control*) + (set! (-> self fact lightjak-effect-time) + (+ (- (seconds 20) (-> self fact lightjak-start-time)) (current-time)) + ) + (when (and (time-elapsed? (-> self fact shield-use-time) (seconds 0.1)) + (and (-> self next-state) (let ((v1-221 (-> self next-state name))) + (or (= v1-221 'target-stance) + (= v1-221 'target-jump) + (= v1-221 'target-falling) + (= v1-221 'target-hit-ground) + (= v1-221 'target-double-jump) + ) + ) + ) + (>= (-> self control last-time-on-surface) (-> self fact shield-start-time)) + ) + (set-time! (-> self fact shield-start-time)) + (go target-lightjak-shield) + ) + ) + (target-lightjak-do-effect) + 0 + (none) + ) + +(defstate target-lightjak-get-on (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('lightjak) + (when (zero? (-> self lightjak want-stage)) + (set! (-> self lightjak want-stage) (the-as lightjak-stage (-> block param 0))) + #t + ) + ) + (('touched) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self control) + (the-as uint 1920) + ) + (target-send-attack + proc + (-> self control danger-mode) + (the-as touching-shapes-entry (-> block param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + (target-generic-event-handler proc argc message block) + ) + ) + (('attack-invinc) + (target-attacked + message + (the-as attack-info (-> block param 1)) + proc + (the-as touching-shapes-entry (-> block param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 lightjak-stage)) + (set! (-> self control lightjak-sound-id) (new 'static 'sound-id)) + 0 + ) + :exit (behavior () + (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-0 command) (sound-command set-param)) + (set! (-> v1-0 id) (-> self control unknown-sound-id00)) + (set! (-> v1-0 params volume) -4) + (set! (-> v1-0 auto-time) 48) + (set! (-> v1-0 auto-from) 2) + (set! (-> v1-0 params mask) (the-as uint 17)) + (-> v1-0 id) + ) + (when (nonzero? (-> self control lightjak-sound-id)) + (set-action! + *gui-control* + (gui-action fade) + (-> self control lightjak-sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> self control lightjak-sound-id) (new 'static 'sound-id)) + 0 + ) + (remove-setting! 'process-mask) + (logclear! (-> self target-flags) (target-flags tf4)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self lightjak-interp) 1.0) + (target-danger-set! 'harmless #f) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (remove-setting! 'gun) + (persist-with-delay *setting-control* 'gun (seconds 0.5) 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-gun-end-mode #t) + ) + :code (behavior ((arg0 lightjak-stage)) + (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-darkjak-end-mode #t) + (send-event (handle->process (-> self notify)) 'notify 'attack 24) + (set! (-> self lightjak stage) (logior arg0 (lightjak-stage ls2))) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *lightjak-trans-mods*) + (set-time! (-> self lightjak start-time)) + (set! (-> self lightjak attack-count) 0) + (set! (-> self lightjak latch-out-time) 0) + (logior! (-> self focus-status) (focus-status light)) + (set! (-> self pending-ext-anim) (target-anim light)) + (set-time! (-> self fact lightjak-start-time)) + (set! (-> self fact lightjak-effect-time) (seconds 20)) + (set! (-> self lightjak mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modelit 0.0 0))) + (target-start-attack) + (target-danger-set! 'get-on #f) + (cond + ((logtest? arg0 (lightjak-stage freeze)) + ) + (else + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile guard vehicle)) + ) + ) + (logior! (-> self target-flags) (target-flags tf4)) + (when (logtest? arg0 (lightjak-stage ls7)) + (set! (-> self post-hook) target-no-move-post) + (while (!= (-> self ext-anim) (target-anim light)) + (if (= (-> self prev-state name) 'target-continue) + (set-blackout-frames (seconds 0.1)) + ) + (suspend) + ) + (if (and (not (-> self lightjak wings)) (logtest? arg0 (lightjak-stage swoop))) + (set! (-> self lightjak wings) (process-spawn wings :init wings-init 'force :name "wings" :to self)) + ) + (go target-stance) + ) + (set! (-> self control unknown-sound-id00) (sound-play "jak-suspend")) + (set! (-> self lightjak on-off) + (the-as + uint + (add-process *gui-control* self (gui-channel jak-effect-1) (gui-action queue) "jak-onof" -99.0 0) + ) + ) + (set-forward-vel 0.0) + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (if (logtest? arg0 (lightjak-stage swoop)) + 2.0 + 1.0 + ) + ) + ) + (ja-no-eval :group! jakb-lightjak-get-on-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 f30-0 1.0) + (suspend) + (ja :num! (seek!)) + ) + ) + (set! (-> self control dynam gravity-max) 0.0) + (set! (-> self control dynam gravity-length) 0.0) + (set! (-> self control transv quad) (the-as uint128 0)) + (let ((s5-2 + (cond + ((logtest? (-> *part-group-id-table* 174 flags) (sp-group-flag sp13)) + (let ((s4-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s4-1 + (let ((t9-24 (method-of-type part-tracker-subsampler activate))) + (t9-24 (the-as part-tracker-subsampler s4-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-25 run-function-in-process) + (a0-42 s4-1) + (a1-16 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 174)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 6) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-25) a0-42 a1-16 *part-tracker-subsampler-params-default*) + ) + (-> s4-1 ppointer) + ) + ) + ) + (else + (let ((s4-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s4-2 + (let ((t9-27 (method-of-type part-tracker activate))) + (t9-27 (the-as part-tracker s4-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-28 run-function-in-process) + (a0-45 s4-2) + (a1-19 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 174)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 6) + ((the-as (function object object object none) t9-28) a0-45 a1-19 *part-tracker-params-default*) + ) + (-> s4-2 ppointer) + ) + ) + ) + ) + ) + ) + (while (!= (-> self ext-anim) (target-anim light)) + (let ((v1-117 (point-off-screen (new 'stack-no-clear 'vector)))) + (set! (-> *part-id-table* 630 init-specs 9 initial-valuef) + (* 1.1 (- (-> v1-117 y) (-> self control trans y))) + ) + (set! (-> *part-id-table* 631 init-specs 9 initial-valuef) + (* 1.1 (- (-> v1-117 y) (-> self control trans y))) + ) + (set! (-> *part-id-table* 632 init-specs 9 initial-valuef) + (* 1.1 (- (-> v1-117 y) (-> self control trans y))) + ) + (set! (-> *part-id-table* 633 init-specs 9 initial-valuef) + (* 1.1 (- (-> v1-117 y) (-> self control trans y))) + ) + ) + (let ((v1-125 (ja-group))) + (when (not (and v1-125 (= v1-125 jakb-lightjak-get-on-loop-ja))) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! jakb-lightjak-get-on-loop-ja :num! min) + ) + ) + (suspend) + (ja :num! (loop!)) + ) + (send-event (ppointer->process s5-2) 'die) + ) + (let ((v1-144 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-144 command) (sound-command set-param)) + (set! (-> v1-144 id) (-> self control unknown-sound-id00)) + (set! (-> v1-144 params volume) -4) + (set! (-> v1-144 auto-time) 48) + (set! (-> v1-144 auto-from) 2) + (set! (-> v1-144 params mask) (the-as uint 17)) + (-> v1-144 id) + ) + (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) + (set! (-> self lightjak-interp) 1.0) + (add-connection + *part-engine* + self + 8 + self + 650 + (new 'static 'vector :x 278.528 :y 643.072 :z 757.76 :w 163840.0) + ) + (add-connection + *part-engine* + self + 8 + self + 650 + (new 'static 'vector :x -278.528 :y 643.072 :z 757.76 :w 163840.0) + ) + (let ((v1-154 (log2 (the-as int (-> self draw mgeo seg-table (log2 8)))))) + (logior! (-> self draw mgeo effect v1-154 effect-usage) 8) + ) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (cond + ((logtest? (-> *part-group-id-table* 175 flags) (sp-group-flag sp13)) + (let ((s5-4 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-4 + (let ((t9-41 (method-of-type part-tracker-subsampler activate))) + (t9-41 (the-as part-tracker-subsampler s5-4) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-42 run-function-in-process) + (a0-94 s5-4) + (a1-32 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 175)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 6) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-42) a0-94 a1-32 *part-tracker-subsampler-params-default*) + ) + (-> s5-4 ppointer) + ) + ) + ) + (else + (let ((s5-5 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-5 + (let ((t9-44 (method-of-type part-tracker activate))) + (t9-44 (the-as part-tracker s5-5) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-45 run-function-in-process) + (a0-97 s5-5) + (a1-35 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 175)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 6) + ((the-as (function object object object none) t9-45) a0-97 a1-35 *part-tracker-params-default*) + ) + (-> s5-5 ppointer) + ) + ) + ) + ) + (cond + ((logtest? arg0 (lightjak-stage regen)) + (go target-lightjak-regen (the-as int (-> self control lightjak-sound-id))) + ) + ((logtest? arg0 (lightjak-stage freeze)) + (go target-lightjak-freeze) + ) + (else + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + ) + ) + (ja-no-eval :group! jakb-lightjak-get-on-out-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (and (not (-> self lightjak wings)) (logtest? arg0 (lightjak-stage swoop))) + (set! (-> self lightjak wings) (process-spawn wings :init wings-init 'open :name "wings" :to self)) + ) + (ja-no-eval :group! jakb-lightjak-get-on-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (< 31.0 (ja-aframe-num 0))) + (goto cfg-81) + ) + (suspend) + (ja :num! (seek!)) + ) + (label cfg-81) + (go target-stance) + ) + :post target-no-stick-post + ) + +(defstate target-lightjak-get-off (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pole-grab 'lightjak 'slide 'wade 'launch 'edge-grab) + #f + ) + (('change-mode) + (case (-> block param 0) + (('grab) + (when (not (focus-test? self dead)) + (if (not (-> block param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + ) + (('attack-invinc) + (target-attacked + message + (the-as attack-info (-> block param 1)) + proc + (the-as touching-shapes-entry (-> block param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *lightjak-trans-mods*) + (case (get-status *gui-control* (the-as sound-id (-> self lightjak on-off))) + (((gui-status pending) (gui-status ready) (gui-status active)) + ) + (else + (set! (-> self lightjak on-off) + (the-as + uint + (add-process *gui-control* self (gui-channel jak-effect-1) (gui-action queue) "jak-onof" -99.0 0) + ) + ) + ) + ) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (target-lightjak-end-mode #t) + ) + :trans (-> target-lightjak-get-on trans) + :code (behavior () + (let ((v1-1 (-> self water flags))) + (cond + ((and (logtest? (water-flag touch-water) v1-1) + (logtest? (water-flag under-water swimming) v1-1) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + (go target-swim-stance) + ) + ((let ((v1-10 (ja-group))) + (not (and v1-10 (= v1-10 jakb-lightjak-get-on-ja))) + ) + (let ((gp-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! gp-0 (- (current-time) (-> self clock old-frame-counter))) + (if (>= gp-0 300) + (go target-falling #f) + ) + (suspend) + ) + ) + ) + ) + ) + (vector-reset! (-> self control transv)) + ((-> target-lightjak-get-off exit)) + (cond + ((logtest? (-> self control status) (collide-status on-water)) + ) + (else + (let ((v1-33 (ja-group))) + (cond + ((and v1-33 (= v1-33 jakb-lightjak-get-on-ja)) + (ja-no-eval :num! (seek! 0.0)) + (while (not (ja-done? 0)) + (seek! (-> self lightjak-interp) 0.0 (* 2.0 (seconds-per-frame))) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.1)) + ) + (else + (if (-> self lightjak wings) + (sound-play "ltjak-wings-in") + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-get-off-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self lightjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 10.0 60.0)) + (if (and (>= (ja-aframe-num 0) 24.0) + (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (= (-> self lightjak-interp) 0.0) + ) + (goto cfg-49) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + (label cfg-49) + (go target-stance) + ) + :post (-> target-grab post) + ) + +(define *lightjak-swoop-mods* (new 'static 'surface + :name 'swoop + :turnv 32768.0 + :turnvf 90.0 + :turnvv 18204.445 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flag check-edge air gun-off no-board) + ) + ) + +(defstate target-lightjak-swoop (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float)) + (set-time! (-> self state-time)) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (apply-settings *setting-control*) + (set! (-> self lightjak get-off-lock) #t) + (set! (-> self fact lightjak-effect-time) + (+ (- (seconds 20) (-> self fact lightjak-start-time)) (current-time)) + ) + (if (not (-> self lightjak wings)) + (set! (-> self lightjak wings) (process-spawn wings :init wings-init 'open :name "wings" :to self)) + ) + (when (and (-> self next-state) (= (-> self next-state name) 'target-lightjak-swoop)) + (if (not (logtest? (-> self lightjak stage) (lightjak-stage ls1))) + (send-event self 'get-pickup (pickup-type eco-pill-light) (- (-> *FACT-bank* lightjak-swoop-inc))) + ) + (send-event (ppointer->process (-> self lightjak wings)) 'open) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + (set-time! (-> self control sliding-start-time)) + (set! (-> self control unknown-symbol03) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + (+! (-> self lightjak swoop-count) 1) + (let ((f30-0 163840.0)) + (let ((f0-6 (if (and (-> self next-state) (= (-> self next-state name) 'target-lightjak-swoop)) + 1.4 + (lerp-scale 0.0 1.0 (* arg0 arg0) 0.25 0.95) + ) + ) + ) + (set! (-> self control unknown-float35) (* 0.0016666667 (* 285.0 f0-6) f30-0)) + ) + (set! (-> self control dynam gravity-max) 245760.0) + (set! (-> self control dynam gravity-length) f30-0) + ) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control mod-surface) *lightjak-swoop-mods*) + (set-setting! 'string-min-height 'low (meters 1) 0) + (set-setting! 'string-max-height 'low (meters 10) 0) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + ) + :exit (behavior () + (remove-setting! 'board) + (remove-setting! 'gun) + (when (not (and (-> self next-state) (let ((v1-7 (-> self next-state name))) + (or (= v1-7 'target-lightjak-swoop) (= v1-7 'target-lightjak-swoop-again)) + ) + ) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (remove-setting! 'string-min-height) + (remove-setting! 'string-max-height) + ) + (target-exit) + ) + :trans (behavior () + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-hit-ground #f) + ) + (if #t + (set-time! (-> self control sliding-start-time)) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + (when (time-elapsed? (-> self control sliding-start-time) (seconds 0.2)) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + ) + (if (or (and (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 0.0) + (and (< (target-height-above-ground) 4096.0) + (or (= (-> self control gspot-pat-surfce mode) (pat-mode ground)) + (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + ) + ) + ) + (!= (-> self fact shield-level) 0.0) + ) + (go target-lightjak-swoop-falling #f) + ) + 0 + ) + :code (behavior ((arg0 float)) + (sound-play "ltjak-flap") + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-swoop1-ja :num! (seek!) :frame-num 0.0) + (let ((v1-16 (new-stack-vector0))) + (let ((f0-5 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-16 (-> self control transv) (vector-float*! v1-16 (-> self control dynam gravity-normal) f0-5)) + ) + (let* ((f0-6 (vector-length v1-16)) + (f1-1 f0-6) + (f2-0 (-> self control unknown-float35)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-16 v1-16 (/ f0-6 f1-1)) + ) + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (if (and (cpad-pressed? (-> self control cpad number) x) (time-elapsed? (-> self state-time) (seconds 0.5))) + (go + target-lightjak-swoop-again + (* 0.0033333334 (the float (- (-> self control sliding-start-time) (-> self state-time)))) + ) + ) + ) + (go target-lightjak-swoop-falling #f) + ) + :post target-post + ) + +(defstate target-lightjak-swoop-again (target) + :event target-jump-event-handler + :enter (-> target-lightjak-swoop enter) + :exit (-> target-lightjak-swoop exit) + :trans (-> target-lightjak-swoop trans) + :code (behavior ((arg0 float)) + (sound-play "ltjak-flap") + (let ((f30-0 44.0)) + (let ((a1-1 6)) + (let ((v1-4 (ja-group))) + (cond + ((and v1-4 (= v1-4 jakb-lightjak-swoop1-ja)) + (set! f30-0 (lerp-scale 48.0 44.0 (ja-aframe-num 0) 30.0 44.0)) + (set! a1-1 30) + ) + ((let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 jakb-lightjak-swoop2-ja)) + ) + (set! f30-0 (lerp-scale 48.0 44.0 (ja-aframe-num 0) 54.0 74.0)) + (set! a1-1 30) + ) + ((let ((v1-18 (ja-group))) + (and v1-18 (or (= v1-18 jakb-lightjak-swoop-fall-ja) (= v1-18 jakb-lightjak-swoop-fall-loop-ja))) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! jakb-lightjak-swoop2-ja :num! (seek! max 2.0) :frame-num (ja-aframe 69.0 0)) + (until (ja-done? 0) + (let ((v1-37 (new-stack-vector0)) + (f0-5 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-37 (-> self control transv) (vector-float*! v1-37 (-> self control dynam gravity-normal) f0-5)) + (let* ((f1-2 (vector-length v1-37)) + (f2-0 f1-2) + (f0-6 (* 0.95 f0-5)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-6) + (vector-float*! v1-37 v1-37 (/ f1-2 f2-0)) + ) + ) + ) + (suspend) + (ja :num! (seek! max 2.0)) + ) + (set! a1-1 0) + ) + ) + ) + (ja-channel-push! 1 (the-as time-frame a1-1)) + ) + (ja-no-eval :group! jakb-lightjak-swoop2-ja :num! (seek!) :frame-num (ja-aframe f30-0 0)) + ) + (while (< (ja-aframe-num 0) 48.0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-73 (new-stack-vector0))) + (let ((f0-20 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-73 (-> self control transv) (vector-float*! v1-73 (-> self control dynam gravity-normal) f0-20)) + ) + (let* ((f0-21 (vector-length v1-73)) + (f1-5 f0-21) + (f2-1 (-> self control unknown-float35)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) + (vector-float*! v1-73 v1-73 (/ f0-21 f1-5)) + ) + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (if (and (cpad-pressed? (-> self control cpad number) x) + (time-elapsed? (-> self state-time) (seconds 0.5)) + (and (>= (ja-aframe-num 0) 54.0) 0) + ) + (go + target-lightjak-swoop-again + (* 0.0033333334 (the float (- (-> self control sliding-start-time) (-> self state-time)))) + ) + ) + ) + (go target-lightjak-swoop-falling #f) + ) + :post target-post + ) + +(defstate target-lightjak-swoop-falling (target) + :event target-jump-event-handler + :enter (behavior ((arg0 symbol)) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (apply-settings *setting-control*) + (set! (-> self control mod-surface) *jump-mods*) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (set-time! (-> self state-time)) + ) + :exit (-> target-lightjak-swoop exit) + :trans (behavior () + (if (and (cpad-pressed? (-> self control cpad number) x) + (not (and (< (target-height-above-ground) 8192.0) + (or (= (-> self control gspot-pat-surfce mode) (pat-mode ground)) + (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + ) + ) + ) + (= (-> self fact shield-level) 0.0) + ) + (go target-lightjak-swoop-again 1.0) + ) + (target-falling-trans + (the-as symbol (-> self control unknown-spool-anim00)) + (the-as time-frame (if (= (-> self control unknown-spool-anim00) #f) + 0 + (the-as int (/ (the-as int (-> *TARGET-bank* stuck-time)) 2)) + ) + ) + #f + ) + ) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-lightjak-swoop-fall-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! jakb-lightjak-swoop-fall-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post target-post + ) + +(deftype freeze-screen (process-drawable) + ((anim-frame float) + (transition float) + (gui-id-1 sound-id) + (gui-id-2 sound-id) + ) + (:state-methods + idle + active + (deactive symbol) + die + ) + (:methods + (freeze-screen-method-24 (_type_) none) + ) + ) + + +(defskelgroup skel-freeze-screen collectables collectables-warp-time-lod0-jg collectables-warp-time-idle-ja + ((collectables-warp-time-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(defstate idle (freeze-screen) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (set-time! (-> self state-time)) + (go-virtual active) + ) + (('die) + (go-virtual die) + ) + (('untrigger) + (if (-> block param 0) + (go-virtual die) + ) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self transition) 0.0) + ) + :code sleep-code + ) + +(defstate active (freeze-screen) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) + (go-virtual deactive (the-as symbol (-> block param 0))) + ) + (('die) + (go-virtual die) + ) + ) + ) + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (until #f + (set! (-> self anim-frame) (* 15.0 (- 1.0 (-> *setting-control* user-current slow-time)))) + (set! (-> self transition) (-> *setting-control* user-current slow-time)) + (ja :num-func num-func-identity :frame-num (-> self anim-frame)) + (suspend) + ) + #f + ) + :post (behavior () + (freeze-screen-method-24 self) + (ja-post) + ) + ) + +(defstate deactive (freeze-screen) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual die) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (until #f + (set! (-> self anim-frame) (* 15.0 (- 1.0 (-> *setting-control* user-current slow-time)))) + (set! (-> self transition) (-> *setting-control* user-current slow-time)) + (when (= (-> self anim-frame) 15.0) + (if arg0 + (go-virtual die) + (go-virtual idle) + ) + ) + (ja :num-func num-func-identity :frame-num (-> self anim-frame)) + (suspend) + ) + #f + ) + :post (behavior () + (freeze-screen-method-24 self) + (ja-post) + ) + ) + +(defstate die (freeze-screen) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (seek! (-> self transition) 0.0 (seconds-per-frame)) + (suspend) + ) + ) + ) + ) + +(defmethod freeze-screen-method-24 ((this freeze-screen)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s3-0 (camera-matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + (f30-0 4096.0) + ) + (let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) + (set-vector! (-> this root scale) f0-4 f0-4 f0-4 1.0) + ) + (set! (-> gp-0 quad) (-> (camera-pos) quad)) + (vector-normalize-copy! s5-0 (-> s3-0 fvec) 1.0) + (matrix->quaternion (-> this root quat) s3-0) + (let ((v1-10 (-> this root trans))) + (let ((a0-5 f30-0)) + (.mov vf7 a0-5) + ) + (.lvf vf5 (&-> s5-0 quad)) + (.lvf vf4 (&-> gp-0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-10 quad) vf6) + ) + ) + 0 + (none) + ) + ) + +(defbehavior freeze-screen-init freeze-screen ((arg0 vector) (arg1 quaternion) (arg2 entity)) + (process-entity-set! self arg2) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-freeze-screen" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self anim-frame) 15.0) + (set! (-> self transition) 0.0) + (set-vector! (-> self draw color-emissive) 0.0 0.0 0.0 0.0) + (set-vector! (-> self draw color-emissive) 0.0 0.0 0.0 0.0) + (logior! (-> self skel status) (joint-control-status blend-shape)) + (ja :group! collectables-warp-time-end-ja) + (set-setting! 'freeze-screen #t 0.0 0) + (go-virtual idle) + ) + +(defmethod deactivate ((this freeze-screen)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (disable *screen-filter*) + (call-parent-method this) + (none) + ) + +(deftype freeze-control (process) + ((clock-pos float) + (freeze-screen handle) + (sound-id sound-id) + (tick-time time-frame) + (abort? symbol) + (freeze-id sound-id) + ) + (:state-methods + idle + ) + ) + + +(defstate idle (freeze-control) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (let ((v0-0 (-> block param 0))) + (set! (-> self abort?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (set-setting! 'music-volume 'rel 0.5 0) + (set-setting! 'sfx-volume 'rel 0.9 0) + (set-setting! 'ambient-volume 'rel 0.9 0) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'test-pickup) + (set! (-> a1-3 param 0) (the-as uint 8)) + (let ((f0-0 (the-as float (send-event-function (ppointer->process (-> self parent)) a1-3)))) + (send-event + (ppointer->process (-> self parent)) + 'get-pickup + (pickup-type eco-pill-light) + (- (fmin (-> *FACT-bank* lightjak-freeze-inc) (+ -1.0 f0-0))) + ) + ) + ) + (set-action! + *gui-control* + (gui-action play) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + :exit (behavior () + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* bg-clock) 1.0) + (update-rates! (-> *display* part-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (send-event (handle->process (-> self freeze-screen)) 'untrigger #t) + (let ((f30-0 1.0)) + (if (>= f30-0 (send-event (ppointer->process (-> self parent)) 'test-pickup (pickup-type eco-pill-light))) + (send-event (ppointer->process (-> self parent)) 'get-pickup (pickup-type eco-pill-light) -100.0) + ) + ) + (set-action! + *gui-control* + (gui-action fade) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + ) + :code (behavior () + (set! (-> self clock-pos) 1.0) + (suspend) + (send-event (handle->process (-> self freeze-screen)) 'trigger) + (while (< 0.05 (-> self clock-pos)) + (seek! (-> self clock-pos) 0.05 (seconds-per-frame)) + (suspend) + ) + (let ((gp-0 (current-time))) + (while (and (not (time-elapsed? gp-0 (the-as time-frame (-> *FACT-bank* lightjak-freeze-duration)))) + (let ((v1-15 #x20000) + (a0-8 (-> self parent)) + ) + (logtest? (the-as focus-status v1-15) + (-> (the-as process-focusable (if a0-8 + (the-as process-focusable (-> a0-8 0 self)) + ) + ) + focus-status + ) + ) + ) + (not (-> self abort?)) + ) + (suspend) + ) + ) + (while (< (-> self clock-pos) 1.0) + (case (-> self abort?) + (('force) + (return #f) + ) + ) + (seek! (-> self clock-pos) 1.0 (* 2.0 (seconds-per-frame))) + (suspend) + ) + ) + :post (behavior () + (set-setting! 'slow-time 'abs (lerp-scale 1.0 0.0 (-> self clock-pos) 0.05 1.0) 0) + (apply-settings *setting-control*) + (format *stdebug* "freeze = ~,,2f ~,,2~%" (-> self clock-pos) (-> *setting-control* user-current slow-time)) + (update-rates! (-> *display* entity-clock) (-> self clock-pos)) + (update-rates! (-> *display* bg-clock) (-> self clock-pos)) + (update-rates! (-> *display* target-clock) (- 1.0 (* 0.1 (- 1.0 (-> self clock-pos))))) + ) + ) + +(defbehavior freeze-control-init freeze-control ((arg0 sound-id)) + (set! (-> self clock-pos) 1.0) + (set! (-> self sound-id) arg0) + (set! (-> self abort?) #f) + (set! (-> self freeze-screen) + (ppointer->handle + (process-spawn + freeze-screen + :init freeze-screen-init + (math-camera-pos) + *null-vector* + (-> self entity) + :name "freeze-screen" + :to *display-pool* + ) + ) + ) + (set! (-> self freeze-id) + (add-process *gui-control* self (gui-channel freeze) (gui-action play) "freeze" -99.0 0) + ) + (go-virtual idle) + ) + +(deftype freeze-watcher (process) + ((old-clock clock) + ) + (:state-methods + (active clock) + ) + ) + + +(defstate active (freeze-watcher) + :virtual #t + :exit (behavior () + (+! (-> self parent 0 clock ref-count) -1) + (+! (-> self old-clock ref-count) 1) + (set! (-> self parent 0 clock) (-> self old-clock)) + ) + :code (behavior ((arg0 clock)) + (let ((s4-0 (-> self parent 0 clock)) + (gp-0 (current-time)) + ) + (copy! arg0 s4-0) + (+! (-> s4-0 ref-count) -1) + (+! (-> arg0 ref-count) 1) + (set! (-> self parent 0 clock) arg0) + (+! (-> self clock ref-count) -1) + (+! (-> self parent 0 clock ref-count) 1) + (set! (-> self clock) (-> self parent 0 clock)) + (while (let* ((s5-2 (ppointer->process (-> self parent))) + (v1-31 (if (type? s5-2 process-focusable) + s5-2 + ) + ) + ) + (and v1-31 + (or (focus-test? (the-as process-focusable v1-31) dead hit) + (and (-> (the-as process-focusable v1-31) next-state) + (let ((v1-34 (-> (the-as process-focusable v1-31) next-state name))) + (or (= v1-34 'hit) + (= v1-34 'knocked) + (= v1-34 'knocked-recover) + (= v1-34 'die) + (= v1-34 'die-falling) + (= v1-34 'die-fast) + ) + ) + ) + ) + (not (time-elapsed? gp-0 (seconds 5))) + ) + ) + (update-rates! (-> self clock) (seek (-> self clock clock-ratio) 1.0 (* 4.0 (seconds-per-frame)))) + (format *stdebug* "watcher ~d ~f~%" (-> self clock index) (-> self clock clock-ratio)) + (suspend) + ) + ) + (while (!= (-> self clock clock-ratio) (lerp-scale 1.0 0.05 (-> *setting-control* user-current slow-time) 0.0 1.0)) + (update-rates! (-> self clock) (seek + (-> self clock clock-ratio) + (lerp-scale 1.0 0.05 (-> *setting-control* user-current slow-time) 0.0 1.0) + (* 4.0 (seconds-per-frame)) + ) + ) + (format *stdebug* "watcher ~d ~f~%" (-> self clock index) (-> self clock clock-ratio)) + (suspend) + ) + ) + ) + +(defbehavior freeze-watcher-init freeze-watcher ((arg0 clock)) + (set! (-> self old-clock) (-> self parent 0 clock)) + (go-virtual active arg0) + ) + +;; WARN: Function freeze-hit-begin has a return type of none, but the expression builder found a return statement. +(defbehavior freeze-hit-begin process () + (local-vars (gp-0 clock)) + (cond + ((or (< (-> *setting-control* user-current slow-time) 0.01) (>= (-> self clock index) 12)) + ) + (else + (if (>= (-> self clock index) 12) + (return #f) + ) + (dotimes (v1-12 10) + (when (zero? (-> *display* clock (+ v1-12 12) ref-count)) + (set! gp-0 (-> *display* clock (+ v1-12 12))) + (goto cfg-18) + ) + ) + (return #f) + (label cfg-18) + (process-spawn freeze-watcher :init freeze-watcher-init gp-0 :name "freeze-watcher" :to self) + ) + ) + 0 + (none) + ) + +(defbehavior freeze-hit-end process () + (let ((gp-0 (-> self child))) + (while gp-0 + (send-event (ppointer->process gp-0) 'notice 'freeze-hit-end) + (set! gp-0 (-> gp-0 0 brother)) + ) + ) + 0 + (none) + ) + +(defstate target-lightjak-freeze (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pole-grab 'darkjak 'lightjak 'slide 'wade 'launch 'edge-grab 'jump 'shove 'attack 'attack-or-shove) + #f + ) + (('attack 'attack-or-shove 'swim) + #f + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self target-flags) (target-flags tf4)) + (set! (-> self lightjak freeze-sound) + (add-process *gui-control* self (gui-channel jak-mode) (gui-action queue) "ljfreeze" -99.0 0) + ) + (set! (-> self lightjak get-off-lock) #t) + ) + :exit (behavior () + (if (not (handle->process (-> self lightjak freeze-control))) + (set-action! + *gui-control* + (gui-action stop) + (-> self lightjak freeze-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (logclear! (-> self target-flags) (target-flags tf4 tf6)) + (target-exit) + ) + :code (behavior () + (send-event (handle->process (-> self notify)) 'notify 'attack 27) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (cond + ((logtest? (-> *part-group-id-table* 180 flags) (sp-group-flag sp13)) + (let ((gp-0 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-0 + (let ((t9-2 (method-of-type part-tracker-subsampler activate))) + (t9-2 (the-as part-tracker-subsampler gp-0) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-3 run-function-in-process) + (a0-10 gp-0) + (a1-3 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 180)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 19) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-3) a0-10 a1-3 *part-tracker-subsampler-params-default*) + ) + (-> gp-0 ppointer) + ) + ) + ) + (else + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-1 + (let ((t9-5 (method-of-type part-tracker activate))) + (t9-5 (the-as part-tracker gp-1) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-6 run-function-in-process) + (a0-13 gp-1) + (a1-6 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 180)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 19) + ((the-as (function object object object none) t9-6) a0-13 a1-6 *part-tracker-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 180 flags) (sp-group-flag sp13)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-2 + (let ((t9-8 (method-of-type part-tracker-subsampler activate))) + (t9-8 (the-as part-tracker-subsampler gp-2) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-9 run-function-in-process) + (a0-16 gp-2) + (a1-9 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 180)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 28) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-9) a0-16 a1-9 *part-tracker-subsampler-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + (else + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-3 + (let ((t9-11 (method-of-type part-tracker activate))) + (t9-11 (the-as part-tracker gp-3) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-12 run-function-in-process) + (a0-19 gp-3) + (a1-12 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 180)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 28) + ((the-as (function object object object none) t9-12) a0-19 a1-12 *part-tracker-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + ) + (set! (-> self control mod-surface) *roll-flip-mods*) + (let ((f30-0 0.0)) + (if (time-elapsed? (-> self fact lightjak-start-time) (seconds 2)) + (set! f30-0 9.0) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-lightjak-freeze-ja :num! (seek! (ja-aframe 20.0 0)) :frame-num (ja-aframe f30-0 0)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + (cond + ((logtest? (-> *part-group-id-table* 181 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) quad) + ) + (let ((gp-7 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-7 + (let ((t9-22 (method-of-type part-tracker-subsampler activate))) + (t9-22 (the-as part-tracker-subsampler gp-7) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-23 run-function-in-process) + (a0-33 gp-7) + (a1-22 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 181)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-23) a0-33 a1-22 *part-tracker-subsampler-params-default*) + ) + (-> gp-7 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) quad) + ) + (let ((gp-9 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-9 + (let ((t9-26 (method-of-type part-tracker activate))) + (t9-26 (the-as part-tracker gp-9) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-27 run-function-in-process) + (a0-37 gp-9) + (a1-26 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 181)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-27) a0-37 a1-26 *part-tracker-params-default*) + ) + (-> gp-9 ppointer) + ) + ) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! (-> self lightjak freeze-control) (ppointer->handle (process-spawn + freeze-control + :init freeze-control-init + (-> self lightjak freeze-sound) + :name "freeze-control" + :to self + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (go target-stance) + ) + :post target-no-stick-post + ) + +(defstate target-lightjak-shield (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pole-grab 'darkjak 'lightjak 'slide 'wade 'launch 'edge-grab 'jump 'shove 'attack 'attack-or-shove) + #f + ) + (('attack 'attack-or-shove 'swim) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self target-flags) (target-flags tf4)) + (set! (-> self neck flex-blend) 0.0) + (quaternion-copy! (-> self control unknown-quaternion04) (-> self control dir-targ)) + (set! (-> self lightjak get-off-lock) #t) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (logclear! (-> self target-flags) (target-flags tf4 tf6)) + (target-exit) + ) + :code (behavior () + (send-event (handle->process (-> self notify)) 'notify 'attack 28) + (if (logtest? (-> self control status) (collide-status on-ground)) + (set! (-> self control mod-surface) *attack-mods*) + (set! (-> self control mod-surface) *jump-attack-mods*) + ) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (cond + ((>= 0.0 f0-1) + (let ((v1-19 (new-stack-vector0))) + (let ((f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-19 (-> self control transv) (vector-float*! v1-19 (-> self control dynam gravity-normal) f0-3)) + ) + (let* ((f0-4 (vector-length v1-19)) + (f1-2 f0-4) + (f2-0 33775.48) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-19 v1-19 (/ f0-4 f1-2)) + ) + ) + ) + ) + (else + (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (seconds-per-frame)))) + (f0-6 (* 0.5 f1-5 (seconds-per-frame) f0-1)) + (v1-25 (new-stack-vector0)) + ) + (let ((f1-9 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-25 (-> self control transv) (vector-float*! v1-25 (-> self control dynam gravity-normal) f1-9)) + ) + (let* ((f1-10 (vector-length v1-25)) + (f2-5 f1-10) + (f0-10 (+ 1024.0 (sqrtf (* 245760.0 (+ 2048.0 f0-6))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-10) + (vector-float*! v1-25 v1-25 (/ f1-10 f2-5)) + ) + ) + ) + ) + ) + ) + (set! (-> self control dynam gravity-length) 122880.0) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (let ((gp-0 jakb-lightjak-shield-ja)) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + (ja-channel-push! 1 (seconds 0.05)) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + (ja-no-eval :group! gp-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek! max (-> self control current-surface align-speed))) + ) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-stance) + (go target-falling #f) + ) + ) + :post target-post + ) + +(let ((a0-106 (copy *jump-mods* 'global))) + (set! (-> a0-106 flags) (surface-flag gun-off gun-fast-exit no-board)) + (set! *heal-mods* a0-106) + ) + +(defstate target-lightjak-regen (target) + :event target-generic-event-handler + :enter (behavior ((arg0 int)) + (logior! (-> self target-flags) (target-flags tf4)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile guard vehicle)) + (set! (-> self control unknown-handle02) (the-as handle #f)) + (set-time! (-> self lightjak regen-start-time)) + (set! (-> self lightjak get-off-lock) #t) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags tf4)) + (set-action! + *gui-control* + (gui-action fade) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (send-event (handle->process (-> self control unknown-handle02)) 'die) + (remove-setting! 'process-mask) + (target-exit) + ) + :trans (behavior () + (set-time! (-> self lightjak regen-time)) + ) + :code (behavior ((arg0 int)) + (set-time! (-> self state-time)) + (sound-play "heal-rise") + (if (nonzero? arg0) + (set! (-> self control unknown-sound-id00) (the-as sound-id arg0)) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* self (gui-channel jak-mode) (gui-action queue) "jak-heal" -99.0 0) + ) + ) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *heal-mods*) + (let ((f28-0 0.0)) + 0 + 0.0 + (let* ((f0-2 (-> self game eco-pill-light)) + (f26-0 (- (-> self fact health-max) (-> self fact health))) + (f30-0 (/ (-> *FACT-bank* eco-pill-light-max-default) (-> self fact health-max))) + (gp-1 (the int (fmin f26-0 (ceil (/ f0-2 f30-0))))) + ) + (let ((v1-17 (ja-group))) + (if (and v1-17 (= v1-17 jakb-lightjak-stance-ja)) + (ja-channel-push! 1 (seconds 0.05)) + (set! f28-0 + (cond + ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (ja-channel-push! 1 (seconds 0.1)) + 14.0 + ) + (else + (set! f28-0 6.0) + (ja-channel-push! 1 (seconds 0.1)) + f28-0 + ) + ) + ) + ) + ) + (show-hud 'hud-health) + (ja-no-eval :group! jakb-lightjak-heal-ja :num! (seek!) :frame-num (ja-aframe f28-0 0)) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 2.0 1.0) + (set-forward-vel (* 0.6 (-> self control ctrl-xz-vel))) + (suspend) + (ja :num! (seek!)) + ) + (show-hud 'hud-health) + (set-action! + *gui-control* + (gui-action play) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (let ((v1-64 (point-off-screen (new 'stack-no-clear 'vector)))) + (set! (-> *part-id-table* 642 init-specs 9 initial-valuef) (- (-> v1-64 y) (-> self control trans y))) + (set! (-> *part-id-table* 643 init-specs 9 initial-valuef) (- (-> v1-64 y) (-> self control trans y))) + (set! (-> *part-id-table* 644 init-specs 9 initial-valuef) (- (-> v1-64 y) (-> self control trans y))) + (set! (-> *part-id-table* 645 init-specs 9 initial-valuef) (- (-> v1-64 y) (-> self control trans y))) + ) + (set! (-> self control unknown-handle02) + (ppointer->handle + (cond + ((logtest? (-> *part-group-id-table* 177 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-2 + (let ((t9-19 (method-of-type part-tracker-subsampler activate))) + (t9-19 + (the-as part-tracker-subsampler s5-2) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-20 run-function-in-process) + (a0-46 s5-2) + (a1-12 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 177)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-20) a0-46 a1-12 *part-tracker-subsampler-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-3 + (let ((t9-22 (method-of-type part-tracker activate))) + (t9-22 (the-as part-tracker s5-3) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-23 run-function-in-process) + (a0-52 s5-3) + (a1-15 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 177)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-23) a0-52 a1-15 *part-tracker-params-default*) + ) + (-> s5-3 ppointer) + ) + ) + ) + ) + ) + ) + (set! (-> self post-hook) target-no-stick-post) + (set! (-> self control mod-surface) *jump-mods*) + (set! (-> self control dynam gravity-max) 0.0) + (set! (-> self control dynam gravity-length) 0.0) + (let ((s5-4 0)) + (while (or (> gp-1 0) (< s5-4 2)) + (ja-no-eval :group! jakb-lightjak-heal-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (>= (- (-> *display* game-clock frame-counter) (-> self fact eco-source-time)) (seconds 0.5)) (> gp-1 0)) + (set! (-> self fact eco-source-time) (-> *display* game-clock frame-counter)) + (set! (-> self fact eco-source) (process->handle self)) + (send-event self 'get-pickup (pickup-type health) 1.0) + (if (not (logtest? (-> self lightjak stage) (lightjak-stage ls1))) + (send-event self 'get-pickup (pickup-type eco-pill-light) (- f30-0)) + ) + (+! gp-1 -1) + ) + (let ((v1-150 (point-off-screen (new 'stack-no-clear 'vector)))) + (set! (-> *part-id-table* 642 init-specs 9 initial-valuef) (- (-> v1-150 y) (-> self control trans y))) + (set! (-> *part-id-table* 643 init-specs 9 initial-valuef) (- (-> v1-150 y) (-> self control trans y))) + (set! (-> *part-id-table* 644 init-specs 9 initial-valuef) (- (-> v1-150 y) (-> self control trans y))) + (set! (-> *part-id-table* 645 init-specs 9 initial-valuef) (- (-> v1-150 y) (-> self control trans y))) + ) + (suspend) + (ja :num! (seek!)) + ) + (+! s5-4 1) + ) + ) + ) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (cond + ((>= 5734.4 (target-height-above-ground)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-heal-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (not (-> self lightjak lightjak-before-powerjak)) + (target-lightjak-end-mode #f) + ) + (go target-stance) + ) + (else + (if (not (-> self lightjak lightjak-before-powerjak)) + (target-lightjak-end-mode #f) + ) + (go target-falling 'target-lightjak-regen) + ) + ) + ) + :post target-post + ) + +(defstate open (lightjak-shield) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (go-virtual close) + ) + (('hit) + (go-virtual hit) + ) + ) + ) + :code (behavior () + (cond + ((logtest? (-> *part-group-id-table* 178 flags) (sp-group-flag sp13)) + (let ((gp-0 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-0 + (let ((t9-1 (method-of-type part-tracker-subsampler activate))) + (t9-1 (the-as part-tracker-subsampler gp-0) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-2 run-function-in-process) + (a0-2 gp-0) + (a1-2 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 178)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 3) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-2) a0-2 a1-2 *part-tracker-subsampler-params-default*) + ) + (-> gp-0 ppointer) + ) + ) + ) + (else + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-1 + (let ((t9-4 (method-of-type part-tracker activate))) + (t9-4 (the-as part-tracker gp-1) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-5 run-function-in-process) + (a0-5 gp-1) + (a1-5 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 178)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 3) + ((the-as (function object object object none) t9-5) a0-5 a1-5 *part-tracker-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + ) + (let ((v1-30 (ja-group))) + (when (not (and v1-30 (= v1-30 jakb-shield-start-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-shield-start-ja :num! min) + ) + ) + (sound-play "shield-on") + (while (not (ja-max? 0)) + (suspend) + (set! (-> self fade) (/ (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -1)))) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! jakb-shield-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (ppointer->process (-> self parent))) + (s3-0 (if (type? gp-0 process-focusable) + (the-as process-focusable gp-0) + ) + ) + (s4-0 (camera-matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'vector)) + (f30-0 4096.0) + ) + (let ((f0-0 3.0)) + (set-vector! (-> self root scale) f0-0 f0-0 f0-0 1.0) + ) + (set! (-> gp-1 quad) (-> (get-trans s3-0 5) quad)) + (vector-normalize-copy! s5-0 (-> s4-0 fvec) 0.0) + (matrix->quaternion (-> self root quat) s4-0) + (let ((v1-11 (-> self root trans))) + (let ((a0-5 f30-0)) + (.mov vf7 a0-5) + ) + (.lvf vf5 (&-> s5-0 quad)) + (.lvf vf4 (&-> gp-1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-11 quad) vf6) + ) + ) + (set! (-> self draw force-fade) (the-as uint (the int (* 128.0 (- 1.0 (-> self fade)))))) + (sound-play "ltjak-shield" :id (the-as sound-id (-> self tone))) + (ja-post) + ) + ) + ) + +(defstate close (lightjak-shield) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (go-virtual open) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (not (and v1-2 (= v1-2 jakb-shield-start-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-shield-start-ja :num! max) + ) + ) + (sound-play "shield-off") + (while (not (ja-min? 0)) + (suspend) + (set! (-> self fade) (/ (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -1)))) + (ja :num! (seek! 0.0)) + ) + ) + :post (-> (method-of-type lightjak-shield open) post) + ) + +(defstate hit (lightjak-shield) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (go-virtual close) + ) + (('hit) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) + (go-virtual hit) + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (if (not (logtest? (-> self parent 0 lightjak stage) (lightjak-stage ls1))) + (send-event + (ppointer->process (-> self parent)) + 'get-pickup + (pickup-type eco-pill-light) + (- (-> *FACT-bank* lightjak-shield-hit-inc)) + ) + ) + (sound-play "shield-hit") + (ja-channel-push! 1 (seconds 0.05)) + (cond + ((logtest? (-> *part-group-id-table* 179 flags) (sp-group-flag sp13)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-5 (method-of-type part-tracker-subsampler activate))) + (t9-5 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-6 run-function-in-process) + (a0-8 gp-1) + (a1-5 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 179)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 3) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-6) a0-8 a1-5 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-8 (method-of-type part-tracker activate))) + (t9-8 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-9 run-function-in-process) + (a0-11 gp-2) + (a1-8 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 179)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 3) + ((the-as (function object object object none) t9-9) a0-11 a1-8 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + (ja-no-eval :group! jakb-shield-hit-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-shield-start-ja :num! max) + (go-virtual open) + ) + :post (-> (method-of-type lightjak-shield open) post) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior lightjak-shield-init lightjak-shield () + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar-shield" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + (logior! (-> self draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> self draw force-fade) (the-as uint 128)) + (set! (-> self fade) 0.0) + (set! (-> self tone) (the-as rgba (new-sound-id))) + (ja-channel-set! 1) + (ja :group! jakb-shield-start-ja :num! min) + (go-virtual open) + (none) + ) + +(defmethod deactivate ((this lightjak-shield)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set! (-> this parent 0 lightjak shield) (the-as (pointer lightjak-shield) #f)) + (let ((v1-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-3 command) (sound-command set-param)) + (set! (-> v1-3 id) (the-as sound-id (-> this tone))) + (set! (-> v1-3 params volume) -4) + (set! (-> v1-3 auto-time) 48) + (set! (-> v1-3 auto-from) 2) + (set! (-> v1-3 params mask) (the-as uint 17)) + (-> v1-3 id) + ) + (call-parent-method this) + (none) + ) diff --git a/goal_src/jak3/engine/target/target-part.gc b/goal_src/jak3/engine/target/target-part.gc index e5fbcd98530..801dfdac08b 100644 --- a/goal_src/jak3/engine/target/target-part.gc +++ b/goal_src/jak3/engine/target/target-part.gc @@ -5,5 +5,7 @@ ;; name in dgo: target-part ;; dgos: GAME +(define-extern process-drawable2-shock-effect (function process-drawable process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher none)) + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/target/target-swim.gc b/goal_src/jak3/engine/target/target-swim.gc index 4e8da06a74f..410ac2b8a16 100644 --- a/goal_src/jak3/engine/target/target-swim.gc +++ b/goal_src/jak3/engine/target/target-swim.gc @@ -7,3 +7,1027 @@ ;; DECOMP BEGINS +(defstate target-wade-stance (target) + :event target-standard-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *wade-mods*) + (set-zero! (-> self water bob)) + ) + :exit (behavior () + (target-state-hook-exit) + (target-exit) + (let ((v1-1 (-> self skel effect))) + (set! (-> v1-1 channel-offset) 0) + ) + 0 + ) + :trans (behavior () + ((-> self state-hook)) + (when (and (not (logtest? (water-flag wading) (-> self water flags))) + (time-elapsed? (-> self water wade-time) (seconds 0.05)) + ) + (if (logtest? (water-flag swimming) (-> self water flags)) + (go target-swim-stance) + (go target-stance) + ) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (go target-duck-stance #f) + ) + (if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-wade-walk) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (when (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #t)) + (sound-play "swim-stroke") + (spawn-ripples (-> self water) 1.4 (-> self control trans) 0 (-> self control transv) #f) + (go target-attack) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t)) + (go target-running-attack) + ) + (if (and (using-gun? self) (let ((v1-82 (ja-group))) + (and v1-82 (= v1-82 jakb-stance-loop-ja)) + ) + ) + (go target-gun-stance) + ) + ) + :code (-> target-stance code) + :post target-post + ) + +(defstate target-wade-walk (target) + :event target-standard-event-handler + :enter (behavior () + ((-> target-wade-stance enter)) + ) + :exit (-> target-wade-stance exit) + :trans (behavior () + ((-> self state-hook)) + (when (and (not (logtest? (water-flag wading) (-> self water flags))) + (time-elapsed? (-> self water wade-time) (seconds 0.1)) + ) + (if (logtest? (water-flag swimming) (-> self water flags)) + (go target-swim-stance) + (go target-stance) + ) + ) + (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-wade-stance) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (go target-duck-walk #f) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (when (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #t)) + (sound-play "swim-stroke") + (spawn-ripples (-> self water) 1.4 (-> self control trans) 0 (-> self control transv) #f) + (go target-attack) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t)) + (go target-running-attack) + ) + ) + :code (behavior () + (let ((gp-0 105) + (f30-0 0.0) + ) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 jakb-walk-ja) (= v1-2 jakb-run-ja))) + (set! gp-0 15) + (set! f30-0 (ja-frame-num 0)) + ) + ((let ((v1-9 (ja-group))) + (and v1-9 (or (= v1-9 jakb-jump-ja) (= v1-9 jakb-jump-loop-ja))) + ) + (set! gp-0 30) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (= v1-16 jakb-swim-walk-ja)) + ) + (set! gp-0 120) + ) + ) + ) + (cond + ((and (= (ja-group-size) 6) (let ((v1-25 (ja-group))) + (and v1-25 (= v1-25 jakb-wade-shallow-walk-ja)) + ) + ) + ) + (else + (ja-channel-push! 6 (the-as time-frame gp-0)) + (ja :group! jakb-wade-shallow-walk-ja + :num! (identity f30-0) + :dist (-> *TARGET-bank* wade-shallow-walk-cycle-dist) + ) + (ja :chan 1 + :group! jakb-wade-deep-walk-ja + :num! (identity f30-0) + :dist (-> *TARGET-bank* wade-deep-walk-cycle-dist) + ) + (let ((gp-3 (-> self skel root-channel 2))) + (let ((f0-2 0.0)) + (set! (-> gp-3 frame-interp 1) f0-2) + (set! (-> gp-3 frame-interp 0) f0-2) + ) + (set! (-> gp-3 dist) (-> *TARGET-bank* walk-cycle-dist)) + (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim jakb-walk-ja) num-func-identity) + (set! (-> gp-3 frame-num) f30-0) + ) + (let ((gp-4 (-> self skel root-channel 3))) + (let ((f0-4 0.0)) + (set! (-> gp-4 frame-interp 1) f0-4) + (set! (-> gp-4 frame-interp 0) f0-4) + ) + (set! (-> gp-4 dist) (-> *TARGET-bank* walk-down-cycle-dist)) + (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim jakb-walk-down-ja) num-func-identity) + (set! (-> gp-4 frame-num) f30-0) + ) + (let ((gp-5 (-> self skel root-channel 4))) + (let ((f0-6 0.0)) + (set! (-> gp-5 frame-interp 1) f0-6) + (set! (-> gp-5 frame-interp 0) f0-6) + ) + (set! (-> gp-5 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (joint-control-channel-group-eval! gp-5 (the-as art-joint-anim jakb-walk-left-ja) num-func-identity) + (set! (-> gp-5 frame-num) f30-0) + ) + ) + ) + ) + (set! (-> self skel root-channel 2 command) (joint-control-command push)) + (set! (-> self skel root-channel 5 command) (joint-control-command stack)) + (let ((f28-0 0.0) + (f26-0 0.0) + (f30-1 (lerp-scale 1.0 0.0 (-> self control ctrl-xz-vel) 16384.0 32768.0)) + (gp-6 0) + ) + (until #f + (let ((f0-10 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control local-slope-z))))) + (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) + ) + (let ((f1-4 (fabs (- f0-10 f28-0)))) + (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4))))) + ) + (let ((f0-14 (fabs (- f24-0 f26-0)))) + (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))) + ) + ) + (ja :chan 3 :group! jakb-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) + (cond + ((>= f28-0 0.0) + (let ((v1-83 (-> self skel root-channel 3))) + (let ((f0-20 (fabs f28-0))) + (set! (-> v1-83 frame-interp 1) f0-20) + (set! (-> v1-83 frame-interp 0) f0-20) + ) + (set! (-> v1-83 dist) (-> *TARGET-bank* walk-up-cycle-dist)) + (set! (-> v1-83 frame-group) (the-as art-joint-anim jakb-walk-up-ja)) + ) + ) + (else + (let ((v1-86 (-> self skel root-channel 3))) + (let ((f0-22 (fabs f28-0))) + (set! (-> v1-86 frame-interp 1) f0-22) + (set! (-> v1-86 frame-interp 0) f0-22) + ) + (set! (-> v1-86 dist) (-> *TARGET-bank* walk-down-cycle-dist)) + (set! (-> v1-86 frame-group) (the-as art-joint-anim jakb-walk-down-ja)) + ) + ) + ) + (cond + ((>= f26-0 0.0) + (let ((v1-89 (-> self skel root-channel 4))) + (let ((f0-25 (fabs f26-0))) + (set! (-> v1-89 frame-interp 1) f0-25) + (set! (-> v1-89 frame-interp 0) f0-25) + ) + (set! (-> v1-89 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (set! (-> v1-89 frame-group) (the-as art-joint-anim jakb-walk-right-ja)) + ) + ) + (else + (let ((v1-92 (-> self skel root-channel 4))) + (let ((f0-27 (fabs f26-0))) + (set! (-> v1-92 frame-interp 1) f0-27) + (set! (-> v1-92 frame-interp 0) f0-27) + ) + (set! (-> v1-92 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (set! (-> v1-92 frame-group) (the-as art-joint-anim jakb-walk-left-ja)) + ) + ) + ) + (let* ((f0-30 (- (-> self water height) (-> self control trans y))) + (f24-1 + (lerp-scale + 0.0 + 1.0 + f0-30 + (lerp (-> self water wade-height) (-> self water swim-height) 0.25) + (lerp (-> self water wade-height) (-> self water swim-height) 0.75) + ) + ) + ) + (let ((v1-100 (-> self skel effect))) + (set! (-> v1-100 channel-offset) (if (< 0.5 f24-1) + 1 + 0 + ) + ) + ) + 0 + (set! f30-1 + (seek f30-1 (lerp-scale 1.0 0.0 (-> self control ctrl-xz-vel) 16384.0 32768.0) (* 4.0 (seconds-per-frame))) + ) + (let ((v1-107 (-> self skel root-channel 1))) + (set! (-> v1-107 frame-interp 1) f24-1) + (set! (-> v1-107 frame-interp 0) f24-1) + ) + (ja :num! (loop! + (/ (-> self control ctrl-xz-vel) + (* 60.0 + (/ (* (current-cycle-distance (-> self skel)) (-> self control scale x)) (-> *TARGET-bank* run-cycle-length)) + ) + ) + ) + ) + (let ((s5-3 (-> self skel root-channel 5)) + (f0-44 (lerp f30-1 0.0 f24-1)) + ) + (set! (-> s5-3 frame-interp 1) f0-44) + (set! (-> s5-3 frame-interp 0) f0-44) + ) + ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (ja :chan 3 :num! (chan 0)) + (ja :chan 4 :num! (chan 0)) + (when (and (time-elapsed? (the-as time-frame gp-6) (seconds 0.2)) + (< (- (-> self water height) (-> self control trans y)) 4096.0) + ) + (case (the int (ja-aframe-num 0)) + ((15 16 17 18) + (spawn-ripples + (-> self water) + 0.2 + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg Rtoes)) + 0 + (vector-float*! (new 'stack-no-clear 'vector) (-> self control transv) 2.5) + #f + ) + (set! gp-6 (the-as int (current-time))) + ) + ((46 47 48 49) + (spawn-ripples + (-> self water) + 0.2 + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg Ltoes)) + 0 + (vector-float*! (new 'stack-no-clear 'vector) (-> self control transv) 2.5) + #f + ) + (set! gp-6 (the-as int (current-time))) + ) + ) + ) + (suspend) + ) + ) + #f + ) + :post target-post + ) + +(defbehavior target-swim-tilt target ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)))) + (let ((v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ))) + (f0-1 (fmin 1.0 (* arg0 (/ (-> self control ctrl-xz-vel) (-> self control current-surface target-speed))))) + ) + (seek! + (-> self control unknown-float43) + (fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3)) + (* arg1 (seconds-per-frame)) + ) + ) + (let ((a2-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)))) + (forward-up-nopitch->quaternion (-> self control override-quat) gp-0 a2-2) + ) + ) + (quaternion-rotate-x! + (-> self control override-quat) + (-> self control override-quat) + (if (>= (-> self control unknown-float43) 0.0) + 16384.0 + -16384.0 + ) + ) + (set! (-> self control override-quat-alpha) (fabs (-> self control unknown-float43))) + (if (and (-> self next-state) (= (-> self next-state name) 'target-swim-down)) + (seek! (-> self control unknown-float001) -6144.0 (* 4096.0 (seconds-per-frame))) + (seek! (-> self control unknown-float001) 0.0 (* 2048.0 (seconds-per-frame))) + ) + (set! (-> self control draw-offset y) (-> self control unknown-float001)) + ) + +(defstate target-swim (target) + :event target-standard-event-handler + :code nothing + :post target-swim-post + ) + +(defstate target-swim-stance (target) + :parent target-swim + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *swim-mods*) + (logior! (-> self water flags) (water-flag swim-ground)) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + ) + :exit (behavior () + (target-state-hook-exit) + (set! (-> self control mod-surface target-speed) 28672.0) + (target-exit) + (when (not (and (-> self next-state) (begin (-> self next-state name) (state-type? (-> self next-state) 'target-swim))) + ) + (quaternion-identity! (-> self control override-quat)) + (set! (-> self control override-quat-alpha) 0.0) + ) + (when (not (and (-> self next-state) (let ((v1-14 (-> self next-state name))) + (or (= v1-14 'target-swim-stance) (= v1-14 'target-swim-walk)) + ) + ) + ) + (let ((v1-15 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-15 command) (sound-command set-param)) + (set! (-> v1-15 id) (-> self control board-jump-and-swim-sound)) + (set! (-> v1-15 params volume) -4) + (set! (-> v1-15 auto-time) 960) + (set! (-> v1-15 auto-from) 2) + (set! (-> v1-15 params mask) (the-as uint 17)) + (-> v1-15 id) + ) + ) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (logtest? (-> self control status) (collide-status on-surface)) + (not (logtest? (-> self control status) (collide-status on-water))) + ) + (set-zero! (-> self water bob)) + ) + (when (and (not (logtest? (water-flag swimming) (-> self water flags))) + (time-elapsed? (-> self state-time) (seconds 0.1)) + ) + (if (logtest? (water-flag wading) (-> self water flags)) + (go target-wade-stance) + (go target-stance) + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) + ) + (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle square) + ) + (-> *setting-control* user-current dive) + (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) + ) + (spawn-ripples (-> self water) 0.7 (-> self control trans) 1 *null-vector* #t) + (set! (-> self control unknown-float43) 0.0) + (go target-swim-down) + ) + (if (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (let ((gp-0 (ja-group))) + (ja-aframe-num 0) + (if (or (and (= gp-0 jakb-swim-up-ja) #t) (and (= gp-0 jakb-swim-down-to-up-ja) #t)) + #f + #t + ) + ) + ) + (go target-swim-walk) + ) + (target-swim-tilt 0.0 2.0 0.0 1.0) + (sound-play "swim-bubbles" :id (-> self control board-jump-and-swim-sound)) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 jakb-swim-up-ja) (= v1-2 jakb-swim-down-to-up-ja))) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! jakb-swim-up-to-stance-ja + :num! (seek! max (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 1.0 + 2.0 + ) + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (let ((a0-9 (-> self skel root-channel 0))) + (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) + (let ((v1-38 (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 1.0 + 2.0 + ) + ) + ) + (set! (-> a0-9 param 1) v1-38) + ) + (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + (else + (let ((v1-43 (ja-group))) + (if (and v1-43 (= v1-43 jakb-swim-walk-ja)) + (ja-channel-push! 1 (seconds 0.83)) + (ja-channel-push! 1 (seconds 0.15)) + ) + ) + ) + ) + ) + (until #f + (ja :group! jakb-swim-stance-ja :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (can-play-stance-amibent?) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) + ) + ) + ) + #f + ) + ) + +(defstate target-swim-walk (target) + :parent target-swim + :enter (behavior () + ((-> target-swim-stance enter)) + (die-on-next-update! (-> self water bob)) + (set! (-> self control unknown-word04) (the-as uint (current-time))) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + ) + :exit (-> target-swim-stance exit) + :trans (behavior () + ((-> self state-hook)) + (if (and (logtest? (-> self control status) (collide-status on-surface)) + (not (logtest? (-> self control status) (collide-status on-water))) + ) + (set-zero! (-> self water bob)) + ) + (when (and (not (logtest? (water-flag swimming) (-> self water flags))) + (time-elapsed? (-> self water swim-time) (seconds 0.1)) + ) + (if (logtest? (water-flag wading) (-> self water flags)) + (go target-wade-stance) + (go target-stance) + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) + ) + (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle square) + ) + (-> *setting-control* user-current dive) + (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) + ) + (spawn-ripples (-> self water) 0.7 (-> self control trans) 1 *null-vector* #t) + (set! (-> self control unknown-float43) 0.0) + (go target-swim-down) + ) + (cond + ((= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (if (>= (the-as uint (- (current-time) (the-as int (-> self control unknown-word04)))) (the-as uint 15)) + (go target-swim-stance) + ) + ) + (else + (set! (-> self control unknown-word04) (the-as uint (current-time))) + ) + ) + (target-swim-tilt 0.0 2.0 0.0 1.0) + (sound-play "swim-bubbles" :id (-> self control board-jump-and-swim-sound)) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 jakb-swim-up-ja) (= v1-2 jakb-swim-down-to-up-ja) (= v1-2 jakb-swim-up-to-stance-ja))) + (ja-channel-push! 1 (seconds 0.3)) + ) + ((let ((v1-8 (ja-group))) + (and v1-8 (= v1-8 jakb-swim-up-to-stance-ja)) + ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! jakb-swim-walk-ja :num! (seek!) :frame-num (ja-aframe 19.0 0)) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (if (not (logtest? (-> self align flags) (align-flags disabled))) + (set! (-> self control mod-surface target-speed) + (* (-> self align delta trans z) (-> self control current-surface alignv) (-> self clock frames-per-second)) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.15)) + ) + ) + ) + (until #f + (ja-no-eval :group! jakb-swim-walk-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (if (not (logtest? (-> self align flags) (align-flags disabled))) + (set! (-> self control mod-surface target-speed) + (* (-> self align delta trans z) (-> self control current-surface alignv) (-> self clock frames-per-second)) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +(defstate target-swim-down (target) + :parent target-swim + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (t0-7 symbol)) + (case message + (('attack 'attack-invinc 'attack-or-shove) + (let ((v1-1 (the-as attack-info (-> block param 1)))) + (set! t0-7 (or (not (logtest? (-> v1-1 mask) (attack-mask mode))) + (case (-> v1-1 mode) + (('bot 'lava 'melt 'dark-eco-pool) + #f + ) + (('drown-death 'sharkey 'instant-death 'crush 'death 'grenade 'endlessfall) + (set! t0-7 'drown-death) + (set! (-> v1-1 mode) t0-7) + t0-7 + ) + (else + #t + ) + ) + ) + ) + (when t0-7 + (if (not (logtest? (attack-mask damage) (-> v1-1 mask))) + (set! (-> v1-1 damage) (-> *FACT-bank* health-single-inc)) + ) + (if (!= (-> v1-1 mode) 'drown-death) + (set! (-> v1-1 mode) 'damage) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (- (-> self fact health) (-> v1-1 damage)))) + (set! (-> v1-1 mode) 'drown-death) + ) + (logior! (-> v1-1 mask) (attack-mask mode)) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + ) + ) + (('slide) + ) + ) + (target-standard-event-handler proc argc message block) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (logclear! (-> self water flags) (water-flag swim-ground)) + (set! (-> self control mod-surface) *dive-mods*) + (set! (-> self control dynam gravity-max) 16384.0) + (set! (-> self control dynam gravity-length) 16384.0) + (set-time! (-> self water swim-time)) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self neck flex-blend) 0.0) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (target-exit) + (when (not (and (-> self next-state) (let ((v1-11 (-> self next-state name))) + (or (= v1-11 'target-swim-stance) + (= v1-11 'target-swim-walk) + (= v1-11 'target-swim-down) + (= v1-11 'target-swim-up) + ) + ) + ) + ) + (quaternion-identity! (-> self control override-quat)) + (set! (-> self control override-quat-alpha) 0.0) + ) + (when (not (and (-> self next-state) (let ((v1-19 (-> self next-state name))) + (or (= v1-19 'target-swim-down) (= v1-19 'target-swim-up)) + ) + ) + ) + (let ((v1-21 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-21 command) (sound-command set-param)) + (set! (-> v1-21 id) (-> self control bubbles-sound)) + (set! (-> v1-21 params volume) -4) + (set! (-> v1-21 auto-time) 960) + (set! (-> v1-21 auto-from) 2) + (set! (-> v1-21 params mask) (the-as uint 17)) + (-> v1-21 id) + ) + ) + (set! (-> self neck flex-blend) 1.0) + ) + :trans (behavior () + (if (time-elapsed? (-> self water swim-time) (seconds 0.5)) + (go target-stance) + ) + (cond + ((time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) + (set! (-> self control mod-surface) *dive-mods*) + (if (and (-> self next-state) (= (-> self next-state name) 'target-swim-down)) + (target-swim-tilt -0.9 1.0 0.0 0.5) + ) + ) + (else + (set! (-> self control mod-surface) *dive-bottom-mods*) + (if (and (-> self next-state) (let ((v1-18 (-> self next-state name))) + (or (= v1-18 'target-swim-down) (= v1-18 'target-swim-stance)) + ) + ) + (target-swim-tilt 0.0 2.0 -1.0 1.0) + ) + ) + ) + ) + :code (behavior () + (let ((gp-0 60) + (s5-0 3000) + (f30-0 0.0) + ) + (let ((v1-2 (ja-group))) + (set! f30-0 + (cond + ((and v1-2 (or (= v1-2 jakb-swim-stance-ja) + (= v1-2 jakb-swim-walk-ja) + (= v1-2 jakb-swim-up-to-stance-ja) + (= v1-2 jakb-swim-up-ja) + (= v1-2 jakb-swim-down-to-up-ja) + ) + ) + (let ((t9-0 ja-channel-push!) + (a0-16 1) + (v1-7 (ja-group)) + ) + (t9-0 a0-16 (the-as time-frame (if (and v1-7 (= v1-7 jakb-swim-down-to-up-ja)) + 105 + 22 + ) + ) + ) + ) + (let ((s4-0 #f)) + (ja-no-eval :group! jakb-swim-walk-to-down-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) + (when (and (>= (ja-aframe-num 0) 73.0) (not s4-0)) + (set! s4-0 #t) + (when (or (= (-> self prev-state name) 'target-swim-stance) (= (-> self prev-state name) 'target-swim-walk)) + (sound-play "swim-dive") + (spawn-ripples (-> self water) 0.7 (-> self control trans) 1 *null-vector* #f) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja :group! jakb-swim-down-ja :num! min) + f30-0 + ) + (else + (let ((v1-59 (ja-group))) + (cond + ((and v1-59 (or (= v1-59 jakb-flop-down-ja) + (= v1-59 jakb-moving-flop-down-ja) + (= v1-59 jakb-flop-down-loop-ja) + (= v1-59 jakb-moving-flop-down-loop-ja) + ) + ) + (ja-channel-push! 1 (seconds 0.075)) + (set! gp-0 120) + (ja :group! jakb-swim-down-ja :num! (identity (ja-aframe 124.0 0))) + -16384.0 + ) + (else + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-swim-down-ja :num! min) + f30-0 + ) + ) + ) + ) + ) + ) + ) + (until #f + (when (and (!= (-> self tobot?) 'tobot) (time-elapsed? (-> self state-time) (seconds 0.05))) + (if (and (or (not (cpad-hold? (-> self control cpad number) circle square)) + (-> self control unknown-spool-anim00) + (not (-> *setting-control* user-current dive)) + ) + (time-elapsed? (-> self state-time) gp-0) + ) + (go target-swim-up) + ) + (if (or (time-elapsed? (-> self control unknown-time-frame27) s5-0) + (and (logtest? (-> self control status) (collide-status on-surface)) + (and (< (-> self water swim-depth) 8192.0) (time-elapsed? (-> self state-time) gp-0)) + ) + ) + (go target-swim-up) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) + (sound-play "water-bubbles" :id (-> self control bubbles-sound)) + ) + (let ((s4-4 (new-stack-vector0)) + (f0-13 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! s4-4 (-> self control transv) (vector-float*! s4-4 (-> self control dynam gravity-normal) f0-13)) + (let* ((f28-0 (vector-length s4-4)) + (f26-0 f28-0) + (f24-0 (+ f0-13 f30-0)) + ) + (set! f30-0 (seek f30-0 0.0 (* 32768.0 (seconds-per-frame)))) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f24-0) + (vector-float*! s4-4 s4-4 (/ f28-0 f26-0)) + ) + ) + ) + (suspend) + (ja :num! (loop! (lerp-scale 0.4 1.0 (vector-length (-> self control transv)) 0.0 16384.0))) + ) + ) + #f + ) + ) + +(defstate target-swim-up (target) + :parent target-swim + :event (-> target-swim-down event) + :enter (behavior () + ((-> target-swim-down enter)) + ) + :exit (-> target-swim-down exit) + :trans (behavior () + (if (and (cpad-pressed? (-> self control cpad number) x) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + (not (logtest? (water-flag head-under-water bouncing) (-> self water flags))) + ) + (go + target-swim-jump-jump + (-> *TARGET-bank* swim-jump-height-min) + (-> *TARGET-bank* swim-jump-height-max) + (the-as surface #f) + ) + ) + (if (and (time-elapsed? (-> self state-time) (seconds 10)) + (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + ) + (send-event self 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'drown-death) + ) + ) + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle square) + (-> *setting-control* user-current dive) + (or (not (time-elapsed? (-> self control unknown-time-frame27) (seconds 10))) + (logtest? (-> self control status) (collide-status touch-ceiling)) + ) + (and (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) + (time-elapsed? (-> self state-time) (seconds 0.05)) + ) + ) + (go target-swim-down) + ) + (sound-play "water-bubbles" :id (-> self control bubbles-sound)) + ((-> target-swim-down trans)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 1.0)) + (let ((s5-0 #t) + (gp-0 #f) + ) + (ja-no-eval :group! jakb-swim-down-to-up-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (target-swim-tilt + (if (< 8192.0 (-> self water swim-depth)) + 0.5 + 0.0 + ) + 1.0 + 0.0 + 0.1 + ) + (when (and (not gp-0) + (or (>= (ja-aframe-num 0) 240.0) (not (logtest? (water-flag head-under-water) (-> self water flags)))) + ) + (set! gp-0 #t) + (sound-play "swim-surface") + (spawn-ripples (-> self water) 0.2 (-> self control trans) 1 (-> self control transv) #t) + ) + (if (and (not (logtest? (-> self water flags) (water-flag under-water))) + (and (or (>= (ja-aframe-num 0) 222.0) + (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (>= (ja-aframe-num 0) 200.0)) + ) + (!= (-> self tobot?) 'tobot) + ) + ) + (goto cfg-51) + ) + (compute-alignment! (-> self align)) + (when (not (logtest? (-> self water flags) (water-flag under-water))) + (logior! (-> self water flags) (water-flag swim-ground)) + (set! s5-0 #f) + ) + (if s5-0 + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja :group! jakb-swim-up-ja :num! min) + (until #f + (target-swim-tilt + (if (< 8192.0 (-> self water swim-depth)) + 0.3 + 0.0 + ) + 1.0 + 0.0 + 0.1 + ) + (if (and (not (logtest? (-> self water flags) (water-flag under-water))) (!= (-> self tobot?) 'tobot)) + (goto cfg-51) + ) + (if (cpad-pressed? (-> self control cpad number) x) + (set! f30-0 2.0) + ) + (compute-alignment! (-> self align)) + (when (logtest? (-> self water flags) (water-flag under-water)) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0) + (set! (-> self control transv y) (+ 8192.0 (* 8192.0 f30-0))) + ) + (suspend) + (ja :num! (loop! f30-0)) + (set! f30-0 (seek f30-0 1.0 (seconds-per-frame))) + ) + ) + #f + (label cfg-51) + (logior! (-> self water flags) (water-flag swim-ground)) + (set-time! (-> self water swim-time)) + (start-bobbing! (-> self water) -4096.0 600 1500) + (set! (-> self water bob start-time) (+ (current-time) (seconds -0.05))) + (go target-swim-stance) + ) + ) + +(defstate target-swim-jump-jump (target) + :parent target-swim + :event (-> target-jump event) + :enter (-> target-jump enter) + :exit target-exit + :trans (behavior () + (cond + ((not (time-elapsed? (-> self state-time) (seconds 0.5))) + (logior! (-> self water flags) (water-flag jump-out)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + ) + (else + (set! (-> self trans-hook) (-> target-jump trans)) + ) + ) + ((-> target-jump trans)) + ) + :code (-> target-jump code) + ) + +(defstate target-swim-jump (target) + :event target-standard-event-handler + :enter (-> target-swim-stance enter) + :exit (behavior () + ((-> target-swim-stance exit)) + (die-on-next-update! (-> self water bob)) + (set! (-> self water align-offset) 0.0) + (logior! (-> self water flags) (water-flag jump-out)) + ) + :code (behavior ((arg0 float) (arg1 float)) + (die-on-next-update! (-> self water bob)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! jakb-swim-jump-ja :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (compute-alignment! (-> self align)) + (if (not (logtest? (-> self align flags) (align-flags disabled))) + (+! (-> self water align-offset) (* 0.6 (-> self align delta trans y))) + ) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek! max 2.0)) + ) + ) + (let ((f0-7 (fmax 0.0 (- (-> self water bob-offset))))) + (let ((v1-36 (new-stack-vector0))) + (let ((f1-5 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-36 (-> self control transv) (vector-float*! v1-36 (-> self control dynam gravity-normal) f1-5)) + ) + (let* ((f1-6 (vector-length v1-36)) + (f2-2 f1-6) + (f3-0 0.4096) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f3-0) + (vector-float*! v1-36 v1-36 (/ f1-6 f2-2)) + ) + ) + ) + (go target-swim-jump-jump (+ f0-7 arg0) (+ f0-7 arg1) (the-as surface #f)) + ) + ) + :post target-post + ) diff --git a/goal_src/jak3/engine/target/target-util.gc b/goal_src/jak3/engine/target/target-util.gc index fd3593bd3ae..4c397d460c6 100644 --- a/goal_src/jak3/engine/target/target-util.gc +++ b/goal_src/jak3/engine/target/target-util.gc @@ -7,3 +7,2398 @@ ;; DECOMP BEGINS +(defskelgroup skel-jchar jakb jakb-lod0-jg -1 + ((jakb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :texture-level 10 + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 1 + ) + +(defskelgroup skel-jchar-normal jakb jakb-lod0-jg -1 + ((jak-ext-geo-c+0-jakclod0-skirt-cg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :shadow jak-ext-geo-c+0-jakclod0-sash-cg + :texture-level 10 + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 1 + ) + +(defskelgroup skel-jchar-old jakb jakb-lod0-jg -1 + ((jakb-old-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :texture-level 10 + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 1 + ) + +(defskelgroup skel-jchar-c jakb jakb-lod0-jg -1 + ((jakb-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :shadow jakb-c-shadow-mg + :texture-level 10 + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 1 + :clothing (((mesh 10) + (gravity-constant (meters 16)) + (wind-constant 0.5) + (cloth-width 13) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-skirt") + (tex-name2 "jakc-skirt") + (tex-name3 "jakc-skirt") + (alt-tex-name "jakc-jacketbody") + (alt-tex-name2 "jakc-jacketbody") + (alt-tex-name3 "jakc-jacketbody") + (cloth-thickness 1.0) + (initial-xform 3) + (drag 0.151) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + ) + ((mesh 11) + (gravity-constant (meters 32)) + (wind-constant 0.75) + (cloth-width 6) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-skirt") + (tex-name2 "jakc-skirt") + (tex-name3 "jakc-skirt") + (alt-tex-name "jakc-jacketbody") + (alt-tex-name2 "jakc-jacketbody") + (alt-tex-name3 "jakc-jacketbody") + (cloth-thickness 1.0) + (initial-xform 3) + (drag 0.251) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + ) + ((mesh 12) + (gravity-constant (meters 16)) + (wind-constant 1.25) + (cloth-width 6) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-scarfhanging") + (tex-name2 "jakc-scarfhanging") + (tex-name3 "jakc-scarfhanging") + (alt-tex-name "jakc-eyebrow-norm") + (alt-tex-name2 "jakc-eyebrow-norm") + (alt-tex-name3 "jakc-eyebrow-norm") + (cloth-thickness 2.0) + (initial-xform 5) + (drag 0.151) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + ) + ) + ) + +(defskelgroup skel-jchar-wings jakb jakb-wings-wings-lod0-jg -1 + ((jakb-wings-wings-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :shadow jakb-walk-down-ja + :texture-level 10 + :sort 2 + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 4 + ) + +(defskelgroup skel-jchar-shield jakb jakb-shield-shield-lod0-jg -1 + ((jakb-shield-shield-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :texture-level 10 + :shadow-joint-index 3 + :light-index 5 + ) + +(define *target-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #x2)) + :shadow-dir (new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0) + :bot-plane (new 'static 'plane :y 1.0 :w 37683.2) + :top-plane (new 'static 'plane :y 1.0 :w 4096.0) + ) + ) + ) + +(defskelgroup skel-jak-highres jak-highres jak-highres-lod0-jg jak-highres-idle-ja + ((jak-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :shadow jak-highres-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 1 + ) + +(defskelgroup skel-jakc-highres jakc-highres jakc-highres-lod0-jg jakc-highres-idle-ja + ((jakc-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :shadow jakc-highres-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + :clothing (((mesh jakc-highres-jakcfma0-skirt-cg) + (gravity-constant (meters 16)) + (wind-constant 0.5) + (cloth-width 13) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-skirt") + (tex-name2 "jakc-skirt") + (tex-name3 "jakc-skirt") + (cloth-thickness 1.0) + (initial-xform 3) + (drag 0.151) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + (timestep-frequency 7) + ) + ((mesh jakc-highres-jakcfma0-sash-cg) + (gravity-constant (meters 32)) + (wind-constant 0.75) + (cloth-width 6) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-skirt") + (tex-name2 "jakc-skirt") + (tex-name3 "jakc-skirt") + (cloth-thickness 1.0) + (initial-xform 3) + (drag 0.251) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + (timestep-frequency 7) + ) + ((mesh jakc-highres-jakcfma0-scarf-cg) + (gravity-constant (meters 16)) + (wind-constant 1.25) + (cloth-width 6) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-scarfhanging") + (tex-name2 "jakc-scarfhanging") + (tex-name3 "jakc-scarfhanging") + (cloth-thickness 2.0) + (initial-xform 4) + (drag 0.151) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + (timestep-frequency 7) + ) + ) + ) + +(defskelgroup skel-generic-blast collectables collectables-generic-blast-lod0-jg collectables-generic-blast-idle-ja + ((collectables-generic-blast-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + :texture-level 10 + :light-index 4 + ) + +(defskelgroup skel-generic-ripples collectables collectables-generic-ripples-lod0-jg collectables-generic-ripples-idle-ja + ((collectables-generic-ripples-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + :texture-level 10 + :light-index 4 + ) + +(defskelgroup skel-bomb-blast collectables collectables-bomb-blast-lod0-jg collectables-bomb-blast-idle-ja + ((collectables-bomb-blast-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + :texture-level 10 + :light-index 4 + ) + +(deftype target-bank (basic) + ((jump-collide-offset meters) + (jump-height-min meters) + (jump-height-max meters) + (double-jump-height-min meters) + (double-jump-height-max meters) + (flip-jump-height-min meters) + (flip-jump-height-max meters) + (duck-jump-height-min meters) + (duck-jump-height-max meters) + (flop-jump-height-min meters) + (flop-jump-height-max meters) + (attack-jump-height-min meters) + (attack-jump-height-max meters) + (edge-grab-jump-height-min meters) + (edge-grab-jump-height-max meters) + (swim-jump-height-min meters) + (swim-jump-height-max meters) + (tube-jump-height-min meters) + (tube-jump-height-max meters) + (carry-jump-height-min meters) + (carry-jump-height-max meters) + (mech-jump-height-min meters) + (mech-jump-height-max meters) + (mech-carry-jump-height-min meters) + (mech-carry-jump-height-max meters) + (indax-jump-height-min meters) + (indax-jump-height-max meters) + (indax-double-jump-height-min meters) + (indax-double-jump-height-max meters) + (roll-duration time-frame) + (roll-jump-pre-window time-frame) + (roll-jump-post-window time-frame) + (roll-timeout time-frame) + (roll-speed-min meters) + (roll-speed-inc meters) + (roll-flip-duration time-frame) + (roll-flip-height meters) + (roll-flip-dist meters) + (roll-flip-art-height meters) + (roll-flip-art-dist meters) + (duck-slide-distance meters) + (fall-far meters) + (fall-far-inc meters) + (attack-timeout time-frame) + (ground-timeout time-frame) + (slide-down-timeout time-frame) + (fall-timeout time-frame) + (fall-stumble-threshold meters) + (yellow-projectile-speed meters) + (hit-invulnerable-timeout time-frame) + (same-attack-invulnerable-timeout time-frame) + (run-cycle-length float) + (walk-cycle-dist meters) + (walk-up-cycle-dist meters) + (walk-down-cycle-dist meters) + (walk-side-cycle-dist meters) + (run-cycle-dist meters) + (run-up-cycle-dist meters) + (run-down-cycle-dist meters) + (run-side-cycle-dist meters) + (run-wall-cycle-dist meters) + (duck-walk-cycle-dist meters) + (wade-shallow-walk-cycle-dist meters) + (wade-deep-walk-cycle-dist meters) + (mech-walk-cycle-dist meters) + (mech-run-cycle-dist meters) + (smack-surface-dist meters) + (smack-surface-height meters) + (min-dive-depth meters) + (root-radius meters) + (root-offset vector :inline) + (body-radius meters) + (edge-radius meters) + (edge-offset vector :inline) + (edge-grab-height-off-ground meters) + (head-radius meters) + (head-height meters) + (head-offset vector :inline) + (spin-radius meters) + (spin-offset vector :inline) + (duck-spin-radius meters) + (duck-spin-offset vector :inline) + (punch-radius meters) + (punch-offset vector :inline) + (uppercut-radius meters) + (uppercut0-offset vector :inline) + (uppercut1-offset vector :inline) + (flop-radius meters) + (flop0-offset vector :inline) + (flop1-offset vector :inline) + (stuck-time seconds) + (stuck-timeout seconds) + (stuck-distance meters) + (tongue-pull-speed-min float) + (tongue-pull-speed-max float) + (yellow-attack-timeout time-frame) + (fall-height meters) + (mech-jump-thrust-fuel float) + (strafe-jump-pre-window time-frame) + (strafe-jump basic) + (strafe-duck-jump basic) + (dark-jump-height-min meters) + (dark-jump-height-max meters) + (ladder-walk-up-speed meters) + (ladder-walk-down-speed meters) + (ladder-slide-speed meters) + (invisible-duration time-frame) + (mech-walk-carry-cycle-dist meters) + ) + ) + + +(define *TARGET-bank* (new 'static 'target-bank + :jump-collide-offset (meters 0.7) + :jump-height-min (meters 1.01) + :jump-height-max (meters 3.5) + :double-jump-height-min (meters 1) + :double-jump-height-max (meters 2.5) + :flip-jump-height-min (meters 5) + :flip-jump-height-max (meters 7) + :duck-jump-height-min (meters 7) + :duck-jump-height-max (meters 7) + :flop-jump-height-min (meters 5) + :flop-jump-height-max (meters 7) + :attack-jump-height-min (meters 5) + :attack-jump-height-max (meters 6.5) + :edge-grab-jump-height-min (meters 1.7) + :edge-grab-jump-height-max (meters 1.7) + :swim-jump-height-min (meters 5) + :swim-jump-height-max (meters 5) + :tube-jump-height-min (meters 1.75) + :tube-jump-height-max (meters 2.5) + :carry-jump-height-min (meters 1.75) + :carry-jump-height-max (meters 2) + :mech-jump-height-min (meters 1.5) + :mech-jump-height-max (meters 1.5) + :mech-carry-jump-height-min (meters 5) + :mech-carry-jump-height-max (meters 3) + :indax-jump-height-min (meters 1.01) + :indax-jump-height-max (meters 3.5) + :indax-double-jump-height-min (meters 1) + :indax-double-jump-height-max (meters 2.5) + :roll-duration (seconds 0.5) + :roll-jump-pre-window (seconds 1) + :roll-jump-post-window (seconds 0.1) + :roll-speed-min (meters 11.5) + :roll-speed-inc (meters 1.5) + :roll-flip-duration (seconds 0.7) + :roll-flip-height (meters 3.52) + :roll-flip-dist (meters 17.3) + :roll-flip-art-height (meters 3.2969) + :roll-flip-art-dist (meters 12.5) + :duck-slide-distance (meters 5.75) + :fall-far (meters 30) + :fall-far-inc (meters 20) + :attack-timeout (seconds 0.3) + :ground-timeout (seconds 0.2) + :slide-down-timeout (seconds 0.2) + :fall-timeout (seconds 1) + :fall-stumble-threshold (meters 39.9) + :yellow-projectile-speed (meters 60) + :hit-invulnerable-timeout (seconds 1) + :same-attack-invulnerable-timeout (seconds 2) + :run-cycle-length 60.0 + :walk-cycle-dist (meters 2.8) + :walk-up-cycle-dist (meters 2.8) + :walk-down-cycle-dist (meters 2.8) + :walk-side-cycle-dist (meters 2.8) + :run-cycle-dist (meters 6.25) + :run-up-cycle-dist (meters 5) + :run-down-cycle-dist (meters 5) + :run-side-cycle-dist (meters 6.25) + :run-wall-cycle-dist (meters 2.8) + :duck-walk-cycle-dist (meters 3.25) + :wade-shallow-walk-cycle-dist (meters 6) + :wade-deep-walk-cycle-dist (meters 6) + :mech-walk-cycle-dist (meters 4) + :mech-run-cycle-dist (meters 8) + :smack-surface-dist (meters 1.25) + :min-dive-depth (meters 2) + :root-radius (meters 2.2) + :root-offset (new 'static 'vector :y 4915.2 :w 1.0) + :body-radius (meters 0.7) + :edge-radius (meters 0.35) + :edge-offset (new 'static 'vector :y 4915.2 :z 4096.0 :w 1.0) + :edge-grab-height-off-ground (meters 2.3) + :head-radius (meters 0.7) + :head-height (meters 1.4) + :head-offset (new 'static 'vector :y 4915.2 :w 1.0) + :spin-radius (meters 2.2) + :spin-offset (new 'static 'vector :y 6553.6 :w 1.0) + :duck-spin-radius (meters 1.2) + :duck-spin-offset (new 'static 'vector :y 4096.0 :w 1.0) + :punch-radius (meters 1.3) + :punch-offset (new 'static 'vector :y 5324.8 :w 1.0) + :uppercut-radius (meters 1) + :uppercut0-offset (new 'static 'vector :y 3276.8 :w 1.0) + :uppercut1-offset (new 'static 'vector :y 9011.2 :w 1.0) + :flop-radius (meters 1.4) + :flop0-offset (new 'static 'vector :y 3276.8 :w 1.0) + :flop1-offset (new 'static 'vector :y 9011.2 :w 1.0) + :stuck-time (seconds 0.3) + :stuck-timeout (seconds 2) + :stuck-distance (meters 0.05) + :tongue-pull-speed-min 0.15 + :tongue-pull-speed-max 0.22 + :yellow-attack-timeout (seconds 0.2) + :fall-height (meters 1) + :mech-jump-thrust-fuel 900.0 + :strafe-jump-pre-window (seconds 0.5) + :strafe-jump #f + :strafe-duck-jump #f + :dark-jump-height-min (meters 20.5) + :dark-jump-height-max (meters 20.5) + :ladder-walk-up-speed (meters 2.5) + :ladder-walk-down-speed (meters 3) + :ladder-slide-speed (meters 20) + :invisible-duration (seconds 30) + :mech-walk-carry-cycle-dist (meters 8) + ) + ) + +(defbehavior target-start-attack target () + (let* ((v1-0 *game-info*) + (a0-1 (+ (-> v1-0 attack-id) 1)) + ) + (set! (-> v1-0 attack-id) a0-1) + (set! (-> self control target-attack-id) a0-1) + ) + (set! (-> self control attack-count) (the-as uint 0)) + (set! (-> self control bomb-scale) 0.0) + (+! (-> self anim-seed) 1) + 0 + (none) + ) + +(defbehavior target-danger-set! target ((arg0 symbol) (arg1 symbol)) + (let* ((s4-0 (-> self control collision-spheres 6)) + (s5-0 (-> self control collision-spheres 7)) + (gp-0 (-> self control collision-spheres 8)) + (s2-0 (-> self control collision-spheres 9)) + (v1-4 arg1) + (f30-0 (if (or (= v1-4 'cone) (= v1-4 'eco-red)) + 2.0 + 1.0 + ) + ) + ) + (set! (-> self control penetrate-using) (penetrate touch)) + (set! (-> self control penetrated-by) (penetrate lunge)) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set! (-> self control danger-mode) arg0) + (logclear! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 transform-index) -2) + (set! (-> s4-0 prim-core collide-as) (collide-spec)) + (set! (-> s4-0 prim-core collide-with) (collide-spec)) + (set! (-> s4-0 local-sphere w) 0.0) + (set! (-> s5-0 transform-index) -2) + (set! (-> s5-0 prim-core collide-as) (collide-spec)) + (set! (-> s5-0 prim-core collide-with) (collide-spec)) + (set! (-> s5-0 local-sphere w) 0.0) + (set! (-> gp-0 transform-index) -2) + (set! (-> gp-0 prim-core collide-as) (collide-spec)) + (set! (-> gp-0 prim-core collide-with) (collide-spec)) + (set! (-> gp-0 local-sphere w) 0.0) + (set! (-> s2-0 transform-index) -2) + (set! (-> s2-0 prim-core collide-as) (collide-spec)) + (set! (-> s2-0 prim-core collide-with) (collide-spec)) + (set! (-> s2-0 local-sphere w) 0.0) + (case arg0 + (('harmless #f) + (set! (-> self control danger-mode) #f) + (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) + ) + (('carry?) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* spin-offset) + (+ 8192.0 (-> *TARGET-bank* spin-radius)) + ) + (set! (-> self control root-prim local-sphere quad) (-> s4-0 local-sphere quad)) + ) + (('spin 'spin-air 'get-on) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 9830.4 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* spin-offset) + (-> *TARGET-bank* spin-radius) + ) + (set! (-> self control penetrate-using) (penetrate touch spin)) + ) + (('board-spin) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 9830.4 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s4-0 local-sphere)) (-> *TARGET-bank* spin-offset) 6963.2) + (set! (-> self control penetrate-using) (penetrate touch spin board)) + ) + (('board-zap) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 13107.2 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s4-0 local-sphere)) (-> *TARGET-bank* spin-offset) 12288.0) + (set! (-> self control penetrate-using) (penetrate touch spin board)) + ) + (('duck-spin) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 10649.6 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* duck-spin-offset) + (-> *TARGET-bank* duck-spin-radius) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius)) + (set! (-> s5-0 transform-index) 46) + (set! (-> self control penetrate-using) (penetrate touch spin)) + ) + (('duck-slide) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* duck-spin-offset) + (-> *TARGET-bank* duck-spin-radius) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius)) + (set! (-> s5-0 transform-index) 40) + (set! (-> self control penetrate-using) (penetrate touch punch)) + ) + (('roll-solid) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* duck-spin-offset) + (+ 819.2 (-> *TARGET-bank* duck-spin-radius)) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius)) + (set! (-> s5-0 transform-index) 8) + (set! (-> self control danger-mode) 'roll) + (set! (-> self control penetrate-using) (penetrate touch roll)) + ) + (('flip) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* duck-spin-offset) + (+ 819.2 (-> *TARGET-bank* duck-spin-radius)) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius)) + (set! (-> s5-0 transform-index) 8) + (set! (-> self control danger-mode) 'flip) + (set! (-> self control penetrate-using) (penetrate touch roll)) + ) + (('punch 'dark-smack) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 11878.4 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* punch-offset) + (-> *TARGET-bank* punch-radius) + ) + (when (not (focus-test? self indax)) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* punch-radius)) + (set! (-> s5-0 transform-index) 27) + ) + (set! (-> self control penetrate-using) (penetrate touch punch)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage bomb0)) + ) + (logior! (-> self control penetrate-using) (penetrate dark-punch)) + ) + (if (= arg0 'dark-smack) + (logior! (-> self control penetrate-using) (penetrate dark-smack)) + ) + ) + (('uppercut) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 11878.4 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* uppercut0-offset) + (-> *TARGET-bank* uppercut-radius) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* uppercut-radius)) + (set! (-> s5-0 transform-index) 27) + (set! (-> gp-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> gp-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> gp-0 local-sphere)) + (-> *TARGET-bank* uppercut1-offset) + (-> *TARGET-bank* uppercut-radius) + ) + (set! (-> self control penetrate-using) (penetrate touch uppercut)) + ) + (('flop) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* flop0-offset) + (-> *TARGET-bank* flop-radius) + ) + (set! f30-0 1.0) + (set! (-> self control danger-mode) 'flop) + (set! (-> self control penetrate-using) (penetrate touch flop)) + ) + (('flop-down) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* flop0-offset) + (-> *TARGET-bank* flop-radius) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s5-0 local-sphere)) + (-> *TARGET-bank* flop1-offset) + (-> *TARGET-bank* flop-radius) + ) + (if (!= f30-0 1.0) + (set! f30-0 2.1) + ) + (set! (-> self control danger-mode) 'flop) + (set! (-> self control penetrate-using) (penetrate touch flop)) + ) + (('flut-attack) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 12288.0 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* spin-offset) + (+ 2048.0 (-> *TARGET-bank* punch-radius)) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s5-0 local-sphere)) + *null-vector* + (+ 1228.8 (-> *TARGET-bank* punch-radius)) + ) + (set! (-> s5-0 transform-index) 8) + (set! (-> self control penetrate-using) (penetrate touch flut-attack)) + ) + (('mech-punch) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self control penetrate-using) (penetrate touch mech)) + ) + (('bomb) + (let* ((f0-32 (-> self control bomb-scale)) + (f28-0 (lerp-scale (-> *TARGET-bank* root-radius) 122880.0 f0-32 0.0 1.0)) + ) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + f28-0 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) + (logclear (-> self control default-collide-with-fgnd) (collide-spec collectable)) + ) + (sphere<-vector+r! (the-as sphere (-> s4-0 local-sphere)) (-> *TARGET-bank* root-offset) f28-0) + ) + (set! (-> self control penetrate-using) (penetrate touch dark-bomb)) + ) + (else + (format 0 "ERROR: ~A unknown danger mode ~A" self arg0) + ) + ) + (when (= arg1 'cone) + (let ((f28-1 16384.0)) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (+ (-> *TARGET-bank* root-radius) (* 2.0 f28-1)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s2-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s2-0 prim-core collide-with) + (logclear (-> self control default-collide-with-fgnd) (collide-spec collectable)) + ) + (set! (-> s2-0 transform-index) 0) + (sphere<-vector+r! + (the-as sphere (-> s2-0 local-sphere)) + (new 'static 'vector :y 12288.0 :z 16384.0 :w 1.0) + f28-1 + ) + ) + (set! (-> self control penetrate-using) (penetrate touch dark-bomb)) + ) + (when (and (!= f30-0 1.0) (not (or (= arg0 'harmless) (= arg0 #f)))) + (set! (-> self control root-prim local-sphere w) (* (-> self control root-prim local-sphere w) f30-0)) + (set! (-> s4-0 local-sphere w) (* (-> s4-0 local-sphere w) f30-0)) + (set! (-> s5-0 local-sphere w) (* (-> s5-0 local-sphere w) f30-0)) + (set! (-> gp-0 local-sphere w) (* (-> gp-0 local-sphere w) f30-0)) + ) + ) + (case (-> self fact eco-type) + ((1) + (logior! (-> self control penetrate-using) (penetrate eco-yellow)) + ) + ((2) + (logior! (-> self control penetrate-using) (penetrate eco-red)) + ) + ((3) + (set! (-> self control penetrate-using) + (the-as penetrate (logior (penetrate eco-blue) (-> self control penetrate-using))) + ) + ) + ((5) + (set! (-> self control penetrate-using) + (the-as penetrate (logior (penetrate eco-green) (-> self control penetrate-using))) + ) + ) + ) + (none) + ) + +(defbehavior target-collide-set! target ((arg0 symbol) (arg1 float)) + (let ((gp-0 (-> self control))) + (if (and (= arg0 'normal) + (enabled-gun? self) + (not (logtest? (-> self control current-surface flags) (surface-flag duck))) + ) + (set! arg0 'gun) + ) + (set! (-> self control collide-mode) arg0) + (set! (-> self control collide-mode-transition) arg1) + (logclear! (-> self control penetrate-using) (penetrate tube vehicle board mech)) + (set! (-> self control penetrated-by) (penetrate lunge)) + (dotimes (v1-10 4) + (set! (-> gp-0 collision-spheres v1-10 transform-index) -2) + ) + (set! (-> gp-0 collision-spheres 3 prim-core collide-as) (collide-spec)) + (set! (-> gp-0 collision-spheres 3 prim-core collide-with) (collide-spec)) + (set! (-> gp-0 collision-spheres 4 prim-core collide-as) (collide-spec jak)) + (set! (-> gp-0 collision-spheres 4 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + hit-by-player-list + hit-by-others-list + player-list + water + collectable + blocking-plane + tobot + pusher + vehicle-mesh + obstacle-for-jak + shield + vehicle-mesh-no-block-use + ) + ) + (cond + ((= arg0 'pole) + (set-vector! (-> gp-0 collision-spheres 0 local-sphere) 0.0 0.0 0.0 (-> *TARGET-bank* body-radius)) + (set-vector! (-> gp-0 collision-spheres 1 local-sphere) 0.0 0.0 0.0 (-> *TARGET-bank* body-radius)) + (set-vector! (-> gp-0 collision-spheres 2 local-sphere) 0.0 0.0 0.0 (-> *TARGET-bank* body-radius)) + (set! (-> gp-0 collision-spheres 0 transform-index) 40) + (set! (-> gp-0 collision-spheres 1 transform-index) 38) + (set! (-> gp-0 collision-spheres 2 transform-index) 8) + ) + ((= arg0 'board) + (logior! (-> self control penetrate-using) (penetrate touch board)) + ) + ((= arg0 'racer) + (set! (-> gp-0 draw-offset y) 4096.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (new 'static 'vector :y 8192.0 :w 1.0) + 16384.0 + ) + (set-vector! (-> gp-0 collision-spheres 0 local-sphere) 0.0 6553.6 0.0 6553.6) + (set-vector! (-> gp-0 collision-spheres 1 local-sphere) 0.0 9420.8 0.0 6553.6) + (set-vector! (-> gp-0 collision-spheres 2 local-sphere) 0.0 12288.0 0.0 6553.6) + (logior! (-> self control penetrate-using) (penetrate touch vehicle)) + ) + ((= arg0 'flut) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (new 'static 'vector :y 8192.0 :w 1.0) + 12288.0 + ) + (set-vector! (-> gp-0 collision-spheres 0 local-sphere) 0.0 4915.2 0.0 4915.2) + (set-vector! (-> gp-0 collision-spheres 1 local-sphere) 0.0 7782.4004 0.0 4915.2) + (set-vector! (-> gp-0 collision-spheres 2 local-sphere) 0.0 10649.6 0.0 4915.2) + (if (= (-> self flut mode) 'racer) + (logior! (-> self control penetrate-using) (penetrate flut)) + ) + ) + ((= arg0 'mech) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (new 'static 'vector :y 8192.0 :w 1.0) + 16384.0 + ) + (set-vector! (-> gp-0 collision-spheres 0 local-sphere) 0.0 4096.0 0.0 4096.0) + (set-vector! (-> gp-0 collision-spheres 1 local-sphere) 0.0 8601.6 0.0 6553.6) + (set-vector! (-> gp-0 collision-spheres 2 local-sphere) 0.0 14745.6 0.0 6963.2) + (logior! (-> self control penetrate-using) (penetrate touch mech)) + ) + ((= arg0 'mech-carry) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (new 'static 'vector :y 12288.0 :w 1.0) + 20480.0 + ) + (set-vector! (-> gp-0 collision-spheres 0 local-sphere) 0.0 4096.0 0.0 4096.0) + (set-vector! (-> gp-0 collision-spheres 1 local-sphere) 0.0 8601.6 0.0 6553.6) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ 5734.4 (lerp-scale 9011.2 12288.0 arg1 0.0 1.0)) + 0.0 + (lerp-scale 9420.8 12697.6 arg1 0.0 1.0) + ) + ) + ((= arg0 'duck) + (set! (-> self control duck-gun-tube-transision) arg1) + (let ((f30-1 (- 1.0 arg1))) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + (* 0.0 f30-1) + (-> *TARGET-bank* body-radius) + ) + (if (using-gun? self) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ 2867.2 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 2867.2 f30-1)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 5734.4 f30-1)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + ) + ) + ((= arg0 'indax) + (let ((f30-2 0.2)) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + (* 0.0 f30-2) + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 2867.2 f30-2)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 5734.4 f30-2)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + ) + (set! (-> gp-0 collision-spheres 4 prim-core collide-as) (collide-spec)) + (set! (-> gp-0 collision-spheres 4 prim-core collide-with) (collide-spec)) + 0 + ) + ((= arg0 'tube) + (set! (-> self control duck-gun-tube-transision) arg1) + (let ((f30-3 (- 1.0 arg1))) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + (* 0.0 f30-3) + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 2867.2 f30-3)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 5734.4 f30-3)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + ) + (logior! (-> self control penetrate-using) (penetrate touch tube)) + ) + ((= arg0 'carry) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ 2867.2 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ 5734.4 (-> *TARGET-bank* body-radius)) + 0.0 + (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 arg1 0.0 1.0) + ) + ) + ((= arg0 'gun) + (set! (-> self control duck-gun-tube-transision) arg1) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ 2867.2 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ 5734.4 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 3 local-sphere) + 0.0 + (+ 5734.4 (-> *TARGET-bank* body-radius)) + 0.0 + (lerp-scale (-> *TARGET-bank* body-radius) 4915.2 arg1 0.0 1.0) + ) + (set! (-> gp-0 collision-spheres 3 prim-core collide-with) (collide-spec + backgnd + bot + crate + obstacle + hit-by-player-list + hit-by-others-list + player-list + water + collectable + blocking-plane + tobot + pusher + vehicle-mesh + obstacle-for-jak + shield + vehicle-mesh-no-block-use + ) + ) + ) + (else + (set! (-> self control duck-gun-tube-transision) 0.0) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ 2867.2 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ 5734.4 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + ) + ) + (set! (-> gp-0 nav-radius) (-> gp-0 collision-spheres 2 local-sphere w)) + ) + 0 + ) + +(defmethod get-quaternion ((this control-info)) + "Get the quat for this [[trsqv]]." + (-> this quat-for-control) + ) + +;; WARN: Return type mismatch art-group vs skeleton-group. +(defun target-skel-group () + (the-as skeleton-group (cond + (*target* + (case (-> *target* ext-geo) + (((target-geo jakb)) + (art-group-get-by-name *level* "skel-jchar-normal" (the-as (pointer level) #f)) + ) + (((target-geo jakb-old)) + (art-group-get-by-name *level* "skel-jchar-old" (the-as (pointer level) #f)) + ) + (((target-geo jakc)) + (art-group-get-by-name *level* "skel-jchar-c" (the-as (pointer level) #f)) + ) + (else + (art-group-get-by-name *level* "skel-jchar" (the-as (pointer level) #f)) + ) + ) + ) + (else + (art-group-get-by-name *level* "skel-jchar" (the-as (pointer level) #f)) + ) + ) + ) + ) + +(defbehavior debounce-speed target ((arg0 float) (arg1 float) (arg2 vector) (arg3 vector)) + (if (and (< 0.3 arg0) (< arg0 0.7) (< 0.0 arg1) (< (vector-dot arg2 arg3) 0.2)) + (set! arg0 0.0) + ) + arg0 + ) + +(defbehavior target-align-vel-z-adjust target ((arg0 float)) + (let ((f1-0 (-> self control local-slope-z))) + (* arg0 (if (< 0.0 f1-0) + (* (- 1.0 f1-0) (-> self control current-surface alignv)) + (-> self control current-surface alignv) + ) + ) + ) + ) + +(defmethod get-inv-mass ((this target)) + (if (focus-test? this mech) + 0.1 + 1.0 + ) + ) + +;; WARN: Return type mismatch control-info vs trsqv. +(defmethod apply-alignment ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) + (with-pp + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> arg2 quad)) + (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) + (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) + (let* ((s3-0 (-> this control c-R-w)) + (s0-0 (-> this control w-R-c)) + (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control dynam gravity) s0-0)) + (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control transv) s0-0)) + ) + (if (logtest? arg0 (align-opts no-gravity)) + (set-vector! s1-0 0.0 0.0 0.0 1.0) + ) + (when (logtest? arg0 (align-opts adjust-x-vel)) + (set! (-> a1-3 x) + (+ (* (-> arg1 trans x) (-> s2-0 x) (-> pp clock frames-per-second)) (* (-> s1-0 x) (seconds-per-frame))) + ) + (if (not (logtest? arg0 (align-opts adjust-xz-vel keep-other-velocities))) + (set! (-> a1-3 z) 0.0) + ) + ) + (if (and (logtest? arg0 (align-opts adjust-y-vel)) + (not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0))) + ) + (set! (-> a1-3 y) + (+ (* (-> arg1 trans y) (-> s2-0 y) (-> pp clock frames-per-second)) (* (-> s1-0 y) (seconds-per-frame))) + ) + ) + (when (logtest? arg0 (align-opts adjust-xz-vel)) + (set! (-> a1-3 z) + (+ (* (-> arg1 trans z) (-> s2-0 z) (-> pp clock frames-per-second)) (* (-> s1-0 z) (seconds-per-frame))) + ) + (if (not (logtest? arg0 (align-opts adjust-x-vel keep-other-velocities))) + (set! (-> a1-3 x) 0.0) + ) + ) + (vector-matrix*! (-> this control transv) a1-3 s3-0) + ) + ) + ) + (if (logtest? arg0 (align-opts adjust-quat)) + (quaternion-normalize! + (quaternion*! (-> this control quat-for-control) (-> this control quat-for-control) (-> arg1 quat)) + ) + ) + (the-as trsqv (-> this control)) + ) + ) + +(defun average-turn-angle ((arg0 target)) + (let ((f30-0 0.0)) + (dotimes (s5-0 8) + (+! f30-0 + (fabs + (deg-diff (atan (-> arg0 control turn-history-ctrl s5-0 x) (-> arg0 control turn-history-ctrl s5-0 z)) 0.0) + ) + ) + ) + (* 0.125 f30-0) + ) + ) + +(defbehavior can-play-stance-amibent? target () + (and (or (and (kiosk?) + (>= (+ -300000 (-> *display* real-clock frame-counter)) (seconds 60)) + (>= (- (-> *display* base-clock frame-counter) (-> self control cpad change-time)) (seconds 60)) + (>= (- (-> *display* game-clock frame-counter) (-> self game kiosk-timeout)) (seconds 60)) + ) + (and (time-elapsed? (-> self ambient-time) (seconds 30)) + (not (logtest? (-> self control status) (collide-status touch-actor))) + (logtest? (-> self control status) (collide-status on-surface)) + (not (or (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self control status) (collide-status on-water)) + ) + ) + (not (logtest? (focus-status dead hit grabbed in-head edge-grab pole flut tube light board mech dark indax teleporting) + (-> self focus-status) + ) + ) + ) + ) + (not (paused?)) + (not (movie?)) + (>= (- (-> *display* base-clock frame-counter) (-> self control cpad change-time)) (seconds 30)) + (!= (-> self tobot?) 'tobot) + (not (-> *setting-control* user-current talking)) + (not (-> *setting-control* user-current spooling)) + (not (-> *setting-control* user-current movie)) + (not (-> *setting-control* user-current hint)) + (not (focus-test? self dead hit grabbed)) + (logtest? (game-feature sidekick) (-> self game features)) + (= (-> self ext-anim) (target-anim default)) + (case *kernel-boot-message* + (('kiosk) + (set! (-> self control cpad change-time) (-> *display* base-clock frame-counter)) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + #f + ) + (else + #t + ) + ) + ) + ) + +(defbehavior target-height-above-ground target () + (- (-> self control trans y) (-> self control gspot-pos y)) + ) + +(defun find-collision-below ((arg0 vector) (arg1 vector) (arg2 float)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s5-0 start-pos quad) (-> arg1 quad)) + (set-vector! (-> s5-0 move-dist) 0.0 (- arg2) 0.0 1.0) + (let ((v1-2 s5-0)) + (set! (-> v1-2 radius) 40.96) + (set! (-> v1-2 collide-with) (collide-spec backgnd hit-by-others-list pusher)) + (set! (-> v1-2 ignore-process0) #f) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) + (set! (-> arg0 quad) (-> s5-0 best-other-tri intersect quad)) + #t + ) + ) + ) + +(defbehavior can-jump? target ((mode symbol)) + (and (or (logtest? (-> self control status) (collide-status on-surface)) + (not (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout))) + (and (= mode 'board) + (or (not (time-elapsed? (-> self board last-jump-time) (seconds 0.05))) + (and (not (time-elapsed? (-> self control last-time-of-stuck) (seconds 0.5))) + (< (target-height-above-ground) 2048.0) + ) + ) + ) + (and (= mode 'flut) + (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.5))) + (< (target-height-above-ground) 6144.0) + ) + ) + (and (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + (or (= mode 'board) (!= (-> self control poly-pat event) 13)) + (if (= mode 'target-roll-flip) + (>= 0.5 (-> self control local-slope-z)) + #t + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior target-jump-go target () + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + (none) + ) + +(defbehavior move-legs? target () + (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + ) + +(defbehavior jump-hit-ground-stuck? target () + (or (logtest? (-> self control status) (collide-status on-surface)) + (when (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) + ) + (set-time! (-> self control last-time-of-stuck)) + #t + ) + ) + ) + +;; WARN: Return type mismatch int vs time-frame. +(defbehavior target-time-to-ground target () + (let ((f0-0 (target-height-above-ground)) + (f2-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f1-1 0.0) + ) + (while (< 0.0 f0-0) + (set! f1-1 (+ 5.0 f1-1)) + (+! f0-0 (* f2-0 (seconds-per-frame))) + (set! f2-0 (- f2-0 (* (-> self control dynam gravity-length) (seconds-per-frame)))) + ) + (the time-frame f1-1) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior fall-test target ((arg0 (state symbol target)) (arg1 float)) + (when (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) arg1) + ) + (if (not (time-elapsed? (-> self control rider-time) (-> *TARGET-bank* ground-timeout))) + (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) + ) + (go arg0 #f) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior slide-down-test target () + (if (and (not (logtest? (-> self control status) (collide-status on-surface touch-edge))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (logtest? (-> self control status) (collide-status touch-surface)) + (< (cos (-> self control current-surface slope-slip-angle)) (-> self control surface-angle)) + ) + (go target-slide-down) + ) + (none) + ) + +(defbehavior smack-surface? target ((arg0 symbol)) + (and (< 0.7 (-> self control touch-angle)) + (and (< (-> self control surface-angle) 0.3) + (logtest? (-> self control status) (collide-status touch-wall)) + (or arg0 (not (logtest? (-> self control status) (collide-status touch-actor)))) + ) + ) + ) + +(defbehavior can-roll? target () + (and (or (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1))) + (logtest? (-> self control status) (collide-status on-surface)) + ) + (or (not (logtest? (-> self control status) (collide-status touch-wall))) + (>= 0.7 (-> self control touch-angle)) + ) + (< (-> self control local-slope-z) 0.7) + (and (not (logtest? (-> self target-flags) (target-flags prevent-attack prevent-duck))) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (time-elapsed? (-> *TARGET-bank* roll-timeout) (-> self control last-roll-end-time)) + (or (not (enabled-gun? self)) + (not (-> *TARGET-bank* strafe-duck-jump)) + (and (< 0.3 (vector-dot (-> self control to-target-pt-xz) (-> self control c-R-w fvec))) + (time-elapsed? (-> self control time-of-last-zero-input) (seconds 0.3)) + ) + ) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + ) + +(defbehavior can-duck? target () + (and (logtest? (-> self control status) (collide-status on-surface)) + (>= (-> self control ground-local-norm-dot-grav) 0.7) + (not (logtest? (water-flag under-water swimming) (-> self water flags))) + (not (logtest? (-> self target-flags) (target-flags prevent-duck))) + (or (not (logtest? (water-flag wading) (-> self water flags))) + (< (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) + ) + (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (let ((v1-23 (ja-group))) + (and (not (and v1-23 (or (= v1-23 (-> self draw art-group data 476)) (= v1-23 (-> self draw art-group data 477))))) + (or (= (-> self ext-anim) (target-anim default)) + (and (= (-> self ext-anim) (target-anim dark)) (focus-test? self dark) (nonzero? (-> self darkjak))) + ) + ) + ) + ) + ) + +(defun can-exit-duck? ((arg0 target)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'sphere 2))) + (dotimes (s3-0 2) + ((method-of-type sphere new) (the-as symbol (-> s4-0 s3-0)) sphere) + ) + (set! (-> s4-0 0 quad) (-> arg0 control trans quad)) + (set! (-> s4-0 0 y) (+ 5734.4 (-> *TARGET-bank* body-radius) (-> s4-0 0 y))) + (set! (-> s4-0 0 r) (-> *TARGET-bank* body-radius)) + (set! (-> s4-0 1 quad) (-> arg0 control trans quad)) + (set! (-> s4-0 1 y) (+ 2867.2 (-> *TARGET-bank* body-radius) (-> s4-0 1 y))) + (set! (-> s4-0 1 r) (-> *TARGET-bank* body-radius)) + (let ((v1-12 gp-0)) + (set! (-> v1-12 spheres) s4-0) + (set! (-> v1-12 best-other-prim) (the-as collide-shape-prim 2)) + (set! (-> v1-12 collide-with) + (logclear + (-> arg0 control root-prim prim-core collide-with) + (collide-spec civilian enemy vehicle-sphere projectile) + ) + ) + (set! (-> v1-12 ignore-process0) #f) + (set! (-> v1-12 ignore-process1) #f) + (set! (-> v1-12 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-12 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-12 action-mask) (collide-action solid)) + ) + ) + (if (fill-and-probe-using-spheres *collide-cache* gp-0) + #f + #t + ) + ) + ) + +(defbehavior can-hands? target ((arg0 symbol)) + (cond + ((or (logtest? (-> self target-flags) (target-flags prevent-attack)) + (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands)) + ) + #f + ) + ((and (or (not arg0) + (and (not (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout))) + (< (-> self control local-slope-z) 0.7) + ) + ) + (time-elapsed? + (-> self control last-running-attack-end-time) + (if (and (= (-> self fact eco-type) 1) (>= (-> self fact eco-level) 1.0)) + (-> *TARGET-bank* yellow-attack-timeout) + (-> *TARGET-bank* attack-timeout) + ) + ) + ) + #t + ) + (else + (set-time! (-> self control last-hands-attempt-time)) + #f + ) + ) + ) + +(defbehavior can-feet? target ((arg0 symbol)) + (cond + ((or (logtest? (-> self target-flags) (target-flags prevent-attack)) + (logtest? (-> self control current-surface flags) (surface-flag no-attack no-feet)) + (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (logtest? (game-feature lightjak-shield) (-> self game features)) + (not (handle->process (-> self lightjak freeze-control))) + ) + ) + #f + ) + ((time-elapsed? (-> self control last-attack-end-time) (-> *TARGET-bank* attack-timeout)) + #t + ) + (else + (set-time! (-> self control last-feet-attempt-time)) + #f + ) + ) + ) + +(defbehavior are-still? target () + (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (< (-> self control ctrl-xz-vel) 61440.0) + ) + ) + +(defbehavior vector-local+! target ((arg0 vector) (arg1 vector)) + (let ((s5-0 (new-stack-vector0))) + (vector-matrix*! s5-0 arg1 (-> self control c-R-w)) + (vector+! arg0 arg0 s5-0) + ) + ) + +(defbehavior move-forward target ((arg0 float)) + (let ((a1-0 (new-stack-vector0)) + (gp-0 (new-stack-vector0)) + ) + (set-vector! a1-0 0.0 0.0 arg0 1.0) + (vector-matrix*! gp-0 a1-0 (-> self control c-R-w)) + (vector+! (-> self control transv) (-> self control transv) gp-0) + ) + ) + +(defbehavior set-forward-vel target ((arg0 float)) + (let ((gp-0 (new-stack-vector0))) + (vector-matrix*! gp-0 (-> self control transv) (-> self control w-R-c)) + (set! (-> gp-0 z) arg0) + (set! (-> gp-0 x) 0.0) + (vector-matrix*! (-> self control transv) gp-0 (-> self control c-R-w)) + ) + ) + +(defbehavior delete-back-vel target () + (let ((gp-0 (new-stack-vector0))) + (vector-z-quaternion! gp-0 (-> self control dir-targ)) + (let ((v1-1 (new-stack-vector0)) + (f0-1 (vector-dot gp-0 (-> self control transv))) + ) + 0.0 + (vector-! v1-1 (-> self control transv) (vector-float*! v1-1 gp-0 f0-1)) + (let* ((f1-2 (vector-length v1-1)) + (f2-0 f1-2) + ) + (if (< f0-1 0.0) + (set! f0-1 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) gp-0 f0-1) + (vector-float*! v1-1 v1-1 (/ f1-2 f2-0)) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior set-side-vel target ((arg0 float)) + (let ((gp-0 (new-stack-vector0))) + (vector-matrix*! gp-0 (-> self control transv) (-> self control w-R-c)) + (set! (-> gp-0 x) arg0) + (set! (-> gp-0 z) 0.0) + (vector-matrix*! (-> self control transv) gp-0 (-> self control c-R-w)) + ) + ) + +(defun target-timed-invulnerable ((arg0 time-frame) (arg1 target) (arg2 int)) + (case arg2 + ((1) + (logior! (-> arg1 target-flags) (target-flags tinvuln1)) + (set-time! (-> arg1 control invul1-on-time)) + (set! (-> arg1 control invul1-off-time) arg0) + ) + ((2) + (logior! (-> arg1 target-flags) (target-flags tinvuln2)) + (set-time! (-> arg1 control invul2-on-time)) + (set! (-> arg1 control invul2-off-time) arg0) + ) + ) + (let ((t9-0 (method-of-object (-> arg1 control) collide-shape-method-49))) + 2 + #x8000 + 0 + (t9-0) + ) + (logior! (-> arg1 focus-status) (focus-status ignore)) + 0 + (none) + ) + +(defun target-timed-invulnerable-off ((arg0 target) (arg1 int)) + (let ((v1-0 arg1)) + (cond + ((zero? v1-0) + (logclear! (-> arg0 target-flags) (target-flags tinvuln1 tinvuln2)) + ) + ((= v1-0 1) + (logclear! (-> arg0 target-flags) (target-flags tinvuln1)) + ) + ((= v1-0 2) + (logclear! (-> arg0 target-flags) (target-flags tinvuln2)) + ) + ) + ) + (when (not (logtest? (target-flags tinvuln1 tinvuln2) (-> arg0 target-flags))) + (logclear! (-> arg0 draw status) (draw-control-status no-draw-bounds)) + (let ((t9-0 (method-of-object (-> arg0 control) collide-shape-method-49))) + 2 + 0 + #x8000 + (t9-0) + ) + ) + 0 + (none) + ) + +(defbehavior target-log-attack target ((arg0 attack-info) (arg1 symbol)) + (if (and (= arg1 'background) (= (-> arg0 id) 2)) + (return #t) + ) + (let ((a3-0 (the-as object (-> self attack-info-old)))) + (dotimes (a2-2 8) + (let ((v1-9 (-> self attack-info-old a2-2))) + (when (= (-> arg0 id) (-> v1-9 id)) + (if (not (time-elapsed? (-> v1-9 attack-time) (-> *TARGET-bank* same-attack-invulnerable-timeout))) + (return #f) + ) + (cond + ((= arg1 'test) + ) + (else + (mem-copy! (the-as pointer v1-9) (the-as pointer arg0) 168) + ) + ) + (return #t) + ) + (if (< (-> v1-9 attack-time) (-> (the-as attack-info a3-0) attack-time)) + (set! a3-0 v1-9) + ) + ) + ) + (case arg1 + (('test) + ) + (else + (mem-copy! (the-as pointer a3-0) (the-as pointer arg0) 168) + ) + ) + ) + #t + ) + +(defmethod attack-info-method-9 ((this attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable)) + (local-vars (v1-14 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (if (type? arg1 process-drawable) + arg1 + ) + ) + ) + (let ((v1-0 (if (type? arg2 process-drawable) + arg2 + ) + ) + ) + (cond + ((logtest? (attack-mask attacker-velocity) (-> this mask)) + (set! (-> arg0 attacker-velocity quad) (-> this attacker-velocity quad)) + (vector-normalize-copy! (-> arg0 trans) (-> arg0 attacker-velocity) 1.0) + ) + (v1-0 + (cond + (s5-0 + (vector-! (-> arg0 trans) (-> v1-0 root trans) (-> s5-0 root trans)) + (vector-normalize! (-> arg0 trans) 1.0) + (set! (-> arg0 attacker-velocity quad) (-> arg0 trans quad)) + ) + (else + (vector-z-quaternion! (-> arg0 trans) (-> v1-0 root quat)) + (vector-negate-in-place! (-> arg0 trans)) + (vector-normalize! (-> arg0 trans) 1.0) + (set! (-> arg0 attacker-velocity quad) (-> arg0 trans quad)) + ) + ) + ) + (else + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 attacker-velocity quad) (the-as uint128 0)) + ) + ) + ) + (if s5-0 + (set! (-> arg0 intersection quad) (-> s5-0 root trans quad)) + (set! (-> arg0 intersection quad) (-> (target-pos 0) quad)) + ) + ) + (.lvf vf1 (&-> (-> arg0 trans) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-14 vf1) + (cond + ((!= v1-14 0.0) + (set! (-> arg0 vector quad) (-> arg0 trans quad)) + (set! (-> arg0 vector y) 0.0) + (vector-xz-normalize! (-> arg0 vector) 1.0) + ) + (else + (set! (-> arg0 vector quad) (the-as uint128 0)) + ) + ) + 0 + (none) + ) + ) + +(defmethod compute-intersect-info ((this attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry)) + (when (and arg3 arg1) + (let ((a1-2 (prims-touching? arg3 (the-as collide-shape (-> arg1 root)) (the-as uint -1)))) + (when a1-2 + (get-intersect-point (-> this intersection) a1-2 (the-as collide-shape (-> arg1 root)) arg3) + (logior! (-> this mask) (attack-mask intersection)) + ) + ) + ) + (when arg1 + (set! (-> this prev-state) (-> arg1 state)) + (logior! (-> this mask) (attack-mask prev-state)) + ) + (when (not (logtest? (-> this mask) (attack-mask attacker))) + (set! (-> this attacker) (process->handle arg2)) + (logior! (-> this mask) (attack-mask attacker)) + ) + (when (not (logtest? (-> this mask) (attack-mask attack-time))) + (set! (-> this attack-time) (-> *display* base-clock frame-counter)) + (logior! (-> this mask) (attack-mask attack-time)) + ) + (if (not (logtest? (attack-mask damage) (-> this mask))) + (set! (-> this damage) (-> *FACT-bank* health-default-inc)) + ) + this + ) + +(defmethod combine! ((this attack-info) (arg0 attack-info) (arg1 process-drawable)) + (let ((s4-0 (-> arg0 mask))) + (set! (-> this mask) (-> arg0 mask)) + (if (logtest? s4-0 (attack-mask attacker)) + (set! (-> this attacker) (-> arg0 attacker)) + ) + (if (logtest? s4-0 (attack-mask mode)) + (set! (-> this mode) (-> arg0 mode)) + ) + (if (logtest? s4-0 (attack-mask angle)) + (set! (-> this angle) (-> arg0 angle)) + ) + (if (logtest? s4-0 (attack-mask dist)) + (set! (-> this dist) (-> arg0 dist)) + ) + (if (logtest? s4-0 (attack-mask control)) + (set! (-> this control) (-> arg0 control)) + ) + (if (logtest? s4-0 (attack-mask speed)) + (set! (-> this speed) (-> arg0 speed)) + ) + (if (logtest? (attack-mask penetrate-using) s4-0) + (set! (-> this penetrate-using) (-> arg0 penetrate-using)) + ) + (if (logtest? (attack-mask damage) s4-0) + (set! (-> this damage) (-> arg0 damage)) + ) + (if (logtest? (attack-mask shield-damage) s4-0) + (set! (-> this shield-damage) (-> arg0 shield-damage)) + ) + (if (logtest? (attack-mask knock) s4-0) + (set! (-> this knock) (-> arg0 knock)) + ) + (if (logtest? (attack-mask count) s4-0) + (set! (-> this count) (-> arg0 count)) + ) + (if (logtest? s4-0 (attack-mask id)) + (set! (-> this id) (-> arg0 id)) + ) + (if (logtest? s4-0 (attack-mask shove-back)) + (set! (-> this shove-back) (-> arg0 shove-back)) + ) + (if (logtest? s4-0 (attack-mask shove-up)) + (set! (-> this shove-up) (-> arg0 shove-up)) + ) + (if (logtest? s4-0 (attack-mask invinc-time)) + (set! (-> this invinc-time) (-> arg0 invinc-time)) + ) + (if (logtest? s4-0 (attack-mask rotate-to)) + (set! (-> this rotate-to) (-> arg0 rotate-to)) + ) + (if (logtest? s4-0 (attack-mask intersection)) + (set! (-> this intersection quad) (-> arg0 intersection quad)) + ) + (if (logtest? (attack-mask attacker-velocity) s4-0) + (set! (-> this attacker-velocity quad) (-> arg0 attacker-velocity quad)) + ) + (cond + ((not (logtest? s4-0 (attack-mask vector))) + (let* ((s2-0 (handle->process (-> this attacker))) + (v1-65 (if (type? s2-0 process-drawable) + (the-as process-drawable s2-0) + ) + ) + ) + (when (and v1-65 (nonzero? (-> v1-65 root))) + (set! (-> this trans quad) (-> v1-65 root trans quad)) + (vector-! (-> this vector) (-> arg1 root trans) (-> v1-65 root trans)) + (logior! (-> this mask) (attack-mask vector)) + ) + ) + ) + (else + (let* ((s3-1 (handle->process (-> this attacker))) + (v1-72 (if (type? s3-1 process-drawable) + (the-as process-drawable s3-1) + ) + ) + ) + (if (and v1-72 (nonzero? (-> v1-72 root))) + (set! (-> this trans quad) (-> v1-72 root trans quad)) + ) + ) + (set! (-> this vector quad) (-> arg0 vector quad)) + (when (not (logtest? s4-0 (attack-mask shove-back))) + (let ((v1-79 (-> this vector))) + (set! (-> this shove-back) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z))))) + ) + ) + (if (not (logtest? s4-0 (attack-mask shove-up))) + (set! (-> this shove-up) (-> this vector y)) + ) + ) + ) + (if (not (logtest? (-> this mask) (attack-mask dist))) + (set! (-> this dist) (fabs (-> this shove-back))) + ) + (if (logtest? s4-0 (attack-mask trans)) + (set! (-> this trans quad) (-> arg0 trans quad)) + ) + ) + this + ) + +(defbehavior ground-tween-initialize target ((arg0 ground-tween-info) + (arg1 uint) + (arg2 uint) + (arg3 uint) + (arg4 uint) + (arg5 uint) + (arg6 uint) + (arg7 float) + ) + (set! (-> arg0 group 0) arg2) + (set! (-> arg0 group 1) arg3) + (set! (-> arg0 group 2) arg4) + (set! (-> arg0 group 3) arg5) + (set! (-> arg0 group 4) arg6) + (dotimes (s2-0 3) + (set! (-> arg0 chan s2-0) (+ arg1 s2-0)) + (let ((s1-0 (-> self skel root-channel (-> arg0 chan s2-0)))) + (let ((f0-1 (fabs (-> arg0 blend s2-0)))) + (set! (-> s1-0 frame-interp 1) f0-1) + (set! (-> s1-0 frame-interp 0) f0-1) + ) + (joint-control-channel-group-eval! s1-0 (the-as art-joint-anim arg2) num-func-identity) + (set! (-> s1-0 frame-num) arg7) + ) + ) + arg0 + ) + +(defbehavior ground-tween-update target ((arg0 ground-tween-info) (arg1 float) (arg2 float) (arg3 float)) + (let ((f0-1 (fmax -1.0 (fmin 1.0 arg1))) + (f30-0 (fmax -1.0 (fmin 1.0 arg2))) + ) + (let ((f1-5 (fabs (- f0-1 (-> arg0 blend 1))))) + (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + ) + (let ((f0-9 (fabs (- f30-0 (-> arg0 blend 2))))) + (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + ) + ) + (cond + ((>= (-> arg0 blend 1) 0.0) + (let ((v1-12 (-> self skel root-channel (-> arg0 chan 1)))) + (let ((f0-16 (fabs (-> arg0 blend 1)))) + (set! (-> v1-12 frame-interp 1) f0-16) + (set! (-> v1-12 frame-interp 0) f0-16) + ) + (set! (-> v1-12 frame-group) (the-as art-joint-anim (-> arg0 group 1))) + ) + ) + (else + (let ((v1-15 (-> self skel root-channel (-> arg0 chan 1)))) + (let ((f0-18 (fabs (-> arg0 blend 1)))) + (set! (-> v1-15 frame-interp 1) f0-18) + (set! (-> v1-15 frame-interp 0) f0-18) + ) + (set! (-> v1-15 frame-group) (the-as art-joint-anim (-> arg0 group 2))) + ) + ) + ) + (cond + ((>= (-> arg0 blend 2) 0.0) + (let ((v1-18 (-> self skel root-channel (-> arg0 chan 2)))) + (let ((f0-21 (fabs (-> arg0 blend 2)))) + (set! (-> v1-18 frame-interp 1) f0-21) + (set! (-> v1-18 frame-interp 0) f0-21) + ) + (set! (-> v1-18 frame-group) (the-as art-joint-anim (-> arg0 group 4))) + ) + ) + (else + (let ((v1-21 (-> self skel root-channel (-> arg0 chan 2)))) + (let ((f0-23 (fabs (-> arg0 blend 2)))) + (set! (-> v1-21 frame-interp 1) f0-23) + (set! (-> v1-21 frame-interp 0) f0-23) + ) + (set! (-> v1-21 frame-group) (the-as art-joint-anim (-> arg0 group 3))) + ) + ) + ) + 0 + (none) + ) + +(defun target-pos ((arg0 int)) + (let ((a1-0 *target*)) + (cond + (a1-0 + (if (zero? arg0) + (-> a1-0 control trans) + (vector<-cspace! (new 'static 'vector) (-> a1-0 node-list data arg0)) + ) + ) + (else + (camera-pos) + ) + ) + ) + ) + +(defun target-cam-pos () + (let ((gp-0 *target*)) + (cond + ((not gp-0) + (camera-pos) + ) + ((logtest? (-> gp-0 target-flags) (target-flags tf6)) + (add-debug-sphere + *display-camera-marks* + (bucket-id debug-no-zbuf1) + (-> gp-0 alt-cam-pos) + (meters 0.2) + (new 'static 'rgba :r #xff :a #x80) + ) + (-> gp-0 alt-cam-pos) + ) + ((logtest? (-> gp-0 target-flags) (target-flags tf12)) + (add-debug-sphere + *display-camera-marks* + (bucket-id debug-no-zbuf1) + (-> gp-0 alt-cam-pos) + (meters 0.2) + (new 'static 'rgba :r #xff :a #x80) + ) + (-> gp-0 alt-cam-pos) + ) + ((logtest? (-> gp-0 target-flags) (target-flags tf14)) + (let ((s5-0 (new 'static 'vector))) + (set! (-> s5-0 quad) (-> gp-0 control camera-pos quad)) + (set! (-> s5-0 y) (fmax (-> s5-0 y) (-> gp-0 alt-cam-pos y))) + (add-debug-sphere + *display-camera-marks* + (bucket-id debug-no-zbuf1) + s5-0 + (meters 0.2) + (new 'static 'rgba :r #xff :a #x80) + ) + s5-0 + ) + ) + (else + (add-debug-sphere + *display-camera-marks* + (bucket-id debug-no-zbuf1) + (-> gp-0 control camera-pos) + (meters 0.2) + (new 'static 'rgba :r #xff :b #xff :a #x80) + ) + (-> gp-0 control camera-pos) + ) + ) + ) + ) + +(defun target-rot () + (let ((v1-0 *target*)) + (if v1-0 + (-> v1-0 control quat-for-control) + *unity-quaternion* + ) + ) + ) + +(defmethod get-trans ((this target) (arg0 int)) + "Get the `trans` for this process." + (local-vars (v0-0 vector)) + (let ((v1-0 (-> this control))) + (cond + ((zero? arg0) + (-> v1-0 trans) + ) + ((= arg0 1) + (let ((a1-2 (-> this water flags))) + (cond + ((and (logtest? (water-flag touch-water) a1-2) + (logtest? (water-flag under-water swimming) a1-2) + (not (logtest? (focus-status mech) (-> this focus-status))) + ) + (set! v0-0 (new 'static 'vector :w 1.0)) + (set! (-> v0-0 quad) (-> this control trans quad)) + (set! (-> v0-0 y) (-> this water height)) + v0-0 + ) + (else + (-> v1-0 gspot-pos) + ) + ) + ) + ) + ((= arg0 2) + (if (logtest? (-> this draw status) (draw-control-status no-draw no-draw-temp)) + (-> v1-0 trans) + (vector<-cspace! (new 'static 'vector) (-> this node-list data 8)) + ) + ) + ((= arg0 3) + (cond + ((logtest? (-> this draw status) (draw-control-status no-draw no-draw-temp)) + (set! v0-0 (new 'static 'vector)) + (set! (-> v0-0 quad) (-> v1-0 trans quad)) + (vector+float*! v0-0 v0-0 (-> this control local-normal) 8192.0) + ) + (else + (set! v0-0 (vector<-cspace! (new 'static 'vector) (-> this node-list data 6))) + (set! (-> v0-0 w) 4096.0) + ) + ) + v0-0 + ) + ((= arg0 4) + (target-cam-pos) + ) + ((= arg0 5) + (if (= (-> this draw origin w) 0.0) + (-> v1-0 trans) + (-> this draw origin) + ) + ) + ((= arg0 6) + (let ((f0-5 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) + (cond + ((and (< 0.0 f0-5) (focus-test? this in-air)) + (let* ((v0-1 (new 'static 'vector)) + (f0-6 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-5)) + (f0-9 (/ (* 0.5 f0-6 f0-6) (-> v1-0 dynam gravity-length))) + ) + (vector+float*! v0-1 (-> v1-0 trans) (-> v1-0 dynam gravity-normal) f0-9) + ) + ) + (else + (-> v1-0 trans) + ) + ) + ) + ) + ((= arg0 7) + (-> v1-0 last-trans-on-ground) + ) + ((= arg0 8) + (-> v1-0 last-trans-leaving-surf) + ) + (else + (-> v1-0 trans) + ) + ) + ) + ) + +(defmethod time-to-apex-or-ground ((this target) (arg0 int)) + (let ((v1-0 (-> this control))) + (cond + ((zero? arg0) + (let ((f0-1 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) + (if (and (< 0.0 f0-1) (focus-test? this in-air)) + (time-to-apex f0-1 (- (-> v1-0 dynam gravity-length))) + 0 + ) + ) + ) + ((= arg0 1) + (if (focus-test? this in-air) + (the-as int (target-time-to-ground)) + 0 + ) + ) + (else + 0 + ) + ) + ) + ) + +(defmethod get-quat ((this target) (arg0 int)) + "Get the quaternion for this process." + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (-> this control quat) + ) + ((= v1-0 1) + (-> this control quat-for-control) + ) + ((= v1-0 2) + (-> this control dir-targ) + ) + ((= v1-0 3) + (if (using-gun? this) + (forward-up->quaternion + (new 'static 'quaternion) + (-> this gun fire-dir-out) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this control quat-for-control)) + ) + (-> this control quat) + ) + ) + (else + (-> this control quat) + ) + ) + ) + ) + +;; WARN: Return type mismatch float vs meters. +(defmethod get-water-height ((this target)) + (the-as meters (if (logtest? (-> this water flags) (water-flag active)) + (-> this water surface-height) + (-> this control trans y) + ) + ) + ) + +(defmethod get-notice-time ((this target)) + (-> this neck notice-time) + ) + +(defun external-target-spawn ((arg0 vector) (arg1 quaternion) (arg2 process) (arg3 symbol) (arg4 manipy-options)) + (local-vars + (v1-5 symbol) + (sv-96 process) + (sv-112 (function vector entity-actor skeleton-group vector manipy-options none :behavior manipy)) + (sv-128 entity-actor) + ) + (let* ((s1-0 (get-process *default-dead-pool* manipy #x20000 1)) + (s5-0 (when s1-0 + (let ((t9-1 (method-of-type manipy activate))) + (t9-1 (the-as manipy s1-0) arg2 "manipy" (the-as pointer #x70004000)) + ) + (let ((s5-1 run-function-in-process)) + (set! sv-96 s1-0) + (set! sv-112 manipy-init) + (set! v1-5 (when (not (logtest? (-> arg2 mask) (process-mask process-tree))) + (set! sv-128 (the-as entity-actor v1-5)) + (set! sv-128 (-> arg2 entity)) + v1-5 + ) + ) + (let ((t0-1 (target-skel-group)) + (t1-0 (if (logtest? arg4 (manipy-options mo3)) + (the-as vector #f) + (new 'static 'vector :y 2867.2 :w 3276.8) + ) + ) + (t2-0 2) + ) + ((the-as (function object object object object object object object none) s5-1) + sv-96 + sv-112 + arg0 + sv-128 + t0-1 + t1-0 + t2-0 + ) + ) + ) + (-> s1-0 ppointer) + ) + ) + ) + (when s5-0 + (cond + ((logtest? arg4 (manipy-options mo2)) + (send-event (ppointer->process s5-0) 'anim-mode 'still) + (send-event (ppointer->process s5-0) 'art-joint-anim "pilot-wcar-turn-back" 0 #x40a00000) + ) + (else + (send-event (ppointer->process s5-0) 'anim-mode 'loop) + (send-event (ppointer->process s5-0) 'art-joint-anim "duck-stance") + ) + ) + (send-event + (ppointer->process s5-0) + 'eval + (lambda :behavior target + () + (logior! (-> self control root-prim prim-core action) (collide-action solid)) + (none) + ) + ) + (send-event (ppointer->process s5-0) 'user-data arg3) + (cond + ((logtest? arg4 (manipy-options mo1)) + (send-event + (ppointer->process s5-0) + 'trans-hook + (lambda :behavior manipy + () + (target-update-segs self) + (if (and (and *target* + (and (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (and (focus-test? *target* indax) + (not (focus-test? *target* in-head pole light board mech dark teleporting)) + (>= (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) + (= (-> *setting-control* user-current bg-a) 0.0) + (send-event *target* 'end-mode 'indax) + ) + ) + (script-eval (the-as pair (-> self userdata))) + ) + (none) + ) + ) + ) + ((logtest? arg4 (manipy-options mo0)) + (send-event + (ppointer->process s5-0) + 'trans-hook + (lambda :behavior manipy + () + (target-update-segs self) + (when (and (and *target* (and (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (focus-test? *target* indax) + (not (focus-test? *target* in-head pole light board mech dark teleporting)) + (can-display-query? self "indax" -99.0) + ) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((v1-14 gp-0)) + (set! (-> v1-14 width) (the float 340)) + ) + (let ((v1-15 gp-0)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-0) + (a0-13 (-> *setting-control* user-default language)) + ) + (set! (-> v1-16 scale) (if (or (= a0-13 (language-enum korean)) (= a0-13 (language-enum russian))) + 0.9 + 0.7 + ) + ) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text (lookup-text! *common-text* (text-id text-0083) #f) gp-0 #f 44 (bucket-id bucket579)) + ) + (if (and (cpad-pressed? 0 triangle) (send-event *target* 'end-mode 'indax)) + (script-eval (the-as pair (-> self userdata))) + ) + ) + (none) + ) + ) + ) + ((logtest? arg4 (manipy-options mo2)) + (send-event + (ppointer->process s5-0) + 'trans-hook + (lambda :behavior target + () + (target-update-segs self) + (set! (-> self control trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) + (quaternion-copy! (-> self control quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) + (none) + ) + ) + ) + (else + (send-event + (ppointer->process s5-0) + 'trans-hook + (lambda :behavior target () (target-update-segs self) (none)) + ) + ) + ) + (quaternion-copy! (-> (the-as process-drawable (-> s5-0 0)) root quat) arg1) + ) + s5-0 + ) + ) + +(defun target-reset-on-task-finish () + (when *target* + (set! (-> *target* fact health) (-> *target* fact health-max)) + (if (using-gun? *target*) + (send-event *target* 'end-mode 'gun) + ) + ) + (hide-hud 'hud-health) + (hide-hud 'hud-gun) + (set! (-> *game-info* gun-ammo 0) (fmax (-> *game-info* gun-ammo 0) (-> *FACT-bank* ammo-yellow-start))) + (set! (-> *game-info* gun-ammo 1) (fmax (-> *game-info* gun-ammo 1) (-> *FACT-bank* ammo-red-start))) + (set! (-> *game-info* gun-ammo 2) (fmax (-> *game-info* gun-ammo 2) (-> *FACT-bank* ammo-blue-start))) + (set! (-> *game-info* gun-ammo 3) (fmax (-> *game-info* gun-ammo 3) (-> *FACT-bank* ammo-dark-start))) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/target/target.gc b/goal_src/jak3/engine/target/target.gc index cac861a15b7..7249057c9bb 100644 --- a/goal_src/jak3/engine/target/target.gc +++ b/goal_src/jak3/engine/target/target.gc @@ -7,3 +7,4228 @@ ;; DECOMP BEGINS +(defbehavior target-falling-trans target ((arg0 symbol) (arg1 time-frame) (arg2 symbol)) + (set! arg2 (and (cpad-pressed? (-> self control cpad number) circle) (and (can-feet? #f) arg2))) + (if arg2 + (go target-attack-air #f) + ) + (when (= arg0 'target-eco-powerup) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (not (logtest? (water-flag touch-water) (-> self water flags))) + (not (time-elapsed? (-> self state-time) (seconds 3))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + (target-jump-go) + ) + ) + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-hit-ground #f) + ) + (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (>= arg1 0) + (time-elapsed? (-> self state-time) arg1) + (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) + ) + #t + ) + (logior! (-> self control status) (collide-status on-surface)) + (go target-hit-ground 'stuck) + ) + (when (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (the-as game-feature (logand (game-feature lightjak-regen) (-> *setting-control* user-current features))) + (-> self game features) + ) + (and (< (-> self fact health) (-> self fact health-max)) (zero? (-> self lightjak latch-out-time))) + ) + ) + (set! (-> self lightjak lightjak-before-powerjak) #t) + (go target-lightjak-regen 0) + ) + (if (!= (-> self state-time) (current-time)) + (slide-down-test) + ) + 0 + (none) + ) + +(defstate target-startup (target) + :event target-standard-event-handler + :code (behavior () + (suspend) + (suspend) + (go target-stance) + ) + :post target-no-move-post + ) + +(defstate target-stance (target) + :event target-standard-event-handler + :enter (behavior () + (set! (-> self control mod-surface) *walk-mods*) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control bend-target) 0.0) + (target-state-hook-exit) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (logtest? (water-flag wading) (-> self water flags)) (not (using-gun? self))) + (go target-wade-stance) + ) + (when (= (-> self control ground-pat material) (pat-material ice)) + (set! (-> self control bend-target) 0.0) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (remove-exit) + (go target-ice-stance) + ) + (when (move-legs?) + (set! (-> self control bend-target) 0.0) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (remove-exit) + (go target-walk) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) r1) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (= (-> self ext-anim) (target-anim dark)) + (logtest? (the-as game-feature (logand (game-feature darkjak-smack) (-> *setting-control* user-current features))) + (-> self game features) + ) + (can-hands? #t) + ) + (go target-darkjak-smack-charge) + ) + (when (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-secrets button-invis) (-> self game secrets)) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (not (logtest? (target-flags invisible) (-> self target-flags))) + (>= (-> self game eco-pill-dark) (-> *FACT-bank* darkjak-button-invis-inc)) + ) + (target-invisible-start (seconds 30)) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-button-invis-inc))) + ) + ) + (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (set! (-> self control bend-target) 0.0) + (remove-exit) + (go target-duck-stance #f) + ) + (when (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-feature lightjak-regen) (-> self game features)) + (and (< (-> self fact health) (-> self fact health-max)) (zero? (-> self lightjak latch-out-time))) + ) + ) + (set! (-> self lightjak lightjak-before-powerjak) #t) + (go target-lightjak-regen 0) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (if (and (using-gun? self) + (and (-> self next-state) (= (-> self next-state name) 'target-stance)) + (let ((v1-163 (ja-group))) + (and v1-163 (or (= v1-163 jakb-stance-loop-ja) (= v1-163 jakb-lightjak-stance-ja))) + ) + ) + (go target-gun-stance) + ) + (if (and (logtest? (game-feature feature19) (-> self game features)) + (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons r1) + ) + ) + (go target-carry-pickup) + ) + (slide-down-test) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + ) + :code target-stance-anim + :post target-post + ) + +(defstate target-walk (target) + :event target-walk-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *walk-mods*) + ) + :exit (behavior () + (target-effect-exit) + (target-state-hook-exit) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (using-gun? self) + (and (-> self next-state) (= (-> self next-state name) 'target-walk)) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + ) + (go target-gun-walk) + ) + (when (= (-> self control ground-pat material) (pat-material ice)) + (target-effect-exit) + (remove-exit) + (go target-ice-walk) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons l1) + ) + (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (can-roll?)) + ) + (go target-roll) + ) + (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (target-effect-exit) + (remove-exit) + (go target-duck-walk #f) + ) + (when (not (move-legs?)) + (target-effect-exit) + (remove-exit) + (go target-stance) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) r1) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (= (-> self ext-anim) (target-anim dark)) + (logtest? (the-as game-feature (logand (game-feature darkjak-smack) (-> *setting-control* user-current features))) + (-> self game features) + ) + (can-hands? #t) + ) + (go target-darkjak-smack-charge) + ) + (when (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-secrets button-invis) (-> self game secrets)) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (not (logtest? (target-flags invisible) (-> self target-flags))) + (>= (-> self game eco-pill-dark) (-> *FACT-bank* darkjak-button-invis-inc)) + ) + (target-invisible-start (seconds 30)) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-button-invis-inc))) + ) + ) + (when (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-feature lightjak-regen) (-> self game features)) + (and (< (-> self fact health) (-> self fact health-max)) (zero? (-> self lightjak latch-out-time))) + ) + ) + (set! (-> self lightjak lightjak-before-powerjak) #t) + (go target-lightjak-regen 0) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (when (and (turn-around?) (time-elapsed? (-> self state-time) (seconds 0.3))) + (set! (-> self control transv quad) + (-> self control transv-history (-> self control idx-of-fastest-xz-vel) quad) + ) + (set! (-> self control transv w) 1.0) + (go target-turn-around) + ) + (if (and (logtest? (game-feature feature19) (-> self game features)) + (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons r1) + ) + ) + (go target-carry-pickup) + ) + (if (wall-hide?) + (go target-hide) + ) + (slide-down-test) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + ) + :code (behavior () + (target-walk-anim -300) + ) + :post target-post + ) + +(defstate target-turn-around (target) + :event target-standard-event-handler + :enter (behavior () + (vector-turn-to (-> self control transv)) + (set! (-> self control mod-surface) *turn-around-mods*) + (set! (-> self control bend-target) 1.0) + ) + :exit (behavior () + (target-state-hook-exit) + (set-forward-vel 0.0) + (set! (-> self control ctrl-xz-vel) 0.0) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set! (-> self control bend-target) 0.0) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #t)) + (go target-attack) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t)) + (go target-running-attack) + ) + (if (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (seconds 0.08)) + ) + (go target-falling #f) + ) + (slide-down-test) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! jakb-turn-around-ja :num! min) + (quaternion-rotate-y! (-> self control dir-targ) (-> self control dir-targ) 32768.0) + (compute-alignment! (-> self align)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 2.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + ) + (remove-exit) + (set! (-> self control bend-target) 0.0) + (set! (-> self control ctrl-xz-vel) (* 40960.0 (-> self darkjak-giant-interp))) + (set-forward-vel (-> self control ctrl-xz-vel)) + (target-state-hook-exit) + (go target-walk) + ) + :post target-no-stick-post + ) + +(defstate target-slide-down (target) + :event target-walk-event-handler + :enter (behavior () + (set! (-> self control mod-surface) *jump-mods*) + ) + :exit (behavior () + (set-time! (-> self control unknown-time-frame13)) + ) + :trans (behavior () + (when (or (logtest? (-> self control status) (collide-status on-surface)) + (if (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + #t + ) + ) + (logior! (-> self control status) (collide-status on-surface)) + (if (using-gun? self) + (go target-stance) + (go target-duck-stance #f) + ) + ) + ) + :code (behavior () + (cond + ((= (-> self ext-anim) (target-anim default)) + (let ((v1-3 (ja-group))) + (if (not (and v1-3 (= v1-3 jakb-duck-stance-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (until #f + (ja-no-eval :group! jakb-duck-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + (else + (let ((v1-34 (ja-group))) + (if (not (and v1-34 (= v1-34 jakb-jump-loop-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (until #f + (ja-no-eval :group! jakb-jump-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + ) + :post target-post + ) + +(define *slide-down-mods* (new 'static 'surface + :name 'run + :turnv 131072.0 + :turnvf 60.0 + :turnvv 524288.0 + :turnvvf 30.0 + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 81920.0 + :target-speed 81920.0 + :seek0 0.4 + :seek90 0.4 + :seek180 0.4 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags (surface-flag no-turn-around) + ) + ) + +(define *slide-jump-mods* (new 'static 'surface + :name 'jump + :turnv 32768.0 + :turnvf 300.0 + :turnvv 18204.445 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.05 + :seek90 0.05 + :seek180 0.05 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +(defstate target-slide-down-to-ground (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('slide) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *slide-down-mods*) + (set! (-> self control sliding-start-time) 0) + (set! (-> self control force-turn-to-strength) 1.0) + (set! (-> self control force-turn-to-speed) 1.0) + ) + :exit (behavior () + (target-effect-exit) + (target-exit) + (set-time! (-> self control unknown-time-frame13)) + ) + :trans (behavior () + (if (and (or (and (logtest? (-> self control status) (collide-status on-surface)) + (and (< 0.9 (-> self control surface-angle)) + (!= (-> self control cur-pat material) 14) + (!= (-> self control cur-pat event) 7) + (!= (-> self control cur-pat event) 14) + (or (= (-> self control cur-pat mode) (pat-mode ground)) + (= (-> self control cur-pat mode) (pat-mode halfpipe)) + ) + ) + ) + (if (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + #t + ) + ) + (zero? (-> self control sliding-start-time)) + ) + (set-time! (-> self control sliding-start-time)) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + (!= (-> self state-time) (current-time)) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control force-turn-to-direction) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) + ) + (vector-normalize-copy! (-> self control transv) (-> self control force-turn-to-direction) 40960.0) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) *slide-jump-mods*) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + (!= (-> self state-time) (current-time)) + ) + (go target-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + (time-elapsed? (-> self control last-running-attack-end-time) (seconds 0.7)) + (!= (-> self state-time) (current-time)) + ) + (go target-running-attack) + ) + (when (= (-> self control force-turn-to-strength) 0.0) + (logior! (-> self control status) (collide-status on-surface)) + (if (using-gun? self) + (go target-stance) + (go target-duck-stance #f) + ) + ) + (set! (-> self control ctrl-xz-vel) (* 40960.0 (-> self darkjak-giant-interp))) + ) + :code (-> target-walk code) + :post (behavior () + (cond + ((zero? (-> self control sliding-start-time)) + (vector-normalize! + (vector-flatten! + (-> self control force-turn-to-direction) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal)) + (-> self control surface-normal) + ) + 1.0 + ) + (if (< 0.0 + (vector-dot + (-> self control force-turn-to-direction) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control force-turn-to-direction) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control force-turn-to-direction)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + ) + ) + ((nonzero? (-> self control sliding-start-time)) + (seek! (-> self control force-turn-to-strength) 0.0 (* 4.0 (seconds-per-frame))) + ) + ) + (set! (-> self control turn-lockout-end-time) (+ (current-time) (seconds 0.1))) + (target-post) + ) + ) + +(defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 symbol) (arg3 symbol) (arg4 vector) (arg5 float)) + (logclear! (-> self control status) (collide-status touch-ceiling-sticky)) + (set-time! (-> self control unknown-time-frame19)) + (delete-back-vel) + (let* ((f0-0 arg5) + (f1-0 0.0) + (f2-2 (+ (* 0.0016666667 (-> self control dynam gravity-length)) + (fmax 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + ) + (f0-1 (* f0-0 (fmax f1-0 (/ (* 0.5 f2-2 f2-2) (-> self control dynam gravity-length))))) + (s5-1 (+ arg0 f0-1)) + ) + (let ((s2-1 (+ arg1 f0-1))) + (when (not (time-elapsed? (-> self control rider-time) (seconds 0.05))) + (let ((f0-4 + (fmax + 0.0 + (fmin 28672.0 (* 0.5 (vector-dot (-> self control dynam gravity-normal) (-> self control rider-last-move)))) + ) + ) + ) + (set! s5-1 (+ s5-1 f0-4)) + (set! s2-1 (+ s2-1 f0-4)) + ) + (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) + ) + (set! (-> self control unknown-float36) 0.0) + (set! (-> self control unknown-float37) 0.0) + (cond + (arg3 + (set! (-> self control unknown-word04) + (the-as uint (- s5-1 (+ -409.6 (-> *TARGET-bank* jump-collide-offset)))) + ) + (set! (-> self control did-move-to-pole-or-max-jump-height) (- s2-1 (-> *TARGET-bank* jump-collide-offset))) + ) + (else + (set! (-> self control unknown-word04) (the-as uint s5-1)) + (set! (-> self control did-move-to-pole-or-max-jump-height) s2-1) + ) + ) + ) + (when arg2 + (- (sqrtf (* 2.0 (-> self control dynam gravity-length) s5-1)) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + (new 'stack-no-clear 'vector) + (let ((v1-55 (new-stack-vector0))) + (let ((f0-20 (vector-dot (-> self control dynam gravity-normal) arg4))) + 0.0 + (vector-! v1-55 arg4 (vector-float*! v1-55 (-> self control dynam gravity-normal) f0-20)) + ) + (let* ((f0-21 (vector-length v1-55)) + (f1-18 f0-21) + (f2-15 + (- (sqrtf (* 2.0 (-> self control dynam gravity-length) s5-1)) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + arg4 + (vector-float*! arg4 (-> self control dynam gravity-normal) f2-15) + (vector-float*! v1-55 v1-55 (/ f0-21 f1-18)) + ) + ) + ) + ) + ) + (let ((v0-2 (-> self control unknown-vector37))) + (set! (-> v0-2 quad) (-> self control trans quad)) + v0-2 + ) + ) + +(defbehavior mod-var-jump target ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 vector)) + (local-vars (v0-1 vector)) + (let ((f0-1 (* 0.033333335 (the float (- (current-time) (-> self state-time)))))) + (cond + ((or (< 1.0 f0-1) (< (-> self control unknown-float36) 0.0) (not arg2)) + (set! (-> self control unknown-float36) -1.0) + ) + (else + (set! (-> self control unknown-float36) f0-1) + (set! (-> self control unknown-float37) f0-1) + (when arg0 + (let ((s3-1 (vector-! (new-stack-vector0) (-> self control trans) (-> self control unknown-vector37))) + (s4-0 (new-stack-vector0)) + ) + (let ((f1-5 (vector-dot (-> self control dynam gravity-normal) arg3))) + 0.0 + (vector-! s4-0 arg3 (vector-float*! s4-0 (-> self control dynam gravity-normal) f1-5)) + ) + (let* ((f30-0 (vector-length s4-0)) + (f28-0 f30-0) + (f0-7 + (- (sqrtf + (* 2.0 + (-> self control dynam gravity-length) + (- (lerp-scale + (the-as float (-> self control unknown-word04)) + (-> self control did-move-to-pole-or-max-jump-height) + f0-1 + 0.0 + 1.0 + ) + (vector-dot (-> self control dynam gravity-normal) s3-1) + ) + ) + ) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + arg3 + (vector-float*! arg3 (-> self control dynam gravity-normal) f0-7) + (vector-float*! s4-0 s4-0 (/ f30-0 f28-0)) + ) + ) + ) + ) + ) + ) + ) + 0 + (when (and arg1 (ja-group) (and (-> (ja-group) extra) #t)) + (let ((v1-57 (res-lump-struct (-> (ja-group) extra) 'collide-offset vector :time (ja-aframe-num 0)))) + (cond + (v1-57 + (set! v0-1 (-> self control anim-collide-offset-local)) + (set! (-> v0-1 quad) (-> v1-57 quad)) + ) + (else + (set! v0-1 (-> self control anim-collide-offset-local)) + (set! (-> v0-1 quad) (the-as uint128 0)) + ) + ) + ) + v0-1 + ) + ) + +(define *duck-mods* + (new 'static 'surface + :name 'duck + :turnv 131072.0 + :turnvf 30.0 + :turnvv 524288.0 + :turnvvf 30.0 + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 16384.0 + :target-speed 16384.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (surface-clamp-speed arg0 arg1 arg2 arg3) + (when (= arg3 1) + (cond + ((or (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (using-gun? self) (= (gun->eco (-> self gun gun-type)) (pickup-type eco-blue))) + ) + (set! (-> arg0 target-speed) 0.0) + (set! (-> arg0 seek0) 0.0) + (set! (-> arg0 seek90) 0.0) + (set! (-> arg0 seek180) 0.0) + (set! (-> arg0 turnv) 0.0) + (set! (-> arg0 turnvv) 0.0) + ) + (else + (set! (-> arg0 target-speed) 16384.0) + ) + ) + ) + ) + :flags (surface-flag duck) + ) + ) + +(defstate target-duck-stance (target) + :event target-standard-event-handler + :enter (behavior ((arg0 symbol)) + (if (not arg0) + (set-time! (-> self state-time)) + ) + (set! (-> self control bend-target) 1.0) + (set! (-> self control mod-surface) *duck-mods*) + (target-collide-set! 'duck 1.0) + (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) + 0 + ) + :exit (behavior () + (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-duck-walk) + (= v1-3 'target-duck-stance) + (= v1-3 'target-walk) + (= v1-3 'target-stance) + (= v1-3 'target-stance-look-around) + ) + ) + ) + ) + (target-state-hook-exit) + ) + (target-exit) + (if (= (-> self control collide-mode) 'duck) + (target-collide-set! 'normal 0.0) + ) + ) + :trans (behavior () + ((-> self state-hook)) + (if (or (and (or (not (cpad-hold? (-> self control cpad number) l1)) + (logtest? (-> self target-flags) (target-flags prevent-duck)) + ) + (let ((v1-13 (ja-group))) + (and (not (and v1-13 (or (= v1-13 jakb-duck-roll-end-ja) + (= v1-13 jakb-duck-roll-ja) + (= v1-13 jakb-gun-duck-roll-end-ja) + (= v1-13 jakb-gun-duck-roll-ja) + ) + ) + ) + (can-exit-duck? self) + ) + ) + ) + (and (nonzero? (-> self ext-anim)) (!= (-> self ext-anim) 2)) + ) + (go target-stance) + ) + (if (and (move-legs?) (and (!= (-> self control current-surface seek0) 0.0) (zero? (-> self ext-anim)))) + (go target-duck-walk 'duck) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) r1) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (= (-> self ext-anim) (target-anim dark)) + (logtest? (the-as game-feature (logand (game-feature darkjak-smack) (-> *setting-control* user-current features))) + (-> self game features) + ) + (can-hands? #t) + ) + (go target-darkjak-smack-charge) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck) + (target-jump-go) + ) + ) + (when (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t)) + (if (and (can-exit-duck? self) + (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + ) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + (slide-down-test) + ) + :code (behavior ((arg0 symbol)) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 jakb-duck-roll-ja) (= v1-2 jakb-gun-duck-roll-ja))) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (cond + ((using-gun? self) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.7))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-duck-roll-end-ja) + 0.0 + 0 + 30 + 1.0 + 6.0 + #f + ) + (ja-no-eval :group! jakb-gun-duck-roll-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-duck-roll-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (set! (-> self neck flex-blend) 1.0) + (set! (-> self neck base-joint) (the-as uint 6)) + ) + ((let ((v1-68 (ja-group))) + (and (and v1-68 (= v1-68 jakb-duck-stance-ja)) (= (-> self skel root-channel 0) (-> self skel channel))) + ) + ) + ((let ((v1-78 (ja-group))) + (and v1-78 (or (= v1-78 jakb-duck-walk-ja) (= v1-78 jakb-gun-duck-walk-ja))) + ) + (ja-channel-push! 1 (seconds 0.1)) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 473) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= (-> self ext-anim) (target-anim default)) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! jakb-stance-to-duck-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (go target-stance) + ) + ) + ) + (until #f + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-no-eval :group! (-> self draw art-group data 474) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-duck-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + ) + :post target-post + ) + +(defstate target-duck-walk (target) + :event target-standard-event-handler + :enter (behavior ((arg0 symbol)) + (let ((gp-0 arg0)) + (if (nonzero? (-> self ext-anim)) + (go target-duck-stance arg0) + ) + (if (not gp-0) + (set-time! (-> self state-time)) + ) + ) + (set! (-> self control bend-target) 1.0) + (target-collide-set! 'duck 1.0) + (let ((v1-11 (ja-group))) + (if (not (and v1-11 (or (= v1-11 jakb-duck-roll-ja) (= v1-11 jakb-gun-duck-roll-ja)))) + (set! (-> self control mod-surface) *duck-mods*) + ) + ) + ) + :exit (-> target-duck-stance exit) + :trans (behavior () + (local-vars (v1-22 joint-control-channel)) + ((-> self state-hook)) + (when (and (or (not (cpad-hold? (-> self control cpad number) l1)) + (logtest? (-> self target-flags) (target-flags prevent-duck)) + (and (logtest? (water-flag wading) (-> self water flags)) + (>= (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) + ) + ) + (can-exit-duck? self) + ) + (if (and (using-gun? self) + (begin (set! v1-22 (get-channel (-> self skel top-anim) 0)) v1-22) + (= (-> v1-22 frame-group) jakb-gun-duck-roll-end-ja) + ) + (target-top-anim-base-mode 60) + ) + (go target-walk) + ) + (if (not (move-legs?)) + (go target-duck-stance 'duck) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck) + (target-jump-go) + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) + (can-hands? #t) + (can-exit-duck? self) + (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + (slide-down-test) + ) + :code (behavior ((arg0 symbol)) + (let ((gp-0 (if (using-gun? self) + jakb-gun-duck-walk-ja + jakb-duck-walk-ja + ) + ) + (v1-6 (ja-group)) + ) + (cond + ((and (and v1-6 (or (= v1-6 jakb-duck-walk-ja) (= v1-6 jakb-gun-duck-walk-ja))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + (else + (let ((v1-16 (ja-group))) + (cond + ((and v1-16 (= v1-16 jakb-duck-stance-ja)) + (ja-channel-push! 1 (seconds 0.45)) + (ja :group! gp-0 :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! gp-0 :num! min) + ) + ) + ) + ) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (until #f + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (set! (-> self control mod-surface) *duck-mods*) + ) + (ja :num! (loop! (fmin 3.0 (/ (-> self control ctrl-xz-vel) + (* 60.0 (/ (-> *TARGET-bank* duck-walk-cycle-dist) (-> *TARGET-bank* run-cycle-length))) + ) + ) + ) + ) + (suspend) + ) + #f + ) + :post target-post + ) + +(defbehavior target-jump-top-anim target () + (let ((gp-0 (get-channel (-> self skel top-anim) 0))) + (when gp-0 + (let ((s5-0 (-> gp-0 frame-group)) + (f0-0 (ja-aframe-num 0)) + ) + (when (or (= s5-0 jakb-gun-side-jump-ja) (= s5-0 jakb-gun-front-jump-ja)) + (let ((v1-13 (ja-group))) + (if (and v1-13 (= v1-13 jakb-duck-high-jump-ja)) + (set! (-> gp-0 frame-num) (/ (- f0-0 (+ 16.0 (-> s5-0 artist-base))) (-> s5-0 artist-step))) + (set! (-> gp-0 frame-num) (/ (- f0-0 (-> s5-0 artist-base)) (-> s5-0 artist-step))) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate target-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (when (= (-> self control jump-kind) 'launch) + (talker-spawn-func (-> *talker-speech* 45) *entity-pool* (target-pos 0) (the-as region #f)) + (talker-spawn-func (-> *talker-speech* 46) *entity-pool* (target-pos 0) (the-as region #f)) + enter-state + (let ((a0-7 (-> self control unknown-dword07)) + (a1-3 (-> self control unknown-dword08)) + (a2-3 (-> self control unknown-vector37)) + ) + (set! (-> a2-3 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-7) (the-as symbol a1-3) a2-3 (-> self control unknown-dword10)) + ) + ) + (set-time! (-> self state-time)) + (sound-play "jump" :vol 70) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + *jump-mods* + ) + ) + ) + (set! (-> self control mod-surface) arg2) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) + ) + (set! (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) + ) + ) + :exit target-exit + :trans (behavior () + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (let ((t9-0 target-falling-trans) + (a0-1 #f) + (v1-12 (ja-group)) + ) + (t9-0 + a0-1 + (the-as time-frame (if (and v1-12 (= v1-12 jakb-jump-loop-ja)) + 15 + -1 + ) + ) + #t + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) x) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + (* 12288.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) + ) + (and (< -116736.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (not (logtest? (water-flag touch-water) (-> self water flags))) + (not (logtest? (target-flags prevent-jump prevent-double-jump) (-> self target-flags))) + ) + ) + (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) + (and (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + (* 26624.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) + ) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + ) + (go + target-flop + 65502.96 + -163840.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + 'flop + ) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (slide-down-test) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) + (seconds-per-frame) + ) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (let ((f28-0 20.0) + (f30-0 1.0) + ) + (when (and (using-gun? self) (not (-> self gun charge-active?))) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-side-jump-ja) 0.0 30 30 1.0 0.0 #f) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (let ((v1-21 (ja-group))) + (cond + ((and (and v1-21 (= v1-21 jakb-flop-down-land-ja)) (>= 25.0 (ja-aframe-num 0)) (>= (ja-aframe-num 0) 17.0)) + (set! (-> self neck flex-blend) 0.0) + (ja-channel-push! 1 0) + (cond + ((and (using-gun? self) (zero? (-> self ext-anim))) + (ja :group! jakb-duck-high-jump-ja :num! (identity (ja-aframe 16.0 0))) + (set! f28-0 35.0) + ) + (else + (ja :group! jakb-flop-jump-ja :num! (identity (ja-aframe 25.0 0))) + (set! f28-0 24.0) + (set! f30-0 0.3) + ) + ) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 444) :num! min) + (suspend) + 0 + ) + (else + (ja-channel-push! 2 (seconds 0.05)) + (ja :group! jakb-jump-ja :num! min) + (let ((a0-26 (-> self skel root-channel 1))) + (let ((f0-8 (-> self control unknown-float35))) + (set! (-> a0-26 frame-interp 1) f0-8) + (set! (-> a0-26 frame-interp 0) f0-8) + ) + (set! (-> a0-26 frame-group) (the-as art-joint-anim jakb-jump-forward-ja)) + (set! (-> a0-26 param 0) 0.0) + (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim jakb-jump-forward-ja) num-func-chan) + ) + (suspend) + (ja :group! jakb-jump-ja :num! (+!)) + (let ((a0-28 (-> self skel root-channel 1))) + (let ((f0-11 (-> self control unknown-float35))) + (set! (-> a0-28 frame-interp 1) f0-11) + (set! (-> a0-28 frame-interp 0) f0-11) + ) + (set! (-> a0-28 frame-group) (the-as art-joint-anim jakb-jump-forward-ja)) + (set! (-> a0-28 param 0) 0.0) + (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim jakb-jump-forward-ja) num-func-chan) + ) + (suspend) + 0 + ) + ) + ) + (until (ja-done? 0) + (let ((f26-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f24-0 (- f28-0 (ja-aframe-num 0))) + ) + (target-jump-top-anim) + (ja :num! (seek! max (if (and (< 0.0 f26-1) (< 0.0 f24-0)) + (fmin (fmin 3.0 f24-0) (/ (* 5.0 f24-0) (the float (time-to-apex f26-1 -245760.0)))) + f30-0 + ) + ) + ) + ) + (when (>= (ja-group-size) 2) + (let ((a0-33 (-> self skel root-channel 1))) + (let ((f0-26 (-> self control unknown-float35))) + (set! (-> a0-33 frame-interp 1) f0-26) + (set! (-> a0-33 frame-interp 0) f0-26) + ) + (set! (-> a0-33 param 0) 0.0) + (joint-control-channel-group-eval! a0-33 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (suspend) + ) + ) + (target-falling-anim -1 (seconds 0.2)) + (go target-falling #f) + ) + :post target-post + ) + +(defstate target-jump-forward (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + ((-> target-jump enter) arg0 arg1 (the-as surface #f)) + (set! (-> self control mod-surface) *forward-jump-mods*) + ) + :exit target-exit + :trans (-> target-jump trans) + :code (behavior ((arg0 float) (arg1 float)) + (when (and (using-gun? self) (not (-> self gun charge-active?))) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-side-jump-ja) 3.0 30 30 1.0 0.0 #f) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-ja) + 3.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (ja-channel-set! 1) + (ja-no-eval :group! jakb-jump-ja :num! (seek!) :frame-num (ja-aframe 3.0 0)) + (until (ja-done? 0) + (set! (-> self control time-of-last-clear-wall-in-jump) 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (target-jump-top-anim) + (ja :group! jakb-jump-loop-ja :num! (loop!)) + ) + #f + ) + :post target-post + ) + +(defstate target-double-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + (if (and (cpad-pressed? (-> self control cpad number) x) + (and (focus-test? self light) + (nonzero? (-> self lightjak)) + (logtest? (-> self lightjak stage) (lightjak-stage swoop)) + ) + (logtest? (the-as game-feature (logand (game-feature lightjak-swoop) (-> *setting-control* user-current features))) + (-> self game features) + ) + (>= (-> self game eco-pill-light) (-> *FACT-bank* lightjak-swoop-inc)) + (= (-> self fact shield-level) 0.0) + (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-feet))) + (and (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + (zero? (-> self lightjak latch-out-time)) + ) + ) + (go target-lightjak-swoop 1.2) + ) + (when (= (-> self control jump-kind) 'launch) + enter-state + (let ((a0-21 (-> self control unknown-dword07)) + (a1-1 (-> self control unknown-dword08)) + (a2-0 (-> self control unknown-vector37)) + ) + (set! (-> a2-0 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-21) (the-as symbol a1-1) a2-0 (-> self control unknown-dword10)) + ) + ) + (set-time! (-> self state-time)) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (if (!= (-> self control mod-surface) *slide-jump-mods*) + (set! (-> self control mod-surface) *double-jump-mods*) + ) + ) + :exit target-exit + :trans (behavior () + (let ((t9-0 target-falling-trans) + (a0-0 #f) + (v1-2 (ja-group)) + ) + (t9-0 + a0-0 + (the-as time-frame (if (and v1-2 (= v1-2 jakb-jump-loop-ja)) + 15 + -1 + ) + ) + #t + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (go + target-flop + 33775.48 + -122880.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + 'flop + ) + ) + (if (!= (-> self state-time) (current-time)) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + ) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) + (seconds-per-frame) + ) + ) + :code (behavior ((arg0 float) (arg1 float)) + (sound-play "jump-double") + (when (and (using-gun? self) (not (-> self gun charge-active?))) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-side-jump-ja) 7.0 30 30 1.0 0.0 #f) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-ja) + 7.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 444) :num! (seek!) :frame-num (ja-aframe 7.0 0)) + ) + (else + (ja-channel-push! 2 (seconds 0.05)) + (ja-no-eval :group! jakb-jump-ja :num! (seek!) :frame-num (ja-aframe 5.0 0)) + (ja :chan 1 :group! jakb-jump-forward-ja :num! (chan 0)) + ) + ) + (until (ja-done? 0) + (suspend) + (target-jump-top-anim) + (ja :num! (seek!)) + (when (>= (ja-group-size) 2) + (let ((a0-20 (-> self skel root-channel 1))) + (let ((f0-13 (-> self control unknown-float35))) + (set! (-> a0-20 frame-interp 1) f0-13) + (set! (-> a0-20 frame-interp 0) f0-13) + ) + (set! (-> a0-20 param 0) 0.0) + (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-chan) + ) + ) + ) + (target-falling-anim -1 (seconds 0.2)) + (go target-falling #f) + ) + :post target-post + ) + +(defstate target-high-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 object)) + (when (and (= (-> self control jump-kind) 'launch) (!= arg2 'launch)) + enter-state + (let ((a0-3 (-> self control unknown-dword07)) + (a1-1 (-> self control unknown-dword08)) + (a2-1 (-> self control unknown-vector37)) + ) + (set! (-> a2-1 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-1 (-> self control unknown-dword10)) + ) + ) + (set! (-> self control unknown-symbol03) (the-as float arg2)) + (if (and (or (= arg2 'duck) (= arg2 'launch)) (zero? (-> self ext-anim))) + (go target-duck-high-jump arg0 arg1 (the-as symbol arg2)) + ) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (sound-play "jump" :pitch 0.3) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (set! (-> self control mod-surface) (cond + ((= arg2 'flip) + *flip-jump-mods* + ) + ((= arg2 'flop-forward) + *forward-high-jump-mods* + ) + (else + *high-jump-mods* + ) + ) + ) + (set! (-> self control unknown-float35) + (fmax 0.0 (fmin 0.5 (* 0.00008138021 (+ -409.6 (-> self control ctrl-xz-vel))))) + ) + ) + :exit target-exit + :trans (behavior () + (let ((t9-0 target-falling-trans) + (a0-0 #f) + (v1-2 (ja-group)) + ) + (t9-0 + a0-0 + (the-as time-frame (if (and v1-2 (= v1-2 jakb-jump-loop-ja)) + 15 + -1 + ) + ) + #t + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (go + target-flop + 33775.48 + -122880.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + 'flop + ) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control ctrl-xz-vel))))) + (seconds-per-frame) + ) + ) + :code (-> target-jump code) + :post target-post + ) + +(defstate target-duck-high-jump (target) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control mod-surface) *turn-around-mods*) + (case arg2 + (('launch) + ) + (else + ) + ) + ) + :exit target-exit + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((v1-2 (ja-group))) + (if (not (and (and v1-2 (= v1-2 jakb-duck-stance-ja)) (= (-> self skel root-channel 0) (-> self skel channel)))) + (ja-channel-push! 1 (seconds 0.04)) + ) + ) + (let ((v1-11 arg2)) + (cond + ((or (= v1-11 'flop) (= v1-11 'flop-forward)) + (ja-no-eval :group! jakb-flop-jump-ja :num! (seek! (ja-aframe 25.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 25.0 0))) + ) + ) + ((using-gun? self) + (ja :group! jakb-duck-high-jump-ja :num! (identity (ja-aframe 16.0 0))) + ) + (else + (ja-no-eval :group! jakb-duck-high-jump-ja :num! (seek! (ja-aframe 16.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 16.0 0))) + ) + ) + ) + ) + (go target-duck-high-jump-jump arg0 arg1 arg2) + ) + :post target-post + ) + +(defstate target-duck-high-jump-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-symbol03) (the-as float arg2)) + (set-time! (-> self state-time)) + (sound-play "jump" :vol 80 :pitch -0.4) + (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (cond + ((= arg2 'launch) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *launch-jump-mods*) + ) + (else + (set! (-> self control mod-surface) *high-jump-mods*) + ) + ) + ) + :exit target-exit + :trans (behavior () + ((-> target-high-jump trans)) + (let ((v1-2 (-> self control unknown-symbol03))) + (when (= (the-as int v1-2) 'launch) + (when *sound-player-enable* + (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-0 command) (sound-command set-param)) + (set! (-> gp-0 id) (-> self control unknown-sound-id00)) + (let ((a1-0 (ear-trans 0))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 control))) + (set! a1-0 (-> s5-0 control trans)) + (set! a1-0 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> gp-0 params trans) a1-0) + ) + (set! (-> gp-0 params mask) (the-as uint 32)) + (-> gp-0 id) + ) + ) + ) + ) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (when (and (using-gun? self) (not (-> self gun charge-active?))) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-side-jump-ja) 0.0 30 30 1.0 0.0 #f) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (let* ((f30-0 1.0) + (v1-18 arg2) + (f28-0 (cond + ((= v1-18 'launch) + 110.0 + ) + ((or (= v1-18 'flop) (= v1-18 'flop-forward)) + (set! f30-0 0.75) + 44.0 + ) + (else + 35.0 + ) + ) + ) + ) + (until (ja-done? 0) + (let ((f24-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f26-0 (- f28-0 (ja-aframe-num 0))) + ) + (target-jump-top-anim) + (let ((f22-1 (fmin (fmin 3.0 f26-0) (/ (* 5.0 f26-0) (the float (time-to-apex f24-0 -245760.0))))) + (s5-0 (-> self skel root-channel 0)) + ) + (set! (-> s5-0 param 0) (the float (+ (-> s5-0 frame-group frames num-frames) -1))) + (let ((v1-41 (cond + ((and (< 0.0 f24-0) (< 0.0 f26-0)) + (if (= arg2 'launch) + (set! f30-0 (lerp f30-0 (* 4.0 f22-1) 0.25)) + ) + f22-1 + ) + (else + f30-0 + ) + ) + ) + ) + (set! (-> s5-0 param 1) v1-41) + ) + (joint-control-channel-group-eval! s5-0 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (suspend) + ) + ) + (cond + ((or (= arg2 'flop) (= arg2 'flop-forward)) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (ja :group! jakb-jump-loop-ja :num! (loop!)) + ) + #f + ) + (else + (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (ja :group! jakb-jump-loop-ja :num! (loop!)) + ) + #f + ) + ) + ) + :post target-post + ) + +(defstate target-falling (target) + :event target-jump-event-handler + :enter (behavior ((arg0 symbol)) + (case arg0 + (('uppercut) + (set! (-> self control mod-surface) *uppercut-jump-mods*) + ) + (else + (set! (-> self control mod-surface) *jump-mods*) + ) + ) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (target-falling-trans + (the-as symbol (-> self control unknown-spool-anim00)) + (the-as time-frame (if (= (-> self control unknown-spool-anim00) #f) + 0 + (the-as int (/ (the-as int (-> *TARGET-bank* stuck-time)) 2)) + ) + ) + #t + ) + ) + :code (behavior ((arg0 symbol)) + (case arg0 + (('uppercut) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self gun surpress-time) 0) + (send-event self 'gun (-> self gun gun-type)) + (set! (-> self gun track-target-hold-time) 0) + 0 + ) + (('hit) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! jakb-hit-from-front-ja :num! (seek!) :frame-num (ja-aframe 15.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (target-falling-anim -1 (seconds 0.33)) + ) + :post target-post + ) + +(defstate target-hit-ground (target) + :event target-walk-event-handler + :enter (behavior ((arg0 symbol)) + (set! (-> self control turn-go-the-long-way) 0.0) + (cond + ((or (= arg0 'stuck) (focus-test? self indax)) + ) + (else + (let ((f0-2 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control last-trans-any-surf) (-> self control trans)) + ) + ) + ) + (if (and (< (-> *TARGET-bank* fall-far) f0-2) (not (logtest? (-> self control status) (collide-status on-water)))) + (go target-hit-ground-hard f0-2) + ) + ) + ) + ) + (cond + ((= arg0 'stuck) + ) + (else + (target-land-effect) + ) + ) + (set! (-> self control last-running-attack-end-time) 0) + (set! (-> self control last-attack-end-time) 0) + (if (>= (-> self control ground-impact-vel) (-> *TARGET-bank* fall-stumble-threshold)) + (set-forward-vel 0.0) + ) + (if (!= (-> self control ground-pat material) (pat-material ice)) + (delete-back-vel) + ) + (set! (-> self control mod-surface) *walk-mods*) + (start-bobbing! + (-> self water) + (lerp-scale 0.0 4096.0 (-> self control ground-impact-vel) 40960.0 102400.0) + 600 + 1500 + ) + (when (and (using-gun? self) (let ((v1-35 (-> self water flags))) + (and (not (and (logtest? (water-flag touch-water) v1-35) + (logtest? (water-flag under-water swimming) v1-35) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + ) + (not (-> self gun charge-active?)) + ) + ) + ) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-jump-land-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type eco-red) (pickup-type eco-dark)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-land-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-land-ja) + 0.0 + 30 + 30 + 1.0 + 25.0 + #f + ) + ) + ) + ) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + ) + :trans (behavior () + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (if (and (or (cpad-hold? (-> self control cpad number) l1) (not (can-exit-duck? self))) (can-duck?)) + (go target-duck-stance #f) + ) + (when (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (if (logtest? (water-flag wading) (-> self water flags)) + (go target-wade-walk) + (go target-walk) + ) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) r1) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (logtest? (the-as game-feature (logand (game-feature darkjak-smack) (-> *setting-control* user-current features))) + (-> self game features) + ) + (can-hands? #t) + ) + (go target-darkjak-smack-charge) + ) + (when (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-secrets button-invis) (-> self game secrets)) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (not (logtest? (target-flags invisible) (-> self target-flags))) + (>= (-> self game eco-pill-dark) (-> *FACT-bank* darkjak-button-invis-inc)) + ) + (target-invisible-start (seconds 30)) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-button-invis-inc))) + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (if (and (using-gun? self) (-> self gun charge-active?)) + (go target-stance) + ) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + (slide-down-test) + ) + :code (behavior ((arg0 symbol)) + (target-hit-ground-anim #f (are-still?)) + (go target-stance) + ) + :post target-post + ) + +(define *attack-mods* (new 'static 'surface + :name 'attack + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (case (-> self control ground-pat event) + (((pat-event slide)) + (set! (-> arg0 seek0) 0.05) + (set! (-> arg0 seek90) 0.05) + (set! (-> arg0 seek180) 0.05) + ) + ) + ) + ) + ) + :mode 'attack + :flags (surface-flag attack spin gun-inactive gun-turn-fast) + ) + ) + +(let ((v1-25 (copy *attack-mods* 'global))) + (set! (-> v1-25 flags) (surface-flag attack spin gun-turn-fast)) + (set! (-> v1-25 mult-hook) + (the-as + (function surface surface surface int none) + (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + ((-> *attack-mods* mult-hook) arg0 arg1 arg2 arg3) + (when (= arg3 1) + (if (and (nonzero? (-> self gun turn-fast-hold-time)) (< (current-time) (-> self gun turn-fast-hold-time))) + (set-quaternion! (-> self control) (-> self control dir-targ)) + ) + ) + ) + ) + ) + (set! *attack-end-mods* v1-25) + ) + +(let ((v1-27 (copy *attack-mods* 'global))) + (set! (-> v1-27 seek0) 0.0) + (set! (-> v1-27 fric) 0.0) + (set! (-> v1-27 nonlin-fric-dist) 0.0) + (set! (-> v1-27 transv-max) 81920.0) + (set! (-> v1-27 target-speed) 245760.0) + (set! *attack-find-mods* v1-27) + ) + +(defstate target-attack (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (cond + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self control) + (the-as uint 1920) + ) + (when (target-send-attack + proc + (-> self control danger-mode) + (the-as touching-shapes-entry (-> block param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + (set-time! (-> self gun combo-window-start)) + (let ((v0-2 (the-as object (-> self state name)))) + (set! (-> self gun combo-window-state) (the-as symbol v0-2)) + v0-2 + ) + ) + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + (('gun-combo) + (when (-> block param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-stance) + ) + #t + ) + (('slide) + #f + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (target-start-attack) + (target-danger-set! 'spin #f) + (if (not (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (logtest? (-> self darkjak stage) (darkjak-stage force-on active)) + ) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-spin-inc))) + ) + (set! (-> self control mod-surface) *attack-mods*) + (set! (-> self water drip-mult) 4.0) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (if (< 0.0 (-> self control turn-to-magnitude)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control to-target-pt-xz) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (quaternion-copy! (-> self control unknown-quaternion04) (-> self control dir-targ)) + (set! (-> self control unknown-float41) 0.0) + (set! (-> self control unknown-float42) 0.0) + ) + :exit (behavior () + (if (zero? (-> self gun track-target-hold-time)) + (quaternion-copy! (-> self control dir-targ) (-> self control unknown-quaternion04)) + ) + (set-time! (-> self control last-attack-end-time)) + (target-exit) + ) + :code (behavior () + (let ((s5-0 jakb-attack-from-stance-ja) + (gp-0 (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage no-anim)) + ) + (combo-tracker-method-13 + (-> self control unknown-combo-tracker00) + (if (time-elapsed? (-> self control send-attack-time) (seconds 2)) + (the-as handle #f) + (-> self control send-attack-dest) + ) + (-> self control trans) + 49152.0 + (-> self control c-R-w fvec) + 65536.0 + ) + ) + ) + ) + (if gp-0 + (combo-tracker-method-12 + (-> self control unknown-combo-tracker00) + (-> self control trans) + (get-trans gp-0 3) + gp-0 + (current-time) + ) + ) + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (set! s5-0 (-> self draw art-group data 449)) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + ) + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! s5-0 jakb-gun-attack-from-stance-ja) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -3276.8) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-blue-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! s5-0 jakb-gun-attack-from-stance-blue-ja) + (set! (-> self control unknown-sound-id01) (sound-play "blue-whoosh")) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! s5-0 jakb-gun-attack-from-stance-ja) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -3276.8) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + ) + ) + ) + (else + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! s5-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (set! (-> self control mod-surface) *attack-mods*) + (when (and gp-0 (send-event (handle->process (-> self control unknown-combo-tracker00 target)) 'combo)) + (let* ((s5-1 (handle->process (-> self control unknown-combo-tracker00 target))) + (s5-2 (get-trans + (the-as process-focusable (if (type? s5-1 process-focusable) + (the-as process-focusable s5-1) + ) + ) + 3 + ) + ) + ) + (when (< 4096.0 (vector-vector-xz-distance s5-2 (-> self control trans))) + (let ((f30-1 (-> self control transv y))) + (vector-! (-> self control transv) s5-2 (-> self control trans)) + (let ((v1-116 + (point-tracker-method-11 + (-> self control unknown-combo-tracker00) + (new 'stack-no-clear 'vector) + (-> self control trans) + s5-2 + (* 0.009107469 (the float (- (current-time) (-> self control unknown-combo-tracker00 move-start-time)))) + ) + ) + ) + (vector-xz-normalize! + (-> self control transv) + (fmin 163840.0 (sqrtf (+ (* (-> v1-116 x) (-> v1-116 x)) (* (-> v1-116 z) (-> v1-116 z))))) + ) + ) + (set! (-> self control mod-surface) *attack-find-mods*) + (set! (-> self control transv y) f30-1) + ) + ) + ) + ) + (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 49) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (target-jump-go) + ) + (suspend) + (ja :num! (seek! max (-> self control current-surface align-speed))) + ) + ) + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -12743.111) + ) + ((using-gun? self) + (when (zero? (-> self gun track-target-hold-time)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-blue-end-ja) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -3640.889) + ) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-end-ja) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -5461.3335) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-end-ja) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -5461.3335) + ) + ) + ) + ) + (else + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + ) + ) + (go target-stance) + ) + :post target-post + ) + +(define *run-attack-mods* (new 'static 'surface + :name 'punch + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 91750.4 + :target-speed 122880.0 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags (surface-flag no-turn-around turn-to-pad attack gun-inactive) + ) + ) + +(defstate target-running-attack (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (cond + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self control) + (the-as uint 1920) + ) + (let ((gp-1 (target-send-attack + proc + (-> self control danger-mode) + (the-as touching-shapes-entry (-> block param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + ) + ) + (when gp-1 + (set-time! (-> self control sliding-start-time)) + (set-time! (-> self gun combo-window-start)) + (set! (-> self gun combo-window-state) (-> self state name)) + (let ((v1-13 (if (type? proc process-focusable) + proc + ) + ) + ) + (when v1-13 + (let* ((s5-1 (-> (the-as process-focusable v1-13) root)) + (v1-14 (if (type? s5-1 collide-shape) + s5-1 + ) + ) + ) + (if (and v1-14 (or (logtest? (-> v1-14 root-prim prim-core collide-as) (collide-spec enemy)) + (logtest? (-> v1-14 root-prim prim-core action) (collide-action no-smack)) + ) + ) + (+! (-> self control unknown-word04) 1) + ) + ) + ) + ) + (cond + ((or (= gp-1 'die) (= gp-1 'push)) + (let ((v0-2 (the-as object (current-time)))) + (set! (-> self control unknown-time-frame18) (the-as time-frame v0-2)) + v0-2 + ) + ) + ((= gp-1 'back) + (let ((f0-0 -122880.0)) + (set! (-> self control unknown-word04) (the-as uint f0-0)) + f0-0 + ) + ) + ) + ) + ) + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + (('gun-combo) + (if (-> block param 0) + (go target-stance) + ) + #t + ) + (('slide) + #f + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (-> self next-state) (= (-> self next-state name) 'target-running-attack)) + (and (= (-> self ext-anim) (target-anim dark)) (zero? (-> self darkjak latch-out-time))) + ) + (go target-darkjak-running-attack) + ) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square)) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons square)) + (set-time! (-> self state-time)) + (combo-tracker-method-12 + (-> self control unknown-combo-tracker00) + *null-vector* + *null-vector* + (the-as process #f) + (current-time) + ) + (set! (-> self control sliding-start-time) 0) + (set! (-> self control unknown-time-frame18) 0) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + (set! (-> self control mod-surface) *run-attack-mods*) + (cond + ((= (-> self control ground-pat event) (pat-event slide)) + (set! (-> *run-attack-mods* turnv) 0.0) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (else + (set! (-> *run-attack-mods* turnv) 655360.0) + (set! (-> *run-attack-mods* turnvv) 655360.0) + ) + ) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (if (or (< (fabs (-> self control local-slope-x)) 0.3) (< 0.3 (fabs (-> self control local-slope-z)))) + (set! (-> self control bend-target) 1.0) + ) + (set! (-> self upper-body twist z) 0.0) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (set! (-> *run-attack-mods* turnv) 0.0) + (set! (-> *run-attack-mods* turnvv) 0.0) + (set-time! (-> self control last-running-attack-end-time)) + (target-exit) + ) + :trans (behavior () + (when (!= (-> self state-time) (current-time)) + (when (and (or (smack-surface? #t) + (and (>= (-> self control surface-slope-z) 0.7) + (not (logtest? (-> self control status) (collide-status touch-actor))) + ) + ) + (begin + (set-time! (-> self control unknown-time-frame18)) + (set! (-> self control bend-target) 0.0) + (let ((v1-11 (new-stack-vector0)) + (f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-11 (-> self control transv) (vector-float*! v1-11 (-> self control dynam gravity-normal) f0-3)) + (let* ((f1-3 (vector-length v1-11)) + (f2-0 f1-3) + (f0-4 (fmin 0.0 f0-3)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-4) + (vector-float*! v1-11 v1-11 (/ f1-3 f2-0)) + ) + ) + ) + #t + ) + (or (zero? (-> self control sliding-start-time)) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) + ) + (!= (-> self control unknown-word04) 1) + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) x) + (< 4096.0 (-> self control ctrl-xz-vel)) + (or (time-elapsed? (-> self state-time) (seconds 0.1)) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square))) + ) + (not (logtest? (-> self target-flags) (target-flags prevent-jump prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack))) + (let ((v1-48 (ja-group))) + (and (not (and v1-48 (= v1-48 jakb-darkjak-attack-combo3-ja))) + (and (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + ) + ) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + (if (and (logtest? (water-flag touch-water) (-> self water flags)) + (zero? (mod (- (current-time) (-> self state-time)) 21)) + ) + (spawn-ripples + (-> self water) + 0.6 + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg neckB)) + 0 + (-> self control transv) + #f + ) + ) + (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 28) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + :code (behavior () + (if (logtest? (water-flag touch-water) (-> self water flags)) + (sound-play "swim-stroke") + ) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((gp-1 jakb-attack-punch-ja)) + (ja-channel-push! 1 (seconds 0.02)) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-butt-ja) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 jakb-gun-attack-butt-blue-ja) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-butt-blue-ja) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 jakb-gun-attack-butt-blue-ja) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-butt-ja) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 jakb-gun-attack-butt-ja) + ) + ) + ) + (ja-no-eval :group! gp-1 :num! (seek!)) + ) + (target-start-attack) + (target-danger-set! 'punch #f) + (if (not (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (logtest? (-> self darkjak stage) (darkjak-stage force-on active)) + ) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-punch-inc))) + ) + (initialize (-> self control impact-ctrl) self 28 3276.8 (-> self control root-prim prim-core collide-with)) + (let ((f26-0 (the-as number 0.0)) + (f30-0 1.0) + (gp-2 0) + (f28-0 1.0) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (when (not (ja-min? 0)) + (cond + ((and (>= (ja-aframe-num 0) 20.0) + (and (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) + ) + ) + (go target-falling #f) + ) + ((< (the-as float f26-0) 0.0) + (set! f26-0 (seek (the-as float f26-0) -0.04096 (* 491520.0 (seconds-per-frame)))) + (set-forward-vel (the-as float f26-0)) + ) + ((and (nonzero? (-> self control unknown-time-frame18)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) + ) + (set-forward-vel 0.0) + ) + ((and (not (cpad-hold? (-> self control cpad number) square)) + (time-elapsed? (-> self control unknown-combo-tracker00 move-start-time) (seconds 0.05)) + ) + (if (= (-> self control ground-pat material) (pat-material ice)) + (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) + (set-forward-vel (* 0.8 (-> self control ctrl-xz-vel))) + ) + ) + ((ja-done? 0) + (set-forward-vel (the-as float f26-0)) + ) + (else + (set! f26-0 + (* (target-align-vel-z-adjust (-> self align delta trans z)) (-> self clock frames-per-second) f30-0) + ) + (set-forward-vel (the-as float f26-0)) + ) + ) + ) + (let ((s5-1 (new-stack-vector0))) + (vector-matrix*! s5-1 (-> self control transv) (-> self control w-R-c)) + (set! (-> s5-1 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) s5-1 (-> self control c-R-w)) + ) + (when (!= (the-as float (-> self control unknown-word04)) 0.0) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f26-0 (-> self control unknown-word04)) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + ) + (when (and (>= (the-as float f26-0) 0.0) + (let ((s5-2 (ja-group)) + (f24-0 (ja-aframe-num 0)) + ) + (if (or (and (= s5-2 jakb-attack-punch-ja) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim jakb-attack-punch-ja) frames num-frames) -1)) (ja-frame-num 0)) + ) + (and (= s5-2 jakb-gun-attack-butt-ja) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim jakb-gun-attack-butt-ja) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= s5-2 jakb-gun-attack-butt-blue-ja) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim jakb-gun-attack-butt-blue-ja) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + ) + #t + ) + ) + ) + (let ((s5-3 (new 'stack-no-clear 'collide-query))) + (when (and (>= (impact-control-method-11 + (-> self control impact-ctrl) + s5-3 + (the-as process #f) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + 0.0 + ) + (>= 0.0 (vector-dot (-> s5-3 best-other-tri normal) (-> self control impact-ctrl dir))) + ) + (when (= (-> s5-3 best-other-tri pat mode) (pat-mode wall)) + (cond + ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s5-3 best-other-tri intersect quad)) + (let ((s5-4 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-4 + (let ((t9-36 (method-of-type part-tracker-subsampler activate))) + (t9-36 (the-as part-tracker-subsampler s5-4) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-37 run-function-in-process) + (a0-72 s5-4) + (a1-16 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-37) a0-72 a1-16 *part-tracker-subsampler-params-default*) + ) + (-> s5-4 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s5-3 best-other-tri intersect quad)) + (let ((s5-5 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-5 + (let ((t9-39 (method-of-type part-tracker activate))) + (t9-39 (the-as part-tracker s5-5) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-40 run-function-in-process) + (a0-77 s5-5) + (a1-19 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-40) a0-77 a1-19 *part-tracker-params-default*) + ) + (-> s5-5 ppointer) + ) + ) + ) + ) + (let ((name (if (using-gun? self) + (the-as sound-name (static-sound-name "gun-punch-w-hit")) + (the-as sound-name (static-sound-name "punch-w-hit")) + ) + ) + ) + (play-effect-sound + (-> self skel effect) + (the-as symbol "punch") + -1.0 + (-> self control impact-ctrl joint) + (the-as basic #f) + (the-as sound-name name) + ) + ) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f26-0 -61440.0) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max (* (-> self control current-surface align-speed) f28-0))) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (if (< 2 gp-2) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) + ) + (+! gp-2 1) + ) + ) + (if (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (go target-falling #f) + ) + (when (and (using-gun? self) + (or (< (-> self control pad-magnitude) 0.7) (= (gun->eco (-> self gun gun-type)) (pickup-type eco-blue))) + ) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.5))) + (when (zero? (-> self gun track-target-hold-time)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-butt-blue-end-ja) + 0.0 + 0 + 60 + 1.0 + 12.0 + #f + ) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-butt-end-ja) + 0.0 + 0 + 60 + 1.0 + 12.0 + #f + ) + ) + ) + ) + ) + (go target-stance) + ) + :post target-post + ) + +(define *jump-attack-mods* + (new 'static 'surface + :name 'attack + :turnvv 18204.445 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 24576.0 + :target-speed 24576.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (if (and (>= (-> self gun fire-pending) 2) (< (-> self gun fire-pending) 5)) + (logclear! (-> arg0 flags) (surface-flag gun-direct)) + ) + (case (-> self control ground-pat event) + (((pat-event slide)) + (set! (-> arg0 seek0) 0.05) + (set! (-> arg0 seek90) 0.05) + (set! (-> arg0 seek180) 0.05) + ) + ) + ) + ) + ) + :mode 'air + :flags (surface-flag check-edge air attack spin gun-direct laser-hide) + ) + ) + +(defstate target-attack-air (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) + (cond + (v0-0 + (empty) + v0-0 + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (target-start-attack) + (target-danger-set! 'spin-air #f) + (if (not (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (logtest? (-> self darkjak stage) (darkjak-stage force-on active)) + ) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-spin-inc))) + ) + (set! (-> self control mod-surface) *jump-attack-mods*) + (set! (-> self neck flex-blend) 0.0) + (let ((f0-4 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (cond + ((or (>= 0.0 f0-4) (= arg0 'flop)) + (let ((v1-28 (new-stack-vector0))) + (let ((f0-6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-28 (-> self control transv) (vector-float*! v1-28 (-> self control dynam gravity-normal) f0-6)) + ) + (let* ((f0-7 (vector-length v1-28)) + (f1-2 f0-7) + (f2-0 33775.48) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-28 v1-28 (/ f0-7 f1-2)) + ) + ) + ) + ) + (else + (let* ((f1-5 (/ f0-4 (* (-> self control dynam gravity-length) (seconds-per-frame)))) + (f0-9 (* 0.5 f1-5 (seconds-per-frame) f0-4)) + ) + (let ((v1-36 (ja-group))) + (if (and v1-36 + (or (= v1-36 jakb-attack-uppercut-ja) + (= v1-36 jakb-gun-attack-upperbutt-ja) + (= v1-36 jakb-gun-attack-upperbutt-blue-ja) + ) + ) + (set! f0-9 + (fmax + 0.0 + (- (-> *TARGET-bank* attack-jump-height-max) + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control last-trans-any-surf)) + ) + ) + ) + ) + ) + ) + (let ((v1-47 (new-stack-vector0))) + (let ((f1-11 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-47 (-> self control transv) (vector-float*! v1-47 (-> self control dynam gravity-normal) f1-11)) + ) + (let* ((f1-12 (vector-length v1-47)) + (f2-7 f1-12) + (f0-14 (+ 1024.0 (sqrtf (* 245760.0 (+ 2048.0 f0-9))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-14) + (vector-float*! v1-47 v1-47 (/ f1-12 f2-7)) + ) + ) + ) + ) + ) + ) + ) + (set! (-> self control dynam gravity-length) 122880.0) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (set-time! (-> self control last-attack-end-time)) + (target-exit) + ) + :trans (behavior () + (when (logtest? (-> self control status) (collide-status on-surface)) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-hit-ground #f) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) + (seek! + (-> self control dynam gravity-length) + (-> self control standard-dynamics gravity-length) + (* 245760.0 (seconds-per-frame)) + ) + ) + (when (and (time-elapsed? (-> self state-time) (seconds 0.05)) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control last-transv)) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + ) + (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 43) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (and (cpad-pressed? (-> self control cpad number) r1) + (zero? (-> self gun fire-pending)) + (!= (-> self gun gun-type) 31) + ) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (+! (-> self gun fire-pending) 5) + ) + (((pickup-type eco-blue)) + (+! (-> self gun fire-pending) 5) + (set! (-> self gun fire-spinv) 218453.33) + ) + (((pickup-type eco-red)) + (+! (-> self gun fire-pending) 2) + ) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (target-attack-air-anim) + (go target-falling #f) + ) + :post target-post + ) + +(let ((v1-34 (copy *turn-around-mods* 'global))) + (set! (-> v1-34 flags) (surface-flag attack gun-inactive)) + (set! *uppercut-mods* v1-34) + ) + +(define *uppercut-jump-mods* (new 'static 'surface + :name 'uppercut + :turnvv 18204.445 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (surface-clamp-speed arg0 arg1 arg2 arg3) + (when (= arg3 1) + (when (nonzero? (-> self gun track-target-hold-time)) + (set! (-> arg0 turnv) 262144.0) + (set! (-> arg0 turnvf) 15.0) + ) + ) + ) + :mode 'air + :flags (surface-flag check-edge air attack spin gun-direct laser-hide) + ) + ) + +(defstate target-attack-uppercut (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('change-mode) + (if (and (= (-> block param 0) 'gun) (focus-test? self dark)) + #f + (target-dangerous-event-handler proc argc message block) + ) + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float)) + (set-time! (-> self state-time)) + (target-start-attack) + (target-danger-set! 'uppercut #f) + (if (not (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (logtest? (-> self darkjak stage) (darkjak-stage force-on active)) + ) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-uppercut-inc))) + ) + (set! (-> self control mod-surface) *uppercut-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.15))) + (if (using-gun? self) + (target-top-anim-base-mode 37) + ) + (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) + 0 + ) + :exit (behavior () + (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-bomb1))) + (set-action! + *gui-control* + (gui-action stop) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (target-exit) + ) + :code (behavior ((arg0 float) (arg1 float)) + (let* ((v1-2 (ja-group)) + (f30-0 (if (and v1-2 (= v1-2 jakb-duck-stance-ja)) + 5.0 + 0.0 + ) + ) + ) + (cond + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-upperbutt-blue-ja) + f30-0 + 5 + 30 + 1.0 + 0.0 + #f + ) + (ja-no-eval :group! jakb-gun-attack-upperbutt-blue-ja + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-upperbutt-ja) + f30-0 + 5 + 30 + 1.0 + 0.0 + #f + ) + (ja-no-eval :group! jakb-gun-attack-upperbutt-ja + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + ) + ) + ((and (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + (and (= (-> self ext-anim) (target-anim dark)) + (logtest? (the-as game-feature (logand (game-feature darkjak-bomb1) (-> *setting-control* user-current features))) + (-> self game features) + ) + (zero? (-> self darkjak latch-out-time)) + (>= (-> self game eco-pill-dark) (-> *FACT-bank* darkjak-bomb-min)) + ) + ) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* self (gui-channel jak-effect-1) (gui-action queue) "darkbom1" -99.0 0) + ) + (ja-no-eval :group! (-> self draw art-group data 441) + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + (go target-darkjak-bomb1) + ) + (else + (ja-no-eval :group! jakb-attack-uppercut-ja :num! (seek! (ja-aframe 7.0 0)) :frame-num (ja-aframe f30-0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + ) + ) + (go target-attack-uppercut-jump arg0 arg1) + ) + :post target-post + ) + +(defstate target-attack-uppercut-jump (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('gun-combo) + (when (-> block param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (let ((v1-7 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-7 (-> self control transv) (vector-float*! v1-7 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f0-2 (vector-length v1-7)) + (f1-1 f0-2) + (f2-3 + (- (sqrtf (* 8192.0 (-> self control dynam gravity-length))) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-3) + (vector-float*! v1-7 v1-7 (/ f0-2 f1-1)) + ) + ) + ) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.5))) + (go target-falling 'uppercut) + ) + #t + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float)) + (if (and (= (-> self control ground-pat material) (pat-material ice)) (< 32768.0 (-> self control ctrl-xz-vel))) + (set-forward-vel 32768.0) + ) + (set-time! (-> self state-time)) + (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *uppercut-jump-mods*) + (target-start-attack) + (target-danger-set! 'uppercut #f) + (set-time! (-> self gun combo-window-start)) + (set! (-> self gun combo-window-state) (-> self state name)) + (set! (-> self gun track-target-hold-time) 0) + 0 + ) + :exit target-exit + :trans (behavior () + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-hit-ground #f) + ) + (when (and (cpad-pressed? (-> self control cpad number) square) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (build-conversions (-> self control transv)) + (go + target-flop + 65502.96 + -163840.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + 'flop + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) + (and (can-feet? #f) + (let ((v1-65 (ja-group))) + (and v1-65 (or (= v1-65 jakb-attack-uppercut-ja) (= v1-65 jakb-gun-attack-upperbutt-ja))) + ) + (>= (ja-aframe-num 0) 12.0) + ) + ) + (go target-attack-air 'uppercut) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 28) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (if (and (= (-> self control danger-mode) 'uppercut) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) -8192.0) + ) + (target-danger-set! 'harmless #f) + ) + (slide-down-test) + ) + :code (behavior ((arg0 float) (arg1 float)) + (when (or (= (-> self skel top-anim frame-group) jakb-gun-attack-upperbutt-ja) + (= (-> self skel top-anim frame-group) jakb-gun-attack-upperbutt-blue-ja) + ) + (let ((v1-10 (get-channel (-> self skel top-anim) 0))) + (if v1-10 + (set! (-> v1-10 param 1) 0.9) + ) + ) + ) + (compute-alignment! (-> self align)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.9)) + (compute-alignment! (-> self align)) + (set! (-> self control turn-go-the-long-way) 1.0) + (let ((v1-27 (ja-group))) + (if (and v1-27 (= v1-27 jakb-attack-uppercut-ja)) + (align! + (-> self align) + (the-as align-opts (cond + ((>= 30.0 (ja-aframe-num 0)) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.1))) + (if (nonzero? (-> self gun track-target-hold-time)) + 2 + 18 + ) + ) + ((>= 43.0 (ja-aframe-num 0)) + (set! (-> self control mod-surface) *double-jump-mods*) + 2 + ) + (else + 0 + ) + ) + ) + 1.0 + 0.95 + 1.0 + ) + (align! + (-> self align) + (the-as align-opts (cond + ((>= 35.0 (ja-aframe-num 0)) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.1))) + (if (nonzero? (-> self gun track-target-hold-time)) + 2 + 18 + ) + ) + ((>= 43.0 (ja-aframe-num 0)) + (set! (-> self control mod-surface) *double-jump-mods*) + 2 + ) + (else + 0 + ) + ) + ) + 1.0 + 0.95 + 1.0 + ) + ) + ) + ) + (set-time! (-> self gun surpress-time)) + (go target-falling #f) + ) + :post target-post + ) + +(defstate target-flop (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v1-0 symbol)) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) + (cond + (v0-0 + (empty) + v0-0 + ) + ((begin (set! v1-0 message) (= v1-0 'slide)) + #f + ) + ((= v1-0 'swim) + (cond + ((< 6144.0 (target-height-above-ground)) + (sound-play "swim-flop") + (set! (-> self control unknown-float43) 0.0) + (go target-swim-down) + ) + (else + (go target-flop-hit-ground 'swim) + ) + ) + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float) (arg2 float) (arg3 object)) + (cond + ((and (= (-> self fact eco-type) 1) (>= (-> self fact eco-level) 1.0)) + (go target-yellow-jump-blast) + ) + ((and (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage invinc)) + ) + (and (= (-> self ext-anim) (target-anim dark)) + (logtest? (the-as game-feature (logand (game-feature darkjak-bomb0) (-> *setting-control* user-current features))) + (-> self game features) + ) + (zero? (-> self darkjak latch-out-time)) + (>= (-> self game eco-pill-dark) (-> *FACT-bank* darkjak-bomb-min)) + ) + ) + (go target-darkjak-bomb0) + ) + ) + (if (= arg2 0.0) + (set-forward-vel arg2) + (set-forward-vel (-> self control ctrl-xz-vel)) + ) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control mod-surface) *flop-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control dynam gravity-max) 245760.0) + (set! (-> self control dynam gravity-length) 245760.0) + (let ((v1-44 (new-stack-vector0))) + (let ((f0-8 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-44 (-> self control transv) (vector-float*! v1-44 (-> self control dynam gravity-normal) f0-8)) + ) + (let* ((f0-9 (vector-length v1-44)) + (f1-4 f0-9) + (f2-0 29491.2) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-44 v1-44 (/ f0-9 f1-4)) + ) + ) + ) + ) + :exit (behavior () + (let ((v1-2 (get-channel (-> self skel top-anim) 0))) + (when v1-2 + (case (-> v1-2 frame-group) + ((jakb-gun-flop-down-ja) + (set! (-> v1-2 param 1) 10.0) + ) + ) + ) + ) + (target-danger-set! 'harmless #f) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) + (set! (-> self neck flex-blend) 1.0) + ) + :trans (behavior () + (delete-back-vel) + (let ((gp-1 (logtest? (-> self control status) (collide-status on-surface)))) + (when (and (not gp-1) (let ((v1-6 (ja-group))) + (and v1-6 (or (= v1-6 jakb-flop-down-loop-ja) (= v1-6 jakb-moving-flop-down-ja))) + ) + ) + (when (and (or (< (target-move-dist (seconds 0.1)) 1638.4) + (and (logtest? (-> self control status) (collide-status touch-wall)) (< 0.7 (-> self control poly-angle))) + ) + (not (logtest? (-> self control status) (collide-status touch-actor))) + (>= (-> self control unknown-word04) (the-as uint 2)) + ) + (set-time! (-> self control last-time-of-stuck)) + (set! gp-1 'stuck) + ) + ) + (when gp-1 + (logior! (-> self control status) (collide-status on-surface)) + (when (or (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage bomb0)) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + (if (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect (-> self skel effect) (the-as symbol "group-red-eco-strike-ground") (ja-frame-num 0) 0) + ) + (let ((v1-56 + (process-spawn + touch-tracker + :init touch-tracker-init + (-> self control trans) + #x45800000 + 30 + :name "touch-tracker" + :to self + ) + ) + ) + (send-event + (ppointer->process v1-56) + 'function + (lambda :behavior target + ((arg0 process-focusable)) + (set! (-> arg0 root root-prim local-sphere w) + (seek (-> arg0 root root-prim local-sphere w) 28672.0 (* 286720.0 (seconds-per-frame))) + ) + ) + ) + ) + ) + (go target-flop-hit-ground gp-1) + ) + ) + (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect + (-> self skel effect) + (the-as symbol "group-red-eco-spinkick") + (ja-frame-num 0) + (if (rand-vu-percent? 0.5) + 28 + 19 + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (when (and (not (-> self control danger-mode)) + (let ((v1-80 (ja-group))) + (and v1-80 (= v1-80 jakb-flop-down-ja)) + ) + (>= (ja-aframe-num 0) 8.0) + ) + (target-start-attack) + (target-danger-set! 'flop #f) + (if (not (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (logtest? (-> self darkjak stage) (darkjak-stage force-on active)) + ) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-flop-inc))) + ) + ) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 float) (arg3 object)) + (if (using-gun? self) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-flop-down-ja) 0.0 0 30 1.0 0.0 #f) + ) + (ja-channel-set! 2) + (ja-no-eval :group! jakb-flop-down-ja :num! (seek!) :frame-num 0.0) + (ja :chan 1 :group! jakb-moving-flop-down-ja :num! (chan 0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (let ((gp-1 (-> self skel root-channel 1))) + (let ((f0-10 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 0.0 40960.0))) + (set! (-> gp-1 frame-interp 1) f0-10) + (set! (-> gp-1 frame-interp 0) f0-10) + ) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group frames num-frames) -1))) + (set! (-> gp-1 param 1) 1.0) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) + (target-danger-set! 'flop-down #f) + (let ((v1-56 (get-channel (-> self skel top-anim) 0))) + (if (and v1-56 (= (-> v1-56 frame-group) jakb-gun-flop-down-ja)) + (set! (-> v1-56 param 1) 0.0) + ) + ) + (let ((f30-0 1.0)) + (let ((v1-58 (new-stack-vector0))) + (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control align-xz-vel)))) + 0.0 + (vector-! + v1-58 + (-> self control align-xz-vel) + (vector-float*! v1-58 (-> self control dynam gravity-normal) f0-17) + ) + ) + (let* ((f0-18 (vector-length v1-58)) + (f1-1 f0-18) + (f2-0 -368640.0) + ) + (vector+! + (-> self control align-xz-vel) + (vector-float*! (-> self control align-xz-vel) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-58 v1-58 (/ f0-18 f1-1)) + ) + ) + ) + (let ((v1-59 (new-stack-vector0))) + (let ((f0-21 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-59 (-> self control transv) (vector-float*! v1-59 (-> self control dynam gravity-normal) f0-21)) + ) + (let* ((f0-22 (vector-length v1-59)) + (f1-3 f0-22) + (f2-2 (* -368640.0 f30-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) + (vector-float*! v1-59 v1-59 (/ f0-22 f1-3)) + ) + ) + ) + (suspend) + (until #f + (+! (-> self control unknown-word04) 1) + (ja :num! (seek!)) + (let ((gp-2 (-> self skel root-channel 1))) + (let ((f0-28 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 0.0 40960.0))) + (set! (-> gp-2 frame-interp 1) f0-28) + (set! (-> gp-2 frame-interp 0) f0-28) + ) + (set! (-> gp-2 param 0) 0.0) + (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-chan) + ) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) + (let ((v1-77 (new-stack-vector0)) + (f0-33 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-77 (-> self control transv) (vector-float*! v1-77 (-> self control dynam gravity-normal) f0-33)) + (let* ((f2-3 (vector-length v1-77)) + (f1-7 f2-3) + ) + (if (< (-> self control current-surface transv-max) f2-3) + (set! f2-3 (-> self control current-surface transv-max)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-33) + (vector-float*! v1-77 v1-77 (/ f2-3 f1-7)) + ) + ) + ) + (if (and (time-elapsed? (-> self state-time) (-> *TARGET-bank* fall-timeout)) (!= (-> self tobot?) 'tobot)) + (go target-falling #f) + ) + (if (and (= *cheat-mode* 'debug) + (cpad-hold? (-> self control cpad number) r2) + (not *pause-lock*) + (!= (-> self tobot?) 'tobot) + ) + (go target-falling #f) + ) + (suspend) + ) + ) + #f + ) + :post target-post + ) + +(defstate target-flop-hit-ground (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (-> self next-state) (= (-> self next-state name) 'target-flop-hit-ground)) + (case message + (('swim 'slide) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + (else + (target-jump-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (let ((f0-1 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control highest-jump-mark) (-> self control trans)) + ) + ) + ) + (if (< (-> *TARGET-bank* fall-far) f0-1) + (go target-hit-ground-hard f0-1) + ) + ) + (target-land-effect) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (set-time! (-> self state-time)) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (set-forward-vel 0.0) + (set! (-> self control mod-surface) *flop-land-mods*) + (logclear! (-> *flop-land-mods* flags) (surface-flag check-edge)) + (logior! (-> self target-flags) (target-flags tf15)) + (set! (-> self neck flex-blend) 0.0) + (cond + ((= arg0 'swim) + ) + (else + ) + ) + ) + :exit target-exit + :trans (behavior () + (when (and (!= (-> self control unknown-spool-anim00) 'stuck) (!= (-> self state-time) (current-time))) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #f) + ) + (go target-attack-air 'flop) + ) + ) + (when (and (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (not (time-elapsed? (-> self state-time) (seconds 0.25))) + ) + (do-effect + (-> self skel effect) + (the-as symbol "group-red-eco-spinkick") + (ja-frame-num 0) + (if (rand-vu-percent? 0.5) + 28 + 19 + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (let ((v1-37 (ja-group))) + (if (and (and v1-37 (= v1-37 jakb-flop-down-land-ja)) (>= (ja-aframe-num 0) 28.0)) + (logior! (-> *flop-land-mods* flags) (surface-flag check-edge)) + ) + ) + (slide-down-test) + ) + :code (behavior ((arg0 symbol)) + (target-hit-ground-anim arg0 (are-still?)) + (go target-falling #f) + ) + :post target-post + ) + +(defstate target-roll (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (= message 'touched) + (send-event proc 'roll) + ) + (case message + (('gun-combo) + (when (-> block param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (let ((a0-8 (-> self control))) + (set-quaternion! a0-8 (-> self control dir-targ)) + (go target-duck-stance (the-as symbol a0-8)) + ) + ) + #t + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (target-collide-set! 'duck 1.0) + (set-time! (-> self state-time)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (set! (-> self control mod-surface) *roll-mods*) + (+! (-> self control unknown-word02) 1) + (rot->dir-targ! (-> self control)) + (set-forward-vel (+ (-> *TARGET-bank* roll-speed-min) + (* (-> *TARGET-bank* roll-speed-inc) (the float (+ (-> self control unknown-word02) -1))) + ) + ) + (if (or (< (fabs (-> self control local-slope-x)) 0.3) (< 0.3 (fabs (-> self control local-slope-z)))) + (set! (-> self control bend-target) 1.0) + ) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control did-move-to-pole-or-max-jump-height) 0.0) + (set! (-> self gun track-target-hold-time) 0) + ) + :exit (behavior () + (when (not (and (-> self next-state) (= (-> self next-state name) 'target-roll))) + (set! (-> self control unknown-word02) 0) + (set-time! (-> self control last-roll-end-time)) + ) + (target-exit) + (target-collide-set! 'normal 0.0) + ) + :code (behavior () + (let ((gp-0 0)) + 0 + (let ((s5-0 0) + (f30-0 1.0) + (s4-0 #f) + ) + (ja-channel-push! 1 (seconds 0.04)) + (cond + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-duck-roll-ja) 0.0 15 30 1.0 0.0 #f) + (ja :group! jakb-gun-duck-roll-ja :num! min) + ) + (else + (ja :group! jakb-duck-roll-ja :num! min) + ) + ) + (until (ja-done? 0) + (if (cpad-pressed? (-> self control cpad number) x) + (set! gp-0 (the-as int (current-time))) + ) + (when (and (not s4-0) (time-elapsed? (-> self state-time) (seconds 0.2))) + (set! s4-0 #t) + (set-time! (-> self gun combo-window-start)) + (set! (-> self gun combo-window-state) (-> self state name)) + ) + (when (and (or (smack-surface? #f) (>= (-> self control surface-slope-z) 0.7)) + (>= (the-as uint (- (current-time) (the-as int (-> self control unknown-word04)))) (the-as uint 3)) + (time-elapsed? (-> self state-time) 1) + ) + (when (>= 6.0 (ja-aframe-num 0)) + (if (using-gun? self) + (target-top-anim-base-mode 15) + ) + (target-shoved + (-> *TARGET-bank* smack-surface-dist) + (-> *TARGET-bank* smack-surface-height) + (the-as process #f) + target-hit + ) + ) + (if (zero? s5-0) + (set! s5-0 (the-as int (current-time))) + ) + ) + (if (cpad-pressed? (-> self control cpad number) square) + (current-time) + ) + (compute-alignment! (-> self align)) + (cond + ((nonzero? s5-0) + ) + (else + (align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 f30-0) + (let ((s3-2 (new-stack-vector0))) + (vector-matrix*! s3-2 (-> self control transv) (-> self control w-R-c)) + (set! (-> s3-2 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) s3-2 (-> self control c-R-w)) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) + ) + ) + (if (and (or (not (time-elapsed? (the-as time-frame gp-0) (-> *TARGET-bank* roll-jump-pre-window))) + (cpad-pressed? (-> self control cpad number) x) + ) + (can-jump? 'target-roll-flip) + ) + (go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist)) + ) + ) + (set-time! (-> self state-hook-time)) + (set! (-> self state-hook) + (the-as + (function none :behavior target) + (lambda :behavior target + () + (cond + ((time-elapsed? (-> self state-hook-time) (-> *TARGET-bank* roll-jump-post-window)) + (let ((v0-0 (the-as object nothing))) + (set! (-> self state-hook) (the-as (function none :behavior target) v0-0)) + v0-0 + ) + ) + (else + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'target-roll-flip) + ) + (go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist)) + ) + ) + ) + ) + ) + ) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) + (go target-duck-stance 'roll) + ) + :post target-post + ) + +(defstate target-roll-flip (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('gun-combo) + (when (-> block param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-falling #f) + ) + #t + ) + (else + (target-jump-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float)) + (set! (-> self control mod-surface) *roll-flip-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (set! (-> self gun track-target-hold-time) 0) + (set-time! (-> self gun combo-window-start)) + (set! (-> self gun combo-window-state) (-> self state name)) + (target-collide-set! 'duck 1.0) + ) + :exit (behavior () + (target-exit) + (target-collide-set! 'normal 0.0) + ) + :trans (behavior () + (if (and (or (smack-surface? #f) + (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + ) + (and (!= (-> self state-time) (current-time)) (not (using-gun? self))) + ) + (target-shoved + (-> *TARGET-bank* smack-surface-dist) + (-> *TARGET-bank* smack-surface-height) + (the-as process #f) + target-hit + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) + (can-feet? #f) + (let ((v1-20 (ja-group))) + (and (and v1-20 (= v1-20 jakb-jump-loop-ja)) (= (-> self skel root-channel 0) (-> self skel channel))) + ) + ) + (go target-attack-air #f) + ) + ) + :code (behavior ((arg0 float) (arg1 float)) + (local-vars (v1-37 symbol)) + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! jakb-roll-flip-ja :num! min) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-roll-flip-ja) 0.0 0 30 1.0 0.0 #f) + ) + (let ((f30-0 1.0)) + (until v1-37 + (compute-alignment! (-> self align)) + (if (not (ja-max? 0)) + (align! + (-> self align) + (align-opts adjust-y-vel adjust-xz-vel) + 1.0 + (/ arg0 (-> *TARGET-bank* roll-flip-art-height)) + (* f30-0 (/ arg1 (-> *TARGET-bank* roll-flip-art-dist))) + ) + (align! + (-> self align) + (align-opts adjust-xz-vel) + 1.0 + 1.0 + (* f30-0 (/ arg1 (-> *TARGET-bank* roll-flip-art-dist))) + ) + ) + (let ((s4-1 (new-stack-vector0))) + (vector-matrix*! s4-1 (-> self control transv) (-> self control w-R-c)) + (set! (-> s4-1 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) s4-1 (-> self control c-R-w)) + ) + (suspend) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) + (set! v1-37 + (or (ja-max? 0) + (and (>= (ja-aframe-num 0) 4.0) (logtest? (-> self control status) (collide-status on-surface))) + ) + ) + ) + ) + (set-time! (-> self state-time)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (when (time-elapsed? (-> self state-time) (seconds 0.01)) + (let ((v1-50 (ja-group))) + (when (not (and v1-50 (= v1-50 jakb-jump-loop-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-jump-loop-ja :num! min) + ) + ) + ) + (let ((v1-59 (new-stack-vector0)) + (f0-19 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-59 (-> self control transv) (vector-float*! v1-59 (-> self control dynam gravity-normal) f0-19)) + (let* ((f2-0 (vector-length v1-59)) + (f1-7 f2-0) + (f2-1 (* 0.9 f2-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-19) + (vector-float*! v1-59 v1-59 (/ f2-1 f1-7)) + ) + ) + ) + (suspend) + (let ((v1-62 (ja-group))) + (if (and v1-62 (= v1-62 jakb-jump-loop-ja)) + (ja :num! (loop!)) + (ja :num-func num-func-identity :frame-num max) + ) + ) + ) + (target-land-effect) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.1))) + (set-time! (-> self state-hook-time)) + (set! (-> self state-hook) + (the-as + (function none :behavior target) + (lambda :behavior target + () + (cond + ((time-elapsed? (-> self state-hook-time) (seconds 0.1)) + (let ((v0-0 (the-as object nothing))) + (set! (-> self state-hook) (the-as (function none :behavior target) v0-0)) + v0-0 + ) + ) + (else + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + (or (not (-> *TARGET-bank* strafe-duck-jump)) (not (enabled-gun? self))) + ) + (go target-high-jump (-> *TARGET-bank* flip-jump-height-min) (-> *TARGET-bank* flip-jump-height-max) 'flip) + ) + ) + ) + ) + ) + ) + (cond + ((not (can-exit-duck? self)) + (go target-duck-stance #f) + ) + (else + (let ((v1-86 (ja-group))) + (if (and v1-86 (= v1-86 jakb-jump-loop-ja)) + (go target-hit-ground #f) + (go target-stance) + ) + ) + ) + ) + ) + :post target-post + ) diff --git a/goal_src/jak3/engine/target/target2.gc b/goal_src/jak3/engine/target/target2.gc index a0f3f3c42f3..fd5466200e6 100644 --- a/goal_src/jak3/engine/target/target2.gc +++ b/goal_src/jak3/engine/target/target2.gc @@ -7,3 +7,2007 @@ ;; DECOMP BEGINS +(let ((a0-1 (copy *walk-no-turn-mods* 'global))) + (set! (-> a0-1 flags) (surface-flag gun-off gun-fast-exit)) + (set! *trip-mods* a0-1) + ) + +(defstate target-load-wait (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('loading) + (set-time! (-> self state-time)) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :exit target-exit + :code (behavior () + (set! (-> self control mod-surface) *trip-mods*) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.05))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-trip-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (let ((v1-22 (process->ppointer self))) + (set! (-> a1-3 from) v1-22) + ) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'joystick) + (set! (-> a1-3 param 0) (the-as uint 0)) + (set! (-> a1-3 param 1) (the-as uint 0)) + (send-event-function *camera* a1-3) + ) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.3)) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) + (suspend) + ) + ) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! jakb-painful-land-ja :num! (seek!) :frame-num (ja-aframe 40.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-painful-land-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (go target-stance) + ) + :post target-no-stick-post + ) + +(defstate target-stance-ambient (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('movie) + (go target-stance) + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self neck flex-blend) 0.0) + ((-> target-stance enter)) + (let ((v1-2 (rand-vu-int-count 7))) + (cond + ((zero? v1-2) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-1" :anim-name "jak-ambient-1" :parts 1 :command-list '()) + ) + ) + ((= v1-2 1) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-2" :anim-name "jak-ambient-2" :parts 1 :command-list '()) + ) + ) + ((= v1-2 2) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-3" :anim-name "jak-ambient-3" :parts 1 :command-list '()) + ) + ) + ((= v1-2 3) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-4" :anim-name "jak-ambient-4" :parts 1 :command-list '()) + ) + ) + ((= v1-2 4) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-5" :anim-name "jak-ambient-5" :parts 1 :command-list '()) + ) + ) + ((= v1-2 5) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-6" :anim-name "jak-ambient-6" :parts 1 :command-list '()) + ) + ) + (else + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-7" :anim-name "jak-ambient-7" :parts 1 :command-list '()) + ) + ) + ) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (set-time! (-> self ambient-time)) + (let ((a0-0 (-> self spool-anim))) + (when (and a0-0 (= (-> *setting-control* user-current spooling) (process->ppointer self))) + (ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1) + (ja-channel-set! 1) + (ja :group! jakb-stance-loop-ja :num! min) + ) + ) + (set! (-> self spool-anim) #f) + ((-> target-stance exit)) + (target-exit) + ) + :trans (behavior () + (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> self spool-anim name) + 0 + -99.0 + (new 'static 'sound-id) + ) + (if (or (cpad-hold? (-> self control cpad number) start l1 r1 triangle circle x square) + *progress-process* + (want-to-powerjak?) + ) + (go target-stance) + ) + ) + :code (behavior () + (while (let ((v1-15 (file-status *art-control* (-> self spool-anim name) 0))) + (not (or (= v1-15 'locked) (= v1-15 'active))) + ) + (if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-stance) + ) + (suspend) + (ja :num! (loop!)) + ) + (ja-play-spooled-anim + (-> self spool-anim) + (the-as art-joint-anim jakb-stance-loop-ja) + (the-as art-joint-anim jakb-stance-loop-ja) + (the-as + (function process-drawable symbol) + (lambda :behavior target () (!= (-> *cpad-list* cpads 0 stick0-speed) 0.0)) + ) + (spooler-flags) + ) + (go target-stance) + ) + :post target-post + ) + +(defstate target-stance-look-around (target) + :event target-standard-event-handler + :enter (-> target-stance enter) + :exit (-> target-stance exit) + :trans (-> target-stance trans) + :code (behavior () + (while (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'dist-from-interp-src) + (and (or (< (the-as float (send-event-function *camera* a1-0)) 4915.2) + (not (time-elapsed? (-> self state-time) (seconds 0.05))) + ) + (and (not (time-elapsed? (-> self state-time) (seconds 0.07))) (zero? (ja-group-size))) + ) + ) + (suspend) + ) + (go target-stance) + ) + :post target-post + ) + +(let ((a0-22 (copy *duck-mods* 'global))) + (set! (-> a0-22 flags) (surface-flag gun-inactive)) + (set! *look-around-mods* a0-22) + ) + +(defstate target-look-around (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (let ((v1-4 message)) + (cond + ((= v1-4 'end-mode) + (case (-> block param 0) + (('in-head) + (if (not (focus-test? self dead)) + (go target-stance-look-around) + ) + ) + ) + ) + ((= v1-4 'gun) + (target-gun-fire (the-as pickup-type (-> block param 0))) + ) + ((or (= v1-4 'push-trans) (= v1-4 'push-transv)) + (set! (-> self cam-user-mode) 'normal) + (target-standard-event-handler proc argc message block) + ) + ((-> self control danger-mode) + (target-dangerous-event-handler proc argc message block) + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self cam-user-mode) 'look-around) + (set! (-> self control mod-surface) *look-around-mods*) + (logior! (-> self focus-status) (focus-status in-head)) + (set-setting! 'mode-name 'cam-eye 0.0 0) + ) + :exit (behavior () + (set! (-> self cam-user-mode) 'normal) + (target-exit) + (remove-setting! 'mode-name) + ) + :trans (behavior () + (when (or (cpad-pressed? (-> self control cpad number) r3) + (< 2048.0 (target-height-above-ground)) + (not (-> *setting-control* user-current allow-look-around)) + ) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons r3)) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons r3)) + (set! (-> self cam-user-mode) 'normal) + ) + ) + :code (behavior () + (local-vars (a1-0 event-message-block) (f30-0 float)) + (until (>= f30-0 (the-as float (send-event-function *camera* a1-0))) + (if (!= (-> self cam-user-mode) 'look-around) + (go target-stance) + ) + (suspend) + (set! f30-0 8192.0) + (set! a1-0 (new 'stack-no-clear 'event-message-block)) + (let ((v1-5 (process->ppointer self))) + (set! (-> a1-0 from) v1-5) + ) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'dist-from-interp-dest) + ) + (ja-channel-set! 0) + (set! (-> self control transv quad) (the-as uint128 0)) + (until #f + (if (!= (-> self cam-user-mode) 'look-around) + (go target-stance-look-around) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + ) + :post (behavior () + (target-no-move-post) + (when (using-gun? self) + (let ((gp-0 (camera-matrix))) + (let ((s5-1 (vector-float*! (new-stack-vector0) (-> gp-0 fvec) 8192.0))) + (vector+float*! s5-1 s5-1 (-> gp-0 uvec) -4096.0) + (vector+! (-> self gun fire-point) (camera-pos) s5-1) + ) + (set! (-> self gun fire-dir-out quad) (-> gp-0 fvec quad)) + ) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) + (target-gun-check) + ) + ) + ) + +(defstate target-grab (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (case message + (('end-mode) + (case (-> block param 0) + (('grab) + (go target-stance) + ) + (('gun) + (target-gun-end-mode #t) + ) + (('darkjak) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (target-darkjak-end-mode #t) + (set! v0-0 'target-darkjak-get-off) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + ) + (('lightjak) + (if (and (focus-test? self light) (nonzero? (-> self lightjak))) + (target-lightjak-end-mode #t) + ) + ) + ) + ) + (('play-anim) + (go target-grab (the-as symbol (-> block param 0))) + ) + (('clone-anim) + (go target-clone-anim (process->handle (the-as process (-> block param 0)))) + ) + (('change-mode) + (case (-> block param 0) + (('normal) + (cond + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (target-darkjak-end-mode #t) + ) + ((and (focus-test? self light) (nonzero? (-> self lightjak))) + (target-lightjak-end-mode #t) + ) + ((using-gun? self) + (target-gun-end-mode #t) + ) + ) + ) + (('gun) + (cond + ((using-gun? self) + (send-event self 'gun-type (-> block param 2)) + ) + ((want-to-gun? self #t) + (if (logtest? (-> self game features) (game-feature gun)) + (target-gun-init (the-as pickup-type (-> block param 2))) + ) + ) + ) + ) + (('demo) + enter-state + (go target-demo) + ) + (('title) + enter-state + (go target-title) + ) + (('grab) + (if (and (and (-> self next-state) (= (-> self next-state name) 'target-grab-ride)) (-> block param 1)) + (go target-grab 'stance) + ) + ) + (('grab-ride) + (if (and (and (-> self next-state) (= (-> self next-state name) 'target-grab)) (-> block param 1)) + (go target-grab-ride (process->handle proc)) + ) + ) + ) + ) + (('anim) + (set! v0-0 (-> block param 0)) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self board latch?) #f) + (set! (-> self control mod-surface) *grab-mods*) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self target-flags) (target-flags tf2)) + (logior! (-> self focus-status) (focus-status grabbed)) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (logior! (-> self skel effect flags) (effect-control-flag ecf2)) + (let ((v1-12 (new-stack-vector0)) + (f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-12 (-> self control transv) (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-2)) + (let* ((f1-2 (vector-length v1-12)) + (f2-0 f1-2) + ) + (if (< 0.0 f0-2) + (set! f0-2 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-2) + (vector-float*! v1-12 v1-12 (/ f1-2 f2-0)) + ) + ) + ) + ) + :exit (behavior () + (let ((v1-1 (-> self control root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self control backup-collide-with)) + ) + (set-time! (-> self ambient-time)) + (logclear! (-> self target-flags) (target-flags tf2)) + (logclear! (-> self skel effect flags) (effect-control-flag ecf2)) + (target-exit) + ) + :code (behavior ((arg0 symbol)) + (set-forward-vel 0.0) + (let ((gp-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! gp-0 (- (current-time) (-> self clock old-frame-counter))) + (suspend) + ) + (if (or (> gp-0 0) + (let ((v1-10 (ja-group))) + (and v1-10 (or (= v1-10 jakb-jump-ja) (= v1-10 jakb-jump-loop-ja) (= v1-10 jakb-duck-high-jump-ja))) + ) + ) + (target-hit-ground-anim #f (are-still?)) + ) + ) + (-> self control unknown-spool-anim00) + (until #f + (let ((gp-2 (-> self control unknown-spool-anim00))) + (case gp-2 + (('stance) + (cond + ((logtest? (water-flag swimming) (-> self water flags)) + (ja-channel-push! 1 (seconds 0.15)) + (until #f + (ja :group! jakb-swim-stance-ja :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) + ) + ) + ) + #f + ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (ja-channel-push! 1 (seconds 0.15)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 446) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (when (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (set! (-> self control unknown-word04) (the-as uint 'stance)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ((and (focus-test? self light) (nonzero? (-> self lightjak))) + (ja-channel-push! 1 (seconds 0.15)) + (until #f + (ja-no-eval :group! jakb-lightjak-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (when (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (set! (-> self control unknown-word04) (the-as uint 'stance)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ((using-gun? self) + (let* ((v1-133 (gun->eco (-> self gun gun-type))) + (s5-2 (cond + ((= v1-133 (pickup-type eco-blue)) + jakb-gun-stance-blue-ja + ) + ((= v1-133 (pickup-type eco-yellow)) + jakb-gun-stance-yellow-ja + ) + ((= v1-133 (pickup-type eco-dark)) + jakb-gun-stance-dark-ja + ) + (else + jakb-gun-stance-ja + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.15)) + (until #f + (ja :group! s5-2 :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (if (or (!= gp-2 (-> self control unknown-spool-anim00)) (not (using-gun? self))) + (goto cfg-131) + ) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + ) + (else + (target-stance-push 1) + (until #f + (ja-no-eval :group! jakb-stance-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (or (!= gp-2 (-> self control unknown-spool-anim00)) (using-gun? self)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + ) + (('shock-in) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! jakb-shocked-ja :num! (seek! (ja-aframe 15.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek! (ja-aframe 15.0 0))) + ) + (until #f + (ja-no-eval :group! jakb-shocked-ja :num! (seek! (ja-aframe 26.0 0)) :frame-num (ja-aframe 16.0 0)) + (until (ja-done? 0) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek! (ja-aframe 26.0 0))) + ) + ) + #f + ) + (('shock-out) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! jakb-shocked-ja :num! (seek!) :frame-num (ja-aframe 17.0 0)) + (until (ja-done? 0) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control unknown-word04) (the-as uint 'stance)) + ) + (('target-darkjak-get-off) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-darkjak-get-off-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 10.0 60.0)) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-darkjak-get-off-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 10.0 60.0)) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control unknown-word04) (the-as uint 'stance)) + ) + ) + ) + (label cfg-131) + ) + #f + ) + :post (behavior () + (if (logtest? (-> self control status) (collide-status on-surface)) + (set! (-> self control transv quad) (the-as uint128 0)) + ) + (set! (-> self game kiosk-timeout) (-> *display* game-clock frame-counter)) + (target-no-stick-post) + ) + ) + +(defstate target-grab-ride (target) + :event (-> target-grab event) + :enter (behavior ((arg0 handle)) + ((-> target-grab enter) 'stance) + ) + :exit (behavior () + ((-> target-grab exit)) + (let ((v1-2 (-> self control root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-2 prim-core collide-with) (-> self control backup-collide-with)) + ) + ) + :code (behavior ((arg0 handle)) + (let ((v1-1 (-> self control root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-channel-set! 0) + (until #f + (let* ((s5-0 (handle->process arg0)) + (a0-6 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if a0-6 + (move-to-point! (-> self control) (get-trans (the-as process-focusable a0-6) 0)) + ) + ) + (suspend) + ) + #f + ) + :post (behavior () + (set! (-> self game kiosk-timeout) (-> *display* game-clock frame-counter)) + (target-no-move-post) + ) + ) + +(defstate target-pole-cycle (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + (target-standard-event-handler proc argc message block) + ) + ) + :enter (behavior ((arg0 handle)) + (set! (-> self control anim-handle) arg0) + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *pole-mods*) + (logior! (-> self focus-status) (focus-status pole)) + (target-collide-set! 'pole 0.0) + (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (set! (-> self control transv quad) (the-as uint128 0)) + (send-event *camera* 'ease-in) + (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float #f)) + (set! (-> self control hand-to-edge-dist) 0.5) + ) + :exit (behavior () + (target-collide-set! 'normal 0.0) + (logclear! (-> self focus-status) (focus-status pole)) + (set! (-> self control anim-handle) (the-as handle #f)) + ) + :trans (behavior () + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + (time-elapsed? (-> self state-time) (seconds 0.4)) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (cond + ((< 44.0 (ja-aframe-num 0)) + (set-forward-vel -49152.0) + (let ((v1-19 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-19 (-> self control transv) (vector-float*! v1-19 (-> self control dynam gravity-normal) f0-2)) + ) + (let* ((f0-3 (vector-length v1-19)) + (f1-1 f0-3) + (f2-0 -81920.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-19 v1-19 (/ f0-3 f1-1)) + ) + ) + ) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (go target-falling 'target-pole-cycle) + ) + ((>= (ja-aframe-num 0) 14.0) + (remove-exit) + (go target-pole-flip-up 28672.0 28672.0 (* 1024.0 (- 26.0 (ja-aframe-num 0)))) + ) + (else + (remove-exit) + (go target-pole-flip-forward 14336.0 14336.0 57344.0) + ) + ) + ) + ) + :code (behavior ((arg0 handle)) + (sound-play "edge-grab") + (target-compute-pole) + (set! (-> self control unknown-word04) + (the-as + uint + (vector-dot (-> self control edge-grab-edge-dir) (vector-normalize! (-> self control unknown-vector37) 1.0)) + ) + ) + (let ((v1-8 (ja-group))) + (cond + ((and v1-8 (= v1-8 jakb-pole-jump-loop-ja)) + (while (not (-> self control did-move-to-pole-or-max-jump-height)) + (ja :num! (seek!)) + (suspend) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe 37.0 0)) + ) + (else + (while (not (-> self control did-move-to-pole-or-max-jump-height)) + (suspend) + ) + (suspend) + (ja-channel-push! 1 (seconds 0.15)) + ) + ) + ) + (ja-no-eval :group! jakb-pole-cycle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (set! (-> self anim-seed) (the-as uint (if (rand-vu-percent? 0.1) + 0 + 1 + ) + ) + ) + (ja-no-eval :group! jakb-pole-cycle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (can-play-stance-amibent?) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post target-no-move-post + ) + +(defstate target-pole-flip-up (target) + :event target-standard-event-handler + :exit (-> target-pole-cycle exit) + :code (behavior ((arg0 float) (arg1 float) (arg2 float)) + (let ((f0-2 (+ 1.0 (fmin 17.0 (ja-aframe-num 0))))) + (ja-no-eval :group! jakb-pole-flip-up-ja :num! (seek!) :frame-num (ja-aframe f0-2 0)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-forward-vel arg2) + (go target-pole-flip-up-jump arg0 arg1) + ) + :post target-no-move-post + ) + +(defstate target-pole-flip-up-jump (target) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + ((-> target-jump-forward enter) arg0 arg1) + (set! (-> self control mod-surface) *forward-pole-jump-mods*) + ) + :exit target-exit + :trans (behavior () + ((-> target-jump-forward trans)) + (vector-flatten! (-> self control transv) (-> self control transv) (-> self control edge-grab-edge-dir)) + ) + :code (behavior ((arg0 float) (arg1 float)) + (send-event *camera* 'damp-up) + (ja :group! jakb-pole-jump-loop-ja :num! min) + (let ((f0-1 (target-height-above-ground)) + (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) + (suspend) + (ja :num! (loop!)) + (set! f0-1 (target-height-above-ground)) + (set! f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + ) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (ja :group! jakb-jump-loop-ja :num! (loop!)) + ) + #f + ) + :post target-post + ) + +(defstate target-pole-flip-forward (target) + :event target-standard-event-handler + :exit (-> target-pole-cycle exit) + :code (behavior ((arg0 float) (arg1 float) (arg2 float)) + (let ((f30-1 (+ 4.0 (ja-aframe-num 0)))) + (ja-no-eval :group! jakb-pole-flip-forward-ja :num! (seek! (ja-aframe 16.0 0)) :frame-num (ja-aframe f30-1 0)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 16.0 0))) + ) + (set-forward-vel arg2) + (go target-pole-flip-forward-jump arg0 arg1) + ) + :post target-no-move-post + ) + +(defstate target-pole-flip-forward-jump (target) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + ((-> target-jump enter) arg0 arg1 (the-as surface #f)) + (set! (-> self control mod-surface) *forward-pole-jump-mods*) + ) + :exit target-exit + :trans (behavior () + ((-> target-jump-forward trans)) + (vector-flatten! (-> self control transv) (-> self control transv) (-> self control edge-grab-edge-dir)) + ) + :code (behavior ((arg0 float) (arg1 float)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ((the-as (function none) (-> target-pole-flip-up-jump code))) + ) + :post target-post + ) + +(defstate target-edge-grab (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (case (-> block param 0) + (('edge-grab) + (go target-falling 'target-edge-grab) + ) + ) + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> *edge-grab-info* pilot-edge-grab?) #f) + (set! (-> self control unknown-handle000) (the-as handle #f)) + (set! (-> self control mod-surface) *edge-grab-mods*) + (set-time! (-> self control edge-grab-start-time)) + (logior! (-> self control root-prim prim-core action) (collide-action dont-push-away)) + (logior! (-> self focus-status) (focus-status edge-grab)) + (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (set! (-> self control transv quad) (the-as uint128 0)) + (send-event *camera* 'ease-in) + (if (!= (-> self skel top-anim interp) 0.0) + (set! (-> self skel top-anim interp) 0.000000000000000000000000000000001) + ) + ) + :exit (behavior () + (let ((v1-2 (handle->process (-> self control unknown-handle000)))) + (when v1-2 + (if (not (-> self control unknown-symbol000)) + (logclear! (-> (the-as process-focusable v1-2) root root-prim prim-core action) (collide-action edge-grabbed)) + ) + ) + ) + (set! (-> self control unknown-handle000) (the-as handle #f)) + (when (focus-test? self edge-grab) + (logclear! (-> self focus-status) (focus-status edge-grab)) + (logclear! (-> self control root-prim prim-core action) (collide-action dont-push-away)) + (send-event *camera* 'damp-up) + ) + (if (!= (-> self skel top-anim interp) 0.0) + (set! (-> self skel top-anim interp) 1.0) + ) + (set! (-> self control draw-offset y) 0.0) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) + (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + (cond + ((or (< -0.2 (local-pad-angle)) (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)) + (let ((a1-2 (new 'stack-no-clear 'collide-query))) + (let ((v1-25 a1-2)) + (set! (-> v1-25 spheres) (-> *collide-edge-work* world-player-leap-up-spheres)) + (set! (-> v1-25 best-other-prim) (the-as collide-shape-prim 6)) + (set! (-> v1-25 collide-with) (-> self control root-prim prim-core collide-with)) + (set! (-> v1-25 ignore-process0) #f) + (set! (-> v1-25 ignore-process1) #f) + (set! (-> v1-25 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-25 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-25 action-mask) (collide-action solid)) + ) + (when (not (fill-and-probe-using-spheres *collide-cache* a1-2)) + (if (!= (-> self skel top-anim interp) 0.0) + (set! (-> self skel top-anim interp) 1.0) + ) + (remove-exit) + (go + target-edge-grab-jump + (-> *TARGET-bank* edge-grab-jump-height-min) + (-> *TARGET-bank* edge-grab-jump-height-max) + #f + ) + ) + ) + ) + (else + (when (!= (-> self skel top-anim interp) 0.0) + (set! (-> self skel top-anim interp) 1.0) + (let* ((v1-47 (-> self skel float-channels)) + (v1-52 (cond + ((= v1-47 1) + (-> self skel channel (-> self skel active-channels)) + ) + ((= v1-47 2) + (-> self skel channel (+ (-> self skel active-channels) 1)) + ) + (else + (the-as joint-control-channel #f) + ) + ) + ) + ) + (if v1-52 + (set! (-> v1-52 frame-interp 1) 1.0) + ) + ) + ) + (remove-exit) + (go target-edge-grab-off) + ) + ) + ) + (if (using-gun? self) + (seek! (-> self control draw-offset y) 778.24 (* 4096.0 (seconds-per-frame))) + ) + ) + :code (behavior () + (target-compute-edge) + (let ((gp-0 *edge-grab-info*)) + (set! (-> self control unknown-handle000) (-> gp-0 actor-handle)) + (set! (-> self control unknown-symbol000) #f) + (let ((v1-4 (handle->process (-> self control unknown-handle000)))) + (if v1-4 + (logior! (-> (the-as process-focusable v1-4) root root-prim prim-core action) (collide-action edge-grabbed)) + ) + ) + (set! (-> self control unknown-word04) + (the-as + uint + (vector-dot (-> self control edge-grab-edge-dir) (vector-normalize! (-> self control unknown-vector37) 1.0)) + ) + ) + (cond + ((= (-> gp-0 pilot-edge-grab?) 'target-double-jump) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-jump-ja :num! (seek! (ja-aframe 14.0 0) 0.75) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 14.0 0) 0.75)) + ) + (sound-play "jump-double") + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-jump-ja :num! (seek! (ja-aframe 14.0 0)) :frame-num (ja-aframe 5.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 14.0 0))) + ) + ) + ((-> gp-0 pilot-edge-grab?) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-jump-ja :num! (seek! (ja-aframe 14.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 14.0 0))) + ) + ) + (else + (while (< 0.0 (-> self control hand-to-edge-dist)) + (let ((v1-60 (ja-group))) + (when (not (and v1-60 (= v1-60 jakb-jump-loop-ja))) + (ja-channel-push! 1 (the-as time-frame (if (using-gun? self) + 15 + 45 + ) + ) + ) + (ja :group! jakb-jump-loop-ja :num! min) + ) + ) + (suspend) + ) + ) + ) + ) + (target-edge-grab-anim (the-as float (-> self control unknown-word04))) + ) + :post target-no-move-post + ) + +(defstate target-edge-grab-jump (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (case (-> block param 0) + (('edge-grab) + (go target-falling 'target-edge-grab) + ) + ) + ) + (('ladder) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :exit (-> target-edge-grab exit) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (case arg2 + (('ladder) + (ja-channel-push! 1 (seconds 0.1)) + ) + (else + (when (-> *edge-grab-info* pilot-edge-grab?) + (set! arg0 (+ 8192.0 arg0)) + (set! arg1 (+ 8192.0 arg1)) + ) + (ja-channel-set! 1) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (logclear! (-> self focus-status) (focus-status edge-grab)) + (logclear! (-> self control root-prim prim-core action) (collide-action dont-push-away)) + (set! (-> self control transv quad) (the-as uint128 0)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((a1-4 (cond + ((using-gun? self) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-edge-grab-to-jump-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + jakb-gun-edge-grab-to-jump-ja + ) + (else + jakb-edge-grab-to-jump-ja + ) + ) + ) + ) + (ja-no-eval :group! a1-4 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (set! (-> self control transv quad) (the-as uint128 0)) + (case arg2 + (('ladder) + ) + (else + (target-compute-edge-rider) + ) + ) + (compute-alignment! (-> self align)) + (when (not (logtest? (-> self align flags) (align-flags disabled))) + (vector-matrix*! s3-0 (the-as vector (-> self align delta)) (-> self control c-R-w)) + (move-by-vector! (-> self control) s3-0) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self control time-of-last-clear-wall-in-jump) 0) + (set-forward-vel 16384.0) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) + (send-event *camera* 'damp-up) + (go target-jump-forward arg0 arg1) + ) + :post target-no-move-post + ) + +(defstate target-edge-grab-off (target) + :event target-standard-event-handler + :exit (-> target-edge-grab exit) + :code (behavior () + (ja-channel-set! 1) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (send-event *camera* 'damp-up) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (if (using-gun? self) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-edge-grab-off-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-no-eval :group! jakb-edge-grab-off-ja :num! (seek! (ja-aframe 191.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (when (not (logtest? (-> self align flags) (align-flags disabled))) + (vector-matrix*! gp-0 (the-as vector (-> self align delta)) (-> self control c-R-w)) + (move-by-vector! (-> self control) gp-0) + ) + (suspend) + (ja :num! (seek! (ja-aframe 191.0 0))) + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (logclear! (-> self focus-status) (focus-status edge-grab)) + (logclear! (-> self control root-prim prim-core action) (collide-action dont-push-away)) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) + (vector-float*! (-> self control transv) (-> self control edge-grab-across-edge-dir) -40960.0) + (if (not (time-elapsed? (-> self control rider-time) (seconds 0.2))) + (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) + ) + (go target-falling 'target-edge-grab) + ) + :post target-no-move-post + ) + +(defstate target-eco-powerup (target) + :event target-standard-event-handler + :exit (behavior () + (logand! (-> self target-effect) -101) + (target-exit) + ) + :trans (behavior () + (slide-down-test) + ) + :code (behavior ((arg0 int) (arg1 float)) + (case arg0 + ((8) + (logior! (-> self target-effect) 36) + ) + ((7) + (logior! (-> self target-effect) 64) + ) + ) + (set! (-> self neck flex-blend) 0.0) + (set-time! (-> self state-time)) + (if (= arg1 (-> *FACT-bank* eco-full-inc)) + (set! (-> self control mod-surface) *double-jump-mods*) + (set! (-> self control mod-surface) *walk-mods*) + ) + (let ((gp-0 (lambda :behavior target + () + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (not (logtest? (water-flag touch-water) (-> self water flags))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + (target-jump-go) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #t)) + (go target-attack-air #f) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #f)) + (go target-running-attack) + ) + ) + ) + ) + (case arg0 + ((7) + (let ((s5-1 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! s5-1 (- (current-time) (-> self clock old-frame-counter))) + (if (>= s5-1 300) + (goto cfg-15) + ) + (gp-0) + (suspend) + ) + ) + (label cfg-15) + (set! (-> self post-hook) target-no-stick-post) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-powerjak-get-on-ja :num! (seek! max 1.2) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! max 1.2)) + ) + (ja-no-eval :group! jakb-powerjak-get-on-loop-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + (ja-no-eval :group! jakb-powerjak-get-on-ja :num! (seek! (ja-aframe 6.0 0) 1.2) :frame-num max) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! (ja-aframe 6.0 0) 1.2)) + ) + (go target-stance) + ) + (else + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-powerup-ja + :num! (seek! max (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 2.0 + 3.0 + ) + ) + :frame-num (ja-aframe + (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 0.0 + 6.0 + ) + 0 + ) + ) + (until (ja-done? 0) + (gp-0) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-y-vel) + 1.0 + (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 2.0 + 1.0 + ) + 1.0 + ) + (suspend) + (let ((a0-21 (-> self skel root-channel 0))) + (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group frames num-frames) -1))) + (let ((v1-124 (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 2.0 + 3.0 + ) + ) + ) + (set! (-> a0-21 param 1) v1-124) + ) + (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (go target-falling 'target-eco-powerup) + ) + ) + ) + ) + :post target-post + ) + +(let ((a0-90 (copy *walk-mods* 'global))) + (set! (-> a0-90 flags) (surface-flag gun-off gun-fast-exit)) + (set! *hit-ground-hard-mods* a0-90) + ) + +(defstate target-hit-ground-hard (target) + :event target-standard-event-handler + :enter (behavior ((arg0 float)) + (set! (-> self control last-running-attack-end-time) 0) + (set! (-> self control last-attack-end-time) 0) + (set-forward-vel 0.0) + (set! (-> self control mod-surface) *hit-ground-hard-mods*) + (logior! (-> self focus-status) (focus-status hit)) + ) + :exit (behavior () + (if (not (and (-> self next-state) (= (-> self next-state name) 'target-death))) + (logclear! (-> self focus-status) (focus-status dead hit)) + ) + (target-exit) + ) + :code (behavior ((arg0 float)) + (when (!= arg0 0.0) + (let ((f0-5 (the float (the int (+ 1.0 (/ (- arg0 (-> *TARGET-bank* fall-far)) (-> *TARGET-bank* fall-far-inc)))))) + ) + (pickup-collectable! + (-> self fact) + (pickup-type health) + (* (-> *FACT-bank* health-single-inc) (- (fmax 0.0 f0-5))) + (the-as handle #f) + ) + ) + (target-timed-invulnerable (-> *TARGET-bank* hit-invulnerable-timeout) self 1) + ) + (cond + ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (set! (-> self attack-info attacker) (the-as handle #f)) + (go target-death 'target-hit-ground-hard) + ) + (else + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (ja-channel-push! 1 1) + (ja :group! jakb-painful-land-ja :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) + ) + ) + (ja :group! jakb-painful-land-end-ja :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) + ) + ) + (go target-stance) + ) + ) + ) + :post target-no-stick-post + ) + +(define *hide-mods* (new 'static 'surface + :name 'run + :turnv 262144.0 + :turnvf 15.0 + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 40960.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags (surface-flag look-around gun-off) + ) + ) + +(defstate target-hide (target) + :event target-standard-event-handler + :enter (behavior () + (set! (-> self control mod-surface) *hide-mods*) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control wall-contact-normal) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (if (using-gun? self) + (target-top-anim-base-mode 37) + ) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control bend-target) 0.0) + ) + :trans (behavior () + (if (and (logtest? (water-flag wading) (-> self water flags)) (not (using-gun? self))) + (go target-wade-stance) + ) + (if (= (-> self control ground-pat material) (pat-material ice)) + (go target-ice-stance) + ) + (if (and (move-legs?) + (and (time-elapsed? (-> self state-time) (seconds 1)) + (let ((f0-1 (vector-dot (-> self control to-target-pt-xz) (-> self control wall-contact-normal)))) + (< 0.1 f0-1) + ) + ) + ) + (go target-walk) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (go target-duck-stance #f) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (if (and (using-gun? self) + (and (-> self next-state) (= (-> self next-state name) 'target-stance)) + (let ((v1-85 (ja-group))) + (and v1-85 (= v1-85 jakb-stance-loop-ja)) + ) + ) + (go target-gun-stance) + ) + (if (and (logtest? (game-feature feature19) (-> self game features)) + (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons r1) + ) + ) + (go target-carry-pickup) + ) + (slide-down-test) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + (set-forward-vel (* 0.7 (-> self control ctrl-xz-vel))) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-wall-hide-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 2 (seconds 0.05)) + (let ((a0-5 (-> self skel root-channel 1))) + (let ((f0-7 0.2)) + (set! (-> a0-5 frame-interp 1) f0-7) + (set! (-> a0-5 frame-interp 0) f0-7) + ) + (set! (-> a0-5 frame-group) (the-as art-joint-anim jakb-wall-hide-body-ja)) + (set! (-> a0-5 param 0) 1.0) + (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim jakb-wall-hide-body-ja) num-func-loop!) + ) + (set! (-> self control unknown-word04) (the-as uint 0.5)) + (set! (-> self control did-move-to-pole-or-max-jump-height) 0.5) + (set! (-> self control unknown-float35) (the-as float #f)) + (let ((gp-0 + (lambda :behavior target + () + (ja :chan 1 :num! (loop! (the-as float (-> self control unknown-word04)))) + (if (rand-vu-percent? 0.05) + (set! (-> self control did-move-to-pole-or-max-jump-height) (rand-vu-float-range 0.5 1.5)) + ) + (set! (-> self control unknown-word04) (the-as uint (seek + (the-as float (-> self control unknown-word04)) + (-> self control did-move-to-pole-or-max-jump-height) + (* 2.0 (seconds-per-frame)) + ) + ) + ) + (let ((v0-4 (> (-> self neck look-at-count) 0))) + (set! (-> self control unknown-float35) (the-as float v0-4)) + v0-4 + ) + ) + ) + ) + (until #f + (let ((s5-0 (rand-vu-int-range 30 600))) + (ja :group! jakb-wall-hide-head-ja) + (let ((s4-0 (current-time))) + (until (time-elapsed? s4-0 s5-0) + (gp-0) + (suspend) + ) + ) + ) + (let ((f30-0 (rand-vu-float-range 0.5 1.5))) + (cond + ((or (cpad-hold? 1 r3) (-> self control unknown-float35)) + (let ((f30-1 (rand-vu-float-range 0.25 0.75))) + (ja-no-eval :group! jakb-wall-hide-scared-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek!)) + ) + (let ((s5-1 (rand-vu-int-range 1 10))) + (dotimes (s4-1 s5-1) + (ja-no-eval :group! jakb-wall-hide-scared-loop-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + ) + (ja-no-eval :group! jakb-wall-hide-scared-return-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((rand-vu-percent? 0.5) + (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (let ((s5-2 (rand-vu-int-range 60 300)) + (s4-2 (current-time)) + ) + (until (time-elapsed? s4-2 s5-2) + (gp-0) + (suspend) + ) + ) + (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! 0.0 f30-0) :frame-num max) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! 0.0 f30-0)) + ) + ) + (else + (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! 0.0 f30-0) :frame-num max) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! 0.0 f30-0)) + ) + (let ((s5-3 (rand-vu-int-range 60 300)) + (s4-3 (current-time)) + ) + (until (time-elapsed? s4-3 s5-3) + (gp-0) + (suspend) + ) + ) + (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + ) + ) + #f + ) + :post target-post + ) + +(defstate target-launch (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) + 'target-launch + (target-standard-event-handler proc argc message block) + ) + ) + :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *turn-around-mods*) + (ja-channel-push! 1 (seconds 0.15)) + (set-forward-vel 0.0) + (ja-no-eval :group! jakb-duck-stance-ja :num! (seek! (ja-aframe 15.0 0) 3.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 15.0 0) 3.0)) + ) + (if arg1 + (send-event *camera* 'change-state arg1 (seconds 0.6)) + ) + (if (nonzero? arg3) + (process-spawn-function + process + (lambda :behavior process + ((arg0 vector) (arg1 time-frame) (arg2 float)) + (local-vars (sv-32 time-frame) (sv-40 vector) (sv-44 symbol)) + (set! sv-32 (current-time)) + (let ((v1-2 (new-stack-vector0))) + (set! (-> v1-2 quad) (-> arg0 quad)) + (set! sv-40 v1-2) + ) + (set! sv-44 #t) + (until (time-elapsed? 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 last-trans-any-surf y)) arg2) + ) + (vector-xz-normalize! (-> (the-as target s4-0) control transv) 0.0) + (when (< (vector-vector-xz-distance (-> (the-as target s4-0) control trans) sv-40) 20480.0) + (let ((v1-15 (vector-! (new-stack-vector0) (-> (the-as target s4-0) control trans) sv-40))) + (set! (-> (the-as target s4-0) control trans x) (+ (-> sv-40 x) (fmax -2867.2 (fmin 2867.2 (-> v1-15 x))))) + (set! (-> (the-as target s4-0) control trans z) (+ (-> sv-40 z) (fmax -2867.2 (fmin 2867.2 (-> v1-15 z))))) + ) + ) + ) + (else + (if sv-44 + (set! sv-32 (current-time)) + ) + (set! sv-44 (the-as symbol #f)) + (when (and (-> (the-as target s4-0) next-state) + (let ((v1-25 (-> (the-as target s4-0) next-state name))) + (or (= v1-25 'target-duck-high-jump-jump) (= v1-25 'target-falling)) + ) + ) + (let ((v1-28 (-> (the-as target s4-0) control trans)) + (s3-0 (-> (the-as target s4-0) control transv)) + ) + (set! (-> s3-0 x) (- (-> sv-40 x) (-> v1-28 x))) + (set! (-> s3-0 z) (- (-> sv-40 z) (-> v1-28 z))) + (let* ((v1-29 s3-0) + (f30-0 (sqrtf (+ (* (-> v1-29 x) (-> v1-29 x)) (* (-> v1-29 z) (-> v1-29 z))))) + ) + (if (< 122880.0 f30-0) + (vector-xz-normalize! s3-0 122880.0) + ) + (if (< 4096.0 f30-0) + (forward-up-nopitch->quaternion + (-> (the-as target s4-0) control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> (the-as target s4-0) control quat)) + ) + ) + ) + ) + ) + ) + ) + ) + (suspend) + 0 + ) + #f + ) + arg2 + arg3 + #x480c0000 + :to self + ) + ) + (go target-high-jump arg0 arg0 'launch) + ) + :post target-no-stick-post + ) + +(defstate target-play-anim (target) + :event target-generic-event-handler + :enter (behavior ((arg0 string) (arg1 handle)) + (set! (-> self control anim-handle) arg1) + (let ((t9-0 (method-of-object (-> self control) collide-shape-moving-method-60))) + #x47200000 + #x47200000 + (-> self control root-prim prim-core collide-with) + (t9-0) + ) + (logior! (-> self focus-status) (focus-status grabbed)) + (set! (-> self neck flex-blend) 0.0) + ) + :exit (behavior () + (send-event (handle->process (-> self control anim-handle)) 'end-mode) + (target-exit) + ) + :code (behavior ((arg0 string) (arg1 handle)) + (let ((gp-0 (get-art-by-name (-> self draw art-group) arg0 art-joint-anim))) + (when gp-0 + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (ja-channel-set! 1) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + ) + ) + (go target-stance) + ) + :post target-no-stick-post + ) + +(defstate target-clone-anim (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ((-> target-grab event) proc argc message block) + ) + :enter (behavior ((arg0 handle)) + (set! (-> self control anim-handle) arg0) + (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (set! (-> self control unknown-word04) (the-as uint #t)) + (quaternion-copy! (the-as quaternion (-> self control unknown-vector38)) (-> self control quat)) + (logior! (-> self focus-status) (focus-status grabbed)) + (vector-reset! (-> self control transv)) + (set! (-> self neck flex-blend) 0.0) + (send-event (ppointer->process (-> self sidekick)) 'shadow #t) + ) + :exit (behavior () + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (send-event (ppointer->process (-> self sidekick)) 'shadow #t) + (let ((gp-0 (joint-node jakb-lod0-jg main)) + (a1-2 (-> self control camera-pos)) + ) + (cond + ((not (-> self control unknown-spool-anim00)) + ) + ((not (logtest? (-> self draw status) (draw-control-status no-draw))) + (move-to-point! (-> self control) a1-2) + (matrix->quaternion (-> self control quat-for-control) (-> gp-0 bone transform)) + (quaternion-copy! (-> self control quat) (-> self control quat-for-control)) + (let ((t9-5 (method-of-object (-> self control) collide-shape-moving-method-60))) + #x45800000 + #x47200000 + #t + (-> self control root-prim prim-core collide-with) + (t9-5) + ) + (when (logtest? (-> self control status) (collide-status on-water)) + (let ((a1-6 (new-stack-vector0))) + (set! (-> a1-6 x) (-> self control trans x)) + (set! (-> a1-6 y) (-> self water height)) + (set! (-> a1-6 z) (-> self control trans z)) + (set! (-> a1-6 w) 1.0) + (move-to-point! (-> self control) a1-6) + ) + ) + ) + (else + (format 0 "ERROR: : camera used backup position~%") + (move-to-point! (-> self control) (-> self control unknown-vector37)) + (quaternion-copy! (-> self control quat) (the-as quaternion (-> self control unknown-vector38))) + ) + ) + ) + (rot->dir-targ! (-> self control)) + (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set-time! (-> self control last-time-on-surface)) + (ja-channel-set! 0) + (ja-post) + (target-exit) + ) + :code (behavior ((arg0 handle)) + (clone-anim arg0 #t "") + (go target-stance) + ) + :post target-no-ja-move-post + ) + +(let ((v1-28 (copy *walk-mods* 'global))) + (set! (-> v1-28 name) 'float) + (set! (-> v1-28 target-speed) 81920.0) + (set! (-> v1-28 transv-max) 81920.0) + (set! (-> v1-28 flags) (surface-flag gun-off)) + (set! *float-mods* v1-28) + ) + +(defstate target-float (target) + :event target-generic-event-handler + :enter (behavior () + (sound-play-by-spec (static-sound-spec "menu-pick" :group 1 :fo-curve 1) (new-sound-id) (the-as vector #t)) + (set! (-> self control additional-decaying-velocity-end-time) 0) + (vector-reset! (-> self control additional-decaying-velocity)) + (let ((v1-3 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-3 (-> self control transv) (vector-float*! v1-3 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f0-2 (vector-length v1-3)) + (f1-1 f0-2) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-3 v1-3 (/ f0-2 f1-1)) + ) + ) + ) + (set! (-> self control dynam gravity-max) 0.0) + (set! (-> self control dynam gravity-length) 0.0) + (set! (-> self control mod-surface) *float-mods*) + (target-darkjak-end-mode #t) + (target-lightjak-end-mode #t) + ) + :exit (behavior () + (sound-play-by-spec (static-sound-spec "menu-back" :group 1 :fo-curve 1) (new-sound-id) (the-as vector #t)) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (target-exit) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2 r2 l1 r1 x)) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons l2 r2 l1 r1 x)) + (when (nonzero? (-> self gun)) + (set! (-> self gun using-gun-type) (pickup-type none)) + (set! (-> self gun latch?) #f) + ) + (if (nonzero? (-> self board)) + (set! (-> self board latch?) #f) + ) + ) + :trans (behavior () + (set-time! (-> self control time-of-last-debug-float)) + (cond + ((cpad-hold? (-> self control cpad number) r2) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self control trans quad)) + (let ((v1-14 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control dynam gravity-normal) a1-0)) + ) + 0.0 + (vector-! v1-14 a1-0 (vector-float*! v1-14 (-> self control dynam gravity-normal) f0-1)) + (let* ((f1-2 (vector-length v1-14)) + (f2-0 f1-2) + (f0-2 (+ 512.0 f0-1)) + ) + (vector+! + a1-0 + (vector-float*! a1-0 (-> self control dynam gravity-normal) f0-2) + (vector-float*! v1-14 v1-14 (/ f1-2 f2-0)) + ) + ) + ) + (move-to-point! (-> self control) a1-0) + ) + ) + ((cpad-hold? (-> self control cpad number) l2) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> self control trans quad)) + (let ((v1-29 (new-stack-vector0)) + (f0-5 (vector-dot (-> self control dynam gravity-normal) a1-1)) + ) + 0.0 + (vector-! v1-29 a1-1 (vector-float*! v1-29 (-> self control dynam gravity-normal) f0-5)) + (let* ((f1-5 (vector-length v1-29)) + (f2-1 f1-5) + (f0-6 (+ -512.0 f0-5)) + ) + (vector+! + a1-1 + (vector-float*! a1-1 (-> self control dynam gravity-normal) f0-6) + (vector-float*! v1-29 v1-29 (/ f1-5 f2-1)) + ) + ) + ) + (move-to-point! (-> self control) a1-1) + ) + ) + ((cpad-pressed? (-> self control cpad number) l1 x) + (go (the-as (state target) target-falling)) + ) + ) + (let ((v1-43 (new-stack-vector0))) + (let ((f0-9 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-43 (-> self control transv) (vector-float*! v1-43 (-> self control dynam gravity-normal) f0-9)) + ) + (let* ((f0-10 (vector-length v1-43)) + (f1-7 f0-10) + (f2-2 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) + (vector-float*! v1-43 v1-43 (/ f0-10 f1-7)) + ) + ) + ) + ) + :code target-stance-anim + :post target-post + ) + +(let ((v1-31 (copy *walk-mods* 'global))) + (set! (-> v1-31 name) 'blast-recover) + (set! (-> v1-31 flags) (surface-flag gun-off gun-fast-exit)) + (set! *blast-recover-mods* v1-31) + ) + +(defstate target-blast-recover (target) + :event target-standard-event-handler + :code (behavior ((arg0 rigid-body-impact)) + (when (= (-> self ext-anim) (target-anim default)) + (set-forward-vel 0.0) + (set! (-> self control mod-surface) *blast-recover-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-blast-recover-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (the-as time-frame arg0)) + (ja-no-eval :group! jakb-blast-recover-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-no-eval :group! jakb-blast-recover-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-walk) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (go target-stance) + ) + :post target-no-stick-post + ) diff --git a/goal_src/jak3/engine/ui/bigmap-h.gc b/goal_src/jak3/engine/ui/bigmap-h.gc index 686cea5f1a9..1cef057d39c 100644 --- a/goal_src/jak3/engine/ui/bigmap-h.gc +++ b/goal_src/jak3/engine/ui/bigmap-h.gc @@ -67,7 +67,7 @@ (bigmap-method-13 () none) (bigmap-method-14 () none) (bigmap-method-15 () none) - (bigmap-method-16 () none) + (bigmap-method-16 (_type_) none) (bigmap-method-17 () none) (bigmap-method-18 () none) (bigmap-method-19 () none) diff --git a/goal_src/jak3/engine/ui/hud-h.gc b/goal_src/jak3/engine/ui/hud-h.gc index aff4264c30f..546b35a5804 100644 --- a/goal_src/jak3/engine/ui/hud-h.gc +++ b/goal_src/jak3/engine/ui/hud-h.gc @@ -16,6 +16,9 @@ ;; ---hud-flags +(define-extern hide-hud (function symbol none)) +(define-extern show-hud (function object none)) + ;; DECOMP BEGINS (deftype hud-string (structure) @@ -121,6 +124,8 @@ ) ) +(define-extern hud-init-by-other (function object :behavior hud)) + (deftype hud-ashelin (hud) () diff --git a/goal_src/jak3/engine/ui/minimap-h.gc b/goal_src/jak3/engine/ui/minimap-h.gc index 5c4744f59f2..1a48d059a57 100644 --- a/goal_src/jak3/engine/ui/minimap-h.gc +++ b/goal_src/jak3/engine/ui/minimap-h.gc @@ -276,7 +276,7 @@ (node-id uint16 64) ) (:methods - (minimap-trail-method-9 () none) + (get-distance-with-path (_type_ vector vector) float) (minimap-trail-method-10 () none) ) ) @@ -330,9 +330,9 @@ ) (:methods (minimap-method-9 () none) - (minimap-method-10 () none) + (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail) (minimap-method-11 () none) - (minimap-method-12 () none) + (add-icon! (_type_ process uint int vector int) connection-minimap) (minimap-method-13 () none) (minimap-method-14 () none) (minimap-method-15 () none) @@ -350,3 +350,5 @@ (minimap-method-27 () none) ) ) + +(define-extern *minimap* minimap) \ No newline at end of file diff --git a/goal_src/jak3/engine/ui/progress/progress-static.gc b/goal_src/jak3/engine/ui/progress/progress-static.gc index 61de59cd2ef..3bf1758aa22 100644 --- a/goal_src/jak3/engine/ui/progress/progress-static.gc +++ b/goal_src/jak3/engine/ui/progress/progress-static.gc @@ -1074,7 +1074,7 @@ ) (new 'static 'controls-page-info :title (text-id progress-controls-lightjak) - :feature (game-feature feature46) + :feature (game-feature lightjak) :strings (new 'static 'boxed-array :type controls-string-info (new 'static 'controls-string-info :button (text-id progress-controls-pad-l2-triangle) diff --git a/goal_src/jak3/engine/ui/text-h.gc b/goal_src/jak3/engine/ui/text-h.gc index 85f70ea9dd7..b9a1628346b 100644 --- a/goal_src/jak3/engine/ui/text-h.gc +++ b/goal_src/jak3/engine/ui/text-h.gc @@ -86,11 +86,11 @@ (text-0053 #x0053) (progress-secrets #x0054) (text-0055 #x0055) - (text-0056 #x0056) - (text-0057 #x0057) - (text-0058 #x0058) - (text-0059 #x0059) - (text-005a #x005a) + (progress-secrets-toggle-beard #x0056) + (progress-secrets-hflip-screen #x0057) + (progress-secrets-endless-ammo #x0058) + (progress-secrets-invulnerable #x0059) + (progress-secrets-hero-mode #x005a) (progress-scene-player-act-1 #x005b) (progress-scene-player-act-2 #x005c) (progress-scene-player-act-3 #x005d) @@ -98,11 +98,11 @@ (progress-title-mega-scrap-book #x005f) (text-0060 #x0060) (text-0061 #x0061) - (text-0062 #x0062) + (progress-secrets-endless-dark #x0062) (text-0063 #x0063) (text-0065 #x0065) - (text-0066 #x0066) - (text-0067 #x0067) + (progress-secrets-big-head #x0066) + (progress-secrets-little-head #x0067) (text-0068 #x0068) (text-0069 #x0069) (progress-missions #x006a) @@ -718,7 +718,7 @@ (text-077b #x077b) (text-077c #x077c) (talk-to-kleiver #x078d) - (text-07b3 #x07b3) + (progress-secrets-unlimited-turbos #x07b3) (text-07b4 #x07b4) (text-07b5 #x07b5) (progress-language-portuguese #x07b8) @@ -746,18 +746,18 @@ (progress-title-commentary #x07d2) (text-07d3 #x07d3) (text-07d4 #x07d4) - (text-07d5 #x07d5) - (text-07d6 #x07d6) + (progress-secrets-fast-movie #x07d5) + (progress-secrets-slow-movie #x07d6) (text-07d7 #x07d7) (text-07d8 #x07d8) - (text-07d9 #x07d9) - (text-07da #x07da) - (text-07db #x07db) - (text-07dc #x07dc) + (progress-secrets-red-ammo-capacity #x07d9) + (progress-secrets-yellow-ammo-capacity #x07da) + (progress-secrets-blue-ammo-capacity #x07db) + (progress-secrets-dark-ammo-capacity #x07dc) (text-07dd #x07dd) - (text-07de #x07de) - (text-07df #x07df) - (text-07e0 #x07e0) + (progress-secrets-gungame-ratchet #x07de) + (progress-secrets-endless-light #x07df) + (progress-secrets-bad-weather #x07e0) (text-07e1 #x07e1) (text-07e2 #x07e2) (progress-title-jak3-mdl-viewer #x07e3) @@ -767,7 +767,7 @@ (text-07e7 #x07e7) (text-07e8 #x07e8) (text-07e9 #x07e9) - (text-07ea #x07ea) + (progress-secrets-kleever-diaper #x07ea) (text-07f6 #x07f6) (text-07f7 #x07f7) (text-07f8 #x07f8) @@ -822,36 +822,36 @@ (text-0831 #x0831) (text-0832 #x0832) (text-0833 #x0833) - (text-0834 #x0834) - (text-0835 #x0835) - (text-0836 #x0836) - (text-0837 #x0837) - (text-0838 #x0838) - (text-0839 #x0839) + (progress-secrets-weapon-upgrades #x0834) + (progress-secrets-cheats #x0835) + (progress-secrets-vehicle-upgrades #x0836) + (progress-secrets-crazy-stuff #x0837) + (progress-secrets-art-gallery #x0838) + (progress-secrets-expert-options #x0839) (text-083a #x083a) - (text-083b #x083b) - (text-083c #x083c) - (text-083d #x083d) - (text-083e #x083e) - (text-083f #x083f) - (text-0840 #x0840) - (text-0841 #x0841) - (text-0842 #x0842) - (text-0843 #x0843) - (text-0844 #x0844) - (text-0845 #x0845) - (text-0846 #x0846) - (text-0847 #x0847) - (text-0848 #x0848) - (text-0849 #x0849) - (text-084a #x084a) - (text-084b #x084b) - (text-084c #x084c) - (text-084d #x084d) + (progress-secrets-gun-upgrade-red-1 #x083b) + (progress-secrets-gun-upgrade-red-2 #x083c) + (progress-secrets-gun-upgrade-red-3 #x083d) + (progress-secrets-gun-upgrade-yellow-1 #x083e) + (progress-secrets-gun-upgrade-yellow-2 #x083f) + (progress-secrets-gun-upgrade-yellow-3 #x0840) + (progress-secrets-gun-upgrade-blue-1 #x0841) + (progress-secrets-gun-upgrade-blue-2 #x0842) + (progress-secrets-gun-upgrade-blue-3 #x0843) + (progress-secrets-gun-upgrade-dark-1 #x0844) + (progress-secrets-gun-upgrade-dark-2 #x0845) + (progress-secrets-gun-upgrade-dark-3 #x0846) + (progress-secrets-vehicle-fox #x0847) + (progress-secrets-vehicle-mirage #x0848) + (progress-secrets-vehicle-x-ride #x0849) + (progress-secrets-vehicle-hit-points #x084a) + (progress-secrets-board-fast #x084b) + (progress-secrets-darkjak-tracking #x084c) + (progress-secrets-daxter-pants #x084d) (progress-title-level-select-act-1 #x084e) (progress-title-level-select-act-2 #x084f) (progress-title-level-select-act-3 #x0850) - (text-0851 #x0851) + (progress-secrets-button-invis #x0851) (text-0852 #x0852) (text-0853 #x0853) (text-0856 #x0856) diff --git a/goal_src/jak3/engine/util/script-h.gc b/goal_src/jak3/engine/util/script-h.gc index 5c49da21263..e930320287e 100644 --- a/goal_src/jak3/engine/util/script-h.gc +++ b/goal_src/jak3/engine/util/script-h.gc @@ -10,6 +10,14 @@ (declare-type load-state structure) (define-extern *load-state* load-state) +(defmacro script-eval (script &key (key (process->ppointer PP)) &key (proc PP) &key (vector (the-as vector #f))) + `(eval! (new 'stack 'script-context ,key ,proc ,vector) ,script)) + +(define-extern command-get-int (function object int int)) +(define-extern command-get-float (function object float float)) +(define-extern command-get-param (function object object object)) +(define-extern command-get-process (function object process process)) + ;; DECOMP BEGINS (deftype script-form (structure) @@ -37,7 +45,7 @@ ) (:methods (new (symbol type object process vector) _type_) - (script-context-method-9 () none) + (eval! (_type_ pair) object) (script-context-method-10 () none) (script-context-method-11 () none) ) diff --git a/goal_src/jak3/engine/util/sync-info-h.gc b/goal_src/jak3/engine/util/sync-info-h.gc index 79b5b3d833f..70ee7aaad59 100644 --- a/goal_src/jak3/engine/util/sync-info-h.gc +++ b/goal_src/jak3/engine/util/sync-info-h.gc @@ -20,7 +20,7 @@ "Parameters used to set up a [[sync-info]]." ((sync-type symbol) (sync-flags sync-flags) - (entity basic) + (entity entity-actor) (period uint32) (percent float) (ease-in float) @@ -39,9 +39,9 @@ (:methods (sync-info-method-9 () none) (sync-info-method-10 () none) - (sync-info-method-11 () none) + (get-norm! (_type_ int) float) (sync-info-method-12 () none) - (sync-info-method-13 () none) + (initialize! (_type_ sync-info-params) none) (sync-info-method-14 () none) (sync-info-method-15 () none) ) diff --git a/goal_src/jak3/kernel/gkernel-h.gc b/goal_src/jak3/kernel/gkernel-h.gc index 1a3a75dd492..e9efa34d77c 100644 --- a/goal_src/jak3/kernel/gkernel-h.gc +++ b/goal_src/jak3/kernel/gkernel-h.gc @@ -255,7 +255,7 @@ (new (symbol type string) _type_) (activate (_type_ process-tree string pointer) process-tree) (deactivate (_type_) none) - (init-from-entity! (_type_ entity-actor) none) ;; todo check + (init-from-entity! (_type_ entity-actor) object) ;; todo check (run-logic? (_type_) symbol) (process-tree-method-13 () none) ) diff --git a/goal_src/jak3/kernel/gstate.gc b/goal_src/jak3/kernel/gstate.gc index 5d06e3180ff..de0d382ffef 100644 --- a/goal_src/jak3/kernel/gstate.gc +++ b/goal_src/jak3/kernel/gstate.gc @@ -111,6 +111,7 @@ ;; *no-state* is just used for the compiler to know whether a handler was actually set or not (defmacro defstate (state-name parents &key (virtual #f) + &key (parent #f) &key (event *no-state*) &key (enter *no-state*) &key (trans *no-state*) @@ -183,11 +184,21 @@ ;; the compiler will set the fields of the given state and define the symbol. ;; This way it can check the individual function types, make sure they make sense, and create ;; a state with the appropriate type. - ,(if virtual - `(define-virtual-state-hook ,state-name ,defstate-type ,new-state ,(eq? virtual 'override) :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) - `(define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) + ,(cond + (virtual + `(define-virtual-state-hook ,state-name ,defstate-type ,new-state ,(eq? virtual 'override) :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) + ) + (parent + `(begin + (inherit-state ,new-state (the state ,parent)) + (set! (-> ,new-state parent) (the state ,parent)) + (define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) ) - + ) + (#t + `(define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) + ) + ) ) ) ) diff --git a/test/decompiler/reference/jak3/decompiler-macros.gc b/test/decompiler/reference/jak3/decompiler-macros.gc index 256dc9b4e78..aeb1025e5ee 100644 --- a/test/decompiler/reference/jak3/decompiler-macros.gc +++ b/test/decompiler/reference/jak3/decompiler-macros.gc @@ -139,6 +139,7 @@ ;; *no-state* is just used for the compiler to know whether a handler was actually set or not (defmacro defstate (state-name parents &key (virtual #f) + &key (parent #f) &key (event *no-state*) &key (enter *no-state*) &key (trans *no-state*) @@ -211,11 +212,21 @@ ;; the compiler will set the fields of the given state and define the symbol. ;; This way it can check the individual function types, make sure they make sense, and create ;; a state with the appropriate type. - ,(if virtual - `(define-virtual-state-hook ,state-name ,defstate-type ,new-state ,(eq? virtual 'override) :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) - `(define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) + ,(cond + (virtual + `(define-virtual-state-hook ,state-name ,defstate-type ,new-state ,(eq? virtual 'override) :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) + ) + (parent + `(begin + (inherit-state ,new-state (the state ,parent)) + (set! (-> ,new-state parent) (the state ,parent)) + (define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) ) - + ) + (#t + `(define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) + ) + ) ) ) ) @@ -868,6 +879,47 @@ ) ) +;; TODO change macro back once sound-group is figured out for jak 3 +(defmacro sound-play (name &key (id (new-sound-id)) + &key (vol 100.0) &key (pitch 0) &key (bend 0) + &key (group sfx) + &key (position #t)) + `(sound-play-by-name (static-sound-name ,name) ,id (the int (* (/ 1024.0 100.0) ,vol)) (the int (* 1524.0 ,pitch)) ,bend (sound-group) ,position)) + +(defmacro sound-vol (vol) + "convert to sound volume units" + (if (number? vol) + (* 1 (/ (* vol 1024) 100)) + `(the int (/ (* ,vol 1024) 100)) + ) + ) + +(defmacro static-sound-spec (name &key (num 1.0) &key (group 1) + &key (volume #f) + &key (pitch-mod 0) + &key (fo-min 0) &key (fo-max 0) + &key (fo-curve 0) + &key (mask ())) + (let ((snd-mask mask) + (snd-volume 100.0)) + (when (nonzero? fo-max) (cons! snd-mask 'fo-max)) + (when (nonzero? fo-min) (cons! snd-mask 'fo-min)) + (when (nonzero? fo-curve) (cons! snd-mask 'fo-curve)) + (when (nonzero? pitch-mod) (cons! snd-mask 'pitch)) + (when volume (cons! snd-mask 'volume) (set! snd-volume volume)) + `(new 'static 'sound-spec + :sound-name (static-sound-name ,name) + :num ,num + :group ,group + :volume (sound-vol ,snd-volume) + :pitch-mod ,pitch-mod + :fo-min ,fo-min + :fo-max ,fo-max + :fo-curve ,fo-curve + :mask (sound-mask ,@snd-mask) + )) + ) + (defmacro time-elapsed? (time duration) `(>= (- (current-time) ,time) ,duration) ) @@ -936,11 +988,42 @@ ) ) +(defmacro joint-node-index (jg-name name) + (let ((jg-info (hash-table-try-ref *jg-info* (symbol->string jg-name)))) + (if (not (car jg-info)) + -1 + (let ((joint-node (hash-table-try-ref (cdr jg-info) (if (integer? name) (int->string name) (symbol->string name))))) + (if (not (car joint-node)) + -1 + (cadr (cdr joint-node))) + ) + ) + ) + ) + +(defmacro joint-node (jg name) + `(-> self node-list data (joint-node-index ,jg ,name)) + ) + (defmacro static-spherem (x y z r) "creates a static vector using meters where the w component is used as sphere radius. for a 'real' sphere use static-bspherem." `(new 'static 'vector :x (meters ,x) :y (meters ,y) :z (meters ,z) :w (meters ,r)) ) +(defmacro static-bspherem (x y z r) + `(new 'static 'sphere :x (meters ,x) :y (meters ,y) :z (meters ,z) :w (meters ,r)) + ) + +(defmacro static-cloth-params (ag-name args) + `(let ((parms (new 'static 'cloth-params))) + ,@(apply (lambda (x) (if (and (eq? (car x) 'mesh) (not (integer? (cadr x)))) + `(set! (-> parms ,(car x)) ,(art-elt-index ag-name (cadr x))) + `(set! (-> parms ,(car x)) ,(cadr x)) + )) args) + parms + ) + ) + (defglobalconstant ART_GROUP_FILE_VERSION 8) (defmacro defskelgroup (name ag-name joint-geom joint-anim lods @@ -979,7 +1062,8 @@ ;; set cloth params array if present (when ,(neq? clothing '()) (set! (-> skel clothing) (new 'static 'boxed-array :type cloth-params :length 0 :allocated-length ,(length clothing))) - ,@(apply-i (lambda (x i) `(set! (-> skel clothing ,i) (static-cloth-params ,x))) clothing) + ,@(apply-i (lambda (x i) + `(set! (-> skel clothing ,i) (static-cloth-params ,(string->symbol-format "{}-ag" ag-name) ,x))) clothing) (set! (-> skel clothing length) ,(length clothing)) ) @@ -1029,6 +1113,11 @@ (-> self skel root-channel ,chan frame-group)) ) +(defmacro ja-group? (group &key (chan 0)) + "is self in this frame group on this channel? default is channel 0, which is the base channel." + `(= (ja-group) ,group) + ) + (defmacro focus-test? (pfoc &rest status) `(logtest? (-> (the process-focusable ,pfoc) focus-status) (focus-status ,@status))) @@ -1154,3 +1243,295 @@ ) `(ja :eval? #f :chan ,chan :group! ,group! :num! ,num! :param0 ,param0 :param1 ,param1 :num-func ,num-func :frame-num ,frame-num :frame-interp ,frame-interp :dist ,dist) ) + +(defmacro script-eval (script &key (key (process->ppointer PP)) &key (proc PP) &key (vector (the-as vector #f))) + `(eval! (new 'stack 'script-context ,key ,proc ,vector) ,script)) + +(defmacro sp-item (launcher + &key (fade-after 0.0) + &key (falloff-to 0.0) + &key (flags ()) + &key (period 0) + &key (length 0) + &key (offset 0) + &key (hour-mask 0) + &key (binding 0) + ) + `(new 'static 'sparticle-group-item + :launcher ,launcher + :fade-after ,fade-after + :falloff-to ,falloff-to + :flags (sp-group-item-flag ,@flags) + :period ,period + :length ,length + :offset ,offset + :hour-mask ,hour-mask + :binding ,binding + ) + ) + +(defmacro defpartgroup (name &key id &key parts &key (duration 3000) &key (linger-duration 1500) &key (flags ()) &key bounds + &key (rotate (0.0 0.0 0.0)) &key (scale (1.0 1.0 1.0))) + "define a new part group. defines a constant with the name of the group with the ID as its value" + `(begin + (defconstant ,name ,id) + (set! (-> *part-group-id-table* ,id) + (new 'static 'sparticle-launch-group + :duration ,duration + :linger-duration ,linger-duration + :flags (sp-group-flag ,@flags) + :bounds ,bounds + :name ,(symbol->string name) + :length ,(length parts) + :launcher (new 'static 'inline-array sparticle-group-item ,(length parts) ,@parts) + :rotate-x ,(car rotate) + :rotate-y ,(cadr rotate) + :rotate-z ,(caddr rotate) + :scale-x ,(car scale) + :scale-y ,(cadr scale) + :scale-z ,(caddr scale) + ) + ) + ) + ) + +(desfun param-float? (p) + (or (float? p) (and (pair? p) (eq? 'meters (car p))) (and (pair? p) (eq? 'degrees (car p)))) + ) + +(desfun param-int? (p) + (or (integer? p) (and (pair? p) (eq? 'seconds (car p)))) + ) + +(desfun param-symbol? (p) + (and (pair? p) (eq? 'quote (car p))) + ) + +(seval (begin +(define *sparticle-fields* (make-string-hash-table)) +(doenum (name val 'sp-field-id) + (hash-table-set! + *sparticle-fields* + (if (string-starts-with? (symbol->string name) "spt-") + (string->symbol (string-substr (symbol->string name) 4 0)) + name) + (list + val name (member name '(spt-vel-x + spt-vel-y + spt-vel-z + spt-scalevel-x + spt-scalevel-y + spt-rotvel-x + spt-rotvel-y + spt-rotvel-z + spt-fade-r + spt-fade-g + spt-fade-b + spt-fade-a + spt-accel-x + spt-accel-y + spt-accel-z)) + ) + ) + ) +;; you cannot define these fields ever. +(define *sparticle-fields-banned* '(misc-fields-start + misc-fields-end + sprite-fields-start + sprite-fields-end + cpu-fields-start + cpu-fields-end + launch-fields-start + launch-fields-end + end + )) +)) + +;; the last field ID defined, to make sure that fields are defined in order. +(seval (define *last-field-id* -1)) + +(desfun process-init-spec (x) + (let* ((head (symbol->string (car x))) + (params (cdr x)) + (field-name (string->symbol (string-substr head 1 0))) + (field-lookup (hash-table-try-ref *sparticle-fields* field-name)) + (field (cdr field-lookup)) + (store? (member ':store params)) + (param-count (if store? (1- (length params)) (length params))) + ) + (when (not (car field-lookup)) + (fmt #t "unknown sparticle field {}\n" x)) + (when (neq? (string-ref head 0) #\:) + (fmt #t "invalid sparticle field {}\n" x)) + ; (when (member field-name *sparticle-fields-banned*) + ; (fmt #t "you cannot use sparticle field {}\n" field-name)) + (let ((field-id (car field)) + (field-enum-name (cadr field)) + (vel? (and #f (caddr field))) + (param0 (and (>= param-count 1) (first params))) + (param1 (and (>= param-count 2) (second params))) + (param2 (and (>= param-count 3) (third params)))) + (when (>= *last-field-id* field-id) + (fmt #t "field {} must come after field {}, not before\n" field-name (car (nth *last-field-id* *sparticle-fields*))) + ) + (set! *last-field-id* field-id) + (cond + ((eq? field-name 'flags) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :initial-value (sp-cpuinfo-flag ,@param0) :random-mult 1) + ) + ((eq? field-name 'texture) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :tex ,param0 :flags (sp-flag int)) + ) + ((eq? field-name 'next-launcher) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :initial-value ,param0 :flags (sp-flag launcher)) + ) + ((eq? field-name 'sound) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :sound ,param0 :flags (sp-flag object)) + ) + ((and (= 2 param-count) (symbol? param0) (eq? param0 ':copy)) + (let* ((other-field-lookup (hash-table-try-ref *sparticle-fields* (cadr (member ':copy params)))) + (other-field (cdr other-field-lookup)) + (other-field-id (car other-field))) + (when (>= other-field-id field-id) + (fmt #t "warning copying to sparticle field {} from {} - you can only copy from fields before this one!\n" field-name (cadr other-field)) ) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag copy-from-other) + :initial-value ,(- other-field-id field-id) :random-mult 1) + ) + ) + ((and (= 2 param-count) (symbol? param0) (eq? param0 ':data)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag object) + :object ,(cadr (member ':data params))) + ) + ((and (= 1 param-count) (param-symbol? param0)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag symbol) + :sym ,param0) + ) + ((and (= 1 param-count) (param-float? param0)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag ,(if store? 'float-store 'float)) + :initial-valuef ,(if vel? `(/ ,param0 60.0) param0) + :random-rangef 0.0 + :random-multf 1.0) + ) + ((and (= 2 param-count) (param-float? param0) (param-float? param1)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag ,(if store? 'float-store 'float)) + :initial-valuef ,(if vel? `(/ ,param0 60.0) param0) + :random-rangef ,(if vel? `(/ ,param1 60.0) param1) + :random-multf 1.0) + ) + ((and (= 3 param-count) (param-float? param0) (param-float? param1) (param-float? param2)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag ,(if store? 'float-store 'float)) + :initial-valuef ,(if vel? `(/ ,param0 60.0) param0) + :random-rangef ,param1 + :random-multf ,(if vel? `(/ ,param2 60.0) param2)) + ) + ((and (= 3 param-count) (param-float? param0) (param-int? param1) (param-float? param2)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag float-int-rand) + :initial-valuef ,(if vel? `(/ ,param0 60.0) param0) + :random-range ,param1 + :random-multf ,(if vel? `(/ ,param2 60.0) param2)) + ) + ((and (= 1 param-count) (param-int? param0)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag int) + :initial-value ,param0 + :random-range 0 + :random-mult 1) + ) + ((and (= 2 param-count) (param-int? param0) (param-int? param1)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag int) + :initial-value ,param0 + :random-range ,param1 + :random-mult 1) + ) + ((and (= 3 param-count) (param-int? param0) (param-int? param1) (param-int? param2)) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-enum-name) :flags (sp-flag int) + :initial-value ,param0 + :random-range ,param1 + :random-mult ,param2) + ) + (#t + `(new 'static 'sp-field-init-spec :field (sp-field-id spt-end)) + ) + ) + ) + ) + ) + +(defmacro defpart (id &key (init-specs ())) + "define a new sparticle-launcher" + (begin + (set! *last-field-id* -1) + `(set! (-> *part-id-table* ,id) + (new 'static 'sparticle-launcher + :init-specs (new 'static 'inline-array sp-field-init-spec ,(1+ (length init-specs)) + ,@(apply process-init-spec init-specs) + (new 'static 'sp-field-init-spec :field (sp-field-id spt-end)) + ))) + ) + ) + +(defmacro static-attack-info (&key (mask ()) args) + (let ((mask-actual mask)) + (dolist (it args) + (when (not (member (caar it) mask-actual)) + (cons! mask-actual (caar it)) + ) + ) + `(let ((atk (new 'static 'attack-info :mask (attack-mask ,@mask-actual)))) + ,@(apply (lambda (x) (if (or (eq? (car x) 'vector) + (eq? (car x) 'intersection) + (eq? (car x) 'attacker-velocity)) + `(vector-copy! (-> atk ,(car x)) ,(cadr x)) + `(set! (-> atk ,(car x)) ,(cadr x)) + )) args) + atk) + ) + ) + +(defmacro new-attack-id () + "generate a new attack-id" + `(1+! (-> *game-info* attack-id)) + ) + +;; inserted by the decompiler if a c->goal bool conversion can't be compacted into a single +;; expression. +(defmacro cmove-#f-zero (dest condition src) + `(if (zero? ,condition) + (set! ,dest #f) + (set! ,dest ,src) + ) + ) + +(defmacro cmove-#f-nonzero (dest condition src) + `(if (zero? ,condition) + (set! ,dest ,src) + (set! ,dest #f) + ) + ) + +(defmacro launch-particles (&key (system *sp-particle-system-2d*) + particle + origin + &key (launch-state (the-as sparticle-launch-state #f)) + &key (launch-control (the-as sparticle-launch-control #f)) + &key (rate 1.0) + &key (origin-is-matrix #f)) + (if origin-is-matrix + `(sp-launch-particles-var + ,system + ,particle + (the matrix ,origin) + ,launch-state + ,launch-control + ,rate #|(if (= (get-video-mode) 'custom) (/ (-> *display* time-factor) 5.0) ,rate)|#) + `(begin + (vector-copy! (-> *launch-matrix* trans) (the vector ,origin)) + (sp-launch-particles-var + ,system + ,particle + *launch-matrix* + ,launch-state + ,launch-control + ,rate #|(if (= (get-video-mode) 'custom) (/ (-> *display* time-factor) 5.0) ,rate)|#) + ) + ) + ) \ No newline at end of file diff --git a/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc new file mode 100644 index 00000000000..6419edccf54 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc @@ -0,0 +1,608 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function can-display-query? +(defun can-display-query? ((arg0 process) (arg1 string) (arg2 float)) + (let ((a1-2 (gui-control-method-12 + *gui-control* + arg0 + (gui-channel query) + (gui-action play) + (if arg1 + arg1 + (symbol->string (-> arg0 type symbol)) + ) + 0 + arg2 + (new 'static 'sound-id) + ) + ) + ) + (= (get-status *gui-control* a1-2) (gui-status active)) + ) + ) + +;; definition for function talker-surpress! +(defun talker-surpress! () + (set! (-> *game-info* hint-play-time) (-> *display* base-clock frame-counter)) + 0 + ) + +;; definition for function talker-displayed? +(defun talker-displayed? () + (if (-> *setting-control* user-current hint) + #t + #f + ) + ) + +;; definition for function kill-current-talker +;; WARN: Return type mismatch int vs none. +(defun kill-current-talker ((arg0 pair) (arg1 pair) (arg2 symbol)) + (if (not (member 'daxter arg1)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel daxter) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (if (not (member 'pecker arg1)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel pecker) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (if (not (member 'voicebox arg1)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel voicebox) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (if (not (member 'message arg1)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel message) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (when (not (member 'notice arg1)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel notice) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel notice-low) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + 0 + (none) + ) + +;; definition for function string->talker-speech +(defun string->talker-speech ((arg0 string)) + (dotimes (s5-0 365) + (let ((s4-0 (-> *talker-speech* s5-0))) + (if (string= arg0 (-> s4-0 name)) + (return s4-0) + ) + ) + ) + (-> *talker-speech* 0) + ) + +;; definition for method 9 of type talker-speech-class +(defmethod talker-speech-class-method-9 ((this talker-speech-class)) + (and (>= (-> *game-info* unknown-arr4 (* (-> this speech) 2)) (-> this pos)) + (>= (-> this neg) (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) + ) + ) + +;; definition for method 10 of type talker-speech-class +;; WARN: Return type mismatch int vs none. +(defmethod play-communicator-speech! ((this talker-speech-class)) + (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) + 0 + (none) + ) + +;; definition for method 11 of type talker-speech-class +;; WARN: Return type mismatch int vs none. +(defmethod talker-speech-class-method-11 ((this talker-speech-class)) + (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) (the-as uint 0)) + 0 + (none) + ) + +;; definition for method 12 of type talker-speech-class +;; WARN: Return type mismatch int vs none. +(defmethod talker-speech-class-method-12 ((this talker-speech-class) (arg0 int)) + (if (>= arg0 0) + (set! (-> *game-info* unknown-arr4 (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (* (-> this speech) 2))) #xfff0 arg0)) + ) + (set! (-> *game-info* unknown-arr4 (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (* (-> this speech) 2))) 0 (- arg0))) + ) + ) + (if (talker-speech-class-method-9 this) + (talker-spawn-func this *entity-pool* (target-pos 0) (the-as region #f)) + ) + 0 + (none) + ) + +;; definition for method 13 of type talker-speech-class +;; WARN: Return type mismatch int vs none. +(defmethod talker-speech-class-method-13 ((this talker-speech-class) (arg0 int)) + (if (>= arg0 0) + (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) #xfff0 arg0)) + ) + (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) 0 (- arg0))) + ) + ) + 0 + (none) + ) + +;; definition for function talker-spawn-func +;; WARN: Return type mismatch int vs sound-id. +(defun talker-spawn-func ((arg0 talker-speech-class) (arg1 process-tree) (arg2 vector) (arg3 region)) + (local-vars (s2-0 int)) + (when (or (not arg0) (zero? (-> arg0 speech)) (not (talker-speech-class-method-9 arg0))) + (set! s2-0 0) + (goto cfg-27) + ) + (if (and (or (not (-> *setting-control* user-current play-hints)) + (= (-> *setting-control* user-current dialog-volume) 0.0) + ) + (logtest? (-> arg0 flags) (talker-flags tf0)) + ) + (play-communicator-speech! arg0) + ) + (set! s2-0 + (the-as int (lookup-gui-connection-id *gui-control* (-> arg0 name) (-> arg0 channel) (gui-action none))) + ) + (set! s2-0 (cond + ((zero? (the-as sound-id s2-0)) + (let ((v1-17 (process-spawn talker :init talker-init arg0 arg2 arg3 :name "talker" :to arg1))) + (cond + (v1-17 + (if (nonzero? (-> (the-as talker (-> v1-17 0)) voice-id)) + (the-as int (-> (the-as talker (-> v1-17 0)) voice-id)) + (the-as int (-> (the-as talker (-> v1-17 0)) message-id)) + ) + ) + (else + (empty) + s2-0 + ) + ) + ) + ) + (else + (empty) + s2-0 + ) + ) + ) + (label cfg-27) + (the-as sound-id s2-0) + ) + +;; definition for function talker-init +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior talker-init talker ((arg0 talker-speech-class) (arg1 vector) (arg2 region)) + (set! (-> self trans quad) (-> arg1 quad)) + (let ((v1-2 (shr (the-as int (-> arg0 channel)) 4))) + (when (not (or (or (= v1-2 4) (= v1-2 5)) + (or (not (-> *setting-control* user-current play-hints)) + (= (-> *setting-control* user-current dialog-volume) 0.0) + ) + ) + ) + (set! (-> self voice-id) + (add-process *gui-control* self (-> arg0 channel) (gui-action queue) (-> arg0 name) 81920.0 0) + ) + (sound-params-set! + *gui-control* + (-> self voice-id) + #f + -1 + -1 + -1 + (-> *setting-control* user-current talker-volume) + ) + ) + ) + (when (nonzero? (-> arg0 text-message)) + (let* ((a0-7 *gui-control*) + (t9-2 (method-of-object a0-7 add-process)) + (a1-4 self) + (v1-18 (shr (the-as int (-> arg0 channel)) 4)) + ) + (set! (-> self message-id) (t9-2 + a0-7 + a1-4 + (if (or (= v1-18 4) (= v1-18 5)) + (the-as gui-channel (the-as int (-> arg0 channel))) + (gui-channel message) + ) + (gui-action play) + (-> arg0 name) + 81920.0 + 0 + ) + ) + ) + ) + (set! (-> self message) arg0) + (set! (-> self region) arg2) + (set! (-> self total-time) 0) + (set! (-> self total-off-time) 0) + (set-time! (-> self start-time)) + (set! (-> self voicebox) (the-as handle #f)) + (set! (-> self save?) #f) + (set! (-> self grab?) #f) + (if (logtest? (-> self message flags) (talker-flags tf5 tf6)) + (set! (-> self interp) 0.0) + (set! (-> self interp) 1.0) + ) + (go-virtual idle) + 0 + (none) + ) + +;; definition for method 10 of type talker +(defmethod deactivate ((this talker)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (send-event (handle->process (-> this voicebox)) 'die) + (call-parent-method this) + (none) + ) + +;; definition for method 17 of type talker +;; WARN: Return type mismatch int vs none. +(defmethod talker-method-17 ((this talker)) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 36 310 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((f0-0 320.0)) + (let ((v1-2 gp-0)) + (set! (-> v1-2 scale) 0.75) + ) + (case (-> this message channel) + (((gui-channel notice)) + (cond + ((logtest? (-> this message flags) (talker-flags tf7)) + (let ((v1-9 gp-0) + (a1-1 36) + (a0-4 140) + ) + (set! (-> v1-9 origin x) (the float a1-1)) + (set! (-> v1-9 origin y) (the float a0-4)) + ) + ) + (else + (let ((v1-10 gp-0)) + (set! (-> v1-10 scale) 0.6) + ) + (let ((v1-11 gp-0) + (a1-2 36) + (a0-6 160) + ) + (set! (-> v1-11 origin x) (the float a1-2)) + (set! (-> v1-11 origin y) (the float a0-6)) + ) + ) + ) + (set! f0-0 160.0) + ) + ) + (let ((v1-14 gp-0)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-0)) + (set! (-> v1-15 height) (the float 140)) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning middle large)) + (if (logtest? (-> this message flags) (talker-flags tf5)) + (set! (-> gp-0 alpha) (-> this interp)) + (set! (-> gp-0 alpha) 1.0) + ) + (when (logtest? (-> this message flags) (talker-flags tf6)) + (let ((s4-0 gp-0) + (s3-0 36) + (v1-27 (the int (lerp-scale 400.0 f0-0 (-> this interp) 0.0 1.0))) + ) + (set! (-> s4-0 origin x) (the float s3-0)) + (set! (-> s4-0 origin y) (the float v1-27)) + ) + ) + ) + (let ((f0-17 (print-game-text + (lookup-text! *common-text* (-> this message text-message) #f) + gp-0 + #t + 44 + (bucket-id bucket579) + ) + ) + ) + (when (< 98.0 f0-17) + (let ((v1-32 gp-0)) + (set! (-> v1-32 scale) 0.6) + ) + ) + ) + (let ((s4-2 print-game-text) + (a0-14 (lookup-text! *common-text* (-> this message text-message) #f)) + (a2-5 #f) + (a3-3 44) + (v1-36 (-> this message channel)) + ) + (s4-2 + a0-14 + gp-0 + a2-5 + a3-3 + (if (or (= v1-36 (gui-channel notice)) (= v1-36 (gui-channel notice-low)) (= v1-36 (gui-channel subtitle))) + (bucket-id bucket581) + (bucket-id bucket579) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (talker) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (the-as time-frame (-> self message delay))) + (suspend) + ) + ) + (while (or (not (time-elapsed? (-> self start-time) (the-as time-frame (+ (-> self message delay) 300)))) + (and (logtest? (-> self message flags) (talker-flags tf8)) + (not (time-elapsed? (-> self start-time) (seconds 180))) + ) + ) + (when (and (or (zero? (-> self voice-id)) (= (get-status *gui-control* (-> self voice-id)) (gui-status ready))) + (or (zero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active))) + ) + (case (-> self message channel) + (((gui-channel voicebox)) + (if (and (not (handle->process (-> self voicebox))) *target*) + (set! (-> self voicebox) (ppointer->handle (voicebox-spawn *target* (target-pos 0)))) + ) + ) + ) + (go-virtual active) + ) + (suspend) + ) + (go-virtual exit) + ) + ) + +;; failed to figure out what this is: +(defstate active (talker) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (if (logtest? (-> self message flags) (talker-flags tf0)) + (play-communicator-speech! (-> self message)) + ) + (set-setting! 'hint (process->ppointer self) 0.0 0) + (set-setting! 'speech-control #f 0.0 0) + (if (nonzero? (-> self voice-id)) + (set-action! + *gui-control* + (gui-action play) + (-> self voice-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (when (and (nonzero? (-> self voice-id)) (logtest? (-> self message flags) (talker-flags tf1))) + (add-setting! 'music-volume 'rel 0.25 0) + (add-setting! 'sfx-volume 'rel 0.75 0) + (add-setting! 'dialog-volume 'rel (-> *setting-control* user-current dialog-volume-talker) 0) + ) + (if (logtest? (-> self message flags) (talker-flags tf2)) + (auto-save-user) + ) + (apply-settings *setting-control*) + ) + :exit (behavior () + (if (and (-> self grab?) *target*) + (process-release? *target*) + ) + (let ((gp-0 (-> self message on-close))) + (when gp-0 + (let* ((s5-0 (handle->process (-> self voicebox))) + (v1-9 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (script-eval gp-0 :vector (if v1-9 + (-> (the-as process-drawable v1-9) root trans) + ) + ) + ) + ) + ) + (when (and (logtest? (-> self message flags) (talker-flags tf3)) (not (-> self save?))) + (set! (-> self save?) #t) + (auto-save-user) + ) + (if (nonzero? (-> self voice-id)) + (set-action! + *gui-control* + (gui-action stop) + (-> self voice-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (if (nonzero? (-> self message-id)) + (set-action! + *gui-control* + (gui-action stop) + (-> self message-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) + (remove-setting! 'hint) + (remove-setting! 'speech-control) + (remove-setting! 'camera-name) + (apply-settings *setting-control*) + ) + :code (behavior () + (local-vars (v1-50 symbol)) + (let ((gp-0 #t)) + (while (or (and (nonzero? (-> self voice-id)) + (let ((v1-41 (get-status *gui-control* (-> self voice-id)))) + (or (= v1-41 (gui-status ready)) (= v1-41 (gui-status active))) + ) + (begin + (dotimes (s5-2 4) + (when (and (string-charp= (-> self message name) (the-as (pointer uint8) (-> *sound-iop-info* stream-name s5-2))) + (= (-> self voice-id) (-> *sound-iop-info* stream-id s5-2)) + (logtest? (-> *sound-iop-info* stream-status s5-2) (stream-status ss6)) + ) + (set! v1-50 #f) + (goto cfg-47) + ) + ) + (set! v1-50 #t) + (label cfg-47) + (and v1-50 (not (time-elapsed? (-> self state-time) (seconds 120)))) + ) + ) + (and (nonzero? (-> self message-id)) + (= (get-status *gui-control* (-> self message-id)) (gui-status active)) + (or (not (time-elapsed? (-> self state-time) (the-as time-frame (-> self message text-duration)))) + (and (logtest? (-> self message flags) (talker-flags tf4)) + (-> self region) + (point-in-region-debug! (-> self region) (target-pos 0)) + ) + ) + ) + (not (time-elapsed? (-> self state-time) (seconds 0.05))) + ) + (when (and (nonzero? (-> self voice-id)) (not gp-0) (zero? (get-status *gui-control* (-> self voice-id)))) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) + (set! gp-0 #t) + ) + (when (and (-> self message camera) (not (-> self grab?)) *target*) + (when (process-grab? *target* #f) + (set! (-> self grab?) #t) + (set-setting! 'entity-name (-> self message camera) 0.0 0) + ) + ) + (when (and (nonzero? (-> self message-id)) + (= (get-status *gui-control* (-> self message-id)) (gui-status active)) + (not (paused?)) + ) + (if (logtest? (-> self message flags) (talker-flags tf5)) + (seek! (-> self interp) 1.0 (* 0.5 (seconds-per-frame))) + (seek! (-> self interp) 1.0 (* 4.0 (seconds-per-frame))) + ) + (talker-method-17 self) + ) + (suspend) + ) + ) + (when (and (nonzero? (-> self message-id)) (logtest? (-> self message flags) (talker-flags tf5 tf6))) + (while (!= (-> self interp) 0.0) + (if (logtest? (-> self message flags) (talker-flags tf5)) + (seek! (-> self interp) 0.0 (* 0.5 (seconds-per-frame))) + (seek! (-> self interp) 0.0 (* 4.0 (seconds-per-frame))) + ) + (if (and (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (not (paused?))) + (talker-method-17 self) + ) + (suspend) + ) + ) + (when (and (logtest? (-> self message flags) (talker-flags tf3)) (not (-> self save?))) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (set! (-> self save?) #t) + (auto-save-user) + ) + (go-virtual exit) + ) + ) + +;; failed to figure out what this is: +(defstate exit (talker) + :virtual #t + :code nothing + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/anim/aligner-h_REF.gc b/test/decompiler/reference/jak3/engine/anim/aligner-h_REF.gc index 29aa31e1108..3e0df106374 100644 --- a/test/decompiler/reference/jak3/engine/anim/aligner-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/aligner-h_REF.gc @@ -15,8 +15,8 @@ ) (:methods (new (symbol type process) _type_) - (align-control-method-9 () none) - (align-control-method-10 () none) + (compute-alignment! (_type_) transformq) + (align! (_type_ align-opts float float float) trsqv) (align-control-method-11 () none) (align-control-method-12 () none) (align-control-method-13 () none) diff --git a/test/decompiler/reference/jak3/engine/camera/camera-h_REF.gc b/test/decompiler/reference/jak3/engine/camera/camera-h_REF.gc index 85d02673a3e..8eb777431f4 100644 --- a/test/decompiler/reference/jak3/engine/camera/camera-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/camera-h_REF.gc @@ -482,6 +482,36 @@ (slope-adjust cam-float-seeker :inline) (slope-quat quaternion :inline) ) + (:states + cam-bike + cam-bt-gun + cam-circular + cam-decel + cam-endlessfall + cam-eye + cam-fixed + cam-fixed-read-entity + cam-free-floating + cam-launcher-longfall + cam-launcher-shortfall + cam-lookat + cam-no-trans + cam-point-watch + cam-pov + cam-pov-track + cam-pov180 + cam-power-game + cam-really-fixed + cam-remote + cam-scorpion-gun + cam-spline + cam-standoff + cam-standoff-read-entity + cam-stick + cam-string + cam-tube-sled + cam-turret + ) ) ;; definition for method 3 of type camera-slave @@ -598,8 +628,8 @@ (interest-dist float) ) (:methods - (camera-master-method-14 () none) - (camera-master-method-15 () none) + (camera-master-method-14 (_type_ vector) vector) + (camera-master-method-15 (_type_ vector) vector) (camera-master-method-16 () none) ) ) diff --git a/test/decompiler/reference/jak3/engine/camera/pov-camera-h_REF.gc b/test/decompiler/reference/jak3/engine/camera/pov-camera-h_REF.gc index 8f84a0f8de5..f5541cffe54 100644 --- a/test/decompiler/reference/jak3/engine/camera/pov-camera-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/pov-camera-h_REF.gc @@ -3,7 +3,7 @@ ;; definition of type pov-camera (deftype pov-camera (process-drawable) - ((flags pov-camera-flags) + ((flags pov-camera-flag) (debounce-start-time time-frame) (notify-handle handle) (anim-name string) @@ -51,7 +51,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc index d0d8f660765..17afe706d7a 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc @@ -151,13 +151,13 @@ It is not useful for ollision queries against a specific foreground object, like ) (:methods (collide-cache-method-9 () none) - (collide-cache-method-10 () none) - (collide-cache-method-11 () none) + (fill-and-probe-using-line-sphere (_type_ collide-query) float) + (fill-and-probe-using-spheres (_type_ collide-query) symbol) (collide-cache-method-12 () none) - (collide-cache-method-13 () none) + (fill-using-line-sphere (_type_ collide-query) none) (collide-cache-method-14 () none) (collide-cache-method-15 () none) - (collide-cache-method-16 () none) + (probe-using-line-sphere (_type_ collide-query) float) (collide-cache-method-17 () none) (collide-cache-method-18 () none) (collide-cache-method-19 () none) @@ -246,7 +246,3 @@ Can represent instanced collision, as a TIE instance, or a single non-instanced ;; failed to figure out what this is: (kmemclose) - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/collide-edge-grab-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-edge-grab-h_REF.gc index 59d5bd20686..ae72824f85b 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-edge-grab-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-edge-grab-h_REF.gc @@ -48,7 +48,7 @@ (pilot-grab-interp float) ) (:methods - (edge-grab-info-method-9 () none) + (edge-grab-info-method-9 (_type_) symbol) (edge-grab-info-method-10 () none) ) ) @@ -351,7 +351,3 @@ ;; failed to figure out what this is: (kmemclose) - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc index a044bd236e0..0414783ba66 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc @@ -19,8 +19,8 @@ This has both inputs from the user, and collision results." (start-pos vector :inline) (move-dist vector :inline) (rlength vector :inline) - (exit-planes plane 2) - (radius float :offset 268) + (exit-planes plane 2 :inline) + (radius float :overlay-at (-> exit-planes 0 data 3)) (inv-mat matrix :inline :offset 288) (spheres (inline-array sphere) :overlay-at (-> overlay-params 0)) (num-spheres uint32 :overlay-at (-> overlay-params 1)) @@ -59,7 +59,7 @@ This has both inputs from the user, and collision results." (format #t "~1Tignore-process1: ~A~%" (-> this ignore-process1)) (format #t "~1Tignore-pat: ~D~%" (-> this ignore-pat)) (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) - (format #t "~1Toverlay-params[3] @ #x~X~%" (-> this overlay-params)) + (format #t "~1Toverlay-params[3] @ #x~X~%" (&-> this spheres)) (format #t "~1Tbbox: #~%" (-> this bbox)) (format #t "~1Tbbox4w: #~%" (-> this bbox4w)) (format #t "~1Tbsphere: #~%" (-> this bsphere)) @@ -70,11 +70,11 @@ This has both inputs from the user, and collision results." (format #t "~1Tradius: ~f~%" (-> this radius)) (format #t "~1Tinv-mat: #~%" (-> this inv-mat)) (format #t "~1Tspheres: #x~X~%" (-> this spheres)) - (format #t "~1Tnum-spheres: ~D~%" (-> this num-spheres)) - (format #t "~1Tsolid-only: ~A~%" (-> this solid-only)) + (format #t "~1Tnum-spheres: ~D~%" (-> this best-other-prim)) + (format #t "~1Tsolid-only: ~A~%" (-> this best-my-prim)) (format #t "~1Tbest-dist: ~f~%" (the-as float (-> this spheres))) - (format #t "~1Tbest-other-prim: ~A~%" (-> this num-spheres)) - (format #t "~1Tbest-my-prim: ~A~%" (-> this solid-only)) + (format #t "~1Tbest-other-prim: ~A~%" (-> this best-other-prim)) + (format #t "~1Tbest-my-prim: ~A~%" (-> this best-my-prim)) (format #t "~1Tmove-vec: #~%" (-> this move-dist)) (format #t "~1Tbest-u: ~f~%" (the-as float (-> this spheres))) (format #t "~1Taction-mask: ~D~%" (-> this action-mask)) @@ -98,7 +98,3 @@ This has both inputs from the user, and collision results." ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc index 1a987d6bff0..f293c47a322 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc @@ -1395,34 +1395,34 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (riders (inline-array collide-rider)) (penetrate-using penetrate) (penetrated-by penetrate) - (unknown-word0 int32) - (unknown-word1 int32) + (backup-collide-as collide-spec) + (backup-collide-with collide-spec) (event-priority uint8 :offset 192) (rider-max-momentum float) ) (:methods (new (symbol type process-drawable collide-list-enum) _type_) - (collide-shape-method-28 () none) - (collide-shape-method-29 () none) + (move-by-vector! (_type_ vector) none) + (move-to-point! (_type_ vector) none) (collide-shape-method-30 () none) - (collide-shape-method-31 () none) - (collide-shape-method-32 () none) + (fill-cache-for-shape (_type_ float collide-query) none) + (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none) (collide-shape-method-33 () none) (collide-shape-method-34 () none) (detect-riders! (_type_) symbol) (collide-shape-method-36 () none) - (collide-shape-method-37 () none) + (integrate-and-collide! (_type_ vector) none) (find-collision-meshes (_type_) none) (collide-shape-method-39 () none) - (collide-shape-method-40 () none) + (find-overlapping-shapes (_type_ overlaps-others-params) symbol) (collide-shape-method-41 () none) (collide-shape-method-42 () none) (collide-shape-method-43 () none) (pull-riders! (_type_) symbol) (do-push-aways (_type_) collide-spec) (update-transforms (_type_) none) - (collide-shape-method-47 () none) - (collide-shape-method-48 () none) + (set-collide-with! (_type_ collide-spec) none) + (set-collide-as! (_type_ collide-spec) none) (collide-shape-method-49 () none) (collide-shape-method-50 () none) (collide-shape-method-51 () none) @@ -1483,6 +1483,9 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (cur-pat pat-surface) (ground-pat pat-surface) (status collide-status) + (old-status collide-status) + (prev-status collide-status) + (reaction-flag cshape-reaction-flags) (reaction (function control-info collide-query vector vector collide-status) :offset 316) (no-reaction (function collide-shape-moving collide-query vector vector object)) (local-normal vector :inline) @@ -1502,17 +1505,17 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ) (:methods (new (symbol type process-drawable collide-list-enum) _type_) - (collide-shape-moving-method-55 () none) - (collide-shape-moving-method-56 () none) + (find-ground (_type_ collide-query collide-spec float float float) symbol) + (react-to-pat! (_type_ pat-surface) cshape-reaction-flags) (collide-shape-moving-method-57 () none) (collide-shape-moving-method-58 () none) (collide-shape-moving-method-59 () none) (collide-shape-moving-method-60 () none) (collide-shape-moving-method-61 () none) - (collide-shape-moving-method-62 () none) + (compute-acc-due-to-gravity (_type_ vector float) vector) (collide-shape-moving-method-63 () none) (collide-shape-moving-method-64 () none) - (collide-shape-moving-method-65 () none) + (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol) (collide-shape-moving-method-66 () none) (collide-shape-moving-method-67 () none) ) @@ -1734,7 +1737,3 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc index 4b44a2cc210..510fa7754f6 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc @@ -3,13 +3,229 @@ ;; definition of type control-info (deftype control-info (collide-shape-moving) - ((pad uint8 5944) + ((unknown-float00 float :overlay-at ground-impact-vel) + (unknown-float01 float :overlay-at surface-angle) + (unknown-float02 float :overlay-at poly-angle) + (unknown-float03 float :overlay-at touch-angle) + (transv-ctrl vector :inline :offset 480) + (target-transv vector :inline :offset 496) + (bent-gravity-normal vector :inline :offset 512) + (quat-for-control quaternion :inline :offset 528) + (override-quat quaternion :inline :offset 544) + (override-quat-alpha float :offset 560) + (ctrl-xz-vel float :offset 564) + (unknown-float003 float :offset 568) + (turn-go-the-long-way float :offset 572) + (velocity-after-thrust float :offset 576) + (turn-lockout-end-time time-frame :offset 584) + (turn-to-alt-heading vector :inline :offset 592) + (last-transv vector :inline :offset 608) + (last-quat-for-control quaternion :inline :offset 624) + (trans-log-trans vector 128 :inline :offset 640) + (trans-log-times time-frame 128 :offset 2688) + (trans-log-idx int32 :offset 3712) + (draw-offset vector :inline :offset 3728) + (cspace-offset vector :inline :offset 3744) + (anim-collide-offset-local vector :inline :offset 3760) + (anim-collide-offset-world vector :inline :offset 3776) + (old-anim-collide-offset-world vector :inline :offset 3792) + (anim-collide-offset-delta-world vector :inline :offset 3808) + (standard-dynamics dynamics :offset 3824) + (mod-surface surface :offset 3828) + (current-surface surface :offset 3832) + (prev-surf surface :offset 3836) + (time-of-last-surface-change time-frame :offset 3840) + (cpad cpad-info :offset 3848) + (turn-to-angle float :offset 3852) + (last-turn-to-angle float :offset 3856) + (turn-to-magnitude float :offset 3860) + (last-turn-to-magnitude float :offset 3864) + (to-target-pt-xz vector :inline :offset 3872) + (last-to-target-pt-xz vector :inline :offset 3888) + (turn-to-target vector :inline :offset 3904) + (last-turn-to-target vector :inline :offset 3920) + (turn-history-ctrl vector 7 :inline :offset 3936) + (pad-xz-dir vector :inline :offset 4064) + (last-pad-xz-dir vector :inline :offset 4080) + (pad-magnitude float :offset 4096) + (last-pad-magnitude float :offset 4100) + (time-of-last-pad-read time-frame :offset 4104) + (w-R-c matrix :inline :offset 4112) + (c-R-w matrix :inline :offset 4176) + (ctrl-orientation matrix :inline :offset 4240) + (pre-collide-local-normal vector :inline :offset 4320) + (camera-pos vector :inline :offset 4336) + (cam-R-w matrix :inline :offset 4352) + (update-cam-R-w-start-time int64 :offset 4416) + (force-turn-to-direction vector :inline :offset 4432) + (force-turn-to-speed float :offset 4448) + (unknown-floatiujh1bnb2n3i1 float :offset 4452) + (force-turn-to-strength float :offset 4456) + (tongue-counter int32 :offset 4460) + (collide-extra-velocity vector :inline :offset 4464) + (additional-decaying-velocity vector :inline :offset 4480) + (additional-decaying-velocity-end-time time-frame :offset 4496) + (additional-decaying-velocity-decay-start-time time-frame :offset 4504) + (gravity-normal vector :inline :offset 4512) + (last-gravity-normal vector :inline :offset 4528) + (last-trans-any-surf vector :inline :offset 4544) + (unknown-float16 float :overlay-at (-> last-trans-any-surf y)) + (ground-contact-normal vector :inline :offset 4560) + (last-trans-on-ground vector :inline :offset 4576) + (ground-contact-sphere-center vector :inline :offset 4592) + (transv-on-last-impact vector :inline :offset 4608) + (list-time-on-ground time-frame :offset 4624) + (ground-local-norm-dot-grav float :offset 4632) + (local-slope-z float :offset 4636) + (local-slope-x float :offset 4640) + (surface-slope-z float :offset 4644) + (surface-slope-x float :offset 4648) + (last-time-on-surface time-frame :offset 4656) + (normal-impact-vel float :offset 4664) + (last-time-touching-actor time-frame :offset 4672) + (wall-contact-pat pat-surface :offset 4680) + (wall-contact-pt vector :inline :offset 4688) + (wall-contact-poly-normal vector :inline :offset 4704) + (wall-contact-normal vector :inline :offset 4720) + (actor-contact-pt vector :inline :offset 4736) + (actor-contact-normal vector :inline :offset 4752) + (actor-contact-handle handle :offset 4768) + (gspot-pat-surfce pat-surface :offset 4776) + (gspot-slope-z float :offset 4780) + (gspot-slope-x float :offset 4784) + (ctrl-slope-heading float :offset 4788) + (ctrl-slope-z float :offset 4792) + (ctrl-slope-x float :offset 4796) + (unknown-word000 int32 :offset 4800) + (unknown-float002 float :offset 4804) + (unknown-float-n12iuh3n1 float :offset 4808) + (unknown-float-ki1jhbn23hj float :offset 4812) + (time-of-last-lc time-frame :offset 4816) + (low-coverage-pat-next1 pat-surface :offset 4828) + (low-coverage-dist-to-next2 float :offset 4832) + (low-coverage-pat-next2 pat-surface :offset 4836) + (low-coverage-slope-to-next1 float :offset 4824) + (low-coverage-norm-of-next1 vector :inline :offset 4848) + (low-coverage-norm-of-next2 vector :inline :offset 4864) + (low-coverage-overhang-plane-normal vector :inline :offset 4912) + (low-coverage-tangent vector :inline :offset 4928) + (low-coverage-tangent-xz vector :inline :offset 4944) + (btransv vector :inline :offset 4976) + (blocked-factor float :offset 4992) + (blocked-in-air-factor float :offset 4996) + (time-of-last-clear-wall-in-jump time-frame :offset 5000) + (time-of-last-lc-touch-edge time-frame :offset 5008) + (collision-spheres collide-shape-prim-sphere 10 :offset 5016) + (unknown-word02 int32 :offset 5064) + (last-roll-end-time time-frame :offset 5072) + (last-running-attack-end-time time-frame :offset 5080) + (last-hands-attempt-time time-frame :offset 5088) + (last-attack-end-time time-frame :offset 5096) + (last-feet-attempt-time time-frame :offset 5104) + (unknown-time-frame13 time-frame :offset 5112) + (last-time-of-stuck time-frame :offset 5120) + (bend-amount float :offset 5132) + (bend-target float :offset 5136) + (bend-speed float :offset 5140) + (ctrl-to-head-offset vector :inline :offset 5152) + (lhand-cspace cspace :offset 5168) + (rhand-cspace cspace :offset 5172) + (midpoint-of-hands vector :inline :offset 5184) + (ctrl-to-hands-offset vector :inline :offset 5200) + (sidekick-root cspace :inline :offset 5216) + (collide-mode symbol :offset 5248) + (collide-mode-transition float :offset 5252) + (duck-gun-tube-transision float :offset 5256) + (transv-history vector 15 :inline :offset 5264) + (average-xz-vel float :offset 5520) + (idx-of-fastest-xz-vel int32 :offset 5524) + (hand-to-edge-dist float :offset 5528) + (unknown-symbol000 symbol :offset 5532) + (edge-grab-edge-dir vector :inline :offset 5536) + (unknown-vector35 vector :inline :offset 5552) + (edge-grab-across-edge-dir vector :inline :offset 5568) + (last-successful-compute-edge-time time-frame :offset 5584) + (edge-grab-start-time time-frame :offset 5592) + (unknown-handle000 handle :offset 5600) + (anim-handle handle :offset 5608) + (unknown-word04 uint32 :offset 5616) + (unknown-spool-anim00 spool-anim :overlay-at unknown-word04) + (unknown-word05 int32 :overlay-at unknown-spool-anim00) + (unknown-symbol01 symbol :overlay-at unknown-word05) + (unknown-float34 float :overlay-at unknown-symbol01) + (did-move-to-pole-or-max-jump-height float :offset 5620) + (unknown-symbol03 float :offset 5624) + (unknown-float35 float :offset 5628) + (unknown-float36 float :offset 5632) + (unknown-float37 float :offset 5636) + (unknown-vector37 vector :inline :offset 5648) + (unknown-vector38 vector :inline :offset 5664) + (unknown-vector39 vector :inline :offset 5680) + (unknown-vector40 vector :inline :offset 5696) + (sliding-start-time time-frame :offset 5712) + (unknown-time-frame18 time-frame :offset 5720) + (unknown-sound-id00 sound-id :offset 5776) + (lightjak-sound-id sound-id :offset 5780) + (unknown-handle02 handle :offset 5792) + (impact-ctrl impact-control :inline :offset 5824) + (unknown-word06 int32 :offset 5832) + (unknown-vector41 vector :inline :offset 5888) + (last-trans-leaving-surf vector :inline :offset 5904) + (unknown-float38 float :overlay-at (-> last-trans-leaving-surf y)) + (highest-jump-mark vector :inline :offset 5920) + (unknown-float39 float :overlay-at (-> highest-jump-mark y)) + (unknown-time-frame19 time-frame :offset 5936) + (time-of-last-debug-float time-frame :offset 5944) + (danger-mode symbol :offset 5984) + (target-attack-id uint32 :offset 5988) + (attacked-by-id int32 :offset 5992) + (bomb-scale float :offset 5996) + (attack-count uint64 :offset 6000) + (send-attack-dest handle :offset 6008) + (send-attack-time time-frame :offset 6016) + (unknown-combo-tracker00 combo-tracker :inline :offset 6032) + (unknown-time-frame21 time-frame :offset 6072) + (unknown-dword07 int64 :offset 6096) + (unknown-dword08 int64 :offset 6104) + (unknown-dword09 int64 :offset 6112) + (unknown-dword10 int64 :offset 6120) + (jump-kind symbol :offset 6144) + (unknown-quaternion04 quaternion :inline :offset 6160) + (unknown-sound-id01 sound-id :offset 6176) + (unknown-float41 float :offset 6180) + (unknown-float42 float :offset 6184) + (history-idx uint16 :offset 6188) + (history-length uint16 :offset 6190) + (remaining-ctrl-iterations int32 :offset 6192) + (invul1-on-time time-frame :offset 6200) + (invul1-off-time time-frame :offset 6208) + (invul2-on-time time-frame :offset 6216) + (invul2-off-time time-frame :offset 6224) + (unknown-float43 float :offset 6232) + (unknown-float001 float :offset 6236) + (board-jump-and-swim-sound sound-id :offset 6240) + (bubbles-sound sound-id :offset 6244) + (unknown-time-frame26 time-frame :offset 6248) + (unknown-time-frame27 time-frame :offset 6256) + (yellow-eco-last-use-time int64 :offset 6264) + (align-xz-vel vector :inline :offset 6272) + (zx-vel-frac float :offset 6288) + (unknown-sound-id04 sound-id :offset 6292) + (unknown-float45 float :offset 6296) + (default-collide-as-all collide-spec :offset 6300) + (default-collide-as-fgnd collide-spec :offset 6304) + (default-collide-with-all collide-spec :offset 6308) + (default-collide-with-fgnd collide-spec :offset 6312) + (time-of-last-zero-input time-frame :offset 6320) + (time-of-last-nonzero-input time-frame :offset 6328) + (time-between-zero-inputs time-frame :offset 6336) + (time-of-last-debug-heal time-frame :offset 6368) + (last-nonzero-input-dir-targ quaternion :inline :offset 6384) + (time-of-last-wall-hide-first-check-pass time-frame :offset 6400) + (time-of-first-wall-hide-first-check-pass time-frame :offset 6408) + (pad uint8 4) ) ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/collide-touch-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-touch-h_REF.gc index d6f11ee04fa..993bfa89e51 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-touch-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-touch-h_REF.gc @@ -140,8 +140,8 @@ storing a record of the primitives involved." (get-head (_type_) touching-prims-entry) (get-next (_type_ touching-shapes-entry) touching-prims-entry) (touching-shapes-entry-method-11 () none) - (touching-shapes-entry-method-12 () none) - (touching-shapes-entry-method-13 () none) + (prims-touching? (_type_ collide-shape uint) touching-prims-entry) + (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic) (touching-shapes-entry-method-14 () none) ) ) @@ -231,7 +231,3 @@ storing a record of the primitives involved." ;; failed to figure out what this is: (kmemclose) - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/find-nearest_REF.gc b/test/decompiler/reference/jak3/engine/collide/find-nearest_REF.gc new file mode 100644 index 00000000000..f5c50c2ba86 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/find-nearest_REF.gc @@ -0,0 +1,487 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type search-info +(deftype search-info (structure) + ((point vector :inline) + (best-point vector :inline) + (match-handle handle) + (match process-focusable) + (best float) + (radius float) + (rating search-info-flag) + (require search-info-flag) + (mask search-info-flag) + (rot-base vector :inline) + (back-point vector :inline) + (rot-range float) + ) + ) + +;; definition for method 3 of type search-info +(defmethod inspect ((this search-info)) + (when (not this) + (set! this this) + (goto cfg-118) + ) + (format #t "[~8x] ~A~%" this 'search-info) + (format #t "~1Tpoint: ~`vector`P~%" (-> this point)) + (format #t "~1Tbest-point: ~`vector`P~%" (-> this best-point)) + (format #t "~1Tmatch-handle: ~D~%" (-> this match-handle)) + (format #t "~1Tmatch: ~A~%" (-> this match)) + (format #t "~1Tbest: ~f~%" (-> this best)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Trating: #x~X : (search-info-flag " (-> this rating)) + (let ((s5-0 (-> this rating))) + (if (= (logand s5-0 (search-info-flag attackable)) (search-info-flag attackable)) + (format #t "attackable ") + ) + (if (= (logand s5-0 (search-info-flag high-priority)) (search-info-flag high-priority)) + (format #t "high-priority ") + ) + (if (= (logand s5-0 (search-info-flag prefer-xz)) (search-info-flag prefer-xz)) + (format #t "prefer-xz ") + ) + (if (= (logand (search-info-flag prefer-center) s5-0) (search-info-flag prefer-center)) + (format #t "prefer-center ") + ) + (if (= (logand s5-0 (search-info-flag cull-xz)) (search-info-flag cull-xz)) + (format #t "cull-xz ") + ) + (if (= (logand s5-0 (search-info-flag enemy)) (search-info-flag enemy)) + (format #t "enemy ") + ) + (if (= (logand s5-0 (search-info-flag combo)) (search-info-flag combo)) + (format #t "combo ") + ) + (if (= (logand (search-info-flag probe-camera) s5-0) (search-info-flag probe-camera)) + (format #t "probe-camera ") + ) + (if (= (logand s5-0 (search-info-flag guard)) (search-info-flag guard)) + (format #t "guard ") + ) + (if (= (logand s5-0 (search-info-flag prefer-dist)) (search-info-flag prefer-dist)) + (format #t "prefer-dist ") + ) + (if (= (logand s5-0 (search-info-flag cull-angle-simple)) (search-info-flag cull-angle-simple)) + (format #t "cull-angle-simple ") + ) + (if (= (logand s5-0 (search-info-flag prefer-angle)) (search-info-flag prefer-angle)) + (format #t "prefer-angle ") + ) + (if (= (logand s5-0 (search-info-flag attackable-priority)) (search-info-flag attackable-priority)) + (format #t "attackable-priority ") + ) + (if (= (logand s5-0 (search-info-flag on-screen)) (search-info-flag on-screen)) + (format #t "on-screen ") + ) + (if (= (logand s5-0 (search-info-flag abort)) (search-info-flag abort)) + (format #t "abort ") + ) + (if (= (logand (search-info-flag probe) s5-0) (search-info-flag probe)) + (format #t "probe ") + ) + (if (= (logand s5-0 (search-info-flag cull-angle)) (search-info-flag cull-angle)) + (format #t "cull-angle ") + ) + (if (= (logand s5-0 (search-info-flag crate)) (search-info-flag crate)) + (format #t "crate ") + ) + (if (= (logand s5-0 (search-info-flag back-point)) (search-info-flag back-point)) + (format #t "back-point ") + ) + ) + (format #t ")~%") + (format #t "~1Trequire: #x~X : (search-info-flag " (-> this require)) + (let ((s5-1 (-> this require))) + (if (= (logand s5-1 (search-info-flag attackable)) (search-info-flag attackable)) + (format #t "attackable ") + ) + (if (= (logand s5-1 (search-info-flag high-priority)) (search-info-flag high-priority)) + (format #t "high-priority ") + ) + (if (= (logand s5-1 (search-info-flag prefer-xz)) (search-info-flag prefer-xz)) + (format #t "prefer-xz ") + ) + (if (= (logand (search-info-flag prefer-center) s5-1) (search-info-flag prefer-center)) + (format #t "prefer-center ") + ) + (if (= (logand s5-1 (search-info-flag cull-xz)) (search-info-flag cull-xz)) + (format #t "cull-xz ") + ) + (if (= (logand s5-1 (search-info-flag enemy)) (search-info-flag enemy)) + (format #t "enemy ") + ) + (if (= (logand s5-1 (search-info-flag combo)) (search-info-flag combo)) + (format #t "combo ") + ) + (if (= (logand (search-info-flag probe-camera) s5-1) (search-info-flag probe-camera)) + (format #t "probe-camera ") + ) + (if (= (logand s5-1 (search-info-flag guard)) (search-info-flag guard)) + (format #t "guard ") + ) + (if (= (logand s5-1 (search-info-flag prefer-dist)) (search-info-flag prefer-dist)) + (format #t "prefer-dist ") + ) + (if (= (logand s5-1 (search-info-flag cull-angle-simple)) (search-info-flag cull-angle-simple)) + (format #t "cull-angle-simple ") + ) + (if (= (logand s5-1 (search-info-flag prefer-angle)) (search-info-flag prefer-angle)) + (format #t "prefer-angle ") + ) + (if (= (logand s5-1 (search-info-flag attackable-priority)) (search-info-flag attackable-priority)) + (format #t "attackable-priority ") + ) + (if (= (logand s5-1 (search-info-flag on-screen)) (search-info-flag on-screen)) + (format #t "on-screen ") + ) + (if (= (logand s5-1 (search-info-flag abort)) (search-info-flag abort)) + (format #t "abort ") + ) + (if (= (logand (search-info-flag probe) s5-1) (search-info-flag probe)) + (format #t "probe ") + ) + (if (= (logand s5-1 (search-info-flag cull-angle)) (search-info-flag cull-angle)) + (format #t "cull-angle ") + ) + (if (= (logand s5-1 (search-info-flag crate)) (search-info-flag crate)) + (format #t "crate ") + ) + (if (= (logand s5-1 (search-info-flag back-point)) (search-info-flag back-point)) + (format #t "back-point ") + ) + ) + (format #t ")~%") + (format #t "~1Tmask: #x~X : (search-info-flag " (-> this mask)) + (let ((s5-2 (-> this mask))) + (if (= (logand s5-2 (search-info-flag attackable)) (search-info-flag attackable)) + (format #t "attackable ") + ) + (if (= (logand s5-2 (search-info-flag high-priority)) (search-info-flag high-priority)) + (format #t "high-priority ") + ) + (if (= (logand s5-2 (search-info-flag prefer-xz)) (search-info-flag prefer-xz)) + (format #t "prefer-xz ") + ) + (if (= (logand (search-info-flag prefer-center) s5-2) (search-info-flag prefer-center)) + (format #t "prefer-center ") + ) + (if (= (logand s5-2 (search-info-flag cull-xz)) (search-info-flag cull-xz)) + (format #t "cull-xz ") + ) + (if (= (logand s5-2 (search-info-flag enemy)) (search-info-flag enemy)) + (format #t "enemy ") + ) + (if (= (logand s5-2 (search-info-flag combo)) (search-info-flag combo)) + (format #t "combo ") + ) + (if (= (logand (search-info-flag probe-camera) s5-2) (search-info-flag probe-camera)) + (format #t "probe-camera ") + ) + (if (= (logand s5-2 (search-info-flag guard)) (search-info-flag guard)) + (format #t "guard ") + ) + (if (= (logand s5-2 (search-info-flag prefer-dist)) (search-info-flag prefer-dist)) + (format #t "prefer-dist ") + ) + (if (= (logand s5-2 (search-info-flag cull-angle-simple)) (search-info-flag cull-angle-simple)) + (format #t "cull-angle-simple ") + ) + (if (= (logand s5-2 (search-info-flag prefer-angle)) (search-info-flag prefer-angle)) + (format #t "prefer-angle ") + ) + (if (= (logand s5-2 (search-info-flag attackable-priority)) (search-info-flag attackable-priority)) + (format #t "attackable-priority ") + ) + (if (= (logand s5-2 (search-info-flag on-screen)) (search-info-flag on-screen)) + (format #t "on-screen ") + ) + (if (= (logand s5-2 (search-info-flag abort)) (search-info-flag abort)) + (format #t "abort ") + ) + (if (= (logand (search-info-flag probe) s5-2) (search-info-flag probe)) + (format #t "probe ") + ) + (if (= (logand s5-2 (search-info-flag cull-angle)) (search-info-flag cull-angle)) + (format #t "cull-angle ") + ) + (if (= (logand s5-2 (search-info-flag crate)) (search-info-flag crate)) + (format #t "crate ") + ) + (if (= (logand s5-2 (search-info-flag back-point)) (search-info-flag back-point)) + (format #t "back-point ") + ) + ) + (format #t ")~%") + (format #t "~1Trot-base: ~`vector`P~%" (-> this rot-base)) + (format #t "~1Tback-point: ~`vector`P~%" (-> this back-point)) + (format #t "~1Trot-range: ~f~%" (-> this rot-range)) + (label cfg-118) + this + ) + +;; definition for symbol *search-info*, type search-info +(define *search-info* (new 'global 'search-info)) + +;; definition for function find-nearest-focusable +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 720 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 784 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 720 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 784 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 720 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 784 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 720 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 784 mismatch: defined as size 4, got size 16 +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] +(defun find-nearest-focusable ((arg0 (array collide-shape)) + (arg1 vector) + (arg2 float) + (arg3 search-info-flag) + (arg4 search-info-flag) + (arg5 vector) + (arg6 vector) + (arg7 float) + ) + (local-vars + (f0-12 float) + (sv-704 (function float float float)) + (sv-720 float) + (sv-736 vector) + (sv-752 vector) + (sv-768 (function float float float)) + (sv-784 float) + ) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 *search-info*)) + (set! (-> gp-0 match) #f) + (set! (-> gp-0 point quad) (-> arg1 quad)) + (set! (-> gp-0 radius) arg2) + (set! (-> gp-0 best) 1000000000000000000000.0) + (set! (-> gp-0 rating) (search-info-flag)) + (set! (-> gp-0 require) arg4) + (set! (-> gp-0 mask) arg3) + (set! (-> gp-0 rot-base quad) (-> arg5 quad)) + (if arg6 + (set! (-> gp-0 back-point quad) (-> arg6 quad)) + (set! (-> gp-0 back-point quad) (-> gp-0 rot-base quad)) + ) + (set! arg7 (cond + ((= arg7 65536.0) + -2.0 + ) + (else + (empty) + arg7 + ) + ) + ) + (set! (-> gp-0 rot-range) arg7) + (let ((s4-0 (-> arg0 length))) + (while (begin (label cfg-104) (nonzero? s4-0)) + (+! s4-0 -1) + (let* ((s0-0 (-> arg0 s4-0)) + (s2-0 (-> s0-0 process)) + (s3-0 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when s3-0 + (let ((s1-0 (process-mask->search-info-flag (the-as process-focusable s3-0)))) + (when (and (and s3-0 (not (logtest? (-> (the-as process-focusable s3-0) focus-status) (focus-status disable dead)))) + (logtest? s1-0 (search-info-flag crate guard attackable enemy attackable-priority high-priority)) + ) + (let* ((s2-1 (get-trans (the-as process-focusable s3-0) 3)) + (f30-0 (- (vector-vector-distance (-> gp-0 point) s2-1) (-> s2-1 w))) + ) + (when (nonzero? (-> s0-0 root-prim prim-core collide-as)) + (let ((s0-1 (search-info-flag))) + 0.0 + (set! sv-736 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s2-1 (-> gp-0 point)) 1.0)) + (let ((f28-0 (cond + ((logtest? (-> gp-0 mask) (search-info-flag prefer-xz)) + (set! sv-704 deg-diff) + (set! sv-720 (vector-y-angle (-> gp-0 rot-base))) + (let ((a1-6 (vector-y-angle sv-736))) + (fabs (sv-704 sv-720 a1-6)) + ) + ) + ((logtest? (-> gp-0 mask) (search-info-flag prefer-angle)) + (- -9999.0 (vector-dot sv-736 (-> gp-0 rot-base))) + ) + ((logtest? (search-info-flag prefer-center) (-> gp-0 mask)) + (* f30-0 (fmax 0.01 (- 1.0 (vector-dot sv-736 (-> gp-0 rot-base))))) + ) + (else + f30-0 + ) + ) + ) + ) + (cond + ((logtest? (-> gp-0 mask) (search-info-flag cull-angle-simple)) + (let* ((v1-41 (-> gp-0 rot-base)) + (f0-11 (-> sv-736 x)) + (f1-6 (-> sv-736 y)) + (f2-2 (-> sv-736 z)) + (f3-0 (-> v1-41 x)) + (f4-0 (-> v1-41 y)) + (f5-0 (-> v1-41 z)) + ) + (.mula.s f0-11 f3-0) + (.madda.s f1-6 f4-0) + (.madd.s f0-12 f2-2 f5-0) + ) + (if (< f0-12 (cos (-> gp-0 rot-range))) + (return (the-as process-focusable #f)) + ) + ) + ((logtest? (-> gp-0 mask) (search-info-flag cull-angle)) + (cond + ((< (-> gp-0 rot-range) 14563.556) + (let ((f26-1 (vector-dot (vector-! (new 'stack-no-clear 'vector) s2-1 (-> gp-0 point)) (-> gp-0 rot-base)))) + (set! sv-752 (new 'stack-no-clear 'vector)) + (let ((v1-53 (-> gp-0 point)) + (a0-27 (-> gp-0 rot-base)) + (f0-17 f26-1) + ) + (.lvf vf2 (&-> a0-27 quad)) + (.lvf vf1 (&-> v1-53 quad)) + (let ((v1-54 f0-17)) + (.mov vf3 v1-54) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> sv-752 quad) vf4) + (let ((f26-2 (* f26-1 (tan (-> gp-0 rot-range)))) + (t9-10 vector-vector-distance) + (a1-8 s2-1) + ) + (if (< f26-2 (- (t9-10 sv-752 a1-8) (-> s2-1 w))) + (goto cfg-104) + ) + ) + ) + ) + (else + (if (< (vector-dot sv-736 (-> gp-0 rot-base)) (cos (-> gp-0 rot-range))) + (return (the-as process-focusable #f)) + ) + ) + ) + ) + ((logtest? (-> gp-0 mask) (search-info-flag cull-xz)) + (let ((f26-4 (-> gp-0 rot-range))) + (set! sv-768 deg-diff) + (set! sv-784 (vector-y-angle (-> gp-0 rot-base))) + (let ((a1-9 (vector-y-angle sv-736))) + (if (< f26-4 (fabs (sv-768 sv-784 a1-9))) + (goto cfg-104) + ) + ) + ) + ) + ) + (when (logtest? (-> gp-0 mask) (search-info-flag back-point)) + (if (< (vector-dot + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s2-1 (-> gp-0 back-point)) 1.0) + (-> gp-0 rot-base) + ) + 0.0 + ) + (goto cfg-104) + ) + ) + (when (logtest? (-> gp-0 mask) (search-info-flag combo)) + (if (not (send-event s3-0 'combo)) + (goto cfg-104) + ) + ) + (if (logtest? s1-0 (search-info-flag high-priority)) + (set! s0-1 (the-as search-info-flag (logior (the-as int s0-1) (search-info-flag high-priority)))) + ) + (if (logtest? s1-0 (search-info-flag guard enemy attackable-priority high-priority)) + (set! s0-1 (the-as search-info-flag (logior (the-as int s0-1) (search-info-flag enemy)))) + ) + (if (logtest? s1-0 (search-info-flag attackable)) + (set! s0-1 (the-as search-info-flag (logior (the-as int s0-1) (search-info-flag attackable)))) + ) + (if (logtest? s1-0 (search-info-flag crate)) + (set! s0-1 (the-as search-info-flag (logior (the-as int s0-1) (search-info-flag crate)))) + ) + (if (and (nonzero? (-> s3-0 draw)) (logtest? (-> s3-0 draw status) (draw-control-status on-screen))) + (set! s0-1 (the-as search-info-flag (logior (the-as int s0-1) (search-info-flag on-screen)))) + ) + (let ((s1-1 (the-as search-info-flag (logand (the-as int s0-1) (-> gp-0 mask))))) + (when (and (>= (the-as int s1-1) (the-as int (-> gp-0 rating))) + (or (zero? (-> gp-0 require)) (logtest? (the-as int s1-1) (-> gp-0 require))) + (or (and (logtest? (the-as int s1-1) (search-info-flag high-priority)) + (not (logtest? (-> gp-0 rating) (search-info-flag high-priority))) + ) + (and (logtest? (the-as int s1-1) (search-info-flag high-priority)) + (logtest? (-> gp-0 rating) (search-info-flag high-priority)) + (< f28-0 (-> gp-0 best)) + ) + (< f28-0 (-> gp-0 best)) + ) + (< f30-0 (-> gp-0 radius)) + ) + (when (logtest? (search-info-flag probe) (-> gp-0 mask)) + (let ((a1-13 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-13 start-pos quad) (-> gp-0 back-point quad)) + (vector-! (-> a1-13 move-dist) s2-1 (-> gp-0 back-point)) + (let ((v1-124 a1-13)) + (set! (-> v1-124 radius) 1228.8) + (set! (-> v1-124 collide-with) (collide-spec backgnd)) + (set! (-> v1-124 ignore-process0) pp) + (set! (-> v1-124 ignore-process1) #f) + (set! (-> v1-124 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-124 action-mask) (collide-action solid)) + ) + (let ((f0-34 (fill-and-probe-using-line-sphere *collide-cache* a1-13))) + (if (and (>= f0-34 0.0) (< f0-34 1.0)) + (goto cfg-104) + ) + ) + ) + ) + (set! (-> gp-0 match) (the-as process-focusable s3-0)) + (set! (-> gp-0 best) f28-0) + (set! (-> gp-0 rating) (the-as search-info-flag s1-1)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (-> gp-0 match) + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc new file mode 100644 index 00000000000..cbe00759577 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc @@ -0,0 +1,3551 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-health collectables collectables-health-lod0-jg collectables-health-idle-ja + ((collectables-health-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + ) + +;; failed to figure out what this is: +(defskelgroup skel-gem collectables collectables-gem-lod0-jg collectables-gem-idle-ja + ((collectables-gem-lod0-mg (meters 20)) (collectables-gem-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.6) + :texture-level 10 + ) + +;; failed to figure out what this is: +(defskelgroup skel-gun-yellow-up yellow-barrel yellow-barrel-lod0-jg yellow-barrel-idle-ja + ((yellow-barrel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :shadow-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-gun-dark-up dark-barrel 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :shadow-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-skill collectables collectables-skill-lod0-jg collectables-skill-idle-ja + ((collectables-skill-lod0-mg (meters 20)) + (collectables-skill-lod1-mg (meters 40)) + (collectables-skill-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 0.6) + :shadow collectables-skill-shadow-mg + :texture-level 10 + :origin-joint-index 3 + ) + +;; definition of type collectable +(deftype collectable (process-drawable) + ((root collide-shape-moving :override) + (pickup-type pickup-type) + (pickup-amount float) + (notify handle) + (old-base vector :inline) + (base vector :inline) + (extra-trans vector :inline) + (jump-pos vector :inline) + (flags collectable-flag) + (birth-time time-frame) + (collect-timeout time-frame) + (fadeout-timeout time-frame) + (bob-offset uint64) + (bob-amount float) + (pickup-handle handle) + (actor-pause symbol) + (collect-effect sparticle-launch-group) + (collect-effect2 sparticle-launch-group) + (target handle) + (suck-time time-frame) + (suck-y-offset float) + (speed vector :inline) + (movie-pos-index int32) + ) + (:state-methods + blocked + wait + deploy + (suck handle) + jump + fade + (pickup symbol handle) + die + (notice-blue handle) + ) + (:methods + (init-common (_type_ entity-actor pickup-type float) none) + (initialize-effects (_type_ pickup-type) none) + (go-to-initial-state (_type_) object) + (initialize-options (_type_ int float fact-info) collectable) + (initialize-allocations (_type_) none) + (common-post (_type_) none) + (do-pickup (_type_ handle) none) + ) + ) + +;; definition for method 3 of type collectable +(defmethod inspect ((this collectable)) + (when (not this) + (set! this this) + (goto cfg-20) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tpickup-type: ~D~%" (-> this pickup-type)) + (format #t "~2Tpickup-amount: ~f~%" (-> this pickup-amount)) + (format #t "~2Tnotify: ~D~%" (-> this notify)) + (format #t "~2Told-base: ~`vector`P~%" (-> this old-base)) + (format #t "~2Tbase: ~`vector`P~%" (-> this base)) + (format #t "~2Textra-trans: ~`vector`P~%" (-> this extra-trans)) + (format #t "~2Tjump-pos: ~`vector`P~%" (-> this jump-pos)) + (format #t "~2Tflags: #x~X : (collectable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (collectable-flag no-eco-blue)) (collectable-flag no-eco-blue)) + (format #t "no-eco-blue ") + ) + (if (= (logand s5-0 (collectable-flag suck-in)) (collectable-flag suck-in)) + (format #t "suck-in ") + ) + (if (= (logand s5-0 (collectable-flag bounce)) (collectable-flag bounce)) + (format #t "bounce ") + ) + (if (= (logand s5-0 (collectable-flag no-distance-check-fadeout)) (collectable-flag no-distance-check-fadeout)) + (format #t "no-distance-check-fadeout ") + ) + (if (= (logand s5-0 (collectable-flag fadeout)) (collectable-flag fadeout)) + (format #t "fadeout ") + ) + (if (= (logand s5-0 (collectable-flag no-bob)) (collectable-flag no-bob)) + (format #t "no-bob ") + ) + (if (= (logand s5-0 (collectable-flag do-fadeout)) (collectable-flag do-fadeout)) + (format #t "do-fadeout ") + ) + (if (= (logand s5-0 (collectable-flag pickup)) (collectable-flag pickup)) + (format #t "pickup ") + ) + ) + (format #t ")~%") + (format #t "~2Tbirth-time: ~D~%" (-> this birth-time)) + (format #t "~2Tcollect-timeout: ~D~%" (-> this collect-timeout)) + (format #t "~2Tfadeout-timeout: ~D~%" (-> this fadeout-timeout)) + (format #t "~2Tbob-offset: ~D~%" (-> this bob-offset)) + (format #t "~2Tbob-amount: ~f~%" (-> this bob-amount)) + (format #t "~2Tpickup-handle: ~D~%" (-> this pickup-handle)) + (format #t "~2Tactor-pause: ~A~%" (-> this actor-pause)) + (format #t "~2Tcollect-effect: ~A~%" (-> this collect-effect)) + (format #t "~2Tcollect-effect2: ~A~%" (-> this collect-effect2)) + (format #t "~2Ttarget: ~D~%" (-> this target)) + (format #t "~2Tsuck-time: ~D~%" (-> this suck-time)) + (format #t "~2Tsuck-y-offset: ~f~%" (-> this suck-y-offset)) + (format #t "~2Tspeed: ~`vector`P~%" (-> this speed)) + (format #t "~2Tmovie-pos-index: ~D~%" (-> this movie-pos-index)) + (label cfg-20) + this + ) + +;; definition for method 31 of type collectable +(defmethod go-to-initial-state ((this collectable)) + (cond + ((logtest? (-> this fact options) (actor-option wait-for-task-complete)) + (go (method-of-object this blocked)) + ) + ((logtest? (-> this flags) (collectable-flag bounce)) + (go (method-of-object this deploy)) + ) + (else + (go (method-of-object this wait)) + ) + ) + ) + +;; definition for method 32 of type collectable +;; INFO: Used lq/sq +(defmethod initialize-options ((this collectable) (arg0 int) (arg1 float) (arg2 fact-info)) + (logclear! (-> this mask) (process-mask crate enemy platform ambient)) + (logior! (-> this mask) (process-mask collectable)) + (set! (-> this flags) (collectable-flag pickup no-eco-blue)) + (set! (-> this bob-amount) arg1) + (set! (-> this bob-offset) (the-as uint (+ (the-as int (-> this root trans x)) + (the-as int (-> this root trans y)) + (the-as int (-> this root trans z)) + ) + ) + ) + (cond + ((or (= (vector-length (-> this root transv)) 0.0) + (logtest? (-> this fact options) (actor-option auto-pickup)) + ) + (vector-reset! (-> this root transv)) + ) + (else + (logior! (-> this flags) (collectable-flag bounce)) + (logclear! (-> this flags) (collectable-flag pickup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this bob-amount) 0.0) + ) + ) + (when (> arg0 0) + (logior! (-> this flags) (collectable-flag fadeout)) + (set! (-> this fadeout-timeout) (the-as time-frame arg0)) + (if (logtest? (actor-option no-distance-check-fadeout) (-> arg2 options)) + (logior! (-> this flags) (collectable-flag no-distance-check-fadeout)) + ) + ) + (set! (-> this collect-timeout) (seconds 0.33)) + (set-time! (-> this birth-time)) + (set! (-> this base quad) (-> this root trans quad)) + (set! (-> this old-base quad) (-> this root trans quad)) + (set! (-> this pickup-handle) (the-as handle #f)) + (case (-> this fact pickup-type) + (((pickup-type eco-pill-green) + (pickup-type eco-pill-dark) + (pickup-type eco-pill-light) + (pickup-type eco-green) + (pickup-type money) + (pickup-type gem) + (pickup-type skill) + (pickup-type eco-blue) + (pickup-type health) + (pickup-type trick-point) + ) + (logclear! (-> this flags) (collectable-flag no-eco-blue)) + ) + ) + (if (logtest? (-> this fact options) (actor-option big-collision)) + (set! (-> this root root-prim local-sphere w) (* 2.5 (-> this root root-prim local-sphere w))) + ) + (when (and arg2 (nonzero? (-> this draw))) + (let* ((s5-0 (-> arg2 process)) + (v1-56 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (if v1-56 + (set! (-> this draw light-index) (-> (the-as process-drawable v1-56) draw light-index)) + ) + ) + ) + this + ) + +;; definition for method 33 of type collectable +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations ((this collectable)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-11 local-sphere) 0.0 3276.8 0.0 3276.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-11) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-14 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + 0 + (none) + ) + +;; definition for method 30 of type collectable +;; WARN: Return type mismatch ambient-sound vs none. +(defmethod initialize-effects ((this collectable) (arg0 pickup-type)) + (let ((s5-0 (the-as sparticle-launch-group #f)) + (s4-0 (the-as sound-spec #f)) + ) + (set! (-> this fact pickup-type) arg0) + (case (-> this fact pickup-type) + (((pickup-type eco-blue) + (pickup-type eco-red) + (pickup-type eco-green) + (pickup-type eco-yellow) + (pickup-type health) + (pickup-type eco-pill-dark) + (pickup-type eco-pill-light) + (pickup-type trick-point) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + ) + ) + (case arg0 + (((pickup-type eco-yellow)) + (set! s5-0 (-> *part-group-id-table* 164)) + (set! (-> this collect-effect) (-> *part-group-id-table* 170)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 165)) + (set! s4-0 (static-sound-spec "yel-eco-idle" :group 1 :fo-max 15)) + ) + (((pickup-type eco-red)) + (set! s5-0 (-> *part-group-id-table* 158)) + (set! (-> this collect-effect) (-> *part-group-id-table* 171)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 159)) + (set! s4-0 (static-sound-spec "red-eco-idle" :group 1 :fo-max 15)) + ) + (((pickup-type eco-blue)) + (set! s5-0 (-> *part-group-id-table* 154)) + (set! (-> this collect-effect) (-> *part-group-id-table* 169)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 155)) + (set! s4-0 (static-sound-spec "blue-eco-idle" :group 1 :fo-max 15)) + ) + (((pickup-type eco-green)) + (set! s5-0 (-> *part-group-id-table* 129)) + (set! (-> this collect-effect) (-> *part-group-id-table* 141)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 124)) + (set! s4-0 (static-sound-spec "green-eco-idle" :group 1 :fo-max 15)) + ) + (((pickup-type health)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-health" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-37 (-> this root root-prim local-sphere))) + (set! (-> v1-37 y) 2457.6) + (set! (-> v1-37 w) 4096.0) + ) + (set! (-> this collect-effect) (-> *part-group-id-table* 141)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 124)) + (set! s4-0 (static-sound-spec "green-eco-idle" :group 1 :fo-max 15)) + ) + (((pickup-type eco-pill-green)) + (set! s5-0 (-> *part-group-id-table* 125)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 126)) + ) + (((pickup-type eco-pill-dark)) + (set! s5-0 (-> *part-group-id-table* 128)) + (set! (-> this collect-effect) (-> *part-group-id-table* 140)) + ) + (((pickup-type eco-pill-light)) + (set! s5-0 (-> *part-group-id-table* 127)) + (set! (-> this collect-effect) (-> *part-group-id-table* 127)) + ) + ) + (if s5-0 + (set! (-> this part) (create-launch-control s5-0 this)) + ) + (if s4-0 + (set! (-> this sound) (new 'process 'ambient-sound s4-0 (-> this root trans) 0.0)) + ) + ) + (none) + ) + +;; definition for function initialize-eco-by-other +;; INFO: Used lq/sq +(defbehavior initialize-eco-by-other eco ((arg0 vector) (arg1 vector) (arg2 fact-info)) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (case (-> self fact pickup-type) + (((pickup-type eco-blue) (pickup-type eco-yellow) (pickup-type eco-red)) + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 0 + ) + 1024.0 + arg2 + ) + ) + (else + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 4500 + ) + 1024.0 + arg2 + ) + ) + ) + (update-transforms (-> self root)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + ) + +;; definition for method 29 of type collectable +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-common ((this collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> this pickup-amount) arg2) + (set! (-> this pickup-type) arg1) + (initialize-allocations this) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (initialize-effects this (-> this fact pickup-type)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (if (logtest? (-> this fact options) (actor-option wait-for-task-complete)) + (go (method-of-object this blocked)) + ) + (go-to-initial-state this) + (none) + ) + +;; definition for method 34 of type collectable +;; WARN: Return type mismatch int vs none. +(defmethod common-post ((this collectable)) + (let ((s5-0 (-> this part)) + (s4-0 (-> this root root-prim prim-core)) + ) + (if (nonzero? (-> this draw)) + (ja-post) + ) + (if (nonzero? s5-0) + (spawn s5-0 (the-as vector s4-0)) + ) + ) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) + ) + 0 + (none) + ) + +;; definition for method 35 of type collectable +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod do-pickup ((this collectable) (arg0 handle)) + (set! (-> this pickup-handle) arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((v1-3 (-> this root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) + ) + (if (nonzero? (-> this draw)) + (logior! (-> this draw status) (draw-control-status no-draw)) + ) + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + (case (-> this fact pickup-type) + (((pickup-type eco-yellow)) + (sound-play "y-eco-pickup") + ) + (((pickup-type eco-red)) + (sound-play "r-eco-pickup") + ) + (((pickup-type eco-blue)) + (sound-play "b-eco-pickup") + ) + (((pickup-type eco-green) (pickup-type health)) + (sound-play "g-eco-pickup") + (+! (-> *game-info* health-collected) 1.0) + ) + (((pickup-type eco-pill-green)) + (sound-play "pill-pickup") + ) + (((pickup-type eco-pill-dark)) + (sound-play "pill-pickup") + (when (>= (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) + (set! (-> this collect-effect) (the-as sparticle-launch-group 0)) + (set! (-> this collect-effect2) (the-as sparticle-launch-group 0)) + 0 + ) + ) + (((pickup-type eco-pill-light)) + (sound-play "pill-pickup") + (when (>= (-> *game-info* eco-pill-light) (-> *FACT-bank* eco-pill-light-max-default)) + (set! (-> this collect-effect) (the-as sparticle-launch-group 0)) + (set! (-> this collect-effect2) (the-as sparticle-launch-group 0)) + 0 + ) + ) + (((pickup-type fuel-cell)) + (sound-play "pu-powercell") + ) + (((pickup-type ammo-yellow) + (pickup-type ammo-red) + (pickup-type ammo-blue) + (pickup-type ammo-dark) + (pickup-type gun-red-1) + (pickup-type gun-red-2) + (pickup-type gun-red-3) + (pickup-type gun-yellow-1) + (pickup-type gun-yellow-2) + (pickup-type gun-yellow-3) + (pickup-type gun-blue-1) + (pickup-type gun-blue-2) + (pickup-type gun-blue-3) + (pickup-type gun-dark-1) + (pickup-type gun-dark-2) + (pickup-type gun-dark-3) + (pickup-type board) + ) + (sound-play "ammo-pickup") + ) + (((pickup-type skill)) + (talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (let ((s5-1 (handle->process arg0))) + (when s5-1 + (when (nonzero? (-> this collect-effect)) + (cond + ((logtest? (-> this collect-effect flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (let ((s4-10 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s4-10 + (let ((t9-23 (method-of-type part-tracker-subsampler activate))) + (t9-23 (the-as part-tracker-subsampler s4-10) s5-1 "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-24 run-function-in-process) + (a0-77 s4-10) + (a1-33 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> this collect-effect)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) part-tracker-track-target) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-24) a0-77 a1-33 *part-tracker-subsampler-params-default*) + ) + (-> s4-10 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (let ((s4-11 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s4-11 + (let ((t9-26 (method-of-type part-tracker activate))) + (t9-26 (the-as part-tracker s4-11) s5-1 "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-27 run-function-in-process) + (a0-84 s4-11) + (a1-36 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> this collect-effect)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) part-tracker-track-target) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-27) a0-84 a1-36 *part-tracker-params-default*) + ) + (-> s4-11 ppointer) + ) + ) + ) + ) + ) + (when (nonzero? (-> this collect-effect2)) + (cond + ((logtest? (-> this collect-effect2 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-2 + (let ((t9-29 (method-of-type part-tracker-subsampler activate))) + (t9-29 (the-as part-tracker-subsampler s5-2) this "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-30 run-function-in-process) + (a0-91 s5-2) + (a1-39 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> this collect-effect2)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) + (lambda ((arg0 part-tracker)) + (let ((v1-1 (handle->process (-> arg0 userdata)))) + (when (the-as process v1-1) + (let* ((s5-0 (handle->process (-> (the-as collectable v1-1) pickup-handle))) + (a0-9 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (a2-0 (if (not a0-9) + (-> arg0 root trans) + (get-trans (the-as process-focusable a0-9) 3) + ) + ) + ) + (vector-lerp! + (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (/ (the float (- (current-time) (-> arg0 state-time))) (the float (-> arg0 part group duration))) + ) + ) + ) + ) + ) + ) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint (process->handle this))) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-30) a0-91 a1-39 *part-tracker-subsampler-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (let ((s5-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-3 + (let ((t9-32 (method-of-type part-tracker activate))) + (t9-32 (the-as part-tracker s5-3) this "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-33 run-function-in-process) + (a0-98 s5-3) + (a1-42 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> this collect-effect2)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) + (lambda ((arg0 part-tracker)) + (let ((v1-1 (handle->process (-> arg0 userdata)))) + (when (the-as process v1-1) + (let* ((s5-0 (handle->process (-> (the-as collectable v1-1) pickup-handle))) + (a0-9 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + (a2-0 (if (not a0-9) + (-> arg0 root trans) + (get-trans (the-as process-focusable a0-9) 3) + ) + ) + ) + (vector-lerp! + (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (/ (the float (- (current-time) (-> arg0 state-time))) (the float (-> arg0 part group duration))) + ) + ) + ) + ) + ) + ) + (set! (-> *part-tracker-params-default* userdata) (the-as uint (process->handle this))) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-33) a0-98 a1-42 *part-tracker-params-default*) + ) + (-> s5-3 ppointer) + ) + ) + ) + ) + ) + ) + ) + (send-event (handle->process (-> this notify)) 'notify 'pickup) + 0 + (none) + ) + +;; definition for function add-blue-shake +(defun add-blue-shake ((arg0 vector) (arg1 vector) (arg2 vector)) + (let* ((f0-0 (vector-vector-distance arg1 arg2)) + (f30-0 (lerp-scale 409.6 0.0 f0-0 (-> *FACT-bank* suck-suck-dist) (-> *FACT-bank* suck-bounce-dist))) + ) + (+! (-> arg0 x) (rand-vu-float-range (- f30-0) f30-0)) + (+! (-> arg0 y) (rand-vu-float-range (- f30-0) f30-0)) + (+! (-> arg0 z) (rand-vu-float-range (- f30-0) f30-0)) + ) + arg0 + ) + +;; definition for function check-blue-suck +(defbehavior check-blue-suck eco ((arg0 process-drawable)) + (let ((v1-0 (if (type? arg0 process-drawable) + arg0 + ) + ) + ) + (when v1-0 + (let* ((gp-1 (-> v1-0 root)) + (v1-1 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (when v1-1 + (let ((a0-5 (-> self root root-prim prim-core)) + (a1-2 (-> (the-as collide-shape v1-1) root-prim prim-core)) + ) + (when (< (vector-vector-distance (the-as vector a0-5) (the-as vector a1-2)) (-> *FACT-bank* suck-suck-dist)) + (logior! (-> self flags) (collectable-flag suck-in)) + #t + ) + ) + ) + ) + ) + ) + ) + +;; definition for function add-blue-motion +(defbehavior add-blue-motion eco ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 symbol)) + (let* ((gp-0 (handle->process (-> self target))) + (s1-0 (if (type? gp-0 process-drawable) + (the-as process-focusable gp-0) + ) + ) + ) + (when s1-0 + (let ((s4-0 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when s4-0 + (let ((s1-1 (-> self root root-prim prim-core)) + (gp-1 (get-trans s4-0 3)) + ) + (if (and arg1 (rand-vu-percent? 0.25)) + (eco-blue-glow (the-as vector s1-1)) + ) + (let ((f0-0 (vector-vector-distance (the-as vector s1-1) gp-1))) + (cond + ((and arg3 (< f0-0 8192.0)) + (return #t) + ) + ((begin + (set! arg0 + (and (or (not arg2) + (or (< f0-0 (-> *FACT-bank* suck-suck-dist)) (logtest? (-> self flags) (collectable-flag suck-in))) + ) + arg0 + ) + ) + arg0 + ) + (logior! (-> self flags) (collectable-flag suck-in)) + (when (= (-> self speed w) 0.0) + (set-time! (-> self suck-time)) + (set! (-> self speed x) (rand-vu-float-range 327680.0 819200.0)) + ) + (+! (-> self speed w) + (* (lerp-scale 40960.0 (-> self speed x) (the float (- (current-time) (-> self suck-time))) 45.0 60.0) + (seconds-per-frame) + ) + ) + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> self base) gp-1))) + (vector-normalize! s5-2 (fmax + (if (focus-test? s4-0 pilot) + -4096.0 + 0.0 + ) + (- (vector-length s5-2) (* (-> self speed w) (seconds-per-frame))) + ) + ) + (when (< (vector-length s5-2) 81920.0) + (+! (-> self speed y) (* 72817.78 (seconds-per-frame))) + (set! (-> self speed y) (fmin (fmin 291271.12 (-> self speed y)) (-> self speed y))) + (vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (seconds-per-frame))) + ) + (set! (-> self suck-y-offset) + (* 2048.0 (sin (* 873.81335 (the float (mod (- (current-time) (-> self suck-time)) 75))))) + ) + (vector+! (-> self base) gp-1 s5-2) + ) + ) + ((and arg2 (and (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) + (not (logtest? (-> self flags) (collectable-flag suck-in))) + ) + ) + (go-virtual wait) + ) + (arg1 + (add-blue-shake (-> self root trans) (the-as vector s1-1) gp-1) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +;; definition for function collectable-standard-event-handler +;; INFO: Used lq/sq +(defbehavior collectable-standard-event-handler collectable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-4 object)) + (when (and (or (= arg2 'touch) (= arg2 'attack)) + (or (logtest? (-> self flags) (collectable-flag pickup)) + (and (-> self next-state) (= (-> self next-state name) 'deploy)) + (< (-> self clock clock-ratio) 1.0) + ) + (and (time-elapsed? + (-> self birth-time) + (the int (* 2.0 (-> self clock clock-ratio) (the float (-> self collect-timeout)))) + ) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (-> *setting-control* user-current pickups) + (send-event arg0 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-contact-action arg0) + (go-virtual pickup #f (process->handle arg0)) + ) + (cond + ((= arg2 'trans) + (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (update-transforms (-> self root)) + (ja-post) + ) + ((= arg2 'jump) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self jump-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (go-virtual jump) + ) + ((= arg2 'pickup) + (when (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (if (and (> arg1 0) (-> arg3 param 0)) + (move-to-point! (-> self root) (the-as vector (-> arg3 param 0))) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-contact-action arg0) + (go-virtual pickup #f (the-as handle #f)) + ) + ) + ((= arg2 'suck) + (when (not (and (-> self next-state) (let ((v1-69 (-> self next-state name))) + (or (= v1-69 'suck) (= v1-69 'pickup)) + ) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual suck (process->handle (the-as process (-> arg3 param 0)))) + ) + ) + ((= arg2 'die) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual die) + ) + ((= arg2 'movie-pos) + (set! v0-4 (-> arg3 param 0)) + (set! (-> self movie-pos-index) (the-as int v0-4)) + v0-4 + ) + ((= arg2 'actor-pause) + (cond + ((-> arg3 param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (set! v0-4 #t) + (set! (-> self actor-pause) (the-as symbol v0-4)) + v0-4 + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + ((= arg2 'fade) + (logior! (-> self flags) (collectable-flag fadeout)) + (set! (-> self fadeout-timeout) (seconds 0.1)) + (set! v0-4 (current-time)) + (set! (-> self birth-time) (the-as time-frame v0-4)) + v0-4 + ) + ((= arg2 'anim) + (cond + ((-> arg3 param 0) + (set! v0-4 (logclear (-> self flags) (collectable-flag no-bob))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + (else + (set! v0-4 (logior (-> self flags) (collectable-flag no-bob))) + (set! (-> self flags) (the-as collectable-flag v0-4)) + ) + ) + v0-4 + ) + ((= arg2 'collide-shape) + (cond + ((-> arg3 param 0) + (let ((v1-106 (-> self root root-prim))) + (set! (-> v1-106 prim-core collide-as) (-> self root backup-collide-as)) + (set! v0-4 (-> self root backup-collide-with)) + (set! (-> v1-106 prim-core collide-with) (the-as collide-spec v0-4)) + ) + v0-4 + ) + (else + (let ((v1-108 (-> self root root-prim))) + (set! (-> v1-108 prim-core collide-as) (collide-spec)) + (set! (-> v1-108 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + ((= arg2 'get-notify) + (cond + ((= (-> arg3 param 0) #t) + (let ((v1-112 (ppointer->process (-> self parent)))) + (cond + ((logtest? (-> v1-112 mask) (process-mask process-tree)) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (process->handle v1-112)) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) + ) + ) + ((= (-> arg3 param 0) #f) + (set! (-> self notify) (the-as handle #f)) + #f + ) + (else + (set! v0-4 (process->handle (the-as process (-> arg3 param 0)))) + (set! (-> self notify) (the-as handle v0-4)) + v0-4 + ) + ) + ) + ((= arg2 'effect) + (when (not (-> arg3 param 0)) + (set! (-> self collect-effect) (the-as sparticle-launch-group 0)) + (set! (-> self collect-effect2) (the-as sparticle-launch-group 0)) + 0 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate blocked (collectable) + :virtual #t + :trans (behavior () + (if (task-complete? *game-info* (-> self entity extra perm task)) + (go-virtual wait) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate jump (collectable) + :virtual #t + :code (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (new 'stack 'trajectory) + (set! (-> self base y) (-> self jump-pos y)) + (let ((t9-1 (method-of-type trajectory trajectory-method-12))) + (-> self root trans) + (-> self jump-pos) + #x43960000 + -1072586060 + (t9-1) + ) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) + (the float (- (current-time) (-> self state-time))) + (let ((t9-2 (method-of-type trajectory trajectory-method-9))) + (-> self root trans) + (t9-2) + ) + (transform-post) + (common-post self) + (suspend) + (if (nonzero? (-> self skel)) + (ja :num! (loop! 0.5)) + ) + ) + (set! (-> self root trans quad) (-> self jump-pos quad)) + (set! (-> self base quad) (-> self root trans quad)) + (vector-reset! (-> self root transv)) + (update-transforms (-> self root)) + (logclear! (-> self flags) (collectable-flag bounce)) + (logior! (-> self flags) (collectable-flag pickup)) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (go-virtual wait) + ) + ) + +;; failed to figure out what this is: +(defstate deploy (collectable) + :virtual #t + :event collectable-standard-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (case (-> self pickup-type) + (((pickup-type gem)) + (sound-play "gem-spawn") + ) + (((pickup-type eco-pill-dark) (pickup-type eco-pill-light)) + (sound-play "pill-spawn") + ) + ) + (if (and (logtest? (-> self fact options) (actor-option suck-in)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + *target* + (not (focus-test? *target* dead)) + (-> *setting-control* user-current pickups) + ) + (go-virtual suck (process->handle *target*)) + ) + ) + :exit (behavior () + (vector-reset! (-> self root transv)) + (logclear! (-> self flags) (collectable-flag bounce)) + (logior! (-> self flags) (collectable-flag pickup)) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + (set! (-> self base quad) (-> self root trans quad)) + (logclear! (-> self root root-prim prim-core action) (collide-action solid)) + (set! (-> self root root-prim prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set! (-> self root root-prim prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + ) + :trans (behavior () + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (let ((t9-2 (method-of-object (-> self root) collide-shape-moving-method-57))) + (-> self root transv) + (t9-2) + ) + (when (and (>= 0.0 (-> self root transv y)) (>= (-> self base y) (-> self root trans y))) + (set! (-> self root trans y) (-> self base y)) + (cond + ((< (-> self root transv y) -8192.0) + (set! (-> self root transv y) (* -0.5 (-> self root transv y))) + ) + (else + (if (and (logtest? (-> self fact options) (actor-option suck-in)) + (not (logtest? (-> self flags) (collectable-flag no-eco-blue))) + ) + (go-virtual notice-blue (process->handle *target*)) + ) + (when (and (logtest? (-> self fact options) (actor-option auto-pickup suck-in)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (-> *setting-control* user-current pickups) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (process-contact-action *target*) + (go-virtual pickup #f (process->handle *target*)) + ) + (go-virtual wait) + ) + ) + ) + ) + :code (behavior () + (until #f + (common-post self) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate suck (collectable) + :virtual #t + :event collectable-standard-event-handler + :enter (behavior ((arg0 handle)) + (sound-play "pickup-suck") + (set! (-> self target) arg0) + (set! (-> self speed quad) (the-as uint128 0)) + (set! (-> self speed z) (if (rand-vu-percent? 0.5) + 1.0 + -1.0 + ) + ) + (set! (-> self suck-y-offset) 0.0) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self flags) (collectable-flag pickup suck-in)) + ) + :code (behavior ((arg0 handle)) + (until #f + (if (and *target* (focus-test? *target* dead)) + (go-virtual fade) + ) + (set! (-> self root trans quad) (-> self base quad)) + (add-blue-motion #t #f #f #f) + (update-transforms (-> self root)) + (common-post self) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate wait (collectable) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('eco-blue) + (when (and (not (logtest? (-> self flags) (collectable-flag do-fadeout no-eco-blue))) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (and (if (and (check-blue-suck (the-as process-drawable proc)) (-> *setting-control* user-current pickups)) + (go-virtual suck (process->handle proc)) + ) + (logtest? (-> self flags) (collectable-flag pickup)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual notice-blue (process->handle proc)) + ) + ) + (else + (collectable-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (when (and (logtest? (-> self fact options) (actor-option auto-pickup suck-in)) + (logtest? (-> self flags) (collectable-flag pickup)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (-> *setting-control* user-current pickups) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (process-contact-action *target*) + (go-virtual pickup #f (process->handle *target*)) + ) + ) + :code (behavior () + (until #f + (if (and (logtest? (-> self flags) (collectable-flag fadeout)) + (begin + (if (movie?) + (set-time! (-> self birth-time)) + ) + (time-elapsed? (-> self birth-time) (-> self fadeout-timeout)) + ) + (or (or (not *target*) (or (< 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (focus-test? *target* teleporting) + ) + ) + (logtest? (-> self flags) (collectable-flag no-distance-check-fadeout)) + ) + ) + (go-virtual fade) + ) + (common-post self) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate fade (collectable) + :virtual #t + :event collectable-standard-event-handler + :code (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + (logior! (-> self flags) (collectable-flag do-fadeout)) + (logior! (-> self state-flags) (state-flags sf0)) + (let ((gp-0 (current-time))) + (until #f + (let ((f0-1 (- 300.0 (the float (- (current-time) gp-0))))) + (cond + ((< f0-1 0.0) + (process-entity-status! self (entity-perm-status dead) #t) + (if (nonzero? (-> self notify)) + (send-event (handle->process (-> self notify)) 'notify 'die) + ) + (deactivate self) + ) + (else + (if (nonzero? (-> self part)) + (set! (-> self part fade) (* 0.0033333334 f0-1)) + ) + (when (nonzero? (-> self draw)) + (logior! (-> self draw status) (draw-control-status force-fade)) + (set! (-> self draw force-fade) (the-as uint (max 0 (min 128 (the int (* 0.42666668 f0-1)))))) + ) + ) + ) + ) + (common-post self) + (suspend) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate notice-blue (collectable) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) + (and (logtest? (-> self flags) (collectable-flag pickup)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) + (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) + (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (process->handle proc)) + ) + ) + :enter (behavior ((arg0 handle)) + (set! (-> self target) arg0) + (set! (-> self speed quad) (the-as uint128 0)) + (set! (-> self speed z) (if (rand-vu-percent? 0.5) + 1.0 + -1.0 + ) + ) + (set! (-> self suck-y-offset) 0.0) + (logclear! (-> self mask) (process-mask actor-pause)) + ) + :exit (behavior () + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'powerup)) + (set! (-> a1-0 param 1) (the-as uint 3)) + (if (and (not (send-event-function *target* a1-0)) (not (logtest? (-> self flags) (collectable-flag suck-in)))) + (go-virtual wait) + ) + ) + ) + :code (behavior ((arg0 handle)) + (until #f + (set! (-> self root trans quad) (-> self base quad)) + (add-blue-motion #t #f #t #f) + (update-transforms (-> self root)) + (common-post self) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate pickup (collectable) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('set-movie-pos) + (let ((v1-2 (res-lump-struct (-> self entity) 'movie-pos structure))) + (when v1-2 + (set! (-> (the-as vector v1-2) quad) (-> (the-as vector (-> block param 0)) quad)) + v1-2 + ) + ) + ) + (('actor-pause) + (cond + ((-> block param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v0-1 (the-as object #t))) + (set! (-> self actor-pause) (the-as symbol v0-1)) + v0-1 + ) + ) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + #f + ) + ) + ) + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (deactivate self) + ) + (('effect) + (when (not (-> block param 0)) + (set! (-> self collect-effect) (the-as sparticle-launch-group 0)) + (set! (-> self collect-effect2) (the-as sparticle-launch-group 0)) + 0 + ) + ) + ) + ) + :enter (behavior ((arg0 symbol) (arg1 handle)) + (do-pickup self arg1) + ) + :code (behavior ((arg0 symbol) (arg1 handle)) + (while (-> self child) + (suspend) + ) + (go-virtual die) + ) + ) + +;; failed to figure out what this is: +(defstate die (collectable) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + ) + ) + +;; definition of type eco +(deftype eco (collectable) + ((respawn-delay time-frame) + ) + ) + +;; definition for method 3 of type eco +(defmethod inspect ((this eco)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 this) + ) + (format #t "~2Trespawn-delay: ~D~%" (-> this respawn-delay)) + (label cfg-4) + this + ) + +;; definition for method 33 of type eco +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations ((this eco)) + (let ((t9-0 (method-of-type collectable initialize-allocations))) + (t9-0 this) + ) + (if (logtest? (-> this fact options) (actor-option respawn-delay)) + (set! (-> this respawn-delay) (-> this fact fade-time)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate die (eco) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fade) + (process-entity-status! self (entity-perm-status dead) #t) + (send-event (handle->process (-> self notify)) 'notify 'die) + (deactivate self) + ) + (('die) + (go-virtual die) + ) + ) + ) + :exit (behavior () + (process-entity-status! self (entity-perm-status no-kill) #f) + (if (-> self actor-pause) + (logior! (-> self mask) (process-mask actor-pause)) + ) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status no-kill) #t) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self fact options) (actor-option auto-pickup suck-in)) + (if (nonzero? (-> self part)) + (kill-particles (-> self part)) + ) + (cond + ((nonzero? (-> self respawn-delay)) + (let ((gp-0 (current-time))) + (while (not (time-elapsed? gp-0 (-> self respawn-delay))) + (suspend) + ) + ) + ) + (else + (while (let ((f30-0 0.0)) + (< f30-0 (send-event *target* 'query 'pickup (-> self fact pickup-type))) + ) + (suspend) + ) + ) + ) + (set! (-> self base quad) (-> self old-base quad)) + (set! (-> self root trans quad) (-> self base quad)) + (let ((v1-26 (-> self root root-prim))) + (set! (-> v1-26 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-26 prim-core collide-with) (-> self root backup-collide-with)) + ) + (+! (-> self clock ref-count) -1) + (+! (-> *display* entity-clock ref-count) 1) + (set! (-> self clock) (-> *display* entity-clock)) + (if (nonzero? (-> self draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (go-virtual wait) + ) + ) + +;; failed to figure out what this is: +(defstate pickup (eco) + :virtual #t + :code (behavior ((arg0 symbol) (arg1 handle)) + (if (not (logtest? (-> self fact options) (actor-option no-reaction))) + (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) + (let ((t9-2 (-> (find-parent-state) code))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +;; definition of type eco-yellow +(deftype eco-yellow (eco) + () + ) + +;; definition for method 3 of type eco-yellow +(defmethod inspect ((this eco-yellow)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type eco inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type eco-yellow +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) + (init-common this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) + ) + +;; definition of type eco-red +(deftype eco-red (eco) + () + ) + +;; definition for method 3 of type eco-red +(defmethod inspect ((this eco-red)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type eco inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type eco-red +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) + (init-common this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) + ) + +;; definition of type eco-blue +(deftype eco-blue (eco) + () + ) + +;; definition for method 3 of type eco-blue +(defmethod inspect ((this eco-blue)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type eco inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type eco-blue +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) + (init-common this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) + ) + +;; definition of type eco-green +(deftype eco-green (eco) + () + ) + +;; definition for method 3 of type eco-green +(defmethod inspect ((this eco-green)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type eco inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type eco-green +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this eco-green) (arg0 entity-actor)) + (init-common this arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) + ) + +;; definition of type health +(deftype health (collectable) + () + ) + +;; definition for method 3 of type health +(defmethod inspect ((this health)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type health +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this health) (arg0 entity-actor)) + (init-common this arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) + ) + +;; definition of type eco-pill +(deftype eco-pill (collectable) + () + ) + +;; definition for method 3 of type eco-pill +(defmethod inspect ((this eco-pill)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate wait (eco-pill) + :virtual #t + :trans (behavior () + (if (and (and *target* + (and (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (and (not (focus-test? *target* dead hit)) + (-> *setting-control* user-current pickups) + (case (-> self fact pickup-type) + (((pickup-type eco-pill-dark)) + (< (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) + ) + (((pickup-type eco-pill-light)) + (< (-> *game-info* eco-pill-light) (-> *FACT-bank* eco-pill-light-max-default)) + ) + (else + #t + ) + ) + ) + ) + (send-event self 'suck *target*) + ) + ) + ) + +;; definition for method 11 of type eco-pill +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) + (init-common this arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) + ) + +;; definition for method 10 of type eco-pill +(defmethod deactivate ((this eco-pill)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (+! (-> *game-info* live-eco-pill-count) -1) + ((method-of-type collectable deactivate) this) + (none) + ) + +;; definition for method 33 of type eco-pill +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations ((this eco-pill)) + (+! (-> *game-info* live-eco-pill-count) 1) + (stack-size-set! (-> this main-thread) 128) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-13 local-sphere) 0.0 3276.8 0.0 1638.4) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-13) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-16 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + 0 + (none) + ) + +;; definition of type money +(deftype money (collectable) + () + ) + +;; definition for method 3 of type money +(defmethod inspect ((this money)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 12 of type money +(defmethod run-logic? ((this money)) + "Should this process be run? Checked by execute-process-tree." + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) + ) + ) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) + ) + ) + ) + +;; definition for method 10 of type money +(defmethod deactivate ((this money)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (when (and (-> this next-state) (= (-> this next-state name) 'pickup)) + (case (-> this pickup-type) + (((pickup-type gem)) + (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status save)))) + (format #t "~A ~A was killed in pickup~%" (-> this type) (-> this name)) + ) + (process-entity-status! this (entity-perm-status dead) #t) + ) + (else + (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status dead)))) + (format #t "~A ~A was killed in pickup~%" (-> this type) (-> this name)) + ) + ) + ) + ) + ((method-of-type collectable deactivate) this) + (none) + ) + +;; definition for method 34 of type money +(defmethod common-post ((this money)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) + (let ((f30-0 (-> this bob-amount))) + (when (< 0.0 f30-0) + (set! (-> this root trans y) + (+ (-> this base y) + (-> this suck-y-offset) + (* f30-0 + (sin + (* 109.22667 + (the float (mod (+ (- (current-time) (-> this birth-time)) (the-as time-frame (-> this bob-offset))) 600)) + ) + ) + ) + ) + ) + (update-transforms (-> this root)) + ) + ) + (let ((a0-7 (-> this part)) + (a1-1 (-> this root root-prim prim-core)) + ) + (if (nonzero? a0-7) + (spawn a0-7 (the-as vector a1-1)) + ) + ) + (ja-post) + (none) + ) + +;; failed to figure out what this is: +(defstate notice-blue (money) + :virtual #t + :code (behavior ((arg0 handle)) + (until #f + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame))) + (set! (-> self root trans quad) (-> self base quad)) + (add-blue-motion #t #t #t #f) + (let ((f30-0 (-> self bob-amount))) + (if (< 0.0 f30-0) + (set! (-> self root trans y) + (+ (-> self base y) + (-> self suck-y-offset) + (* f30-0 + (sin + (* 109.22667 + (the float (mod (+ (- (current-time) (-> self birth-time)) (the-as time-frame (-> self bob-offset))) 600)) + ) + ) + ) + ) + ) + ) + ) + (transform-post) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate pickup (money) + :virtual #t + :code (behavior ((arg0 symbol) (arg1 handle)) + (process-entity-status! self (entity-perm-status dead) #t) + ) + ) + +;; definition for method 33 of type money +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations ((this money)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type money) 1.0)) + (let ((a0-11 (-> this entity))) + (if (when a0-11 + (let ((a0-12 (-> a0-11 extra perm task))) + (if a0-12 + (= a0-12 (game-task none)) + ) + ) + ) + (set! (-> this entity extra perm task) (game-task complete)) + ) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (-> this entity) + (nav-mesh-connect-from-ent this) + ) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + 0 + (none) + ) + +;; definition for method 11 of type money +(defmethod init-from-entity! ((this money) (arg0 entity-actor)) + (initialize-allocations this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) + ) + +;; definition for function money-init-by-other +;; INFO: Used lq/sq +(defbehavior money-init-by-other money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor) (arg4 time-frame)) + (let ((s2-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (process-entity-set! self arg3) + (set! (-> self pickup-type) s2-0) + (set! (-> self pickup-amount) f30-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s2-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (let ((v1-5 (ppointer->process (-> self parent)))) + (set! (-> self notify) (if (logtest? (-> v1-5 mask) (process-mask process-tree)) + (the-as handle #f) + (process->handle v1-5) + ) + ) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (set! (-> self root transv quad) (-> arg1 quad)) + (initialize-options + self + (the-as int (cond + ((and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (-> arg2 fade-time) + ) + (else + (empty) + arg4 + ) + ) + ) + 1024.0 + arg2 + ) + (update-transforms (-> self root)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + ) + +;; definition for function money-init-by-other-no-bob +;; INFO: Used lq/sq +(defbehavior money-init-by-other-no-bob money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 float) (arg4 entity-actor)) + (process-entity-set! self arg4) + (set! (-> self pickup-type) (the-as pickup-type arg2)) + (set! (-> self pickup-amount) arg3) + (initialize-allocations self) + (set! (-> self fact pickup-type) (the-as pickup-type arg2)) + (set! (-> self fact pickup-amount) arg3) + (let ((v1-4 (ppointer->process (-> self parent)))) + (set! (-> self notify) (if (logtest? (-> v1-4 mask) (process-mask process-tree)) + (the-as handle #f) + (process->handle v1-4) + ) + ) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (set! (-> self root transv quad) (-> arg1 quad)) + (initialize-options self 4500 0.0 (the-as fact-info #f)) + (logior! (-> self flags) (collectable-flag no-eco-blue)) + (update-transforms (-> self root)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + ) + +;; definition of type gem +(deftype gem (money) + ((roty-speed degrees) + (bounce-time time-frame) + (gem-pool uint8) + ) + ) + +;; definition for method 3 of type gem +(defmethod inspect ((this gem)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type money inspect))) + (t9-0 this) + ) + (format #t "~2Troty-speed: (deg ~r)~%" (-> this roty-speed)) + (format #t "~2Tbounce-time: ~D~%" (-> this bounce-time)) + (format #t "~2Tgem-pool: ~D~%" (-> this gem-pool)) + (label cfg-4) + this + ) + +;; definition for method 10 of type gem +(defmethod deactivate ((this gem)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (+! (-> *game-info* live-gem-count) -1) + (call-parent-method this) + (none) + ) + +;; definition for method 34 of type gem +;; WARN: Return type mismatch int vs none. +(defmethod common-post ((this gem)) + (seek! (-> this roty-speed) 20024.889 (* 65536.0 (seconds-per-frame))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* (-> this roty-speed) (seconds-per-frame))) + (logclear! (-> this draw status) (draw-control-status no-draw-temp uninited)) + (do-joint-math (-> this draw) (-> this node-list) (-> this skel)) + (let ((a0-7 (-> this part)) + (a1-3 (-> this draw skeleton bones 3)) + ) + (if (nonzero? a0-7) + (sparticle-launch-control-method-17 a0-7 (the-as matrix a1-3)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate suck (gem) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-1 object)) + (case message + (('handle-gem-pickup) + (return (notify-gem-pickup (-> self gem-pool))) + v0-1 + ) + (else + (collectable-standard-event-handler proc argc message block) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate deploy (gem) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-1 object)) + (case message + (('handle-gem-pickup) + (return (notify-gem-pickup (-> self gem-pool))) + v0-1 + ) + (else + (collectable-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((t9-0 (-> (method-of-type collectable deploy) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-vector! + (-> self root transv) + (rand-vu-float-range -20480.0 20480.0) + 81920.0 + (rand-vu-float-range -20480.0 20480.0) + 1.0 + ) + (when (-> *setting-control* user-current gem-seek-target-dir?) + (let ((gp-2 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)))) + 0.0 + (set! (-> gp-2 y) 0.0) + (let ((f30-0 (vector-normalize-ret-len! gp-2 1.0))) + (let ((a0-6 gp-2)) + (set! (-> a0-6 quad) (-> gp-2 quad)) + (set! (-> a0-6 y) 0.0) + (vector-normalize! a0-6 1.0) + ) + (vector-float*! gp-2 gp-2 (rand-vu-float-range (* 0.25 f30-0) (* 0.75 f30-0))) + ) + (set! (-> self root transv quad) (-> gp-2 quad)) + ) + (set! (-> self root transv y) 81920.0) + ) + (set-gravity-length (-> self root dynam) 122880.0) + (set! (-> self roty-speed) 186413.52) + (logior! (-> self flags) (collectable-flag pickup)) + (set! (-> self root root-prim prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> self root root-prim prim-core collide-as) (collide-spec collectable)) + (set! (-> self root max-iteration-count) (the-as uint 2)) + (logior! (-> self root root-prim prim-core action) (collide-action solid)) + (set! (-> self root reaction) projectile-bounce-reaction) + (set! (-> self root penetrated-by) (the-as penetrate -1)) + ) + :exit (behavior () + (set! (-> self roty-speed) (fmin 262144.0 (-> self roty-speed))) + (set-gravity-length (-> self root dynam) 245760.0) + (set! (-> self root root-prim local-sphere w) 6144.0) + (update-transforms (-> self root)) + (let ((t9-2 (-> (method-of-type collectable deploy) exit))) + (if t9-2 + (t9-2) + ) + ) + ) + :trans #f + :code sleep-code + :post (behavior () + (let ((gp-0 #t)) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (when (-> self entity) + (when (get-simple-travel-vector + (-> self entity) + (-> self root transv) + (-> self root trans) + (-> self root transv) + (* 1.5 (-> self root root-prim prim-core world-sphere w)) + 0.8 + ) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (f30-0 (-> self root transv y)) + ) + (project-point-to-nav-mesh (-> self entity) s5-1 (-> self root trans) (the-as nav-poly #f) 40960000.0) + (when (>= (vector-vector-xz-distance s5-1 (-> self root trans)) 204.8) + (vector-! (-> self root transv) s5-1 (-> self root trans)) + (vector-normalize! (-> self root transv) 40960.0) + (set! (-> self root transv y) (if (< 0.0 (-> self root transv y)) + (+ f30-0 (* 4.0 (seconds-per-frame) (-> self root transv y))) + f30-0 + ) + ) + (set! gp-0 #f) + ) + ) + ) + ) + (cond + (gp-0 + (let ((v1-31 (-> self root)) + (a2-3 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> a2-3 collide-with) (-> v1-31 root-prim prim-core collide-with)) + (set! (-> a2-3 ignore-process0) self) + (set! (-> a2-3 ignore-process1) #f) + (set! (-> a2-3 ignore-pat) (-> v1-31 pat-ignore-mask)) + (set! (-> a2-3 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-31 (-> v1-31 transv) a2-3 (meters 0)) + ) + ) + (else + (let ((t9-7 (method-of-object (-> self root) collide-shape-moving-method-57))) + (-> self root transv) + (t9-7) + ) + ) + ) + ) + (let* ((gp-1 (-> self root)) + (s5-2 (-> gp-1 status)) + ) + (cond + ((logtest? s5-2 (collide-status touch-surface)) + (set! (-> gp-1 transv x) (* 0.7 (-> gp-1 transv x))) + (set! (-> gp-1 transv y) (* (-> gp-1 transv y) (rand-vu-float-range 0.7 0.75))) + (set! (-> gp-1 transv z) (* 0.7 (-> gp-1 transv z))) + (set! (-> self roty-speed) + (fmin + 131072.0 + (+ (-> self roty-speed) (lerp-scale 0.0 131072.0 (-> self root ground-impact-vel) 0.0 122880.0)) + ) + ) + (if (or (and (logtest? s5-2 (collide-status on-surface)) (< (vector-length (-> gp-1 transv)) 1228.8)) + (time-elapsed? (-> self state-time) (seconds 10)) + ) + (go-virtual wait) + ) + (when (time-elapsed? (-> self bounce-time) (seconds 0.1)) + (set-time! (-> self bounce-time)) + (sound-play-by-name + (static-sound-name "gem-bounce") + (new-sound-id) + (the int (* 1024.0 (lerp-scale 0.5 1.0 (-> self root ground-impact-vel) 0.0 40960.0))) + 0 + 0 + (sound-group) + #t + ) + ) + ) + ((time-elapsed? (-> self state-time) (seconds 15)) + (go-virtual wait) + ) + ) + ) + (seek! (-> self roty-speed) 0.0 (* 16384.0 (seconds-per-frame))) + (common-post self) + ) + ) + +;; definition for method 33 of type gem +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations ((this gem)) + (+! (-> *game-info* live-gem-count) 1) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-11 local-sphere) 0.0 2048.0 0.0 2048.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-11) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-14 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this roty-speed) 40049.777) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (rand-vu-float-range 0.0 65536.0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type gem) 1.0)) + (let ((v1-22 (-> this entity))) + (if (and (-> this entity) + (-> v1-22 extra perm task) + (= (-> v1-22 extra perm task) (game-task none)) + (type-type? (-> v1-22 etype) crate) + ) + (set! (-> this entity extra perm task) (game-task complete)) + ) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (if (-> this entity) + (nav-mesh-connect-from-ent this) + ) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 134) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 135)) + (set! (-> this gem-pool) (the-as uint 0)) + 0 + (none) + ) + +;; definition for symbol *collectable-dummy-shadow-control*, type shadow-control +(define *collectable-dummy-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #x2)) + :shadow-dir (new 'static 'vector :y -1.0 :w 163840.0) + :bot-plane (new 'static 'plane :y 1.0 :w 40960.0) + :top-plane (new 'static 'plane :y 1.0 :w -4096.0) + ) + ) + ) + +;; definition of type skill +(deftype skill (money) + () + ) + +;; definition for method 3 of type skill +(defmethod inspect ((this skill)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type money inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate wait (skill) + :virtual #t + :code (behavior () + (until #f + (if (and (logtest? (-> self flags) (collectable-flag fadeout)) + (begin + (if (movie?) + (set-time! (-> self birth-time)) + ) + (time-elapsed? (-> self birth-time) (-> self fadeout-timeout)) + ) + ) + (go-virtual fade) + ) + (common-post self) + (suspend) + ) + #f + ) + ) + +;; definition for method 33 of type skill +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations ((this skill)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this root pause-adjust-distance) 409600.0) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type skill) 1.0)) + (let ((a0-11 (-> this entity))) + (if (when a0-11 + (let ((a0-12 (-> a0-11 extra perm task))) + (if a0-12 + (= a0-12 (game-task none)) + ) + ) + ) + (set! (-> this entity extra perm task) (game-task complete)) + ) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-skill" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw shadow-ctrl) *collectable-dummy-shadow-control*) + (if (-> this entity) + (nav-mesh-connect-from-ent this) + ) + (cond + ((>= (-> this pickup-amount) (-> *FACT-bank* super-skill-inc)) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 1.0 0.2 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 133) this)) + ) + (else + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 132) this)) + ) + ) + 0 + (none) + ) + +;; definition of type fuel-cell +(deftype fuel-cell (process-hidden) + () + ) + +;; definition for method 3 of type fuel-cell +(defmethod inspect ((this fuel-cell)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) + (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) + (format #t "process-tree ") + ) + (if (= (logand s5-0 (process-mask target)) (process-mask target)) + (format #t "target ") + ) + (if (= (logand (process-mask collectable) s5-0) (process-mask collectable)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand s5-0 (process-mask sleep-code)) (process-mask sleep-code)) + (format #t "sleep-code ") + ) + (if (= (logand s5-0 (process-mask actor-pause)) (process-mask actor-pause)) + (format #t "actor-pause ") + ) + (if (= (logand (process-mask metalhead) s5-0) (shl #x8000 16)) + (format #t "metalhead ") + ) + (if (= (logand (process-mask bot) s5-0) (process-mask bot)) + (format #t "bot ") + ) + (if (= (logand (process-mask vehicle) s5-0) (process-mask vehicle)) + (format #t "vehicle ") + ) + (if (= (logand (process-mask enemy) s5-0) (process-mask enemy)) + (format #t "enemy ") + ) + (if (= (logand (process-mask entity) s5-0) (process-mask entity)) + (format #t "entity ") + ) + (if (= (logand s5-0 (process-mask heap-shrunk)) (process-mask heap-shrunk)) + (format #t "heap-shrunk ") + ) + (if (= (logand (process-mask sidekick) s5-0) (process-mask sidekick)) + (format #t "sidekick ") + ) + (if (= (logand s5-0 (process-mask going)) (process-mask going)) + (format #t "going ") + ) + (if (= (logand s5-0 (process-mask execute)) (process-mask execute)) + (format #t "execute ") + ) + (if (= (logand (process-mask civilian) s5-0) (process-mask civilian)) + (format #t "civilian ") + ) + (if (= (logand (process-mask death) s5-0) (process-mask death)) + (format #t "death ") + ) + (if (= (logand (process-mask guard) s5-0) (process-mask guard)) + (format #t "guard ") + ) + (if (= (logand s5-0 (process-mask no-kill)) (process-mask no-kill)) + (format #t "no-kill ") + ) + (if (= (logand (process-mask kg-robot) s5-0) (process-mask kg-robot)) + (format #t "kg-robot ") + ) + (if (= (logand (process-mask platform) s5-0) (process-mask platform)) + (format #t "platform ") + ) + (if (= (logand s5-0 (process-mask freeze)) (process-mask freeze)) + (format #t "freeze ") + ) + (if (= (logand s5-0 (process-mask sleep)) (process-mask sleep)) + (format #t "sleep ") + ) + (if (= (logand s5-0 (process-mask progress)) (process-mask progress)) + (format #t "progress ") + ) + (if (= (logand s5-0 (process-mask menu)) (process-mask menu)) + (format #t "menu ") + ) + (if (= (logand (process-mask camera) s5-0) (process-mask camera)) + (format #t "camera ") + ) + (if (= (logand (process-mask ambient) s5-0) (process-mask ambient)) + (format #t "ambient ") + ) + (if (= (logand s5-0 (process-mask dark-effect)) (process-mask dark-effect)) + (format #t "dark-effect ") + ) + (if (= (logand (process-mask crate) s5-0) (process-mask crate)) + (format #t "crate ") + ) + (if (= (logand s5-0 (process-mask kernel-run)) (process-mask kernel-run)) + (format #t "kernel-run ") + ) + (if (= (logand s5-0 (process-mask movie)) (process-mask movie)) + (format #t "movie ") + ) + (if (= (logand s5-0 (process-mask pause)) (process-mask pause)) + (format #t "pause ") + ) + ) + (format #t ")~%") + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tprev-state: ~A~%" (-> this prev-state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Tstate-stack: ~A~%" (-> this state-stack)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) + (label cfg-68) + this + ) + +;; definition of type trick-point +(deftype trick-point (collectable) + () + ) + +;; definition for method 3 of type trick-point +(defmethod inspect ((this trick-point)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type skate-point +(deftype skate-point (trick-point) + () + ) + +;; definition for method 3 of type skate-point +(defmethod inspect ((this skate-point)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type trick-point inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 33 of type trick-point +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations ((this trick-point)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) + (set-vector! (-> v1-8 local-sphere) 0.0 2048.0 0.0 4915.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this root pause-adjust-distance) 204800.0) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type trick-point) 100.0)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 142) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 143)) + 0 + (none) + ) + +;; definition for method 11 of type trick-point +(defmethod init-from-entity! ((this trick-point) (arg0 entity-actor)) + (initialize-allocations this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) + ) + +;; definition of type ammo-collectable +(deftype ammo-collectable (collectable) + ((ammo-effect basic) + ) + ) + +;; definition for method 3 of type ammo-collectable +(defmethod inspect ((this ammo-collectable)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type collectable inspect))) + (t9-0 this) + ) + (format #t "~2Tammo-effect: ~A~%" (-> this ammo-effect)) + (label cfg-4) + this + ) + +;; definition for method 31 of type ammo-collectable +(defmethod go-to-initial-state ((this ammo-collectable)) + (if (-> *setting-control* user-current gun-special-mode) + (go empty-state) + (call-parent-method this) + ) + ) + +;; definition for method 33 of type ammo-collectable +;; WARN: Return type mismatch int vs none. +(defmethod initialize-allocations ((this ammo-collectable)) + (stack-size-set! (-> this main-thread) 128) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-10 local-sphere) 0.0 3276.8 0.0 6553.6) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-10) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (rand-vu-float-range 0.0 65536.0)) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + (case (-> this pickup-type) + (((pickup-type ammo-yellow)) + (set! (-> this collect-effect) (-> *part-group-id-table* 136)) + ) + (((pickup-type ammo-red)) + (set! (-> this collect-effect) (-> *part-group-id-table* 137)) + ) + (((pickup-type ammo-blue)) + (set! (-> this collect-effect) (-> *part-group-id-table* 138)) + ) + (((pickup-type ammo-dark)) + (set! (-> this collect-effect) (-> *part-group-id-table* 139)) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type ammo-collectable +;; WARN: Return type mismatch object vs none. +(defmethod initialize-effects ((this ammo-collectable) (arg0 pickup-type)) + (set! (-> this fact pickup-type) arg0) + (case arg0 + (((pickup-type ammo-yellow)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 2.5 2.5 2.5 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 164)) + ) + (((pickup-type ammo-red)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 4.0 4.0 4.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 158)) + ) + (((pickup-type ammo-blue)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 4.0 4.0 4.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 154)) + ) + (((pickup-type ammo-dark)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 129)) + ) + (((pickup-type gun-yellow-1) (pickup-type gun-yellow-2) (pickup-type gun-yellow-3)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-yellow-up" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) + (let ((v1-34 (-> this node-list data))) + (set! (-> v1-34 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-34 0 param1) (the-as basic (-> this root trans))) + (set! (-> v1-34 0 param2) (the-as basic (-> this extra-trans))) + ) + (set-vector! (-> this extra-trans) 0.0 1638.4 0.0 1.0) + ) + (((pickup-type gun-dark-1) (pickup-type gun-dark-2) (pickup-type gun-dark-3)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-dark-up" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) + ) + (((pickup-type board)) + (process-entity-set! this (the-as entity #f)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-board" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (let ((v1-48 (-> this skel root-channel 0))) + (set! (-> v1-48 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + ) + (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) + (let ((v1-52 (-> this node-list data))) + (set! (-> v1-52 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-52 0 param1) (the-as basic (-> this root trans))) + (set! (-> v1-52 0 param2) (the-as basic (-> this extra-trans))) + ) + (set-vector! (-> this extra-trans) 0.0 2048.0 0.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) + ) + (((pickup-type shield)) + (set! (-> this ammo-effect) (-> *part-group-id-table* 125)) + ) + (((pickup-type trick-point)) + ) + ) + (none) + ) + +;; definition for function initialize-ammo-by-other +;; INFO: Used lq/sq +(defbehavior initialize-ammo-by-other ammo ((arg0 vector) (arg1 vector) (arg2 fact-info)) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (initialize-options self 4500 1024.0 arg2) + (update-transforms (-> self root)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + ) + +;; definition for method 29 of type ammo-collectable +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-common ((this ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> this pickup-amount) arg2) + (set! (-> this pickup-type) arg1) + (initialize-allocations this) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (initialize-effects this (-> this fact pickup-type)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) + (none) + ) + +;; definition for method 34 of type ammo-collectable +;; WARN: Return type mismatch int vs none. +(defmethod common-post ((this ammo-collectable)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) + ((method-of-type collectable common-post) this) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate die (ammo-collectable) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + ) + ) + +;; definition of type ammo +(deftype ammo (ammo-collectable) + () + ) + +;; definition for method 3 of type ammo +(defmethod inspect ((this ammo)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type ammo-collectable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type shield +(deftype shield (ammo-collectable) + () + ) + +;; definition for method 3 of type shield +(defmethod inspect ((this shield)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type ammo-collectable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type upgrade-collectable +(deftype upgrade-collectable (ammo-collectable) + () + ) + +;; definition for method 3 of type upgrade-collectable +(defmethod inspect ((this upgrade-collectable)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type ammo-collectable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for function initialize-upgrade-by-other +;; INFO: Used lq/sq +(defbehavior initialize-upgrade-by-other upgrade-collectable ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) + (process-entity-set! self arg3) + (let ((s3-0 (-> arg2 pickup-type)) + (f30-0 (-> arg2 pickup-spawn-amount)) + ) + (set! (-> self pickup-amount) f30-0) + (set! (-> self pickup-type) s3-0) + (initialize-allocations self) + (set! (-> self fact pickup-type) s3-0) + (set! (-> self fact pickup-amount) f30-0) + ) + (set! (-> self fact options) (-> arg2 options)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root transv quad) (-> arg1 quad)) + (initialize-effects self (-> self fact pickup-type)) + (set! (-> self notify) (the-as handle #f)) + (initialize-options + self + (if (and arg2 (logtest? (-> arg2 options) (actor-option fade-out))) + (the-as int (-> arg2 fade-time)) + 0 + ) + 1024.0 + (the-as fact-info #f) + ) + (set! (-> self collect-timeout) (seconds 1)) + (update-transforms (-> self root)) + (set! (-> self event-hook) (-> (method-of-object self wait) event)) + (go-to-initial-state self) + ) + +;; definition for method 11 of type eco +(defmethod init-from-entity! ((this eco) (arg0 entity-actor)) + (let ((v1-1 (res-lump-value (-> this entity) 'eco-info uint128 :time -1000000000.0))) + (set! (-> this type) (cond + ((= (the-as uint v1-1) 3) + eco-blue + ) + ((= (the-as uint v1-1) 2) + eco-red + ) + ((= (the-as uint v1-1) 1) + eco-yellow + ) + ((= (the-as uint v1-1) 5) + eco-green + ) + ((= (the-as uint v1-1) 20) + health + ) + ((= (the-as uint v1-1) 10) + money + ) + ((= (the-as uint v1-1) 21) + trick-point + ) + ((= (the-as uint v1-1) 23) + gem + ) + ((= (the-as uint v1-1) 24) + skill + ) + ((= (the-as uint v1-1) 11) + fuel-cell + ) + (else + eco-pill + ) + ) + ) + ) + (init-from-entity! this arg0) + ) + +;; definition for function verify-pickup-type +;; WARN: Return type mismatch int vs pickup-type. +(defun verify-pickup-type ((arg0 pickup-type)) + (case arg0 + (((pickup-type eco-pill-light)) + (if (not (logtest? (game-feature lightjak) (-> *game-info* features))) + (set! arg0 (pickup-type none)) + ) + ) + (((pickup-type ammo-red)) + (if (not (logtest? (-> *game-info* features) (game-feature gun-red-1))) + (set! arg0 (pickup-type ammo-yellow)) + ) + ) + (((pickup-type ammo-blue)) + (if (not (logtest? (-> *game-info* features) (game-feature gun-blue-1))) + (set! arg0 (pickup-type ammo-yellow)) + ) + ) + (((pickup-type ammo-dark)) + (if (not (logtest? (-> *game-info* features) (game-feature gun-dark-1))) + (set! arg0 (pickup-type ammo-yellow)) + ) + ) + ) + (the-as pickup-type arg0) + ) + +;; definition for function birth-pickup-at-point +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs (pointer process). +(defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info)) + (local-vars + (v1-56 pickup-type) + (v1-68 pickup-type) + (sv-32 vector) + (sv-36 float) + (sv-40 (pointer process)) + (sv-48 int) + (sv-56 fact-info) + (sv-64 int) + (sv-72 int) + ) + (let ((s2-0 (verify-pickup-type arg1))) + (if (= s2-0 (pickup-type none)) + (return (the-as (pointer process) 0)) + ) + (set! sv-32 (new-stack-vector0)) + (set! sv-36 (res-lump-float + (if (and arg5 (nonzero? (-> arg5 process))) + (-> arg5 process entity) + ) + 'pickup-radius + :default (cond + ((= s2-0 (pickup-type buzzer)) + 0.0 + ) + ((= arg2 1.0) + 409.6 + ) + (else + 8192.0 + ) + ) + ) + ) + (set! sv-40 (the-as (pointer process) #f)) + (set! sv-48 (the int arg2)) + (set! sv-56 (new 'static 'fact-info)) + (set! (-> sv-56 options) (actor-option)) + (set! (-> sv-56 process) #f) + (if arg5 + (mem-copy! (&-> sv-56 type) (&-> arg5 type) 40) + ) + (set! (-> sv-56 pickup-type) s2-0) + (if (not (logtest? (actor-option dont-override-fact) (-> sv-56 options))) + (set! (-> sv-56 pickup-spawn-amount) 1.0) + ) + (while (> sv-48 0) + (set! sv-48 (+ sv-48 -1)) + (when arg3 + (set-vector! sv-32 0.0 57001.605 sv-36 1.0) + (vector-rotate-around-y! sv-32 sv-32 (/ (* 65536.0 (the float sv-48)) arg2)) + ) + (case s2-0 + (((pickup-type eco-yellow)) + (set! sv-40 (process-spawn + eco-yellow + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "eco-yellow" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type eco-red)) + (set! sv-40 (process-spawn + eco-red + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "eco-red" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type eco-blue)) + (set! sv-40 (process-spawn + eco-blue + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "eco-blue" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type eco-green)) + (set! sv-40 (process-spawn + eco-green + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "eco-green" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type health)) + (if (not (logtest? (actor-option dont-override-fact) (-> sv-56 options))) + (set! (-> sv-56 pickup-spawn-amount) arg2) + ) + (set! sv-40 (process-spawn + health + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "health" + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type eco-pill-green) (pickup-type eco-pill-dark) (pickup-type eco-pill-light)) + (set! sv-64 (cond + ((logtest? (actor-option dont-override-fact) (-> sv-56 options)) + (the int (-> sv-56 pickup-spawn-amount)) + ) + ((begin (set! v1-56 s2-0) (= v1-56 (pickup-type eco-pill-dark))) + 2 + ) + ((= v1-56 (pickup-type eco-pill-light)) + 20 + ) + (else + 1 + ) + ) + ) + (set! (-> sv-56 pickup-spawn-amount) (the float sv-64)) + (set! sv-40 (process-spawn + eco-pill + :init initialize-eco-by-other + arg0 + sv-32 + sv-56 + :name "eco-pill" + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 (- sv-48 (+ sv-64 -1))) + ) + (((pickup-type ammo-yellow) + (pickup-type ammo-red) + (pickup-type ammo-blue) + (pickup-type ammo-dark) + (pickup-type shield) + ) + (set! sv-72 (cond + ((logtest? (actor-option dont-override-fact) (-> sv-56 options)) + (the int (-> sv-56 pickup-spawn-amount)) + ) + ((begin (set! v1-68 s2-0) (= v1-68 (pickup-type ammo-red))) + 5 + ) + ((= v1-68 (pickup-type ammo-dark)) + 1 + ) + (else + 10 + ) + ) + ) + (set! (-> sv-56 pickup-spawn-amount) (the float sv-72)) + (set! sv-40 (process-spawn + ammo-collectable + :init initialize-ammo-by-other + arg0 + sv-32 + sv-56 + :name "ammo-collectable" + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 (- sv-48 (+ sv-72 -1))) + ) + (((pickup-type gun-red-1) + (pickup-type gun-red-2) + (pickup-type gun-red-3) + (pickup-type gun-yellow-1) + (pickup-type gun-yellow-2) + (pickup-type gun-yellow-3) + (pickup-type gun-blue-1) + (pickup-type gun-blue-2) + (pickup-type gun-blue-3) + (pickup-type gun-dark-1) + (pickup-type gun-dark-2) + (pickup-type gun-dark-3) + (pickup-type board) + ) + (set! sv-40 (process-spawn + upgrade-collectable + :init initialize-upgrade-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + :name "upgrade-collectable" + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type trick-point)) + (if (not (logtest? (actor-option dont-override-fact) (-> sv-56 options))) + (set! (-> sv-56 pickup-spawn-amount) arg2) + ) + (set! sv-40 (process-spawn + trick-point + :init initialize-ammo-by-other + arg0 + sv-32 + sv-56 + :name "trick-point" + :from *pickup-dead-pool* + :to arg4 + ) + ) + (set! sv-48 0) + 0 + ) + (((pickup-type money)) + (set! sv-40 + (process-spawn money arg0 sv-32 sv-56 (-> self entity) 0 :name "money" :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type trick-point)) + (set! sv-40 + (process-spawn money arg0 sv-32 sv-56 (-> self entity) 4500 :name "money" :from *pickup-dead-pool* :to arg4) + ) + ) + (((pickup-type gem)) + (if (>= (-> *game-info* live-gem-count) 20) + (return (the-as (pointer process) #f)) + ) + (set! sv-40 (process-spawn + gem + :init money-init-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + 4500 + :name "gem" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (((pickup-type skill)) + (when (>= arg2 (-> *FACT-bank* super-skill-inc)) + (if (not (logtest? (actor-option dont-override-fact) (-> sv-56 options))) + (set! (-> sv-56 pickup-spawn-amount) arg2) + ) + (set! sv-48 0) + 0 + ) + (set! sv-40 (process-spawn + skill + :init money-init-by-other + arg0 + sv-32 + sv-56 + (-> self entity) + 0 + :name "skill" + :from *pickup-dead-pool* + :to arg4 + ) + ) + ) + (else + (format 0 "ERROR: unknown type of eco ~d~%" s2-0) + ) + ) + ) + ) + (the-as (pointer process) sv-40) + ) + +;; definition for function pickup-dark-set! +(defun pickup-dark-set! ((arg0 fact-info) (arg1 (pointer pickup-type)) (arg2 (pointer float)) (arg3 int)) + (-> arg2 0) + (you-suck-stage *game-info* #f 0) + (cond + ((or (< 20 (-> *game-info* live-eco-pill-count)) + (not (logtest? (game-feature feature58) (-> *game-info* features))) + ) + (return (the-as pickup-type #f)) + ) + ((< 10 (-> *game-info* live-eco-pill-count)) + (set! (-> arg1 0) (pickup-type eco-pill-dark)) + (set! (-> arg2 0) 2.0) + ) + ((type? arg0 fact-info-enemy) + (set! (-> arg1 0) (pickup-type eco-pill-dark)) + (set! (-> arg2 0) (+ (rand-vu-float-range 6.0 (+ 10.0 (-> arg2 0))) (fmin 10.0 (the float arg3)))) + ) + (else + (set! (-> arg1 0) (pickup-type eco-pill-dark)) + (set! (-> arg2 0) (+ (rand-vu-float-range 4.0 (+ 6.0 (-> arg2 0))) (fmin 10.0 (the float arg3)))) + ) + ) + (-> arg1 0) + ) + +;; definition for function pickup-light-set! +;; WARN: Return type mismatch number vs pickup-type. +(defun pickup-light-set! ((arg0 fact-info) (arg1 (pointer pickup-type)) (arg2 (pointer float)) (arg3 int)) + (the-as pickup-type (cond + ((logtest? (game-feature feature57) (-> *game-info* features)) + (set! (-> arg1 0) (pickup-type eco-pill-light)) + (set! (-> arg2 0) 20.0) + ) + (else + (set! (-> arg1 0) (pickup-type none)) + 0 + ) + ) + ) + ) + +;; definition for function pickup-ammo-set! +(defun pickup-ammo-set! ((arg0 fact-info) (arg1 (pointer pickup-type)) (arg2 (pointer float)) (arg3 int)) + (local-vars (v0-5 number) (sv-16 float)) + (let ((s2-0 (-> *game-info* features))) + 0.0 + (let ((f22-0 0.0) + (f26-0 0.0) + (f28-0 0.0) + (f30-0 0.0) + ) + (set! sv-16 (the-as float (if (logtest? s2-0 (game-feature gun-yellow-1 gun-yellow-2 gun-yellow-3)) + (get-max-ammo-for-gun *game-info* (pickup-type ammo-yellow)) + 0.0 + ) + ) + ) + (let* ((f20-0 (if (logtest? s2-0 (game-feature gun-red-1 gun-red-2 gun-red-3)) + (get-max-ammo-for-gun *game-info* (pickup-type ammo-red)) + 0.0 + ) + ) + (f24-0 (if (logtest? s2-0 (game-feature gun-blue-1 gun-blue-2 gun-blue-3)) + (get-max-ammo-for-gun *game-info* (pickup-type ammo-blue)) + 0.0 + ) + ) + (f0-2 (if (logtest? (game-feature gun-dark-1 gun-dark-2 gun-dark-3) s2-0) + (get-max-ammo-for-gun *game-info* (pickup-type ammo-dark)) + 0.0 + ) + ) + (f4-0 (if (logtest? s2-0 (game-feature gun-yellow-1 gun-yellow-2 gun-yellow-3)) + (-> *game-info* gun-ammo 0) + 0.0 + ) + ) + (f1-2 (if (logtest? s2-0 (game-feature gun-red-1 gun-red-2 gun-red-3)) + (-> *game-info* gun-ammo 1) + 0.0 + ) + ) + (f2-1 (if (logtest? s2-0 (game-feature gun-blue-1 gun-blue-2 gun-blue-3)) + (-> *game-info* gun-ammo 2) + 0.0 + ) + ) + (f3-1 (if (logtest? (game-feature gun-dark-1 gun-dark-2 gun-dark-3) s2-0) + (-> *game-info* gun-ammo 3) + 0.0 + ) + ) + (f22-1 (+ f22-0 (- sv-16 f4-0))) + ) + (if (< 0.0 sv-16) + (set! f22-1 (/ f22-1 sv-16)) + ) + (let ((f1-4 (+ f26-0 (- f20-0 f1-2)))) + (if (< 0.0 f20-0) + (set! f1-4 (/ f1-4 f20-0)) + ) + (let ((f2-3 (+ f28-0 (- f24-0 f2-1)))) + (if (< 0.0 f24-0) + (set! f2-3 (/ f2-3 f24-0)) + ) + (let ((f3-3 (+ f30-0 (- f0-2 f3-1)))) + (if (< 0.0 f0-2) + (set! f3-3 (/ f3-3 f0-2)) + ) + (let ((f26-1 (+ f22-1 f1-4 f2-3 f3-3))) + (when (= f26-1 0.0) + (set! f22-1 1.0) + (set! f26-1 1.0) + ) + (cond + ((!= f26-1 0.0) + (let* ((f24-1 (+ f1-4 f22-1)) + (f28-1 (+ f2-3 f24-1)) + (f30-1 (+ f3-3 f28-1)) + (v1-39 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-40 (the-as number (logior #x3f800000 v1-39))) + (f0-10 (* (+ -1.0 (the-as float v1-40)) f26-1)) + ) + (set! v0-5 (cond + ((and (>= f22-1 f0-10) (logtest? s2-0 (game-feature gun-yellow-1 gun-yellow-2 gun-yellow-3))) + (set! v0-5 15) + (set! (-> arg1 0) (the-as pickup-type v0-5)) + v0-5 + ) + ((and (>= f24-1 f0-10) (logtest? s2-0 (game-feature gun-red-1 gun-red-2 gun-red-3))) + (set! (-> arg1 0) (pickup-type ammo-red)) + (if (>= 1 (mod (the-as int (rand-uint31-gen *random-generator*)) 3)) + (set! (-> arg2 0) (* 0.5 (-> arg2 0))) + ) + ) + ((and (>= f28-1 f0-10) (logtest? s2-0 (game-feature gun-blue-1 gun-blue-2 gun-blue-3))) + (set! v0-5 17) + (set! (-> arg1 0) (the-as pickup-type v0-5)) + v0-5 + ) + ((and (>= f30-1 f0-10) (logtest? (game-feature gun-dark-1 gun-dark-2 gun-dark-3) s2-0)) + (set! (-> arg1 0) (pickup-type ammo-dark)) + (set! (-> arg2 0) (the float (the int (fmax 1.0 (* 0.06666667 (-> arg2 0)))))) + ) + (else + (pickup-dark-set! arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + (else + (set! (-> arg1 0) (pickup-type none)) + 0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + (-> arg1 0) + ) + +;; definition for method 9 of type fact-info +;; INFO: Used lq/sq +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +(defmethod drop-pickup ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int) (arg4 symbol)) + (local-vars (sv-16 pickup-type) (sv-20 float)) + (set! sv-16 (-> this pickup-type)) + (set! sv-20 (-> this pickup-amount)) + (if (not arg4) + (set! sv-20 (fmin 10.0 sv-20)) + ) + (cond + ((= sv-16 (pickup-type ammo-random)) + (pickup-ammo-set! this (& sv-16) (& sv-20) arg3) + ) + ((= sv-16 (pickup-type eco-pill-random)) + (if (rand-vu-percent? 0.1) + (pickup-light-set! this (& sv-16) (& sv-20) arg3) + (pickup-dark-set! this (& sv-16) (& sv-20) arg3) + ) + ) + ((= sv-16 (pickup-type light-random)) + (cond + ((rand-vu-percent? 0.1) + (pickup-light-set! this (& sv-16) (& sv-20) arg3) + ) + (else + (set! sv-16 (pickup-type none)) + 0 + ) + ) + ) + ((= sv-16 (pickup-type ammo-light-random)) + (let ((v1-17 (rand-vu-int-count 100))) + (cond + ((< v1-17 10) + (pickup-light-set! this (& sv-16) (& sv-20) arg3) + ) + ((< v1-17 50) + (pickup-ammo-set! this (& sv-16) (& sv-20) arg3) + ) + (else + (set! sv-16 (pickup-type none)) + 0 + ) + ) + ) + ) + ((= sv-16 (pickup-type ammo-dark-light-random)) + (let ((v1-23 (rand-vu-int-count 100))) + (cond + ((< v1-23 10) + (pickup-light-set! this (& sv-16) (& sv-20) arg3) + ) + ((< v1-23 55) + (pickup-ammo-set! this (& sv-16) (& sv-20) arg3) + ) + (else + (pickup-dark-set! this (& sv-16) (& sv-20) arg3) + ) + ) + ) + ) + ) + (if (= sv-16 (pickup-type none)) + (return (the-as (pointer process) #f)) + ) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) + (set-vector! (-> s3-1 move-dist) 0.0 -81920.0 0.0 1.0) + (+! (-> s3-1 start-pos y) 12288.0) + (let ((v1-33 s3-1)) + (set! (-> v1-33 radius) 40.96) + (set! (-> v1-33 collide-with) (collide-spec backgnd hit-by-others-list pusher)) + (set! (-> v1-33 ignore-process0) #f) + (set! (-> v1-33 ignore-process1) #f) + (set! (-> v1-33 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-33 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-1) 0.0) + (set! (-> s3-1 start-pos quad) (-> s3-1 best-other-tri intersect quad)) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) + ) + (if (= sv-16 (pickup-type fuel-cell)) + (+! (-> s3-1 start-pos y) 6144.0) + ) + (birth-pickup-at-point (-> s3-1 start-pos) sv-16 sv-20 arg0 arg1 this) + ) + ) + +;; definition for function gun-pickup-type->game-feature +;; WARN: Return type mismatch int vs game-feature. +(defun gun-pickup-type->game-feature ((arg0 pickup-type)) + (let ((v1-0 arg0)) + (the-as game-feature (cond + ((= v1-0 (pickup-type gun-red-1)) + (the-as game-feature (game-feature gun-red-1)) + ) + ((= v1-0 (pickup-type gun-red-2)) + (the-as game-feature (game-feature gun-red-2)) + ) + ((= v1-0 (pickup-type gun-red-3)) + (the-as game-feature (game-feature gun-red-3)) + ) + ((= v1-0 (pickup-type gun-yellow-1)) + (the-as game-feature (game-feature gun-yellow-1)) + ) + ((= v1-0 (pickup-type gun-yellow-2)) + (the-as game-feature (game-feature gun-yellow-2)) + ) + ((= v1-0 (pickup-type gun-yellow-3)) + (the-as game-feature (game-feature gun-yellow-3)) + ) + ((= v1-0 (pickup-type gun-blue-1)) + (the-as game-feature (game-feature gun-blue-1)) + ) + ((= v1-0 (pickup-type gun-blue-2)) + (the-as game-feature (game-feature gun-blue-2)) + ) + ((= v1-0 (pickup-type gun-blue-3)) + (the-as game-feature (game-feature gun-blue-3)) + ) + ((= v1-0 (pickup-type gun-dark-1)) + (the-as game-feature (game-feature gun-dark-1)) + ) + ((= v1-0 (pickup-type gun-dark-2)) + (the-as game-feature (game-feature gun-dark-2)) + ) + ((= v1-0 (pickup-type gun-dark-3)) + (the-as game-feature (game-feature gun-dark-3)) + ) + (else + (the-as game-feature (game-feature)) + ) + ) + ) + ) + ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc new file mode 100644 index 00000000000..7f6ef10d314 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc @@ -0,0 +1,1743 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-crate-krimson crate crate-krimson-lod0-jg crate-idle-ja + ((crate-krimson-lod0-mg (meters 20)) (crate-krimson-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 10 + ) + +;; failed to figure out what this is: +(defskelgroup skel-crate-cty-blue ctycrate ctycrate-blue-lod0-jg ctycrate-idle-ja + ((ctycrate-blue-lod0-mg (meters 20)) (ctycrate-blue-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +;; failed to figure out what this is: +(defskelgroup skel-crate-cty-metal ctycrate ctycrate-metal-lod0-jg ctycrate-idle-ja + ((ctycrate-metal-lod0-mg (meters 20)) (ctycrate-metal-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +;; failed to figure out what this is: +(defskelgroup skel-crate-urn-a urn-a urn-a-lod0-jg urn-a-idle-ja + ((urn-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +;; failed to figure out what this is: +(defskelgroup skel-crate-urn-b urn-b urn-b-lod0-jg urn-b-idle-ja + ((urn-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +;; failed to figure out what this is: +(defskelgroup skel-crate-urn-c urn-c urn-c-lod0-jg urn-c-idle-ja + ((urn-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + ) + +;; definition of type crate-bank +(deftype crate-bank (basic) + ((COLLIDE_YOFF float) + (COLLIDE_RADIUS float) + (DARKECO_EXPLODE_RADIUS float) + ) + ) + +;; definition for method 3 of type crate-bank +(defmethod inspect ((this crate-bank)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1TCOLLIDE_YOFF: ~f~%" (-> this COLLIDE_YOFF)) + (format #t "~1TCOLLIDE_RADIUS: ~f~%" (-> this COLLIDE_RADIUS)) + (format #t "~1TDARKECO_EXPLODE_RADIUS: ~f~%" (-> this DARKECO_EXPLODE_RADIUS)) + (label cfg-4) + this + ) + +;; definition for symbol *CRATE-bank*, type crate-bank +(define *CRATE-bank* + (new 'static 'crate-bank :COLLIDE_YOFF 4096.0 :COLLIDE_RADIUS 6963.2 :DARKECO_EXPLODE_RADIUS 16384.0) + ) + +;; definition of type crate +(deftype crate (process-focusable) + ((root collide-shape-moving :override) + (fact fact-info-crate :override) + (smush smush-control :inline) + (base vector :inline) + (look symbol) + (defense symbol) + (incoming-attack-id uint32) + (target handle) + (child-count int32) + (victory-anim spool-anim) + ) + (:state-methods + hide + idle + (die symbol int) + special-contents-die + bounce-on + (notice-blue handle) + carry + fall + ) + (:methods + (init! (_type_ entity-actor) none) + (init-skel! (_type_) none) + (init-collision! (_type_) none) + (params-set! (_type_ symbol symbol) none) + (go-initial-state (_type_) none) + (smush-update! (_type_) none) + (should-hide? (_type_) symbol) + ) + ) + +;; definition for method 3 of type crate +(defmethod inspect ((this crate)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tsmush: #~%" (-> this smush)) + (format #t "~2Tbase: ~`vector`P~%" (-> this base)) + (format #t "~2Tlook: ~A~%" (-> this look)) + (format #t "~2Tdefense: ~A~%" (-> this defense)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Ttarget: ~D~%" (-> this target)) + (format #t "~2Tchild-count: ~D~%" (-> this child-count)) + (format #t "~2Tvictory-anim: ~A~%" (-> this victory-anim)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(method-set! crate 12 (method-of-type process run-logic?)) + +;; definition for function collectable-count +(defbehavior collectable-count crate ((arg0 process-tree)) + (set! *global-search-count* 0) + (iterate-process-tree + arg0 + (lambda ((arg0 process)) + (if (type? arg0 collectable) + (set! *global-search-count* (+ *global-search-count* 1)) + ) + #t + ) + *null-kernel-context* + ) + *global-search-count* + ) + +;; definition for function crate-post +(defbehavior crate-post crate () + (rider-trans) + (smush-update! self) + (rider-post) + (carry-info-method-9 (-> self carry)) + (none) + ) + +;; failed to figure out what this is: +(defpart 810 + :init-specs ((:texture (new 'static 'texture-id :page #x4)) + (:num 16.0) + (:y (meters 0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 32.0) + (:g 128.0 32.0) + (:b 128.0 32.0) + (:a 32.0 16.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -1.2) (degrees 1.2)) + (:accel-y (meters 0.00066666666)) + (:timer (seconds 0.4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 set-conerot)) + (:next-time (seconds 0.1) (seconds 0.197)) + (:next-launcher 811) + (:conerot-x (degrees 70) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 811 + :init-specs ((:fade-a -1.0666667)) + ) + +;; failed to figure out what this is: +(defpart 812 + :init-specs ((:texture (new 'static 'texture-id :index #x3e :page #x4)) + (:num 4.0) + (:y (meters 0.75)) + (:scale-x (meters 6)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3) (meters 1)) + (:r 192.0) + (:g 192.0) + (:b 64.0 128.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 set-conerot)) + (:next-time (seconds 0.05)) + (:next-launcher 813) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 813 + :init-specs ((:fade-a -2.1333334)) + ) + +;; failed to figure out what this is: +(defpart 814 + :init-specs ((:texture (new 'static 'texture-id :index #x4b :page #x4)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 196.0) + (:b 196.0) + (:a 28.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 set-conerot)) + ) + ) + +;; failed to figure out what this is: +(defpart 815 + :init-specs ((:texture (new 'static 'texture-id :index #x6 :page #x4)) + (:num 5.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.25) (meters 1.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.6) 2.0 (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3)) + (:r 160.0) + (:g 160.0) + (:b 160.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-x (degrees 1.2)) + (:rotvel-y (degrees 2.4)) + (:rotvel-z (degrees 0) 2 (degrees 2.4)) + (:accel-y (meters -0.0033333334)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 set-conerot)) + (:next-time (seconds 0.25)) + (:next-launcher 816) + (:conerot-x (degrees 40) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 816 + :init-specs ((:scalevel-x (meters -0.0033333334)) (:scalevel-y :copy scalevel-x) (:fade-a -3.4)) + ) + +;; failed to figure out what this is: +(defpart 817 + :init-specs ((:texture (new 'static 'texture-id :index #x5 :page #x4)) + (:num 4.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.25) (meters 1.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.3) 1 (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3)) + (:r 100.0) + (:g 100.0) + (:b 100.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-x (degrees 1.2)) + (:rotvel-y (degrees 2.4)) + (:rotvel-z (degrees 0) 3 (degrees 2.4)) + (:accel-y (meters -0.0033333334)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 set-conerot)) + (:next-time (seconds 0.25)) + (:next-launcher 816) + (:conerot-x (degrees 40) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-crate-explode + :id 195 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 810 :flags (sp7)) + (sp-item 812 :flags (sp7)) + (sp-item 814 :flags (sp7)) + (sp-item 815 :flags (sp7)) + (sp-item 817 :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-crate-steel-explode + :id 196 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 810) (sp-item 812) (sp-item 814) (sp-item 817) (sp-item 817) (sp-item 817)) + ) + +;; failed to figure out what this is: +(defpartgroup group-dark-eco-box-explosion + :id 197 + :duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 145 :fade-after (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 143) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 818 :fade-after (meters 160) :period (seconds 2) :length (seconds 0.017)) + (sp-item 146 :period (seconds 2) :length (seconds 0.017)) + (sp-item 147 :fade-after (meters 80) :falloff-to (meters 80) :period (seconds 2) :length (seconds 0.135)) + (sp-item 148 :period (seconds 2) :length (seconds 0.067)) + (sp-item 819 :fade-after (meters 120) :falloff-to (meters 120) :period (seconds 2) :length (seconds 0.067)) + ) + ) + +;; failed to figure out what this is: +(defpart 147 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 6.0) + (:scale-x (meters 0.2) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g 0.0 32.0) + (:b 96.0 64.0) + (:a 32.0 96.0) + (:vel-y (meters 0.026666667) (meters 0.10666667)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.1) (seconds 0.097)) + (:next-launcher 820) + (:conerot-x (degrees 0) (degrees 140)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 2) (meters 4)) + ) + ) + +;; failed to figure out what this is: +(defpart 820 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -1.4222223)) + ) + +;; failed to figure out what this is: +(defpart 819 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 3.0) + (:scale-x (meters 0.2)) + (:rot-z (degrees 0) (degrees 180)) + (:scale-y (meters 8)) + (:r 64.0 192.0) + (:g 0.0 32.0) + (:b 128.0 64.0) + (:a 32.0 64.0) + (:scalevel-y (meters 0.42666668)) + (:fade-a -1.6) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 146 + :init-specs ((:texture (new 'static 'texture-id :index #x4b :page #x4)) + (:num 1.0) + (:scale-x (meters 16)) + (:scale-y :copy scale-x) + (:r 64.0 192.0) + (:g 0.0 32.0) + (:b 128.0 64.0) + (:a 96.0) + (:fade-a -1.7454545) + (:timer (seconds 0.18)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 148 + :init-specs ((:texture (new 'static 'texture-id :page #x4)) + (:num 4.0) + (:scale-x (meters 2.5) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 96.0) + (:g 0.0 32.0) + (:b 64.0 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.053333335) (meters 0.013333334)) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.8) + (:timer (seconds 1.7)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 145 + :init-specs ((:texture (new 'static 'texture-id :index #x4b :page #x4)) + (:num 16.0) + (:y (meters 1)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:a 0.0) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:accel-y (meters -0.00033333333)) + (:friction 0.94) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 140)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 143 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3) (meters 0.3)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 96.0) + (:g 0.0 32.0) + (:b 64.0 32.0) + (:a 64.0 64.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.026666667) (meters 0.10666667)) + (:scalevel-x (meters -0.000909091)) + (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.26666668) + (:fade-a -0.19393939) + (:timer (seconds 0.3) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 144 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g 0.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.0006190476)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.01904762) + (:accel-y (meters -0.000100000005) (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 599) + ) + ) + +;; failed to figure out what this is: +(defpart 818 + :init-specs ((:texture (new 'static 'texture-id :index #x5 :page #x4)) + (:num 8.0 16.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.25) (meters 1.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.3) 1 (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3)) + (:r 128.0) + (:g 64.0 1 32.0) + (:b 32.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-x (degrees 1.2)) + (:rotvel-y (degrees 2.4)) + (:rotvel-z (degrees 0) 3 (degrees 2.4)) + (:accel-y (meters -0.0033333334)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.25)) + (:next-launcher 821) + (:conerot-x (degrees 40) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 821 + :init-specs ((:scalevel-x (meters -0.0033333334)) (:scalevel-y :copy scalevel-x) (:fade-a -3.4)) + ) + +;; definition for method 20 of type crate +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this crate)) + (the-as search-info-flag (if (logtest? (actor-option no-track) (-> this fact options)) + 0 + 2 + ) + ) + ) + +;; definition for function crate-standard-event-handler +;; INFO: Used lq/sq +(defbehavior crate-standard-event-handler crate ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (let* ((v1-1 (the-as attack-info (-> arg3 param 1))) + (s4-0 (-> v1-1 id)) + (s5-0 (-> v1-1 count)) + ) + (case (-> self defense) + (('iron) + (case (-> v1-1 mode) + (('flop 'uppercut 'explode 'eco-yellow 'racer 'board 'tube 'flut-bonk 'flut-attack 'darkjak 'mech-punch) + (if (and (logtest? (-> self fact options) (actor-option racer-only)) + (= (-> arg0 type) target) + (not (logtest? (focus-status pilot) (-> (the-as process-focusable arg0) focus-status))) + ) + (return #f) + ) + (send-event arg0 'get-attack-count 1) + (process-contact-action arg0) + (set! (-> self target) (process->handle arg0)) + (go-virtual die #f (the-as int s5-0)) + ) + (else + (when (and (!= s4-0 (-> self incoming-attack-id)) (= (-> self root trans y) (-> self base y))) + (talker-spawn-func (-> *talker-speech* 39) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self incoming-attack-id) s4-0) + (if (not (!= (-> self smush amp) 0.0)) + (sound-play "icrate-nobreak") + ) + (activate! (-> self smush) 0.1 90 150 1.0 1.0 (-> self clock)) + (go-virtual bounce-on) + ) + #f + ) + ) + ) + (('steel) + (case (-> v1-1 mode) + (('explode 'eco-yellow 'tube 'flut-bonk 'flut-attack 'racer 'board 'darkjak 'mech-punch) + (send-event arg0 'get-attack-count 1) + (when (logtest? (-> self draw status) (draw-control-status on-screen)) + (talker-spawn-func (-> *talker-speech* 40) *entity-pool* (target-pos 0) (the-as region #f)) + (talker-spawn-func (-> *talker-speech* 41) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (process-contact-action arg0) + (set! (-> self target) (process->handle arg0)) + (go-virtual die #f (the-as int s5-0)) + ) + (else + (when (and (!= s4-0 (-> self incoming-attack-id)) (= (-> self root trans y) (-> self base y))) + (talker-spawn-func (-> *talker-speech* 42) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self incoming-attack-id) s4-0) + (if (not (!= (-> self smush amp) 0.0)) + (sound-play "scrate-nobreak") + ) + (activate! (-> self smush) 0.1 90 150 1.0 1.0 (-> self clock)) + (go-virtual bounce-on) + ) + #f + ) + ) + ) + (('darkeco) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'darkeco)) + ) + ) + (when (= (-> arg0 type) target) + (talker-spawn-func (-> *talker-speech* 43) *entity-pool* (target-pos 0) (the-as region #f)) + (talker-spawn-func (-> *talker-speech* 38) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (process-contact-action arg0) + (set! (-> self target) (process->handle arg0)) + (go-virtual die #f (the-as int s5-0)) + ) + (else + (-> v1-1 mode) + (send-event arg0 'get-attack-count 1) + (process-contact-action arg0) + (set! (-> self target) (process->handle arg0)) + (go-virtual die #f (the-as int s5-0)) + ) + ) + ) + ) + (('touch) + (case (-> self defense) + (('darkeco) + (send-event + arg0 + 'attack + (-> arg3 param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'darkeco)) + ) + ) + (process-contact-action arg0) + (set! (-> self target) (process->handle arg0)) + (go-virtual die #f 0) + ) + ) + ) + (('bonk) + (when (= (-> self root trans y) (-> self base y)) + (activate! (-> self smush) -0.1 75 150 1.0 1.0 (-> self clock)) + (go-virtual bounce-on) + ) + ) + (('impact-impulse) + (let ((v1-115 (the-as object (-> arg3 param 0)))) + (when (< 122880.0 (-> (the-as impact-control v1-115) trans 1 x)) + (logior! (-> self root penetrated-by) (penetrate vehicle)) + (go-virtual die #f 0) + #t + ) + ) + ) + (('wake) + (let ((v0-0 (the-as object (logclear (-> self mask) (process-mask sleep))))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 + ) + ) + (('hide) + (go-virtual hide) + ) + (('die) + (go-virtual die #f 0) + ) + (('eco-blue) + (if (not (or (= (-> self defense) 'darkeco) + (and (-> self next-state) (let ((v1-131 (-> self next-state name))) + (or (= v1-131 'notice-blue) (= v1-131 'die)) + ) + ) + (!= (-> self root trans y) (-> self base y)) + ) + ) + (go-virtual notice-blue (process->handle arg0)) + ) + ) + (('fall) + (when (not (and (-> self next-state) (= (-> self next-state name) 'fall))) + (set! (-> self root transv quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (go-virtual fall) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate hide (crate) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status dead) #f) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (vector+! (-> self draw origin) (-> self root trans) (-> self draw bounds)) + (set! (-> self draw origin w) (-> self draw bounds w)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-9 (-> self root root-prim))) + (set! (-> v1-9 prim-core collide-as) (collide-spec)) + (set! (-> v1-9 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-post) + (while (or (should-hide? self) + (and (sphere-in-view-frustum? (the-as sphere (-> self draw origin))) + (< (vector-vector-distance (camera-pos) (-> self root trans)) 327680.0) + ) + (and *target* (and (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + ) + (suspend) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-29 (-> self root root-prim))) + (set! (-> v1-29 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-29 prim-core collide-with) (-> self root backup-collide-with)) + ) + (go-virtual idle) + ) + ) + +;; failed to figure out what this is: +(defstate idle (crate) + :virtual #t + :event crate-standard-event-handler + :trans (behavior () + (if (-> *setting-control* user-current hide-crates?) + (go-virtual hide) + ) + ) + :code (behavior () + (suspend) + (update-transforms (-> self root)) + (carry-info-method-9 (-> self carry)) + (logior! (-> self mask) (process-mask sleep)) + (until #f + (suspend) + ) + #f + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate carry (crate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('carry? 'carry-info) + (-> self carry) + ) + (('drop) + (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) + (go-virtual fall) + ) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + (carry-info-method-9 (-> self carry)) + (carry-info-method-13 (-> self carry)) + (update-transforms (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate fall (crate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('carry-info) + (-> self carry) + ) + (('carry? 'pickup) + (the-as carry-info #f) + ) + ) + ) + :enter (behavior () + (if (handle->process (-> self carry other)) + (drop-impl! + (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) + (-> self carry) + ) + ) + (set! (-> self root status) (collide-status)) + (set! (-> self root root-prim local-sphere w) (-> self carry carry-radius)) + (logior! + (-> self root root-prim prim-core collide-with) + (collide-spec backgnd crate obstacle hit-by-others-list pusher) + ) + ) + :trans (behavior () + (when (and (logtest? (-> self root status) (collide-status on-surface)) (< 0.8 (-> self root surface-angle))) + (vector-reset! (-> self root transv)) + (when (= (vector-length (-> self root transv)) 0.0) + (set! (-> self root root-prim local-sphere w) (-> self carry backup-radius)) + (set! (-> self base quad) (-> self root trans quad)) + (let ((v1-16 (-> self root root-prim))) + (set! (-> v1-16 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-16 prim-core collide-with) (-> self root backup-collide-with)) + ) + (go-virtual idle) + ) + ) + ) + :code sleep-code + :post (behavior () + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (if (< (-> self root dynam gravity-max) (vector-length (-> self root transv))) + (vector-normalize! (-> self root transv) (-> self root dynam gravity-max)) + ) + (let ((gp-1 (-> self root))) + (let ((a2-1 (new 'stack-no-clear 'collide-query))) + (set! (-> gp-1 root-prim type) collide-shape-prim-sphere) + (set! (-> a2-1 collide-with) (collide-spec backgnd crate obstacle pusher)) + (set! (-> a2-1 ignore-process0) self) + (set! (-> a2-1 ignore-process1) #f) + (set! (-> a2-1 ignore-pat) (-> gp-1 pat-ignore-mask)) + (set! (-> a2-1 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide gp-1 (-> gp-1 transv) a2-1 (meters 0)) + ) + (set! (-> gp-1 root-prim type) collide-shape-prim-mesh) + ) + (crate-post) + ) + ) + +;; failed to figure out what this is: +(defstate bounce-on (crate) + :virtual #t + :event crate-standard-event-handler + :code (behavior () + (while (!= (-> self smush amp) 0.0) + (suspend) + ) + (go-virtual idle) + ) + :post crate-post + ) + +;; failed to figure out what this is: +(defstate notice-blue (crate) + :virtual #t + :event crate-standard-event-handler + :trans (behavior () + (cond + ((not (send-event *target* 'query 'powerup (pickup-type eco-blue))) + (logior! (-> self mask) (process-mask sleep-code)) + (if (not (!= (-> self smush amp) 0.0)) + (go-virtual idle) + ) + ) + (else + (logclear! (-> self mask) (process-mask sleep-code)) + ) + ) + ) + :code (behavior ((arg0 handle)) + (set! (-> self target) arg0) + (until #f + (let* ((gp-0 (handle->process (-> self target))) + (v1-3 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (when v1-3 + (let* ((gp-1 (-> (the-as process-drawable v1-3) root)) + (v1-4 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (when v1-4 + (let* ((gp-2 (-> self root root-prim prim-core)) + (a1-3 (-> (the-as collide-shape v1-4) root-prim prim-core)) + (f30-0 (vector-vector-distance (the-as vector gp-2) (the-as vector a1-3))) + ) + (when (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (!= (-> self defense) 'steel)) + (logior! (-> self fact options) (actor-option suck-in)) + (process-contact-action (handle->process (-> self target))) + (go-virtual die #f 0) + ) + (when (rand-vu-percent? 0.5) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (the-as uint128 (the-as vector (-> gp-2 world-sphere quad)))) + (dotimes (gp-3 3) + (+! (-> s5-0 data gp-3) (rand-vu-float-range -5324.8 5324.8)) + ) + (eco-blue-glow s5-0) + ) + ) + (activate! + (-> self smush) + (lerp-scale + (rand-vu-float-range 0.1 0.3) + (rand-vu-float-range 0.0 0.02) + f30-0 + (-> *FACT-bank* suck-suck-dist) + (-> *FACT-bank* suck-bounce-dist) + ) + 60 + 60 + 1.0 + 1.0 + (-> self clock) + ) + ) + ) + ) + ) + ) + (suspend) + ) + #f + ) + :post crate-post + ) + +;; failed to figure out what this is: +(defstate die (crate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (case (-> self defense) + (('darkeco) + (send-event + proc + 'attack + (-> block param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'darkeco)) + ) + ) + ) + ) + ) + ) + ) + :code (behavior ((arg0 symbol) (arg1 int)) + (+! (-> *game-info* crates-opened) 1.0) + (logior! (-> self focus-status) (focus-status dead)) + (let ((v1-6 (-> self root root-prim))) + (set! (-> v1-6 prim-core collide-as) (collide-spec)) + (set! (-> v1-6 prim-core collide-with) (collide-spec)) + ) + 0 + (if (nonzero? (-> self sound)) + (stop! (-> self sound)) + ) + (let ((v1-13 (handle->process (-> self target)))) + (if (and (and v1-13 (= (-> v1-13 type) target) (focus-test? (the-as process-focusable v1-13) flut tube board pilot)) + (and (!= (-> self fact pickup-type) 11) (not arg0)) + ) + (logior! (-> self fact options) (actor-option suck-in)) + ) + ) + (when (not arg0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 0.04)) + (suspend) + ) + ) + (case (-> self look) + (('iron) + (sound-play "icrate-break") + ) + (('steel) + (sound-play "scrate-break") + ) + (('darkeco) + (sound-play "dcrate-break") + ) + (('urn-a 'urn-b 'urn-c) + (sound-play "vase-smash") + ) + (else + (sound-play "wcrate-break") + ) + ) + (case (-> self defense) + (('darkeco) + (let ((f0-2 (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root trans) (target-pos 0)) 8192.0 40960.0))) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 f0-2)) (seconds 0.3)) + ) + (process-spawn + touch-tracker + :init touch-tracker-init + (-> self root trans) + (-> *CRATE-bank* DARKECO_EXPLODE_RADIUS) + 30 + :name "touch-tracker" + :to self + ) + ) + ) + (let ((v1-55 (-> self look))) + (cond + ((= v1-55 'darkeco) + (cond + ((logtest? (-> *part-group-id-table* 197 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-9 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-9 + (let ((t9-19 (method-of-type part-tracker-subsampler activate))) + (t9-19 (the-as part-tracker-subsampler s5-9) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-20 run-function-in-process) + (a0-41 s5-9) + (a1-20 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 197)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-20) a0-41 a1-20 *part-tracker-subsampler-params-default*) + ) + (-> s5-9 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-10 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-10 + (let ((t9-22 (method-of-type part-tracker activate))) + (t9-22 (the-as part-tracker s5-10) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-23 run-function-in-process) + (a0-47 s5-10) + (a1-23 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 197)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-23) a0-47 a1-23 *part-tracker-params-default*) + ) + (-> s5-10 ppointer) + ) + ) + ) + ) + ) + ((or (= v1-55 'steel) (= v1-55 'iron)) + (cond + ((logtest? (-> *part-group-id-table* 196 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-11 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-11 + (let ((t9-25 (method-of-type part-tracker-subsampler activate))) + (t9-25 (the-as part-tracker-subsampler s5-11) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-26 run-function-in-process) + (a0-55 s5-11) + (a1-27 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 196)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-26) a0-55 a1-27 *part-tracker-subsampler-params-default*) + ) + (-> s5-11 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-12 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-12 + (let ((t9-28 (method-of-type part-tracker activate))) + (t9-28 (the-as part-tracker s5-12) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-29 run-function-in-process) + (a0-61 s5-12) + (a1-30 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 196)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-29) a0-61 a1-30 *part-tracker-params-default*) + ) + (-> s5-12 ppointer) + ) + ) + ) + ) + ) + ((logtest? (-> *part-group-id-table* 195 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-13 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-13 + (let ((t9-31 (method-of-type part-tracker-subsampler activate))) + (t9-31 (the-as part-tracker-subsampler s5-13) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-32 run-function-in-process) + (a0-67 s5-13) + (a1-33 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 195)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-32) a0-67 a1-33 *part-tracker-subsampler-params-default*) + ) + (-> s5-13 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((s5-14 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-14 + (let ((t9-34 (method-of-type part-tracker activate))) + (t9-34 (the-as part-tracker s5-14) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-35 run-function-in-process) + (a0-73 s5-14) + (a1-36 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 195)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-35) a0-73 a1-36 *part-tracker-params-default*) + ) + (-> s5-14 ppointer) + ) + ) + ) + ) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (ja-post) + (case (-> self fact pickup-type) + (((pickup-type money) + (pickup-type buzzer) + (pickup-type eco-blue) + (pickup-type eco-yellow) + (pickup-type eco-red) + (pickup-type fuel-cell) + (pickup-type gem) + (pickup-type skill) + ) + (go-virtual special-contents-die) + ) + (((pickup-type health)) + (talker-spawn-func (-> *talker-speech* 5) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1 #t) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 5)) + (suspend) + ) + ) + (when (logtest? (actor-option cond-respawn) (-> self fact options)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 15)) + (suspend) + ) + ) + (go-virtual hide) + ) + ) + ) + +;; failed to figure out what this is: +(defstate special-contents-die (crate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (let ((gp-0 (-> self entity extra perm))) + (logior! (-> gp-0 status) (entity-perm-status bit-5)) + (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) + (+! (-> self child-count) -1) + (when (<= (-> self child-count) 0) + (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) + (process-entity-status! self (entity-perm-status bit-4) #f) + ) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (process-entity-status! self (entity-perm-status bit-15) #f) + (set! (-> gp-0 user-int8 0) 2) + (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) + (set! (-> self mask) v0-0) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) + :trans (-> (method-of-type crate die) trans) + :code (behavior () + (logior! (-> self focus-status) (focus-status dead)) + (when (or (= (-> self fact pickup-type) (pickup-type money)) + (= (-> self fact pickup-type) (pickup-type gem)) + (= (-> self fact pickup-type) (pickup-type skill)) + (= (-> self defense) 'iron) + (= (-> self defense) 'steel) + ) + (let ((a0-6 (-> self entity))) + (if (when a0-6 + (let ((a0-7 (-> a0-6 extra perm task))) + (if a0-7 + (= a0-7 (game-task none)) + ) + ) + ) + (set! (-> self entity extra perm task) (game-task complete)) + ) + ) + ) + (let ((v1-20 (-> self root root-prim))) + (set! (-> v1-20 prim-core collide-as) (collide-spec)) + (set! (-> v1-20 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (drop-pickup (-> self fact) #t self (the-as fact-info #f) 0 #t) + (set! (-> self child-count) (collectable-count self)) + (process-entity-status! self (entity-perm-status bit-4) #t) + (process-entity-status! self (entity-perm-status bit-15) #t) + (when (-> self entity) + (let ((v1-31 (-> self entity extra perm))) + (logior! (-> v1-31 status) (entity-perm-status bit-5)) + (set! (-> v1-31 user-int8 0) 1) + ) + ) + (when (-> self child) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + (while (-> self child) + (suspend) + ) + ) + ) + ) + +;; definition for function crate-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +(defbehavior crate-init-by-other crate ((arg0 entity) (arg1 vector) (arg2 symbol) (arg3 fact-info-crate)) + (process-entity-set! self arg0) + (init! self (the-as entity-actor arg0)) + (set! (-> self root trans quad) (-> arg1 quad)) + (set! (-> self look) arg2) + (set! (-> self defense) arg2) + (init-skel! self) + (when arg3 + (set! (-> self fact pickup-type) (-> arg3 pickup-type)) + (set! (-> self fact pickup-amount) (-> arg3 pickup-spawn-amount)) + (set! (-> self fact options) (-> arg3 options)) + ) + (set! (-> self draw light-index) (the-as uint 10)) + (go-initial-state self) + ) + +;; definition for method 11 of type crate +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this crate) (arg0 entity-actor)) + (init! this arg0) + (init-skel! this) + (set! (-> this draw light-index) (the-as uint 10)) + (go-initial-state this) + ) + +;; definition for method 38 of type crate +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this crate)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate notice-blue-eco-powerup)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 3072.0 0.0 (-> *CRATE-bank* COLLIDE_RADIUS)) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech + mech-punch + dark-skin + dark-punch + dark-smack + flut + knocked + ) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 36 of type crate +;; WARN: Return type mismatch crate vs none. +(defmethod init! ((this crate) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask crate)) + (init-collision! this) + (set! (-> this fact) + (new 'process 'fact-info-crate this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (when (-> this entity) + (let ((v1-12 (-> this entity extra perm))) + (set! (-> this fact pickup-amount) + (fmax 0.0 (- (-> this fact pickup-amount) (the float (-> v1-12 user-int8 1)))) + ) + ) + ) + (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (set! (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-amount) 0.0) + ) + (when arg0 + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + ) + (let ((v1-27 + ((method-of-type res-lump get-property-struct) + (-> this entity) + 'crate-type + 'interp + -1000000000.0 + (the-as structure 'wood) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! (-> this look) (the-as symbol v1-27)) + (set! (-> this defense) (the-as symbol v1-27)) + ) + (set! (-> this carry) + (new 'process 'carry-info this 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0) + ) + (set! (-> this carry max-pull) 3686.4) + (set! (-> this carry carry-radius) 3276.8) + (set! (-> this target) (the-as handle #f)) + (none) + ) + +;; definition for method 37 of type crate +;; INFO: Used lq/sq +;; WARN: Return type mismatch crate vs none. +(defmethod init-skel! ((this crate)) + (case (-> this look) + (('iron) + (set! (-> this root penetrated-by) (penetrate flop uppercut tube vehicle flut-attack board dark-skin explode)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('steel) + (set! (-> this root penetrated-by) (penetrate tube vehicle flut-attack board dark-skin explode)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('blue) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-cty-blue" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('metal) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-cty-metal" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('darkeco) + (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + ) + (('none) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this draw status) (draw-control-status no-draw)) + ) + (('urn-a) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-urn-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('urn-b) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-urn-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (('urn-c) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-urn-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (else + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + ) + (set! (-> this base quad) (-> this root trans quad)) + (crate-post) + (nav-mesh-connect-from-ent this) + (none) + ) + +;; definition for method 39 of type crate +;; WARN: Return type mismatch crate vs none. +(defmethod params-set! ((this crate) (arg0 symbol) (arg1 symbol)) + (if arg0 + (set! (-> this look) arg0) + ) + (if arg1 + (set! (-> this defense) arg1) + ) + (none) + ) + +;; definition for method 40 of type crate +;; WARN: Return type mismatch int vs none. +(defmethod go-initial-state ((this crate)) + (if (-> *setting-control* user-current hide-crates?) + (go (method-of-object this hide)) + ) + (when (-> this entity) + (if (and (>= (-> this entity extra perm user-int8 0) 1) + (-> this entity) + (logtest? (-> this entity extra perm status) (entity-perm-status bit-15)) + ) + (go (method-of-object this die) #t 0) + ) + ) + (cond + ((logtest? (actor-option cond-hide) (-> this fact options)) + (go (method-of-object this hide)) + ) + ((logtest? (actor-option fall) (-> this fact options)) + (go (method-of-object this fall)) + ) + (else + (go (method-of-object this idle)) + ) + ) + 0 + (none) + ) + +;; definition for method 41 of type crate +;; WARN: Return type mismatch int vs none. +(defmethod smush-update! ((this crate)) + (let ((f0-0 (update! (-> this smush)))) + (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale y) (+ 1.0 f0-0)) + (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) + ) + 0 + (none) + ) + +;; definition for method 42 of type crate +;; WARN: disable def twice: 62. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod should-hide? ((this crate)) + (with-pp + (cond + ((or (and (> (-> this fact suck-count) 0) (< (you-suck-stage *game-info* #f 0) (-> this fact suck-count))) + (-> *setting-control* user-current hide-crates?) + ) + #t + ) + ((logtest? (actor-option cond-low-ammo) (-> this fact options)) + (case (-> this fact pickup-type) + (((pickup-type ammo-yellow) (pickup-type ammo-red) (pickup-type ammo-blue) (pickup-type ammo-dark)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer pp)) + (set! (-> a1-4 num-params) 1) + (set! (-> a1-4 message) 'test-pickup) + (set! (-> a1-4 param 0) (the-as uint (-> this fact pickup-type))) + (let ((v1-17 (the-as float (send-event-function *target* a1-4)))) + (or (not v1-17) (< 10.0 v1-17)) + ) + ) + ) + (else + #f + ) + ) + ) + (else + #f + ) + ) + ) + ) + +;; definition of type pickup-spawner +(deftype pickup-spawner (crate) + ((blocker entity-actor) + ) + ) + +;; definition for method 3 of type pickup-spawner +(defmethod inspect ((this pickup-spawner)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type crate inspect))) + (t9-0 this) + ) + (format #t "~2Tblocker: ~A~%" (-> this blocker)) + (label cfg-4) + this + ) + +;; definition for method 36 of type pickup-spawner +;; WARN: Return type mismatch pickup-spawner vs none. +(defmethod init! ((this pickup-spawner) (arg0 entity-actor)) + (let ((t9-0 (method-of-type crate init!))) + (t9-0 this arg0) + ) + (set! (-> this look) 'none) + (set! (-> this blocker) #f) + (if (logtest? (-> this fact options) (actor-option blocked)) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + ) + (none) + ) + +;; definition for method 40 of type pickup-spawner +;; WARN: Return type mismatch int vs none. +(defmethod go-initial-state ((this pickup-spawner)) + (go (method-of-object this idle)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (pickup-spawner) + :virtual #t + :code (behavior () + (until #f + (if (or (not (-> self blocker)) + (logtest? (-> self blocker extra perm status) (entity-perm-status subtask-complete)) + ) + (go-virtual die #t 0) + ) + (suspend) + ) + #f + ) + ) + +;; definition of type urn-a +(deftype urn-a (crate) + () + ) + +;; definition for method 3 of type urn-a +(defmethod inspect ((this urn-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type crate inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 36 of type urn-a +;; WARN: Return type mismatch urn-a vs none. +(defmethod init! ((this urn-a) (arg0 entity-actor)) + (let ((t9-0 (method-of-type crate init!))) + (t9-0 this arg0) + ) + (set! (-> this look) 'urn-a) + (none) + ) + +;; definition of type urn-b +(deftype urn-b (crate) + () + ) + +;; definition for method 3 of type urn-b +(defmethod inspect ((this urn-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type crate inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 36 of type urn-b +;; WARN: Return type mismatch urn-b vs none. +(defmethod init! ((this urn-b) (arg0 entity-actor)) + (let ((t9-0 (method-of-type crate init!))) + (t9-0 this arg0) + ) + (set! (-> this look) 'urn-b) + (none) + ) + +;; definition of type urn-c +(deftype urn-c (crate) + () + ) + +;; definition for method 3 of type urn-c +(defmethod inspect ((this urn-c)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type crate inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 36 of type urn-c +;; WARN: Return type mismatch urn-c vs none. +(defmethod init! ((this urn-c) (arg0 entity-actor)) + (let ((t9-0 (method-of-type crate init!))) + (t9-0 this arg0) + ) + (set! (-> this look) 'urn-c) + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/curves_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/curves_REF.gc new file mode 100644 index 00000000000..604de322c41 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/curves_REF.gc @@ -0,0 +1,663 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type float-pair +(deftype float-pair (structure) + ((first float) + (second float) + (x float :overlay-at first) + (y float :overlay-at second) + ) + ) + +;; definition for method 3 of type float-pair +(defmethod inspect ((this float-pair)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'float-pair) + (format #t "~1Tfirst: ~f~%" (-> this first)) + (format #t "~1Tsecond: ~f~%" (-> this second)) + (format #t "~1Tx: ~f~%" (-> this first)) + (format #t "~1Ty: ~f~%" (-> this second)) + (label cfg-4) + this + ) + +;; definition of type float-pair-array +(deftype float-pair-array (inline-array-class) + ((data float-pair :inline :dynamic) + ) + ) + +;; definition for method 3 of type float-pair-array +(defmethod inspect ((this float-pair-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> float-pair-array heap-base) (the-as uint 16)) + +;; definition of type curve2d +(deftype curve2d (basic) + () + (:methods + (curve2d-method-9 (_type_ float int) float) + ) + ) + +;; definition for method 3 of type curve2d +(defmethod inspect ((this curve2d)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (label cfg-4) + this + ) + +;; definition of type curve-color +(deftype curve-color (basic) + () + (:methods + (curve-color-method-9 (_type_ float rgbaf int) rgbaf) + ) + ) + +;; definition for method 3 of type curve-color +(defmethod inspect ((this curve-color)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (label cfg-4) + this + ) + +;; definition of type curve2d-piecewise +(deftype curve2d-piecewise (curve2d) + ((pts float-pair-array) + (default-loop-behavior uint64) + ) + (:methods + (curve2d-piecewise-method-10 (_type_ int symbol uint) none) + (curve2d-piecewise-method-11 (_type_) none) + ) + ) + +;; definition for method 3 of type curve2d-piecewise +(defmethod inspect ((this curve2d-piecewise)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tpts: ~A~%" (-> this pts)) + (format #t "~1Tdefault-loop-behavior: ~D~%" (-> this default-loop-behavior)) + (label cfg-4) + this + ) + +;; definition of type curve2d-fast +(deftype curve2d-fast (curve2d) + ((xs vector :inline) + (ys vector :inline) + (one-over-x-deltas vector :inline) + ) + ) + +;; definition for method 3 of type curve2d-fast +(defmethod inspect ((this curve2d-fast)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Txs: #~%" (-> this xs)) + (format #t "~1Tys: #~%" (-> this ys)) + (format #t "~1Tone-over-x-deltas: #~%" (-> this one-over-x-deltas)) + (label cfg-4) + this + ) + +;; definition for function rgbaf-lerp! +(defun rgbaf-lerp! ((arg0 rgbaf) (arg1 rgbaf) (arg2 rgbaf) (arg3 float)) + (vector-lerp! arg0 arg1 arg2 arg3) + (set! (-> arg0 w) (lerp (-> arg1 w) (-> arg2 w) arg3)) + arg0 + ) + +;; definition of type curve-color-fast +(deftype curve-color-fast (curve-color) + ((xs vector :inline) + (ys vector 4 :inline) + (one-over-x-deltas vector :inline) + ) + ) + +;; definition for method 3 of type curve-color-fast +(defmethod inspect ((this curve-color-fast)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Txs: #~%" (-> this xs)) + (format #t "~1Tys[4] @ #x~X~%" (-> this ys)) + (format #t "~1Tone-over-x-deltas: #~%" (-> this one-over-x-deltas)) + (label cfg-4) + this + ) + +;; definition of type color-pair +(deftype color-pair (structure) + ((first float) + (second rgbaf :inline) + (x float :overlay-at first) + (y rgbaf :inline :overlay-at second) + ) + ) + +;; definition for method 3 of type color-pair +(defmethod inspect ((this color-pair)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'color-pair) + (format #t "~1Tfirst: ~f~%" (-> this first)) + (format #t "~1Tsecond: #~%" (-> this second)) + (format #t "~1Tx: ~f~%" (-> this first)) + (format #t "~1Ty: #~%" (-> this second)) + (label cfg-4) + this + ) + +;; definition of type color-pair-array +(deftype color-pair-array (inline-array-class) + ((data color-pair :inline :dynamic) + ) + ) + +;; definition for method 3 of type color-pair-array +(defmethod inspect ((this color-pair-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> color-pair-array heap-base) (the-as uint 32)) + +;; definition of type curve-color-piecewise +(deftype curve-color-piecewise (curve-color) + ((pts color-pair-array) + (default-loop-behavior uint64) + ) + (:methods + (curve-color-piecewise-method-10 (_type_ int symbol uint) none) + ) + ) + +;; definition for method 3 of type curve-color-piecewise +(defmethod inspect ((this curve-color-piecewise)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tpts: ~A~%" (-> this pts)) + (format #t "~1Tdefault-loop-behavior: ~D~%" (-> this default-loop-behavior)) + (label cfg-4) + this + ) + +;; definition for method 10 of type curve2d-piecewise +;; WARN: Return type mismatch int vs none. +(defmethod curve2d-piecewise-method-10 ((this curve2d-piecewise) (arg0 int) (arg1 symbol) (arg2 uint)) + (set! (-> this pts) ((method-of-type float-pair-array new) arg1 float-pair-array arg0)) + (set! (-> this default-loop-behavior) (the-as uint (if arg2 + 0 + 1 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type curve-color-piecewise +;; WARN: Return type mismatch int vs none. +(defmethod curve-color-piecewise-method-10 ((this curve-color-piecewise) (arg0 int) (arg1 symbol) (arg2 uint)) + (set! (-> this pts) ((method-of-type color-pair-array new) arg1 color-pair-array arg0)) + (set! (-> this default-loop-behavior) (the-as uint (if arg2 + 0 + 1 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type curve-color-piecewise +;; INFO: Used lq/sq +(defmethod curve-color-method-9 ((this curve-color-piecewise) (arg0 float) (arg1 rgbaf) (arg2 int)) + (when (or (< 1.0 arg0) (< arg0 0.0)) + (if (= arg2 3) + (set! arg2 (the-as int (-> this default-loop-behavior))) + ) + (let ((v1-8 arg2)) + (cond + ((zero? v1-8) + (set! arg0 (- arg0 (* (the float (the int (/ arg0 1.0))) 1.0))) + ) + ((= v1-8 1) + (set! arg0 (fmax 0.0 (fmin 1.0 arg0))) + ) + ) + ) + ) + (when (= arg0 0.0) + (set! (-> arg1 quad) (-> this pts data 0 second quad)) + (return arg1) + ) + (dotimes (s4-0 (-> this pts length)) + (when (>= (-> this pts data s4-0 first) arg0) + (let ((a3-4 (lerp-scale 0.0 1.0 arg0 (-> this pts data (+ s4-0 -1) first) (-> this pts data s4-0 first)))) + (return (rgbaf-lerp! + arg1 + (the-as rgbaf (+ (the-as uint (-> this pts data 0 second)) (* (+ s4-0 -1) 32))) + (the-as rgbaf (+ (the-as uint (-> this pts data 0 second)) (* s4-0 32))) + a3-4 + ) + ) + ) + ) + ) + (the-as rgbaf #f) + ) + +;; definition for method 9 of type curve2d-piecewise +(defmethod curve2d-method-9 ((this curve2d-piecewise) (arg0 float) (arg1 int)) + (when (or (< 1.0 arg0) (< arg0 0.0)) + (if (= arg1 3) + (set! arg1 (the-as int (-> this default-loop-behavior))) + ) + (let ((v1-8 arg1)) + (cond + ((zero? v1-8) + (set! arg0 (- arg0 (* (the float (the int (/ arg0 1.0))) 1.0))) + ) + ((= v1-8 1) + (set! arg0 (fmax 0.0 (fmin 1.0 arg0))) + ) + ) + ) + ) + (if (= arg0 0.0) + (return (-> this pts data 0 second)) + ) + (dotimes (v1-18 (-> this pts length)) + (if (>= (-> this pts data v1-18 first) arg0) + (return (lerp-scale + (-> this pts data (+ v1-18 -1) second) + (-> this pts data v1-18 second) + arg0 + (-> this pts data (+ v1-18 -1) first) + (-> this pts data v1-18 first) + ) + ) + ) + ) + 0.0 + ) + +;; definition for function evaluate-curve-fast +;; WARN: Return type mismatch number vs float. +(defun evaluate-curve-fast ((arg0 curve2d-fast) (arg1 rgbaf) (arg2 rgbaf)) + (local-vars (v0-0 number)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + ) + (init-vf0-vector) + (let ((a2-1 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (.mov vf27 arg1) + (.lvf vf24 (&-> arg0 xs quad)) + (.lvf vf25 (&-> arg0 ys quad)) + (.lvf vf26 (&-> arg0 one-over-x-deltas quad)) + (.min.w.vf vf27 vf27 vf0) + (.max.x.vf vf27 vf27 vf0) + (.add.x.vf vf28 vf24 vf27) + (.mul.w.vf acc vf25 vf0) + (.add.mul.vf vf29 vf28 vf26 acc) + (.svf (&-> a2-1 quad) vf28) + (.svf (&-> v1-0 quad) vf29) + (let ((a0-1 (-> a2-1 z)) + (a1-1 (-> a2-1 y)) + ) + (nop!) + (b! (>= (the-as int a0-1) 0) cfg-3 :delay (set! v0-0 (-> v1-0 z))) + (b! (>= (the-as int a1-1) 0) cfg-3 :delay (set! v0-0 (-> v1-0 y))) + ) + (set! v0-0 (-> v1-0 x)) + ) + (label cfg-3) + (the-as float v0-0) + ) + ) + +;; definition for method 9 of type curve2d-fast +;; WARN: Return type mismatch number vs float. +(defmethod curve2d-method-9 ((this curve2d-fast) (arg0 float) (arg1 int)) + (local-vars (v0-0 number)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + ) + (init-vf0-vector) + (let ((a1-1 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (let ((a2-1 arg0)) + (.mov vf27 a2-1) + ) + (.lvf vf24 (&-> this xs quad)) + (.lvf vf25 (&-> this ys quad)) + (.lvf vf26 (&-> this one-over-x-deltas quad)) + (.min.w.vf vf27 vf27 vf0) + (.max.x.vf vf27 vf27 vf0) + (.add.x.vf vf28 vf24 vf27) + (.mul.w.vf acc vf25 vf0) + (.add.mul.vf vf29 vf28 vf26 acc) + (.svf (&-> a1-1 quad) vf28) + (.svf (&-> v1-0 quad) vf29) + (let ((a0-1 (-> a1-1 z)) + (a1-2 (-> a1-1 y)) + ) + (nop!) + (b! (>= (the-as int a0-1) 0) cfg-3 :delay (set! v0-0 (-> v1-0 z))) + (b! (>= (the-as int a1-2) 0) cfg-3 :delay (set! v0-0 (-> v1-0 y))) + ) + (set! v0-0 (-> v1-0 x)) + ) + (label cfg-3) + (the-as float v0-0) + ) + ) + +;; definition for function evaluate-color-curve-fast +(defun evaluate-color-curve-fast ((arg0 curve-color-fast) (arg1 rgbaf) (arg2 rgbaf)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf23 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf28 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (.mov vf26 arg1) + (.lvf vf23 (&-> arg0 xs quad)) + (.lvf vf25 (&-> arg0 one-over-x-deltas quad)) + (.max.w.vf vf3 vf0 vf0) + (.mul.vf acc vf25 vf23) + (.add.mul.x.vf vf28 vf25 vf26 acc) + (.svf (&-> v1-0 quad) vf28) + (let ((a1-1 (-> v1-0 z)) + (v1-1 (-> v1-0 y)) + ) + (b! (>= (the-as int a1-1) 0) cfg-4 :delay (nop!)) + (b! (>= (the-as int v1-1) 0) cfg-3 :delay (nop!)) + ) + ) + (.lvf vf1 (&-> arg0 ys 0 quad)) + (.lvf vf2 (&-> arg0 ys 1 quad)) + (.sub.x.vf vf4 vf3 vf28) + (.mul.x.vf acc vf2 vf28) + (.add.mul.x.vf vf5 vf1 vf4 acc) + (b! #t cfg-5 :delay (.svf (&-> arg2 quad) vf5)) + (label cfg-3) + (.lvf vf1 (&-> arg0 ys 1 quad)) + (.lvf vf2 (&-> arg0 ys 2 quad)) + (.sub.y.vf vf4 vf3 vf28) + (.mul.y.vf acc vf2 vf28) + (.add.mul.y.vf vf5 vf1 vf4 acc) + (b! #t cfg-5 :delay (.svf (&-> arg2 quad) vf5)) + (label cfg-4) + (.lvf vf1 (&-> arg0 ys 2 quad)) + (.lvf vf2 (&-> arg0 ys 3 quad)) + (.sub.z.vf vf4 vf3 vf28) + (.mul.z.vf acc vf2 vf28) + (.add.mul.z.vf vf5 vf1 vf4 acc) + (.svf (&-> arg2 quad) vf5) + (label cfg-5) + arg2 + ) + ) + +;; definition for method 9 of type curve-color-fast +(defmethod curve-color-method-9 ((this curve-color-fast) (arg0 float) (arg1 rgbaf) (arg2 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf23 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf28 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 this) + (f0-0 arg0) + (a0-1 arg1) + ) + (let ((a1-1 (new 'stack-no-clear 'rgbaf))) + (let ((a3-1 f0-0)) + (.mov vf26 a3-1) + ) + (.lvf vf23 (&-> v1-0 xs quad)) + (.lvf vf25 (&-> v1-0 one-over-x-deltas quad)) + (.max.w.vf vf3 vf0 vf0) + (.mul.vf acc vf25 vf23) + (.add.mul.x.vf vf28 vf25 vf26 acc) + (.svf (&-> a1-1 quad) vf28) + (let ((a3-2 (-> a1-1 z)) + (a1-2 (-> a1-1 y)) + ) + (b! (>= (the-as int a3-2) 0) cfg-4 :delay (nop!)) + (b! (>= (the-as int a1-2) 0) cfg-3 :delay (nop!)) + ) + ) + (.lvf vf1 (&-> v1-0 ys 0 quad)) + (.lvf vf2 (&-> v1-0 ys 1 quad)) + (.sub.x.vf vf4 vf3 vf28) + (.mul.x.vf acc vf2 vf28) + (.add.mul.x.vf vf5 vf1 vf4 acc) + (b! #t cfg-5 :delay (.svf (&-> a0-1 quad) vf5)) + (label cfg-3) + (.lvf vf1 (&-> v1-0 ys 1 quad)) + (.lvf vf2 (&-> v1-0 ys 2 quad)) + (.sub.y.vf vf4 vf3 vf28) + (.mul.y.vf acc vf2 vf28) + (.add.mul.y.vf vf5 vf1 vf4 acc) + (b! #t cfg-5 :delay (.svf (&-> a0-1 quad) vf5)) + (label cfg-4) + (.lvf vf1 (&-> v1-0 ys 2 quad)) + (.lvf vf2 (&-> v1-0 ys 3 quad)) + (.sub.z.vf vf4 vf3 vf28) + (.mul.z.vf acc vf2 vf28) + (.add.mul.z.vf vf5 vf1 vf4 acc) + (.svf (&-> a0-1 quad) vf5) + ) + (label cfg-5) + (set! (-> arg1 w) 1.0) + arg1 + ) + ) + +;; definition for function rgba<-rgbaf +;; WARN: Return type mismatch rgba vs int. +(defun rgba<-rgbaf ((arg0 rgba) (arg1 rgbaf)) + (the-as int (copy-and-set-field + (copy-and-set-field + (copy-and-set-field + (copy-and-set-field arg0 r (the int (* 128.0 (-> arg1 x)))) + g + (the int (* 128.0 (-> arg1 y))) + ) + b + (the int (* 128.0 (-> arg1 z))) + ) + a + (the int (* 128.0 (-> arg1 w))) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-unity* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-linear-up* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-linear-down* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x -1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(when (or (zero? *curve-linear-up-hold*) (!= loading-level global)) + (set! *curve-linear-up-hold* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *curve-linear-up-hold* 2 'loading-level (the-as uint #f)) + ) + +;; failed to figure out what this is: +(set! (-> *curve-linear-up-hold* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-linear-up-hold* pts data 0 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-linear-up-hold* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-linear-up-hold* pts data 1 second) 1.0) + +;; failed to figure out what this is: +(if #t + (set! *curve-linear-up-down* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y -2.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *trail-color-curve-white* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! particle-color-curve-white* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *trail-color-curve-red* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 0.3 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.25 :z 1.0 :w 1.0) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/common-obs/gem-pool_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/gem-pool_REF.gc new file mode 100644 index 00000000000..fb41be22428 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/gem-pool_REF.gc @@ -0,0 +1,89 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function get-gem-pool-size +(defun get-gem-pool-size ((arg0 int)) + (case arg0 + ((1) + (cond + ((task-node-closed? (game-task-node city-power-game-resolution)) + 1000.0 + ) + ((task-node-closed? (game-task-node city-port-assault-resolution)) + 120.0 + ) + ((task-node-closed? (game-task-node city-port-assault-introduction)) + 90.0 + ) + (else + 60.0 + ) + ) + ) + ((2) + 10.0 + ) + (else + 0.0 + ) + ) + ) + +;; definition for function compare-gems +(defun compare-gems ((arg0 int) (arg1 (pointer float))) + (< (-> arg1 0) (get-gem-pool-size arg0)) + ) + +;; definition for function gems-available? +(defun gems-available? ((arg0 int)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + #t + ) + ((= v1-0 1) + (let ((a1-1 (task-perm-by-index *game-info* 6))) + (compare-gems arg0 (the-as (pointer float) a1-1)) + ) + ) + ((= v1-0 2) + (let ((a1-3 (task-perm-by-index *game-info* 41))) + (compare-gems arg0 (the-as (pointer float) a1-3)) + ) + ) + (else + #f + ) + ) + ) + ) + +;; definition for function notify-gem-pickup +(defun notify-gem-pickup ((arg0 uint)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + #f + ) + ((= v1-0 1) + (let ((v1-2 (task-perm-by-index *game-info* 6))) + (logior! (-> v1-2 status) (entity-perm-status bit-5)) + (set! (-> v1-2 user-object 0) (+ 1.0 (the-as float (-> v1-2 user-object 0)))) + (logior! (-> v1-2 status) (entity-perm-status bit-14)) + ) + #t + ) + ((= v1-0 2) + (let ((v1-4 (task-perm-by-index *game-info* 41))) + (logior! (-> v1-4 status) (entity-perm-status bit-5)) + (set! (-> v1-4 user-object 0) (+ 1.0 (the-as float (-> v1-4 user-object 0)))) + (logior! (-> v1-4 status) (entity-perm-status bit-14)) + ) + #t + ) + (else + #f + ) + ) + ) + ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc index 9228368549a..5bb1d013812 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc @@ -18,7 +18,7 @@ (new-post-hook (function none)) (cur-post-hook (function none)) (clone-copy-trans symbol) - (shadow-backup basic) + (shadow-backup shadow-geo) (draw? symbol) (userdata uint64) (prefix basic) @@ -72,9 +72,9 @@ "A process that spawns a specified particle group." ((root trsqv) (part sparticle-launch-control) - (path basic) + (path path-control) (sound ambient-sound) - (sound-extra basic) + (sound-extra ambient-sound) (mode (pointer sparticle-launch-group)) (enable symbol) (path-pos float) @@ -87,7 +87,7 @@ active ) (:methods - (part-spawner-method-15 () none) + (is-in-view? (_type_) symbol) ) ) @@ -134,11 +134,13 @@ (target handle) (target-joint int32) ) + (:state-methods + active + linger + die + ) (:methods - (part-tracker-method-14 () none) - (part-tracker-method-15 () none) - (part-tracker-method-16 () none) - (part-tracker-method-17 () none) + (notify-parent-of-death (_type_) none) ) ) @@ -176,8 +178,8 @@ (duration time-frame) (group sparticle-launch-group) (callback (function part-tracker vector)) - (target basic) - (mat-joint basic) + (target process-drawable) + (mat-joint object) ) ) @@ -204,8 +206,8 @@ (duration time-frame) (group sparticle-launch-group) (callback (function part-tracker vector)) - (target basic) - (mat-joint basic) + (target process-drawable) + (mat-joint object) (subsample-num float) ) ) @@ -230,7 +232,7 @@ ;; definition of type part-tracker-subsampler (deftype part-tracker-subsampler (part-tracker) - ((subsampler basic) + ((subsampler sparticle-subsampler) ) ) @@ -267,10 +269,12 @@ (user-vector vector :inline) (user-handle handle 2 :offset 288) ) + (:state-methods + active + ) (:methods - (lightning-tracker-method-14 () none) - (lightning-tracker-method-15 () none) - (lightning-tracker-method-16 () none) + (notify-parent-of-death (_type_) none) + (update (_type_) none) ) ) @@ -310,10 +314,10 @@ (event symbol) (run-function (function object)) (callback (function touch-tracker none)) - (event-mode basic) + (event-mode symbol) ) - (:methods - (touch-tracker-method-20 () none) + (:state-methods + active ) ) @@ -345,12 +349,14 @@ (dir vector :inline) (sync sync-eased :inline) ) + (:state-methods + idle + (active handle) + ) (:methods - (swingpole-method-20 () none) - (swingpole-method-21 () none) - (swingpole-method-22 () none) - (swingpole-method-23 () none) - (swingpole-method-24 () none) + (swingpole-method-22 (_type_) none) + (init-collision! (_type_) none) + (get-trans (_type_) vector) ) ) @@ -464,7 +470,7 @@ (damage-scale float) (vehicle-damage-factor float) (vehicle-impulse-factor float) - (ignore-proc uint64) + (ignore-proc handle) ) ) @@ -499,10 +505,12 @@ (mat matrix :inline) (params explosion-init-params :inline) ) + (:state-methods + explode + ) (:methods - (explosion-method-20 () none) (explosion-method-21 () none) - (explosion-method-22 () none) + (explosion-method-22 (_type_) none) ) ) @@ -677,13 +685,15 @@ (deftype simple-prim (process-drawable) ((strip prim-strip) ) + (:state-methods + active + ) (:methods - (simple-prim-method-20 () none) - (simple-prim-method-21 () none) - (simple-prim-method-22 () none) - (simple-prim-method-23 () none) - (simple-prim-method-24 () none) - (simple-prim-method-25 () none) + (init-strip! (_type_) none) + (strip-setup (_type_) none) + (get-alpha (_type_) int) + (allocate-trans-and-strip! (_type_) prim-strip) + (get-color (_type_) rgba) ) ) @@ -701,14 +711,14 @@ this ) -;; definition for symbol *simple-prim-additive*, type int -(define *simple-prim-additive* 72) +;; definition for symbol *simple-prim-additive*, type gs-alpha +(define *simple-prim-additive* (new 'static 'gs-alpha :b #x2 :d #x1)) -;; definition for symbol *simple-prim-alpha-blend*, type int -(define *simple-prim-alpha-blend* 68) +;; definition for symbol *simple-prim-alpha-blend*, type gs-alpha +(define *simple-prim-alpha-blend* (new 'static 'gs-alpha :b #x1 :d #x1)) -;; definition for symbol *simple-prim-subtractive*, type int -(define *simple-prim-subtractive* 66) +;; definition for symbol *simple-prim-subtractive*, type gs-alpha +(define *simple-prim-subtractive* (new 'static 'gs-alpha :a #x2 :d #x1)) ;; definition of type task-arrow-params (deftype task-arrow-params (structure) @@ -739,8 +749,8 @@ ((pause-time time-frame) (blur symbol) ) - (:methods - (external-camera-controller-method-14 () none) + (:state-methods + active ) ) @@ -761,7 +771,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc new file mode 100644 index 00000000000..56949d23776 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc @@ -0,0 +1,4772 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *part-tracker-params-default*, type part-tracker-init-params +(define *part-tracker-params-default* (new 'static 'part-tracker-init-params)) + +;; definition for symbol *part-tracker-subsampler-params-default*, type part-tracker-subsampler-init-params +(define *part-tracker-subsampler-params-default* (new 'static 'part-tracker-subsampler-init-params)) + +;; failed to figure out what this is: +(defskelgroup skel-spotlight spotlight spotlight-lod0-jg -1 + ((spotlight-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :shadow-joint-index 5 + ) + +;; definition for function entity-lookup-part-group +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs (pointer sparticle-launch-group). +(defun entity-lookup-part-group ((arg0 entity-actor) (arg1 (pointer string)) (arg2 symbol)) + (local-vars (sv-16 res-tag)) + (let ((gp-0 (the-as object #f))) + (set! sv-16 (new 'static 'res-tag)) + (let ((s4-0 (res-lump-data arg0 arg2 pointer :tag-ptr (& sv-16)))) + (if (not s4-0) + (go process-drawable-art-error (the-as string #f)) + ) + (let ((s3-0 (the-as object (-> (the-as (pointer uint32) s4-0))))) + (cond + ((part-group-pointer? (the-as pointer s3-0)) + (set! gp-0 (-> (the-as (pointer uint32) s4-0))) + ) + ((= (-> (the-as string s3-0) type) string) + (if arg1 + (set! (-> arg1 0) (the-as string s3-0)) + ) + (set! gp-0 (lookup-part-group-pointer-by-name (the-as string s3-0))) + (if (the-as (pointer object) gp-0) + (set! (-> (the-as (pointer int32) s4-0)) (the-as int gp-0)) + ) + ) + (else + (go process-drawable-art-error (the-as string s3-0)) + ) + ) + ) + ) + (the-as (pointer sparticle-launch-group) gp-0) + ) + ) + +;; definition for function clone-anim-once +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior clone-anim-once process-drawable ((arg0 handle) (arg1 symbol) (arg2 string)) + (logclear! (-> self skel status) (joint-control-status valid-spooled-frame)) + (let ((gp-0 (handle->process arg0))) + (if gp-0 + (joint-control-copy! (-> self skel) (-> (the-as process-drawable gp-0) skel)) + ) + (cond + ((and gp-0 (joint-control-remap! + (-> self skel) + (-> self draw art-group) + (-> (the-as process-drawable gp-0) draw art-group) + '() + 0 + arg2 + ) + ) + (when arg1 + (let* ((s5-1 (-> self root)) + (a0-7 (if (type? s5-1 collide-shape) + s5-1 + ) + ) + ) + (if a0-7 + (move-to-point! (the-as collide-shape a0-7) (-> (the-as process-drawable gp-0) root trans)) + (set! (-> self root trans quad) (-> (the-as process-drawable gp-0) root trans quad)) + ) + ) + (quaternion-copy! (-> self root quat) (-> (the-as process-drawable gp-0) root quat)) + ) + (if (logtest? (-> (the-as process-drawable gp-0) skel status) (joint-control-status valid-spooled-frame)) + (logior! (-> self skel status) (joint-control-status valid-spooled-frame)) + ) + (logclear! (-> self draw status) (draw-control-status no-draw no-draw-temp uninited)) + (if (or (zero? (-> self skel active-channels)) (not (-> self skel root-channel 0 frame-group))) + (logior! (-> self draw status) (draw-control-status no-draw-temp)) + ) + (let* ((gp-1 self) + (v1-38 (if (type? gp-1 manipy) + gp-1 + ) + ) + ) + (if (and v1-38 (not (-> (the-as manipy v1-38) draw?))) + (logior! (-> self draw status) (draw-control-status no-draw-temp)) + ) + ) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + (let ((a0-22 (-> self skel effect))) + (if a0-22 + (effect-control-method-9 a0-22) + ) + ) + (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) + (merc-blend-shape self) + ) + (if (logtest? (-> self skel status) (joint-control-status eye-anim-valid eye-anim)) + (merc-eye-anim self) + ) + (cloth-post) + ) + (else + (set! (-> self skel active-channels) (the-as uint 0)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (ja-post) + ) + ) + ) + 0 + (none) + ) + +;; definition for function clone-anim +;; WARN: Return type mismatch int vs none. +(defbehavior clone-anim process-drawable ((arg0 handle) (arg1 symbol) (arg2 string)) + (ja-post) + (while (handle->process arg0) + (clone-anim-once arg0 #t arg2) + (suspend) + ) + (logclear! (-> self skel status) (joint-control-status valid-spooled-frame)) + 0 + (none) + ) + +;; definition for method 22 of type swingpole +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod swingpole-method-22 ((this swingpole)) + (with-pp + (if (nonzero? (-> this draw)) + (ja-post) + ) + (cond + ((nonzero? (-> this path)) + (set! (-> this path-pos) (get-norm! (-> this sync) 0)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (get-point-at-percent-along-path! (-> this path) s5-0 (-> this path-pos) 'interp) + (set! (-> this speed) (* (vector-vector-distance s5-0 (-> this root trans)) (-> pp clock frames-per-second))) + (move-to-point! (the-as collide-shape (-> this root)) s5-0) + ) + ) + ((>= (-> this joint-track) 0) + (let ((v1-15 (ppointer->process (-> this parent))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (let ((s4-0 (-> (the-as process-drawable v1-15) node-list data (-> this joint-track)))) + (vector<-cspace! s5-1 s4-0) + (vector-normalize-copy! (-> this dir) (the-as vector (-> s4-0 bone transform)) 1.0) + ) + (move-to-point! (the-as collide-shape (-> this root)) s5-1) + ) + ) + ) + (when (nonzero? (-> this sound)) + (set! (-> this sound trans quad) (-> this root trans quad)) + (let ((f30-0 (lerp-scale -0.1 -0.05 (-> this speed) 8192.0 20480.0)) + (f0-6 (lerp-scale 0.7 1.0 (-> this speed) 8192.0 20480.0)) + ) + (set! (-> this sound pitch) (the int (* 1524.0 f30-0))) + (set! (-> this sound volume) (the int (* 1024.0 f0-6))) + ) + (update! (-> this sound)) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (swingpole) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (if (send-event proc 'pole-grab (-> block param 0)) + (go-virtual active (process->handle proc)) + ) + #f + ) + ) + ) + :code (behavior () + (if (nonzero? (-> self draw)) + (ja-post) + ) + (update-transforms (the-as collide-shape (-> self root))) + (cond + ((or (nonzero? (-> self path)) (>= (-> self joint-track) 0)) + (until #f + (swingpole-method-22 self) + (suspend) + ) + #f + ) + (else + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (swingpole) + :virtual #t + :code (behavior ((arg0 handle)) + (swingpole-method-22 self) + (suspend) + (while (let* ((s5-0 (handle->process arg0)) + (a0-7 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (and a0-7 (focus-test? (the-as process-focusable a0-7) pole)) + ) + (swingpole-method-22 self) + (suspend) + ) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.5)) + (swingpole-method-22 self) + (suspend) + ) + ) + (go-virtual idle) + ) + ) + +;; definition for method 24 of type swingpole +(defmethod get-trans ((this swingpole)) + (-> this root trans) + ) + +;; definition for method 23 of type swingpole +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this swingpole)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type swingpole +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this swingpole) (arg0 entity-actor)) + "Copy defaults from the entity." + (stack-size-set! (-> this main-thread) 128) + (init-collision! this) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (vector-y-quaternion! (-> this dir) (-> this root quat)) + (set! (-> this joint-track) -1) + (let ((a1-5 (res-lump-struct (-> this entity) 'art-name structure))) + (if a1-5 + (initialize-skeleton-by-name this (the-as string a1-5)) + ) + ) + (set! (-> this dir y) 0.0) + (vector-normalize! (-> this dir) 1.0) + (set! (-> this edge-length) 8192.0) + (let ((s4-0 (new 'stack-no-clear 'sync-info-params))) + (let ((a0-13 (res-lump-value arg0 'options uint128 :time -1000000000.0)) + (v1-17 0) + ) + (if (not (logtest? (the-as int a0-13) 8)) + (set! v1-17 (logior v1-17 1)) + ) + (set! (-> s4-0 sync-type) 'sync-eased) + (set! (-> s4-0 sync-flags) (the-as sync-flags v1-17)) + ) + (set! (-> s4-0 period) (the-as uint 0)) + (set! (-> s4-0 entity) arg0) + (set! (-> s4-0 percent) 0.0) + (set! (-> s4-0 ease-in) 0.2) + (set! (-> s4-0 ease-out) 0.2) + (set! (-> s4-0 pause-in) 0.0) + (set! (-> s4-0 pause-out) 0.0) + (initialize! (-> this sync) s4-0) + ) + (when (nonzero? (-> this sync period)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + ) + (set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans) 0.0)) + (go (method-of-object this idle)) + ) + +;; definition for function swingpole-init +;; INFO: Used lq/sq +(defbehavior swingpole-init swingpole ((arg0 int)) + (stack-size-set! (-> self main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-4) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-7 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self joint-track) arg0) + (set-vector! (-> self dir) 0.0 0.0 1.0 1.0) + (set! (-> self edge-length) 8192.0) + (go-virtual idle) + ) + +;; failed to figure out what this is: +(defstate die (process-hidden) + :virtual #t + :code nothing + ) + +;; definition for method 11 of type process-hidden +(defmethod init-from-entity! ((this process-hidden) (arg0 entity-actor)) + "Copy defaults from the entity." + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die)) + ) + +;; definition of type target-start +(deftype target-start (process-hidden) + () + ) + +;; definition for method 3 of type target-start +(defmethod inspect ((this target-start)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) + (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) + (format #t "process-tree ") + ) + (if (= (logand s5-0 (process-mask target)) (process-mask target)) + (format #t "target ") + ) + (if (= (logand (process-mask collectable) s5-0) (process-mask collectable)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand s5-0 (process-mask sleep-code)) (process-mask sleep-code)) + (format #t "sleep-code ") + ) + (if (= (logand s5-0 (process-mask actor-pause)) (process-mask actor-pause)) + (format #t "actor-pause ") + ) + (if (= (logand (process-mask metalhead) s5-0) (shl #x8000 16)) + (format #t "metalhead ") + ) + (if (= (logand (process-mask bot) s5-0) (process-mask bot)) + (format #t "bot ") + ) + (if (= (logand (process-mask vehicle) s5-0) (process-mask vehicle)) + (format #t "vehicle ") + ) + (if (= (logand (process-mask enemy) s5-0) (process-mask enemy)) + (format #t "enemy ") + ) + (if (= (logand (process-mask entity) s5-0) (process-mask entity)) + (format #t "entity ") + ) + (if (= (logand s5-0 (process-mask heap-shrunk)) (process-mask heap-shrunk)) + (format #t "heap-shrunk ") + ) + (if (= (logand (process-mask sidekick) s5-0) (process-mask sidekick)) + (format #t "sidekick ") + ) + (if (= (logand s5-0 (process-mask going)) (process-mask going)) + (format #t "going ") + ) + (if (= (logand s5-0 (process-mask execute)) (process-mask execute)) + (format #t "execute ") + ) + (if (= (logand (process-mask civilian) s5-0) (process-mask civilian)) + (format #t "civilian ") + ) + (if (= (logand (process-mask death) s5-0) (process-mask death)) + (format #t "death ") + ) + (if (= (logand (process-mask guard) s5-0) (process-mask guard)) + (format #t "guard ") + ) + (if (= (logand s5-0 (process-mask no-kill)) (process-mask no-kill)) + (format #t "no-kill ") + ) + (if (= (logand (process-mask kg-robot) s5-0) (process-mask kg-robot)) + (format #t "kg-robot ") + ) + (if (= (logand (process-mask platform) s5-0) (process-mask platform)) + (format #t "platform ") + ) + (if (= (logand s5-0 (process-mask freeze)) (process-mask freeze)) + (format #t "freeze ") + ) + (if (= (logand s5-0 (process-mask sleep)) (process-mask sleep)) + (format #t "sleep ") + ) + (if (= (logand s5-0 (process-mask progress)) (process-mask progress)) + (format #t "progress ") + ) + (if (= (logand s5-0 (process-mask menu)) (process-mask menu)) + (format #t "menu ") + ) + (if (= (logand (process-mask camera) s5-0) (process-mask camera)) + (format #t "camera ") + ) + (if (= (logand (process-mask ambient) s5-0) (process-mask ambient)) + (format #t "ambient ") + ) + (if (= (logand s5-0 (process-mask dark-effect)) (process-mask dark-effect)) + (format #t "dark-effect ") + ) + (if (= (logand (process-mask crate) s5-0) (process-mask crate)) + (format #t "crate ") + ) + (if (= (logand s5-0 (process-mask kernel-run)) (process-mask kernel-run)) + (format #t "kernel-run ") + ) + (if (= (logand s5-0 (process-mask movie)) (process-mask movie)) + (format #t "movie ") + ) + (if (= (logand s5-0 (process-mask pause)) (process-mask pause)) + (format #t "pause ") + ) + ) + (format #t ")~%") + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tprev-state: ~A~%" (-> this prev-state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Tstate-stack: ~A~%" (-> this state-stack)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) + (label cfg-68) + this + ) + +;; definition of type camera-start +(deftype camera-start (process-hidden) + () + ) + +;; definition for method 3 of type camera-start +(defmethod inspect ((this camera-start)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) + (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) + (format #t "process-tree ") + ) + (if (= (logand s5-0 (process-mask target)) (process-mask target)) + (format #t "target ") + ) + (if (= (logand (process-mask collectable) s5-0) (process-mask collectable)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand s5-0 (process-mask sleep-code)) (process-mask sleep-code)) + (format #t "sleep-code ") + ) + (if (= (logand s5-0 (process-mask actor-pause)) (process-mask actor-pause)) + (format #t "actor-pause ") + ) + (if (= (logand (process-mask metalhead) s5-0) (shl #x8000 16)) + (format #t "metalhead ") + ) + (if (= (logand (process-mask bot) s5-0) (process-mask bot)) + (format #t "bot ") + ) + (if (= (logand (process-mask vehicle) s5-0) (process-mask vehicle)) + (format #t "vehicle ") + ) + (if (= (logand (process-mask enemy) s5-0) (process-mask enemy)) + (format #t "enemy ") + ) + (if (= (logand (process-mask entity) s5-0) (process-mask entity)) + (format #t "entity ") + ) + (if (= (logand s5-0 (process-mask heap-shrunk)) (process-mask heap-shrunk)) + (format #t "heap-shrunk ") + ) + (if (= (logand (process-mask sidekick) s5-0) (process-mask sidekick)) + (format #t "sidekick ") + ) + (if (= (logand s5-0 (process-mask going)) (process-mask going)) + (format #t "going ") + ) + (if (= (logand s5-0 (process-mask execute)) (process-mask execute)) + (format #t "execute ") + ) + (if (= (logand (process-mask civilian) s5-0) (process-mask civilian)) + (format #t "civilian ") + ) + (if (= (logand (process-mask death) s5-0) (process-mask death)) + (format #t "death ") + ) + (if (= (logand (process-mask guard) s5-0) (process-mask guard)) + (format #t "guard ") + ) + (if (= (logand s5-0 (process-mask no-kill)) (process-mask no-kill)) + (format #t "no-kill ") + ) + (if (= (logand (process-mask kg-robot) s5-0) (process-mask kg-robot)) + (format #t "kg-robot ") + ) + (if (= (logand (process-mask platform) s5-0) (process-mask platform)) + (format #t "platform ") + ) + (if (= (logand s5-0 (process-mask freeze)) (process-mask freeze)) + (format #t "freeze ") + ) + (if (= (logand s5-0 (process-mask sleep)) (process-mask sleep)) + (format #t "sleep ") + ) + (if (= (logand s5-0 (process-mask progress)) (process-mask progress)) + (format #t "progress ") + ) + (if (= (logand s5-0 (process-mask menu)) (process-mask menu)) + (format #t "menu ") + ) + (if (= (logand (process-mask camera) s5-0) (process-mask camera)) + (format #t "camera ") + ) + (if (= (logand (process-mask ambient) s5-0) (process-mask ambient)) + (format #t "ambient ") + ) + (if (= (logand s5-0 (process-mask dark-effect)) (process-mask dark-effect)) + (format #t "dark-effect ") + ) + (if (= (logand (process-mask crate) s5-0) (process-mask crate)) + (format #t "crate ") + ) + (if (= (logand s5-0 (process-mask kernel-run)) (process-mask kernel-run)) + (format #t "kernel-run ") + ) + (if (= (logand s5-0 (process-mask movie)) (process-mask movie)) + (format #t "movie ") + ) + (if (= (logand s5-0 (process-mask pause)) (process-mask pause)) + (format #t "pause ") + ) + ) + (format #t ")~%") + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tprev-state: ~A~%" (-> this prev-state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Tstate-stack: ~A~%" (-> this state-stack)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) + (label cfg-68) + this + ) + +;; definition of type cam-slope +(deftype cam-slope (process-hidden) + () + ) + +;; definition for method 3 of type cam-slope +(defmethod inspect ((this cam-slope)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) + (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) + (format #t "process-tree ") + ) + (if (= (logand s5-0 (process-mask target)) (process-mask target)) + (format #t "target ") + ) + (if (= (logand (process-mask collectable) s5-0) (process-mask collectable)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand s5-0 (process-mask sleep-code)) (process-mask sleep-code)) + (format #t "sleep-code ") + ) + (if (= (logand s5-0 (process-mask actor-pause)) (process-mask actor-pause)) + (format #t "actor-pause ") + ) + (if (= (logand (process-mask metalhead) s5-0) (shl #x8000 16)) + (format #t "metalhead ") + ) + (if (= (logand (process-mask bot) s5-0) (process-mask bot)) + (format #t "bot ") + ) + (if (= (logand (process-mask vehicle) s5-0) (process-mask vehicle)) + (format #t "vehicle ") + ) + (if (= (logand (process-mask enemy) s5-0) (process-mask enemy)) + (format #t "enemy ") + ) + (if (= (logand (process-mask entity) s5-0) (process-mask entity)) + (format #t "entity ") + ) + (if (= (logand s5-0 (process-mask heap-shrunk)) (process-mask heap-shrunk)) + (format #t "heap-shrunk ") + ) + (if (= (logand (process-mask sidekick) s5-0) (process-mask sidekick)) + (format #t "sidekick ") + ) + (if (= (logand s5-0 (process-mask going)) (process-mask going)) + (format #t "going ") + ) + (if (= (logand s5-0 (process-mask execute)) (process-mask execute)) + (format #t "execute ") + ) + (if (= (logand (process-mask civilian) s5-0) (process-mask civilian)) + (format #t "civilian ") + ) + (if (= (logand (process-mask death) s5-0) (process-mask death)) + (format #t "death ") + ) + (if (= (logand (process-mask guard) s5-0) (process-mask guard)) + (format #t "guard ") + ) + (if (= (logand s5-0 (process-mask no-kill)) (process-mask no-kill)) + (format #t "no-kill ") + ) + (if (= (logand (process-mask kg-robot) s5-0) (process-mask kg-robot)) + (format #t "kg-robot ") + ) + (if (= (logand (process-mask platform) s5-0) (process-mask platform)) + (format #t "platform ") + ) + (if (= (logand s5-0 (process-mask freeze)) (process-mask freeze)) + (format #t "freeze ") + ) + (if (= (logand s5-0 (process-mask sleep)) (process-mask sleep)) + (format #t "sleep ") + ) + (if (= (logand s5-0 (process-mask progress)) (process-mask progress)) + (format #t "progress ") + ) + (if (= (logand s5-0 (process-mask menu)) (process-mask menu)) + (format #t "menu ") + ) + (if (= (logand (process-mask camera) s5-0) (process-mask camera)) + (format #t "camera ") + ) + (if (= (logand (process-mask ambient) s5-0) (process-mask ambient)) + (format #t "ambient ") + ) + (if (= (logand s5-0 (process-mask dark-effect)) (process-mask dark-effect)) + (format #t "dark-effect ") + ) + (if (= (logand (process-mask crate) s5-0) (process-mask crate)) + (format #t "crate ") + ) + (if (= (logand s5-0 (process-mask kernel-run)) (process-mask kernel-run)) + (format #t "kernel-run ") + ) + (if (= (logand s5-0 (process-mask movie)) (process-mask movie)) + (format #t "movie ") + ) + (if (= (logand s5-0 (process-mask pause)) (process-mask pause)) + (format #t "pause ") + ) + ) + (format #t ")~%") + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tprev-state: ~A~%" (-> this prev-state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Tstate-stack: ~A~%" (-> this state-stack)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) + (label cfg-68) + this + ) + +;; definition for function manipy-post +;; WARN: Return type mismatch int vs none. +(defbehavior manipy-post manipy () + ((-> self cur-post-hook)) + (when (and (>= (-> self shadow-volume-joint) 0) (-> self draw shadow-ctrl)) + (let ((a2-0 (-> self node-list data (-> self shadow-volume-joint))) + (a3-0 (-> self draw shadow-ctrl)) + ) + (format *stdcon* "shadow-volume for ~A ~A~%" a2-0 a3-0) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (manipy) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (s4-0 object)) + (case message + (('blend-shape) + (when (nonzero? (-> self skel)) + (cond + ((-> block param 0) + (set! s4-0 (logior (-> self skel status) (joint-control-status blend-shape eye-anim))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + (else + (set! s4-0 (logclear (-> self skel status) (joint-control-status blend-shape eye-anim))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + ) + s4-0 + ) + ) + (('shadow) + (when (nonzero? (-> self draw)) + (cond + ((-> block param 0) + (set! s4-0 (-> self shadow-backup)) + (set! (-> self draw shadow) (the-as shadow-geo s4-0)) + s4-0 + ) + (else + (set! (-> self draw shadow) #f) + #f + ) + ) + ) + ) + (('shadow-volume) + (let ((v1-14 (the-as + joint + (get-art-by-name-method (-> self draw jgeo) (the-as string (-> block param 0)) (the-as type #f)) + ) + ) + ) + (if v1-14 + (set! (-> self shadow-volume-joint) (+ (-> v1-14 number) 1)) + ) + ) + (when (and (-> self draw shadow-ctrl) (< 1 argc) (>= (the-as int (-> block param 1)) 0)) + (let ((v0-1 (command-get-int (-> block param 1) 0))) + (set! (-> self draw shadow-ctrl settings flags) (the-as shadow-flags v0-1)) + v0-1 + ) + ) + ) + (('shadow-type) + (if (and (-> self draw shadow-ctrl) (> argc 0)) + (set! (-> self draw shadow-ctrl settings shadow-type) (command-get-int (-> block param 0) 0)) + ) + ) + (('shadow-disable-smooth) + (when (nonzero? (-> self draw)) + (cond + ((-> block param 0) + (when (-> self draw shadow-ctrl) + (set! s4-0 (logior (-> self draw shadow-ctrl settings flags) (shadow-flags shdf08))) + (set! (-> self draw shadow-ctrl settings flags) (the-as shadow-flags s4-0)) + s4-0 + ) + ) + (else + (when (-> self draw shadow-ctrl) + (set! s4-0 (logclear (-> self draw shadow-ctrl settings flags) (shadow-flags shdf08))) + (set! (-> self draw shadow-ctrl settings flags) (the-as shadow-flags s4-0)) + s4-0 + ) + ) + ) + ) + ) + (('shadow-dir) + (when (and (-> self draw shadow-ctrl) (> argc 0)) + (set! s4-0 (-> self draw shadow-ctrl settings shadow-dir)) + (set! (-> (the-as vector s4-0) x) (the-as float (-> block param 0))) + (set! (-> (the-as vector s4-0) y) (the-as float (-> block param 1))) + (set! (-> (the-as vector s4-0) z) (the-as float (-> block param 2))) + (set! (-> (the-as vector s4-0) w) (the-as float (if (< 3 argc) + (command-get-param (-> block param 3) #f) + 409600.0 + ) + ) + ) + s4-0 + ) + ) + (('shadow-top-plane) + (when (and (-> self draw shadow-ctrl) (>= argc 4)) + (set! s4-0 (-> self draw shadow-ctrl settings top-plane)) + (set! (-> (the-as plane s4-0) x) (the-as float (-> block param 0))) + (set! (-> (the-as plane s4-0) y) (the-as float (-> block param 1))) + (set! (-> (the-as plane s4-0) z) (the-as float (-> block param 2))) + (set! (-> (the-as plane s4-0) w) (the-as float (-> block param 3))) + s4-0 + ) + ) + (('shadow-bot-plane) + (when (and (-> self draw shadow-ctrl) (>= argc 4)) + (set! s4-0 (-> self draw shadow-ctrl settings bot-plane)) + (set! (-> (the-as plane s4-0) x) (the-as float (-> block param 0))) + (set! (-> (the-as plane s4-0) y) (the-as float (-> block param 1))) + (set! (-> (the-as plane s4-0) z) (the-as float (-> block param 2))) + (set! (-> (the-as plane s4-0) w) (the-as float (-> block param 3))) + s4-0 + ) + ) + (('shadow-fade-dist) + (if (-> self draw shadow-ctrl) + (set! (-> self draw shadow-ctrl settings fade-dist) (the-as float (-> block param 0))) + ) + ) + (('no-fog) + (set! s4-0 (logior (-> self draw status) (draw-control-status disable-fog))) + (set! (-> self draw status) (the-as draw-control-status s4-0)) + s4-0 + ) + (('setup-spotlight-shadow) + (when (-> self draw shadow-ctrl) + (let ((v1-80 (command-get-process "spotlight" *target*))) + (when v1-80 + (let ((s5-1 (-> (the-as process-drawable v1-80) node-list data 3))) + (vector<-cspace! (new 'stack-no-clear 'vector) s5-1) + (let ((s5-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-1 bone transform fvec) -1.0)) + (s4-1 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self draw shadow-joint-index))) + ) + (f30-0 1638400.0) + (s3-0 (new 'stack-no-clear 'collide-query)) + (f28-0 122880.0) + ) + (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) + (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) + (let ((v1-91 s3-0)) + (set! (-> v1-91 radius) 1638.4) + (set! (-> v1-91 collide-with) (collide-spec obstacle hit-by-others-list)) + (set! (-> v1-91 ignore-process0) self) + (set! (-> v1-91 ignore-process1) #f) + (set! (-> v1-91 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-91 action-mask) (collide-action solid)) + ) + (let* ((f0-14 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) + (f28-1 (if (< 0.0 f0-14) + (* f0-14 f28-0) + 122880.0 + ) + ) + ) + (shadow-control-method-14 + (-> self draw shadow-ctrl) + s4-1 + s5-2 + f30-0 + (- f28-1 (command-get-float (-> block param 0) 0.0)) + (+ f28-1 (command-get-float (-> block param 1) 0.0)) + ) + ) + ) + ) + ) + ) + ) + ) + (('color-mult) + (when (>= argc 4) + (set! s4-0 (-> self draw color-mult)) + (set! (-> (the-as rgbaf s4-0) x) (command-get-float (-> block param 0) 0.0)) + (set! (-> (the-as rgbaf s4-0) y) (command-get-float (-> block param 1) 0.0)) + (set! (-> (the-as rgbaf s4-0) z) (command-get-float (-> block param 2) 0.0)) + (set! (-> (the-as rgbaf s4-0) w) (command-get-float (-> block param 3) 0.0)) + s4-0 + ) + ) + (('color-mult-vector) + (set! s4-0 (-> self draw color-mult)) + (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + (('color-emissive-vector) + (set! s4-0 (-> self draw color-emissive)) + (set! (-> (the-as rgbaf s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + (('segment) + (let ((a1-34 (/ (the-as int (-> block param 0)) 8)) + (a2-5 (/ (the-as int (-> block param 1)) 8)) + ) + (setup-masks (-> self draw) (the-as int a1-34) (the-as int a2-5)) + ) + ) + (('trans-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self new-trans-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('post-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self new-post-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('user-data) + (set! s4-0 (-> block param 0)) + (set! (-> self userdata) (the-as uint s4-0)) + s4-0 + ) + (('eval) + ((the-as (function manipy none) (-> block param 0)) self) + ) + (('speed) + (set! (-> self speed) (the-as float (-> block param 0))) + ) + (('event-hook) + (set! s4-0 (-> block param 0)) + (set! (-> self cur-event-hook) (the-as (function none) s4-0)) + s4-0 + ) + (('art-joint-anim) + (set! (-> self new-joint-anim) + (get-art-by-name (-> self draw art-group) (the-as string (-> block param 0)) art-joint-anim) + ) + (set! (-> self new-joint-anim-blend) (the-as uint (if (>= argc 2) + (the-as int (-> block param 1)) + 0 + ) + ) + ) + (set! (-> self new-joint-anim-frame) (the-as float (if (>= argc 3) + (-> block param 2) + 0.0 + ) + ) + ) + ) + (('anim-mode) + (when (nonzero? (-> self skel)) + (set! (-> self anim-mode) (the-as symbol (-> block param 0))) + (if (= (-> self anim-mode) 'clone-anim) + (ja-post) + ) + (-> self anim-mode) + ) + ) + (('origin-joint-index 'center-joint) + (set! (-> self draw origin-joint-index) (-> block param 0)) + (set! s4-0 (-> block param 0)) + (set! (-> self draw shadow-joint-index) (the-as uint s4-0)) + s4-0 + ) + (('max-vis-dist) + (set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> block param 0))) + ) + (('grab) + (set! (-> self cur-grab-handle) (process->handle (the-as process (-> block param 0)))) + (let ((v1-127 (handle->process (-> self cur-grab-handle)))) + (when v1-127 + (set! s4-0 (-> self old-grab-pos)) + (set! (-> (the-as vector s4-0) quad) (-> (the-as process-drawable v1-127) root trans quad)) + s4-0 + ) + ) + ) + (('target) + (set! s4-0 (process->handle (the-as process (-> block param 0)))) + (set! (-> self cur-target-handle) (the-as handle s4-0)) + s4-0 + ) + (('trans) + (cond + ((type? (-> self root) collide-shape) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + ) + (else + (set! s4-0 (-> self root trans)) + (set! (-> (the-as vector s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + ) + ) + (('scale) + (set! s4-0 (-> self root scale)) + (set! (-> (the-as vector s4-0) quad) (-> (the-as vector (-> block param 0)) quad)) + s4-0 + ) + (('rot) + (let ((s5-3 (new 'stack-no-clear 'matrix))) + (matrix-rotate-y! s5-3 (the-as float (-> block param 0))) + (matrix->quaternion (-> self root quat) s5-3) + ) + ) + (('rot-quat) + (quaternion-copy! (-> self root quat) (the-as quaternion (-> block param 0))) + ) + (('clone-copy-trans) + (set! s4-0 (-> block param 0)) + (set! (-> self clone-copy-trans) (the-as symbol s4-0)) + s4-0 + ) + (('release) + (set! (-> self cur-grab-handle) (the-as handle #f)) + #f + ) + (('draw) + (set! (-> self draw?) (the-as symbol (-> block param 0))) + (cond + ((-> block param 0) + (let ((v1-146 (logtest? (-> self draw status) (draw-control-status no-draw)))) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (when v1-146 + (cond + ((nonzero? (-> self skel)) + (let ((gp-1 (-> self skel status))) + (logior! (-> self skel status) (joint-control-status sync-math)) + (set! s4-0 (ja-post)) + (set! (-> self skel status) gp-1) + ) + s4-0 + ) + (else + (ja-post) + ) + ) + ) + ) + ) + (else + (set! s4-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status s4-0)) + s4-0 + ) + ) + ) + (('sync) + (when (nonzero? (-> self skel)) + (cond + ((-> block param 0) + (set! s4-0 (logior (-> self skel status) (joint-control-status sync-math))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + (else + (set! s4-0 (logclear (-> self skel status) (joint-control-status sync-math))) + (set! (-> self skel status) (the-as joint-control-status s4-0)) + ) + ) + s4-0 + ) + ) + (('query) + (case (-> block param 0) + (('grab) + (handle->process (-> self cur-grab-handle)) + ) + (('done) + (case (-> self anim-mode) + (('play1 'play) + (>= (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -2))) + ) + ) + ) + ) + ) + (('set-frame-num) + (let ((v1-179 (-> self skel root-channel 0))) + (set! (-> v1-179 num-func) num-func-identity) + (set! (-> v1-179 frame-num) (the-as float (-> block param 0))) + ) + ) + (('prefix) + (set! s4-0 (-> block param 0)) + (set! (-> self prefix) (the-as basic s4-0)) + s4-0 + ) + (('light-index) + (let ((v0-29 (command-get-int (-> block param 0) 0))) + (set! (-> self draw light-index) (the-as uint v0-29)) + v0-29 + ) + ) + (('eye-slot) + (set! (-> self draw mgeo header eye-ctrl eye-slot) (command-get-int (-> block param 0) 0)) + ) + (('shadow-mask) + (let ((v0-31 (command-get-int (-> block param 0) 0))) + (set! (-> self draw shadow-mask) (the-as uint v0-31)) + v0-31 + ) + ) + (('shadow-values) + (let ((v0-32 (command-get-int (-> block param 0) 0))) + (set! (-> self draw shadow-values) (the-as uint v0-32)) + v0-32 + ) + ) + (('mirror) + (cond + ((-> block param 0) + (set! s4-0 (-> self node-list data 2)) + (set! (-> (the-as cspace s4-0) param0) + (the-as (function cspace transformq none) cspace<-parented-matrix-mirror!) + ) + (set! (-> (the-as cspace s4-0) param1) (the-as basic (-> *math-camera* mirror-trans))) + (set! (-> (the-as cspace s4-0) param2) (the-as basic (-> *math-camera* mirror-normal))) + ) + (else + (set! s4-0 (-> self node-list data 2)) + (set! (-> (the-as cspace s4-0) param0) #f) + ) + ) + s4-0 + ) + (('draw-mirror) + (send-event (ppointer->process (-> self child)) 'draw (-> block param 0)) + ) + (('user) + (set! s4-0 (-> block param 1)) + (set! (-> self user-uint64 (/ (the-as int (-> block param 0)) 8)) (the-as uint s4-0)) + s4-0 + ) + (('die) + (deactivate self) + ) + (('do-effect) + (if (and (nonzero? (-> self skel)) (-> self skel effect)) + (do-effect (-> self skel effect) (the-as symbol (-> block param 0)) (the-as float (-> block param 1)) -1) + ) + ) + (('no-actor-pause) + (set! s4-0 (logclear (-> self mask) (process-mask actor-pause))) + (set! (-> self mask) (the-as process-mask s4-0)) + s4-0 + ) + (else + (if (-> self cur-event-hook) + ((-> self cur-event-hook)) + ) + ) + ) + ) + :trans (behavior () + (if (!= (-> self cur-trans-hook) (-> self new-trans-hook)) + (set! (-> self cur-trans-hook) (-> self new-trans-hook)) + ) + (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 (!= (ja-group) (-> self new-joint-anim)) (!= (-> self anim-mode) 'clone-anim)) + ) + (ja-channel-push! 1 (the-as time-frame (-> self new-joint-anim-blend))) + (ja :group! (-> self new-joint-anim) :num! (identity (ja-aframe (-> self new-joint-anim-frame) 0))) + ) + (let ((v1-20 (handle->process (-> self cur-grab-handle)))) + (when v1-20 + (let ((gp-1 (-> (the-as process-drawable v1-20) root trans))) + (if (type? (-> self root) collide-shape) + (move-by-vector! (-> self root) (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self old-grab-pos))) + (vector+! + (-> self root trans) + (-> self root trans) + (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self old-grab-pos)) + ) + ) + (set! (-> self old-grab-pos quad) (-> gp-1 quad)) + ) + ) + ) + ((-> self cur-trans-hook)) + ) + :code (behavior () + (logclear! (-> self mask) (process-mask heap-shrunk)) + (until #f + (case (-> self anim-mode) + (('loop) + (ja-post) + (manipy-post) + (suspend) + (ja :num! (loop!)) + ) + (('play) + (ja-post) + (manipy-post) + (suspend) + (ja :num! (seek!)) + ) + (('copy-parent) + (let ((v1-17 (-> self skel root-channel 0))) + (set! (-> v1-17 num-func) num-func-identity) + (let ((a0-10 (-> self parent))) + (set! (-> v1-17 frame-num) (-> (the-as process-drawable (if a0-10 + (the-as process-drawable (-> a0-10 0 self)) + ) + ) + skel + root-channel + 0 + frame-num + ) + ) + ) + ) + (ja-post) + (manipy-post) + (suspend) + 0 + ) + (('clone-parent) + (let ((gp-0 (ppointer->process (-> self parent)))) + (set! (-> self post-hook) #f) + (joint-control-copy! (-> self skel) (-> (the-as process-drawable gp-0) skel)) + (joint-control-remap! + (-> self skel) + (-> self draw art-group) + (-> (the-as process-drawable gp-0) draw art-group) + '() + 0 + "" + ) + ) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + (manipy-post) + (suspend) + 0 + ) + (('clone-anim) + (clone-anim-once + (if (handle->process (-> self cur-target-handle)) + (the-as handle (-> self cur-target-handle)) + (ppointer->handle (-> self parent)) + ) + (-> self clone-copy-trans) + (the-as string (-> self prefix)) + ) + (manipy-post) + (suspend) + 0 + ) + (('mirror) + (let ((gp-1 (if (handle->process (-> self cur-target-handle)) + (-> self cur-target-handle) + (ppointer->handle (-> self parent)) + ) + ) + ) + (clone-anim-once gp-1 (-> self clone-copy-trans) (the-as string (-> self prefix))) + (logior! (-> self draw global-effect) (draw-control-global-effect disable-envmap)) + (set! (-> self draw light-index) (the-as uint 5)) + (if (logtest? (-> (the-as process-drawable (handle->process gp-1)) draw status) + (draw-control-status no-draw no-draw-temp no-draw-bounds) + ) + (logior! (-> self draw status) (draw-control-status no-draw-temp)) + ) + ) + (manipy-post) + (suspend) + 0 + ) + (('still) + (ja-post) + (manipy-post) + (suspend) + 0 + ) + (('play1) + (ja-post) + (manipy-post) + (suspend) + (ja :num! (seek! max (-> self speed))) + (if (ja-done? 0) + (deactivate self) + ) + ) + ) + ) + #f + ) + ) + +;; definition for function manipy-init +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior manipy-init manipy ((arg0 vector) (arg1 entity-actor) (arg2 skeleton-group) (arg3 vector) (arg4 manipy-options)) + (stack-size-set! (-> self main-thread) 128) + (logior! (-> self mask) (process-mask heap-shrunk)) + (process-entity-set! self arg1) + (cond + ((= arg3 'collide-shape-moving) + (let ((s3-1 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) + (set! (-> s3-1 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s3-1 reaction) cshape-reaction-default) + (set! (-> s3-1 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s3-1 (the-as uint 0)))) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s3-1 total-prims) (the-as uint 1)) + (set! (-> s3-1 root-prim) v1-11) + ) + (set! (-> s3-1 nav-radius) (* 0.75 (-> s3-1 root-prim local-sphere w))) + (let ((v1-14 (-> s3-1 root-prim))) + (set! (-> s3-1 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s3-1 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> self root) s3-1) + ) + ) + (arg3 + (let ((s3-2 (new 'process 'collide-shape self (collide-list-enum hit-by-player)))) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s3-2 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list)) + (set-vector! (-> v1-18 local-sphere) (-> arg3 x) (-> arg3 y) (-> arg3 z) (-> arg3 w)) + (set! (-> s3-2 total-prims) (the-as uint 1)) + (set! (-> s3-2 root-prim) v1-18) + ) + (set! (-> s3-2 nav-radius) (* 0.75 (-> s3-2 root-prim local-sphere w))) + (let ((v1-21 (-> s3-2 root-prim))) + (set! (-> s3-2 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s3-2 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> self root) s3-2) + ) + ) + (else + (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) + ) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton self arg2 (the-as pair 0)) + (if (type? (-> self root) collide-shape) + (update-transforms (-> self root)) + ) + (set! (-> self shadow-backup) (-> self draw shadow)) + (set! (-> self shadow-volume-joint) -1) + (set! (-> self options) arg4) + (when (-> self draw shadow) + (set! (-> self draw shadow-ctrl) (new + 'process + 'shadow-control + 0.0 + 0.0 + 614400.0 + (the-as vector #f) + 0.000000000000000000000000000000000000000000084 + 245760.0 + ) + ) + (quad-copy! (the-as pointer (-> self draw shadow-ctrl settings)) (the-as pointer *default-shadow-settings*) 5) + ) + (set! (-> self new-trans-hook) nothing) + (set! (-> self cur-trans-hook) nothing) + (set! (-> self new-post-hook) nothing) + (set! (-> self cur-post-hook) nothing) + (set! (-> self cur-event-hook) #f) + (set! (-> self cur-grab-handle) (the-as handle #f)) + (set! (-> self cur-target-handle) (the-as handle #f)) + (set! (-> self clone-copy-trans) #t) + (set! (-> self draw?) #t) + (set! (-> self prefix) "") + (set! (-> self speed) 1.0) + (when (logtest? (-> self options) (manipy-options mo0)) + (let ((v1-56 (the-as joint (get-art-by-name-method (-> self draw jgeo) "neckA" (the-as type #f))))) + (when v1-56 + (set! (-> self joint 0) (new 'process 'joint-mod (joint-mod-mode flex-blend) self (+ (-> v1-56 number) 1))) + (set! (-> self joint 0 parented-scale?) #t) + ) + ) + ) + (when (logtest? (-> self options) (manipy-options mo1)) + (let ((v1-64 (the-as joint (get-art-by-name-method (-> self draw jgeo) "horns" (the-as type #f))))) + (when v1-64 + (set! (-> self joint 1) (new 'process 'joint-mod (joint-mod-mode joint-set) self (+ (-> v1-64 number) 1))) + (set! (-> self joint 1 parented-scale?) #t) + (set! (-> self joint 1 track-mode) (track-mode no-trans no-rotate)) + (trs-set! (-> self joint 1) (the-as vector #f) (the-as quaternion #f) *null-vector*) + ) + ) + ) + (cond + ((nonzero? (-> self skel)) + (set! (-> self new-joint-anim) (ja-group)) + (set! (-> self new-joint-anim-frame) 0.0) + (set! (-> self anim-mode) 'loop) + ) + (else + (set! (-> self anim-mode) 'still) + ) + ) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + (none) + ) + +;; definition for method 10 of type part-tracker +(defmethod deactivate ((this part-tracker)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + ((method-of-type process deactivate) this) + (none) + ) + +;; definition for method 17 of type part-tracker +;; WARN: Return type mismatch object vs none. +(defmethod notify-parent-of-death ((this part-tracker)) + (with-pp + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) (process->ppointer pp)) + (set! (-> gp-0 num-params) 1) + (set! (-> gp-0 message) 'notify) + (set! (-> gp-0 param 0) (the-as uint 'die)) + (let ((s5-0 send-event-function) + (s4-0 (ppointer->process (-> this parent))) + ) + (s5-0 + (if (type? s4-0 process) + s4-0 + ) + gp-0 + ) + ) + ) + (none) + ) + ) + +;; definition for method 7 of type part-tracker-subsampler +;; WARN: Return type mismatch process vs part-tracker-subsampler. +(defmethod relocate ((this part-tracker-subsampler) (offset int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (if (nonzero? (-> this subsampler)) + (&+! (-> this subsampler) offset) + ) + (the-as part-tracker-subsampler ((method-of-type process relocate) this offset)) + ) + +;; failed to figure out what this is: +(defstate active (part-tracker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (case message + (('clock) + (+! (-> self clock ref-count) -1) + (+! (-> (the-as process (-> block param 0)) clock ref-count) 1) + (set! v0-0 (-> (the-as process (-> block param 0)) clock)) + (set! (-> self clock) (the-as clock v0-0)) + v0-0 + ) + (('draw) + (when (not (-> block param 0)) + (set! v0-0 1) + (set! (-> self duration) (the-as time-frame v0-0)) + v0-0 + ) + ) + (('trans) + (set! v0-0 (-> self root trans)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad)) + v0-0 + ) + (('die) + (deactivate self) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (and (nonzero? (-> self duration)) (time-elapsed? (-> self state-time) (-> self duration))) + (go-virtual linger) + ) + (if (-> self callback) + ((-> self callback) self) + ) + (let* ((gp-0 (handle->process (-> self target))) + (v1-15 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (cond + ((and v1-15 + (nonzero? (-> (the-as process-drawable v1-15) root)) + (nonzero? (-> (the-as process-drawable v1-15) node-list)) + ) + (sparticle-launch-control-method-18 + (-> self part) + (-> (the-as process-drawable v1-15) node-list data (-> self target-joint)) + ) + (set! (-> self root trans quad) (-> self part origin trans quad)) + ) + (else + (let ((a0-11 (-> self root trans))) + (set! (-> self mat trans quad) (-> a0-11 quad)) + ) + (sparticle-launch-control-method-17 (-> self part) (-> self mat)) + ) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate linger (part-tracker) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (-> self linger-callback) + ((-> self linger-callback) self) + ) + (if (time-elapsed? (-> self state-time) (-> self linger-duration)) + (go-virtual die) + ) + (let* ((gp-0 (handle->process (-> self target))) + (v1-13 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (if (and v1-13 + (nonzero? (-> (the-as process-drawable v1-13) root)) + (nonzero? (-> (the-as process-drawable v1-13) node-list)) + ) + (vector<-cspace! + (-> self root trans) + (-> (the-as process-drawable v1-13) node-list data (-> self target-joint)) + ) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate die (part-tracker) + :virtual #t + :enter (behavior () + (notify-parent-of-death self) + ) + :code (behavior () + (suspend) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate active (part-tracker-subsampler) + :virtual #t + :trans (behavior () + (if (and (nonzero? (-> self duration)) (time-elapsed? (-> self state-time) (-> self duration))) + (go-virtual linger) + ) + (if (-> self callback) + ((-> self callback) self) + ) + (let* ((gp-0 (handle->process (-> self target))) + (v1-15 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (cond + ((and v1-15 + (nonzero? (-> (the-as process-drawable v1-15) root)) + (nonzero? (-> (the-as process-drawable v1-15) node-list)) + ) + (sparticle-subsampler-method-10 + (-> self subsampler) + (-> (the-as process-drawable v1-15) node-list data (-> self target-joint) bone transform) + ) + (set! (-> self root trans quad) (-> self subsampler spawn-mat trans quad)) + ) + (else + (let ((a0-11 (-> self root trans))) + (set! (-> self mat trans quad) (-> a0-11 quad)) + ) + (sparticle-subsampler-method-10 (-> self subsampler) (-> self mat)) + ) + ) + ) + ) + ) + +;; definition for function part-tracker-init-base +;; INFO: Used lq/sq +(defbehavior part-tracker-init-base part-tracker ((arg0 sparticle-launch-group) + (arg1 time-frame) + (arg2 (function part-tracker vector)) + (arg3 uint) + (arg4 process-drawable) + (arg5 object) + ) + (stack-size-set! (-> self main-thread) 16) + (when (= pointer process-tree) + (+! (-> self clock ref-count) -1) + (+! (-> *display* part-clock ref-count) 1) + (set! (-> self clock) (-> *display* part-clock)) + ) + (set! (-> self target) (process->handle arg4)) + (cond + (arg4 + (set! (-> self target-joint) (the-as int arg5)) + ) + ((logtest? (-> arg0 flags) (sp-group-flag sp5)) + (let* ((s1-1 (-> self mat)) + (a2-1 (math-camera-matrix)) + (v1-18 (-> a2-1 rvec quad)) + (a0-10 (-> a2-1 uvec quad)) + (a1-2 (-> a2-1 fvec quad)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> s1-1 rvec quad) v1-18) + (set! (-> s1-1 uvec quad) a0-10) + (set! (-> s1-1 fvec quad) a1-2) + (set! (-> s1-1 trans quad) a2-2) + ) + (set! (-> self mat trans quad) (-> (the-as matrix arg5) trans quad)) + (set! (-> self offset quad) (-> self mat trans quad)) + ) + (else + (let* ((v1-21 (-> self mat)) + (a3-1 (the-as matrix arg5)) + (a0-15 (-> a3-1 rvec quad)) + (a1-3 (-> a3-1 uvec quad)) + (a2-3 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-21 rvec quad) a0-15) + (set! (-> v1-21 uvec quad) a1-3) + (set! (-> v1-21 fvec quad) a2-3) + (set! (-> v1-21 trans quad) a3-2) + ) + (set! (-> self offset quad) (-> self mat trans quad)) + ) + ) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> self mat trans quad)) + (if (zero? arg0) + (go process-drawable-art-error "null group") + ) + (set! (-> self callback) arg2) + (set! (-> self linger-callback) #f) + (set! (-> self userdata) arg3) + (set! arg1 (cond + ((> arg1 0) + (empty) + arg1 + ) + ((= arg1 -1) + 0 + ) + (else + (the-as time-frame (-> arg0 duration)) + ) + ) + ) + (set! (-> self duration) (the-as time-frame arg1)) + (set! (-> self linger-duration) (the-as time-frame (-> arg0 linger-duration))) + (if (or (zero? (+ (-> self duration) (seconds 0.007))) (= (-> self duration) (seconds 218.447))) + (deactivate self) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 57 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:timer (seconds 0.1)) + ) + ) + +;; definition for function part-tracker-subsampler-init +(defbehavior part-tracker-subsampler-init part-tracker-subsampler ((arg0 part-tracker-subsampler-init-params)) + (part-tracker-init-base + (-> arg0 group) + (-> arg0 duration) + (-> arg0 callback) + (-> arg0 userdata) + (-> arg0 target) + (-> arg0 mat-joint) + ) + (dotimes (s5-0 1) + (let* ((v1-2 (-> arg0 group launcher s5-0)) + (s4-0 (-> *part-id-table* (-> v1-2 launcher))) + ) + (let ((a2-1 (if (logtest? (-> v1-2 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + ) + ) + self + (set! (-> self subsampler) + (new 'process 'sparticle-subsampler a2-1 (-> *part-id-table* 57) (-> arg0 subsample-num)) + ) + ) + (set! (-> self subsampler sp-launcher) s4-0) + ) + ) + (go-virtual active) + ) + +;; definition for function part-tracker-init +(defbehavior part-tracker-init part-tracker ((arg0 part-tracker-init-params)) + (part-tracker-init-base + (-> arg0 group) + (-> arg0 duration) + (-> arg0 callback) + (-> arg0 userdata) + (-> arg0 target) + (-> arg0 mat-joint) + ) + (set! (-> self part) (create-launch-control (-> arg0 group) self)) + (when (and (-> arg0 target) (logtest? (-> self part group flags) (sp-group-flag sp12 sp14))) + (let* ((gp-0 (-> self part)) + (s5-0 (method-of-object gp-0 sparticle-launch-control-method-20)) + (s4-0 (add-connection *part-local-space-engine* self local-space-proc-joint (-> self target-joint) 0 0)) + ) + (let ((v1-10 (process->handle (-> arg0 target)))) + (if (= v1-10 #f) + (set! v1-10 (process->handle self)) + ) + (set! (-> (the-as particle-local-space-info s4-0) hand) (the-as handle v1-10)) + ) + (matrix-identity! (-> (the-as particle-local-space-info s4-0) mat-new)) + (matrix-identity! (-> (the-as particle-local-space-info s4-0) mat-prev)) + (set! (-> (the-as particle-local-space-info s4-0) flags) + (if (logtest? (-> self part group flags) (sp-group-flag sp14)) + (part-local-space-flags pls0) + (part-local-space-flags) + ) + ) + (s5-0 gp-0 (the-as float s4-0)) + ) + ) + (set! (-> self event-hook) (-> (method-of-object self active) event)) + (go-virtual active) + ) + +;; definition for function part-tracker-track-root +;; WARN: Return type mismatch int vs none. +(defun part-tracker-track-root ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-3 (-> arg1 key proc root trans))) + (set! (-> arg2 x) (-> v1-3 x)) + (set! (-> arg2 y) (-> v1-3 y)) + (set! (-> arg2 z) (-> v1-3 z)) + ) + 0 + (none) + ) + +;; definition for function part-tracker-move-to-target +(defun part-tracker-move-to-target ((arg0 part-tracker)) + (let* ((a0-1 *target*) + (a2-0 (if (not a0-1) + (-> arg0 root trans) + (get-trans a0-1 3) + ) + ) + ) + (vector-lerp! + (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (* 0.006666667 (the float (- (current-time) (-> arg0 state-time)))) + ) + ) + ) + +;; definition for function part-tracker-track-target +;; INFO: Used lq/sq +(defun part-tracker-track-target ((arg0 part-tracker)) + (set! (-> arg0 linger-callback) (-> arg0 callback)) + (let* ((a0-1 *target*) + (v1-2 (if (not a0-1) + (-> arg0 root trans) + (get-trans a0-1 3) + ) + ) + (v0-1 (-> arg0 root trans)) + ) + (set! (-> v0-1 quad) (-> v1-2 quad)) + v0-1 + ) + ) + +;; definition for method 15 of type lightning-tracker +;; WARN: Return type mismatch object vs none. +(defmethod notify-parent-of-death ((this lightning-tracker)) + (with-pp + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) (process->ppointer pp)) + (set! (-> gp-0 num-params) 1) + (set! (-> gp-0 message) 'notify) + (set! (-> gp-0 param 0) (the-as uint 'die)) + (let ((s5-0 send-event-function) + (s4-0 (ppointer->process (-> this parent))) + ) + (s5-0 + (if (type? s4-0 process) + s4-0 + ) + gp-0 + ) + ) + ) + (none) + ) + ) + +;; definition for method 16 of type lightning-tracker +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod update ((this lightning-tracker)) + (if (-> this callback) + ((-> this callback) this) + ) + (let ((a0-6 (cond + ((>= (-> this target-joint0) 0) + (let ((s5-0 (handle->process (-> this target0)))) + (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (else + (the-as process #f) + ) + ) + ) + ) + (cond + ((< (-> this target-joint0) 0) + (when (and (!= (-> this lightning spec rand-func) 3) (!= (-> this lightning spec rand-func) 2)) + (let ((v1-17 (-> this lightning)) + (a0-9 (-> this offset0)) + ) + (set! (-> v1-17 state meet data 0 quad) (-> a0-9 quad)) + ) + ) + ) + ((or (not a0-6) (zero? (-> (the-as process-drawable a0-6) root))) + (deactivate this) + ) + ((= (-> this target-joint0) 256) + (let ((s5-1 (-> this lightning)) + (a0-12 (get-trans (the-as process-focusable a0-6) 3)) + ) + (set! (-> s5-1 state meet data 0 quad) (-> a0-12 quad)) + ) + ) + (else + (let ((s5-2 (-> this lightning)) + (a0-16 (vector<-cspace! + (new 'stack-no-clear 'vector) + (-> (the-as process-focusable a0-6) node-list data (-> this target-joint0)) + ) + ) + ) + (set! (-> s5-2 state meet data 0 quad) (-> a0-16 quad)) + ) + ) + ) + ) + (let ((a0-22 (cond + ((>= (-> this target-joint1) 0) + (let ((s5-3 (handle->process (-> this target1)))) + (if (type? s5-3 process-drawable) + (the-as process-focusable s5-3) + ) + ) + ) + (else + (the-as process-focusable #f) + ) + ) + ) + ) + (cond + ((< (-> this target-joint1) 0) + (when (and (!= (-> this lightning spec rand-func) 3) (!= (-> this lightning spec rand-func) 2)) + (let ((a0-26 (-> this lightning)) + (v1-44 (-> this offset1)) + ) + (set! (-> a0-26 state meet data (+ (-> a0-26 state points-to-draw) -1) quad) (-> v1-44 quad)) + ) + ) + ) + ((or (not a0-22) (zero? (-> a0-22 root))) + (deactivate this) + ) + ((= (-> this target-joint1) 256) + (let ((gp-1 (-> this lightning)) + (v1-51 (get-trans a0-22 3)) + ) + (set! (-> gp-1 state meet data (+ (-> gp-1 state points-to-draw) -1) quad) (-> v1-51 quad)) + ) + ) + (else + (let ((s5-4 (-> this lightning)) + (v1-54 (vector<-cspace! (new 'stack-no-clear 'vector) (-> a0-22 node-list data (-> this target-joint1)))) + ) + (set! (-> s5-4 state meet data (+ (-> s5-4 state points-to-draw) -1) quad) (-> v1-54 quad)) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (lightning-tracker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (deactivate self) + ) + ) + ) + :exit (behavior () + (when (nonzero? (-> self sound)) + (let ((v1-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-1 command) (sound-command set-param)) + (set! (-> v1-1 id) (-> self sound)) + (set! (-> v1-1 params volume) -4) + (set! (-> v1-1 auto-time) 240) + (set! (-> v1-1 auto-from) 2) + (set! (-> v1-1 params mask) (the-as uint 17)) + (-> v1-1 id) + ) + ) + ) + :code (behavior () + (set! (-> self sound) (new 'static 'sound-id)) + (when (!= (+ (-> self lightning spec delay) (-> self lightning spec delay-rand)) 0.0) + (let ((gp-0 (current-time)) + (s5-0 (the int (rand-vu-float-range + (-> self lightning spec delay) + (+ (-> self lightning spec delay) (-> self lightning spec delay-rand)) + ) + ) + ) + ) + (while (not (time-elapsed? gp-0 s5-0)) + (suspend) + ) + ) + ) + (let ((gp-1 (-> self lightning spec sound))) + (when gp-1 + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> self offset1 quad)) + (when (and (>= (-> self target-joint1) 0) (< (-> self target-joint1) 256)) + (let* ((s4-0 (handle->process (-> self target1))) + (v1-28 (if (type? s4-0 process-drawable) + (the-as process-drawable s4-0) + ) + ) + ) + (if (and v1-28 (nonzero? (-> v1-28 root))) + (set! (-> s5-1 quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-28 node-list data (-> self target-joint1))) quad) + ) + ) + ) + ) + (set! (-> self sound) (sound-play-by-spec (the-as sound-spec gp-1) (new-sound-id) s5-1)) + ) + ) + ) + (let ((v1-33 (-> self lightning)) + (a0-10 1) + ) + (let ((a1-10 (!= a0-10 (-> v1-33 state mode)))) + (case a0-10 + ((3) + (if a1-10 + (set! (-> v1-33 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-33 state start-color) (-> v1-33 spec start-color)) + (set! (-> v1-33 state end-color) (-> v1-33 spec end-color)) + ) + ) + ) + (set! (-> v1-33 state mode) (the-as uint a0-10)) + ) + (set-time! (-> self start-time)) + (while (or (zero? (-> self duration)) (not (time-elapsed? (-> self start-time) (-> self duration)))) + (update self) + (suspend) + ) + (let ((f30-0 (-> self lightning spec fade-time))) + (when (< 0.0 f30-0) + (let ((v1-47 (-> self lightning)) + (a0-14 3) + ) + (let ((a1-20 (!= a0-14 (-> v1-47 state mode)))) + (case a0-14 + ((3) + (if a1-20 + (set! (-> v1-47 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-47 state start-color) (-> v1-47 spec start-color)) + (set! (-> v1-47 state end-color) (-> v1-47 spec end-color)) + ) + ) + ) + (set! (-> v1-47 state mode) (the-as uint a0-14)) + ) + (set-time! (-> self start-time)) + (while (not (time-elapsed? (-> self start-time) (the int f30-0))) + (suspend) + ) + ) + ) + (let ((v1-54 (-> self lightning)) + (a0-17 0) + ) + (let ((a1-30 (!= a0-17 (-> v1-54 state mode)))) + (case a0-17 + ((3) + (if a1-30 + (set! (-> v1-54 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-54 state start-color) (-> v1-54 spec start-color)) + (set! (-> v1-54 state end-color) (-> v1-54 spec end-color)) + ) + ) + ) + (set! (-> v1-54 state mode) (the-as uint a0-17)) + ) + (notify-parent-of-death self) + (suspend) + 0 + ) + ) + +;; definition for function lightning-tracker-init +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior lightning-tracker-init lightning-tracker ((arg0 lightning-spec) (arg1 time-frame) (arg2 symbol) (arg3 process-drawable) (arg4 vector) (arg5 vector)) + (stack-size-set! (-> self main-thread) 128) + (set! (-> self target0) (process->handle arg3)) + (let ((s1-1 (ppointer->process (-> self parent)))) + (set! (-> self target1) (process->handle (the-as process (if (type? s1-1 process-drawable) + s1-1 + ) + ) + ) + ) + ) + (cond + ((>= 256 (the-as int arg4)) + (set! (-> self target-joint0) (the-as int arg4)) + (vector-identity! (-> self offset0)) + ) + (else + (set! (-> self target-joint0) -1) + (set! (-> self offset0 quad) (-> arg4 quad)) + ) + ) + (cond + ((>= 256 (the-as int arg5)) + (set! (-> self target-joint1) (the-as int arg5)) + (vector-identity! (-> self offset1)) + ) + (else + (set! (-> self target-joint1) -1) + (set! (-> self offset1 quad) (-> arg5 quad)) + ) + ) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self callback) (the-as (function lightning-tracker none) arg2)) + (set! arg1 + (cond + ((> arg1 0) + (empty) + arg1 + ) + ((= arg1 -1) + 0 + ) + (else + (the-as + time-frame + (the int (rand-vu-float-range (-> arg0 duration) (+ (-> arg0 duration) (-> arg0 duration-rand)))) + ) + ) + ) + ) + (set! (-> self duration) (the-as time-frame arg1)) + (set! (-> self lightning) (new 'process 'lightning-control arg0 self 0.0)) + (let ((v1-21 (-> self lightning)) + (a0-17 0) + ) + (let ((a1-7 (!= a0-17 (-> v1-21 state mode)))) + (case a0-17 + ((3) + (if a1-7 + (set! (-> v1-21 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-21 state start-color) (-> v1-21 spec start-color)) + (set! (-> v1-21 state end-color) (-> v1-21 spec end-color)) + ) + ) + ) + (set! (-> v1-21 state mode) (the-as uint a0-17)) + ) + (go-virtual active) + (none) + ) + +;; definition for function process-grab? +;; WARN: Return type mismatch object vs symbol. +(defbehavior process-grab? process ((arg0 process) (arg1 symbol)) + (let ((a0-1 (command-get-process arg0 *target*))) + (the-as symbol (if a0-1 + (send-event a0-1 'change-mode 'grab (cond + ((= arg1 #t) + #f + ) + ((= arg1 'dead) + 'dead + ) + (else + #t + ) + ) + ) + ) + ) + ) + ) + +;; definition for function process-release? +;; WARN: Return type mismatch object vs symbol. +(defbehavior process-release? process ((arg0 process)) + (let* ((gp-0 (command-get-process arg0 *target*)) + (a0-2 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (the-as symbol (if (and a0-2 (focus-test? (the-as process-focusable a0-2) grabbed)) + (send-event a0-2 'end-mode 'grab) + #t + ) + ) + ) + ) + +;; definition for function camera-look-at +(defun camera-look-at ((arg0 pair) (arg1 uint)) + (let ((gp-0 (command-get-process arg0 *target*))) + (if gp-0 + (send-event *camera* 'change-target gp-0 arg1) + ) + gp-0 + ) + ) + +;; definition for function ja-anim-done? +;; WARN: Return type mismatch object vs symbol. +(defun ja-anim-done? ((arg0 process)) + (with-pp + (let ((gp-0 (command-get-process arg0 *target*))) + (the-as + symbol + (when gp-0 + (cond + ((type? gp-0 manipy) + (send-event gp-0 'query 'done) + ) + ((type? gp-0 process-drawable) + (when (not (logtest? (-> (the-as process-drawable gp-0) skel status) (joint-control-status spooling-not-last-block)) + ) + (let ((s5-0 pp)) + (set! pp gp-0) + (let ((v0-1 (the-as object (ja-done? 0)))) + (set! pp s5-0) + v0-1 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for function camera-pov-from +(defun camera-pov-from ((arg0 pair) (arg1 uint)) + (let ((gp-0 (command-get-process arg0 *target*))) + (when gp-0 + (when (= arg1 -10) + (set! arg1 (the-as uint 0)) + (when (> (-> (the-as process-drawable gp-0) skel active-channels) 0) + (let ((v1-7 (the-as + joint + (get-art-by-name-method (-> (the-as process-drawable gp-0) draw jgeo) "camera" (the-as type #f)) + ) + ) + ) + (if v1-7 + (set! arg1 (the-as uint (+ (-> v1-7 number) 1))) + ) + ) + ) + ) + (let ((v1-9 (process->ppointer gp-0))) + (set-setting! 'pov-handle v1-9 (the float arg1) (-> v1-9 0 pid)) + ) + ) + gp-0 + ) + ) + +;; definition of type med-res-level +(deftype med-res-level (process-drawable) + ((level-name symbol) + (part-mode symbol) + (index int32) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type med-res-level +(defmethod inspect ((this med-res-level)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tlevel-name: ~A~%" (-> this level-name)) + (format #t "~2Tpart-mode: ~A~%" (-> this part-mode)) + (format #t "~2Tindex: ~D~%" (-> this index)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (med-res-level) + :virtual #t + :code (behavior () + (until #f + (let ((v1-1 (level-get *level* (-> self level-name)))) + (cond + ((and v1-1 (= (-> v1-1 display?) 'special)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (if (nonzero? (-> self skel)) + (ja :num! (loop!)) + ) + ) + ((and v1-1 (= (-> v1-1 status) 'active)) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + (else + (logclear! (-> self draw status) (draw-control-status no-draw)) + (if (nonzero? (-> self skel)) + (ja :num! (loop!)) + ) + ) + ) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +;; definition for method 11 of type med-res-level +(defmethod init-from-entity! ((this med-res-level) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (res-lump-struct arg0 'art-name structure)) + (s3-0 (res-lump-struct (-> this entity) 'level structure)) + (v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0)) + ) + (when s3-0 + (set! (-> this level-name) (the-as symbol s3-0)) + (set! (-> this index) (the-as int v1-5)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton-by-name this (the-as string s4-0)) + (logior! (-> this draw status) (draw-control-status no-closest-distance)) + (if (nonzero? (-> this draw)) + (go (method-of-object this idle)) + ) + ) + ) + ) + +;; definition for method 10 of type part-spawner +(defmethod deactivate ((this part-spawner)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) + ) + (if (nonzero? (-> this sound-extra)) + (stop! (-> this sound-extra)) + ) + ((method-of-type process deactivate) this) + (none) + ) + +;; definition for method 15 of type part-spawner +(defmethod is-in-view? ((this part-spawner)) + (sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius)) + (sphere-in-view-frustum? (-> this world-sphere)) + ) + +;; failed to figure out what this is: +(defstate active (part-spawner) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('stop) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (set! (-> self enable) #f) + #t + ) + (('start) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (set! (-> self enable) #t) + #t + ) + (('trans) + (let ((v0-1 (the-as object (-> (the-as vector (-> block param 0)) quad)))) + (set! (-> self root trans quad) (the-as uint128 v0-1)) + v0-1 + ) + ) + ) + ) + :trans (behavior () + (when (-> self enable) + (when (nonzero? (-> self path)) + (path-control-method-9 (-> self path)) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-pos) 'interp) + (displacement-between-points-at-percent-normalized! (-> self path) (-> self last-velocity) (-> self path-pos)) + (let ((f0-3 (+ (-> self path-pos) (* (-> self path-speed) (seconds-per-frame))))) + (set! (-> self path-pos) f0-3) + (set! (-> self path-pos) (- f0-3 (* (the float (the int (/ f0-3 1.0))) 1.0))) + ) + ) + (spawn (-> self part) (-> self root trans)) + (when (nonzero? (-> self sound)) + (update-trans! (-> self sound) (-> self root trans)) + (update! (-> self sound)) + ) + (when (nonzero? (-> self sound-extra)) + (update-trans! (-> self sound-extra) (-> self root trans)) + (update! (-> self sound-extra)) + ) + ) + ) + :code sleep-code + ) + +;; definition for method 11 of type part-spawner +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) + (local-vars (sv-16 string)) + (stack-size-set! (-> this main-thread) 16) + (logior! (-> this mask) (process-mask ambient)) + (+! (-> this clock ref-count) -1) + (+! (-> *display* part-clock ref-count) 1) + (set! (-> this clock) (-> *display* part-clock)) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (set! (-> this radius) 12288.0) + (set! (-> this enable) + (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) + ) + (set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans) 0.0)) + (set! (-> this sound-extra) (new 'process 'ambient-sound (-> this entity) (-> this root trans) 1.0)) + (when (res-lump-data arg0 'path pointer) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-speed) (res-lump-float arg0 'speed :default 1.0)) + ) + (let ((v1-36 (res-lump-struct arg0 'trans-offset structure))) + (if v1-36 + (vector+! (-> this root trans) (-> this root trans) (the-as vector v1-36)) + ) + ) + (let ((s4-0 (res-lump-struct arg0 'rot-offset (pointer degrees)))) + (when s4-0 + (if (< 0.0 (-> s4-0 0)) + (quaternion-rotate-local-x! (-> this root quat) (-> this root quat) (-> s4-0 0)) + ) + (if (< 0.0 (-> s4-0 1)) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) (-> s4-0 1)) + ) + (if (< 0.0 (-> s4-0 2)) + (quaternion-rotate-local-z! (-> this root quat) (-> this root quat) (-> s4-0 2)) + ) + ) + ) + (set! sv-16 "#f") + (set! (-> this mode) (entity-lookup-part-group arg0 (& sv-16) 'art-name)) + (when (-> this mode) + (let ((s5-1 (-> this mode 0))) + (when (and (nonzero? s5-1) (= (-> s5-1 type) sparticle-launch-group)) + (cond + ((logtest? (-> s5-1 flags) (sp-group-flag sp8)) + (countdown (v1-60 (-> s5-1 length)) + (let* ((a0-34 (-> s5-1 launcher v1-60)) + (a2-12 (-> *part-id-table* (-> a0-34 launcher))) + ) + (when (nonzero? a2-12) + (let ((a1-22 (-> this level part-engine))) + (when (and a1-22 (< (-> a1-22 length) (-> a1-22 allocated-length))) + (let ((a3-14 (-> a1-22 data (-> a1-22 length)))) + (set! (-> a3-14 next1) (the-as connectable a2-12)) + (set! (-> a3-14 prev1) (the-as connectable (-> a0-34 hour-mask))) + (set! (-> (the-as vector (&-> a3-14 param0)) quad) (-> this root trans quad)) + (set! (-> a3-14 param3) (the-as int (-> a0-34 fade-after))) + ) + (+! (-> a1-22 length) 1) + ) + ) + ) + ) + ) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) + ) + ((logtest? (-> s5-1 flags) (sp-group-flag sp9)) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) + ) + (else + (set! (-> this part) (create-launch-control s5-1 this)) + (when (logtest? (-> s5-1 flags) (sp-group-flag sp10)) + (process-entity-status! this (entity-perm-status subtask-complete) #t) + (set! (-> this enable) #f) + ) + (go (method-of-object this active)) + ) + ) + ) + ) + ) + (go process-drawable-art-error sv-16) + ) + +;; definition of type launcher +(deftype launcher (process-drawable) + ((spring-height meters) + (camera state) + (active-distance float) + (seek-time time-frame) + (dest vector :inline) + (sound-id sound-id) + ) + (:state-methods + idle + active + deactivated + ) + ) + +;; definition for method 3 of type launcher +(defmethod inspect ((this launcher)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tspring-height: (meters ~m)~%" (-> this spring-height)) + (format #t "~2Tcamera: ~A~%" (-> this camera)) + (format #t "~2Tactive-distance: ~f~%" (-> this active-distance)) + (format #t "~2Tseek-time: ~D~%" (-> this seek-time)) + (format #t "~2Tdest: ~`vector`P~%" (-> this dest)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defpartgroup group-beach-launcher + :id 7 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 58 :fade-after (meters 100) :falloff-to (meters 100)) + (sp-item 59 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 60 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 61 :fade-after (meters 50) :falloff-to (meters 80)) + (sp-item 62 :fade-after (meters 70) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 58 + :init-specs ((:num 1.5) + (:x (meters 1.5)) + (:y (meters -0.5)) + (:rot-x 5) + (:r 4096.0) + (:g 2867.2) + (:b 3276.8) + (:vel-y (meters 0.026666667)) + (:timer (seconds 0.9)) + (:flags (distort)) + (:next-time (seconds 0.6)) + (:next-launcher 63) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 63 + :init-specs ((:fade-b -4.551111)) + ) + +;; failed to figure out what this is: +(defpart 59 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 1.0) + (:x (meters 0) (meters 1.8)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2.5) (meters 2.5)) + (:r 0.0 1 128.0) + (:g 64.0 196.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0025)) + (:scalevel-y (meters 0.24414062) (meters 0.48828125)) + (:timer (seconds 0.27)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 60 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 2.0) + (:x (meters 1.8) (meters 1)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 0.0 1 128.0) + (:g 64.0 196.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0025)) + (:scalevel-y (meters 0.048828125) (meters 0.09765625)) + (:timer (seconds 0.27)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 61 + :init-specs ((:texture (new 'static 'texture-id :index #x50 :page #x4)) + (:num 1.5) + (:x (meters 2.9) (meters 2.5)) + (:y (meters -0.5)) + (:scale-x (meters 0.3) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1) (meters 0.1)) + (:r 10.0 6.0) + (:g 64.0 128.0) + (:b 10.0 6.0) + (:a 80.0) + (:vel-x (meters -0.011666667) (meters -0.0033333334)) + (:vel-y (meters 0)) + (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) + (:fade-a -0.2) + (:accel-y (meters 0.0016666667)) + (:friction 0.996) + (:timer (seconds 0.6) (seconds 0.397)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 62 + :init-specs ((:texture (new 'static 'texture-id :page #x4)) + (:num 0.5) + (:x (meters 2.9) (meters 2.5)) + (:y (meters -0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 10.0 5.0) + (:a 0.0) + (:vel-x (meters -0.011666667) (meters -0.0033333334)) + (:vel-y (meters 0)) + (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) + (:fade-a 0.6) + (:accel-y (meters 0.0016666667)) + (:friction 0.996) + (:timer (seconds 0.9)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.15)) + (:next-launcher 64) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 64 + :init-specs ((:fade-a -0.18)) + ) + +;; failed to figure out what this is: +(defpartgroup group-jungle-launcher + :id 8 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 58 :fade-after (meters 100) :falloff-to (meters 100)) + (sp-item 65 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 66 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 67 :fade-after (meters 70) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 65 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 1.0) + (:x (meters 0) (meters 1.4)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2.5) (meters 2.5)) + (:r 0.0 1 128.0) + (:g 64.0 196.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0025)) + (:scalevel-y (meters 0.24414062) (meters 0.48828125)) + (:timer (seconds 0.27)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 66 + :init-specs ((:texture (new 'static 'texture-id :index #x18 :page #x4)) + (:num 2.0) + (:x (meters 1.4) (meters 0.9)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 0.0 1 128.0) + (:g 64.0 196.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0025)) + (:scalevel-y (meters 0.048828125) (meters 0.09765625)) + (:timer (seconds 0.27)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 67 + :init-specs ((:texture (new 'static 'texture-id :page #x4)) + (:num 0.5) + (:x (meters 2.9) (meters 2.5)) + (:y (meters -0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 32.0 32.0) + (:b 10.0 5.0) + (:a 0.0) + (:vel-x (meters -0.011666667) (meters -0.0033333334)) + (:vel-y (meters 0)) + (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) + (:fade-a 0.6) + (:accel-y (meters 0.0016666667)) + (:friction 0.996) + (:timer (seconds 0.9)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.15)) + (:next-launcher 64) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-swamp-launcher + :id 9 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 58 :fade-after (meters 100) :falloff-to (meters 100)) + (sp-item 59 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 60 :fade-after (meters 70) :falloff-to (meters 100) :flags (is-3d)) + (sp-item 68 :fade-after (meters 70) :falloff-to (meters 100)) + ) + ) + +;; failed to figure out what this is: +(defpart 68 + :init-specs ((:texture (new 'static 'texture-id :page #x4)) + (:num 0.5) + (:x (meters 2.9) (meters 2.5)) + (:y (meters -0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 16.0 16.0) + (:g 16.0 16.0) + (:b 5.0 2.5) + (:a 0.0) + (:vel-x (meters -0.011666667) (meters -0.0033333334)) + (:vel-y (meters 0)) + (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) + (:fade-a 0.6) + (:accel-y (meters 0.0016666667)) + (:friction 0.996) + (:timer (seconds 0.9)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.15)) + (:next-launcher 64) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; definition for function cam-launcher-joystick +;; INFO: Used lq/sq +(defbehavior cam-launcher-joystick camera-slave () + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (set! (-> s5-0 rvec quad) (the-as uint128 0)) + (set! (-> s5-0 uvec quad) (the-as uint128 0)) + (set! (-> s5-0 fvec quad) (the-as uint128 0)) + (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((gp-0 (vector-reset! (new 'stack-no-clear 'vector)))) + (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) + (f0-1 (* -546.13336 f0-0)) + (f0-3 (fmin 546.13336 (fmax -546.13336 f0-1))) + ) + (matrix-axis-angle! s5-0 (-> *camera* local-down) f0-3) + ) + (vector-! gp-0 (-> self trans) (-> *camera* tpos-curr)) + (vector-matrix*! gp-0 gp-0 s5-0) + (vector+! (-> self trans) gp-0 (-> *camera* tpos-curr)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate cam-launcher-shortfall (camera-slave) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (when (not (-> self enter-has-run)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) + (vector-flatten! gp-0 (-> self tracking inv-mat fvec) (-> *camera* local-down)) + (vector-normalize! gp-0 1.0) + (set! (-> self pivot-pt quad) (-> gp-0 quad)) + (vector+float*! gp-0 gp-0 (-> *camera* local-down) 1000.0) + (vector-normalize-copy! (-> self tracking inv-mat fvec) gp-0 1.0) + ) + (vector-cross! + (-> self tracking inv-mat uvec) + (-> self tracking inv-mat fvec) + (the-as vector (-> self tracking)) + ) + (set! (-> self blend-from-type) (camera-blend-from-type unknown-0)) + (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) + 0 + ) + ) + :trans (behavior () + (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) + (cam-slave-go cam-free-floating) + ) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until #f + (when (not (paused?)) + (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) + (send-event *camera* 'teleport) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) + (send-event *camera* 'change-state cam-string (seconds 0.5)) + ) + ) + (suspend) + ) + ) + #f + ) + ) + +;; definition for function cam-launcher-long-joystick +;; INFO: Used lq/sq +(defbehavior cam-launcher-long-joystick camera-slave () + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (set! (-> gp-0 rvec quad) (the-as uint128 0)) + (set! (-> gp-0 uvec quad) (the-as uint128 0)) + (set! (-> gp-0 fvec quad) (the-as uint128 0)) + (set! (-> gp-0 trans quad) (the-as uint128 0)) + (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) + (f0-1 (* -546.13336 f0-0)) + (f0-3 (fmin 546.13336 (fmax -546.13336 f0-1))) + ) + (matrix-axis-angle! gp-0 (-> *camera* local-down) f0-3) + ) + (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) + ) + (vector-normalize! (-> self view-flat) 4096.0) + ) + ) + +;; failed to figure out what this is: +(defstate cam-launcher-longfall (camera-slave) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('teleport) + #f + ) + (else + (cam-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (when (not (-> self enter-has-run)) + (new 'stack-no-clear 'vector) + (vector-negate! (-> self view-flat) (-> self tracking inv-mat fvec)) + (vector-normalize! (-> self view-flat) 4096.0) + (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) + (vector+! (-> self trans) (-> self trans) (-> self view-flat)) + (set! (-> self blend-from-type) (camera-blend-from-type unknown-0)) + (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) + (cam-calc-follow! (-> self tracking) (-> self trans) #f) + (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) + ) + ) + :trans (behavior () + (if (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) + (cam-slave-go cam-free-floating) + ) + (cam-launcher-long-joystick) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until #f + (when (not (paused?)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + 0.0 + (send-event *camera* 'teleport) + (let* ((f0-4 (vector-dot (-> self velocity) (-> *camera* local-down))) + (f30-0 (* 0.975 f0-4)) + ) + (vector--float*! s4-0 (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) + (vector-! s4-0 s4-0 (-> self trans)) + (let ((f28-0 (vector-dot s4-0 (-> *camera* local-down)))) + (vector--float*! s5-0 s4-0 (-> *camera* local-down) f28-0) + (cond + ((< f28-0 f30-0) + (set! f30-0 f28-0) + ) + ((< 20480.0 f28-0) + (let ((f28-1 (+ -20480.0 f28-0))) + (let ((f0-8 (lerp f30-0 f28-1 0.005))) + (if (< f30-0 f0-8) + (set! f30-0 f0-8) + ) + ) + (if (< (* 0.09 f28-1) f30-0) + (set! f30-0 (* 0.09 f28-1)) + ) + ) + ) + ) + ) + (vector+float*! (-> self velocity) s5-0 (-> *camera* local-down) f30-0) + ) + ) + (vector+! (-> self trans) (-> self trans) (-> self velocity)) + (set! (-> self trans x) (-> *camera* tpos-curr x)) + (set! (-> self trans z) (-> *camera* tpos-curr z)) + (vector+! (-> self trans) (-> self trans) (-> self view-flat)) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) + (send-event *camera* 'change-state cam-string (seconds 0.5)) + ) + ) + (vector-reset! (-> self tracking follow-off)) + (vector+! (-> self tracking follow-pt) (-> *camera* tpos-curr-adj) (-> self tracking follow-off)) + (vector--float*! + (-> self tracking follow-pt) + (-> self tracking follow-pt) + (-> *camera* local-down) + (-> *camera* settings target-height) + ) + (slave-set-rotation! (-> self tracking) (-> self trans) (-> self options) (-> self fov) #f) + (suspend) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate idle (launcher) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('instant-death) + (go-virtual deactivated) + ) + (('trans) + (move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> block param 0))) + (update-transforms (the-as collide-shape (-> self root))) + ) + ) + ) + :trans (behavior () + (when (and *target* + (and (>= (-> self active-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (cond + ((send-event *target* 'query 'powerup (pickup-type eco-blue)) + (go-virtual active) + ) + (else + (let ((gp-0 'target-launch)) + (if (= (send-event *target* 'query 'mode) gp-0) + (send-event *target* 'end-mode 'launch) + ) + ) + ) + ) + (if (and (and *target* (and (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) + ) + (talker-spawn-func (-> *talker-speech* 44) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate active (launcher) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (or (= message 'touch) (= message 'attack)) + (set-time! (-> self state-time)) + (send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) + ) + (cond + ((= message 'instant-death) + (go-virtual deactivated) + ) + ((= message 'trans) + (move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> block param 0))) + (update-transforms (the-as collide-shape (-> self root))) + ) + ) + ) + :exit (behavior () + (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-0 command) (sound-command set-param)) + (set! (-> v1-0 id) (-> self sound-id)) + (set! (-> v1-0 params volume) -4) + (set! (-> v1-0 auto-time) 120) + (set! (-> v1-0 auto-from) 2) + (set! (-> v1-0 params mask) (the-as uint 17)) + (-> v1-0 id) + ) + ) + :trans (behavior () + (if (or (or (not *target*) + (or (< (-> self active-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (focus-test? *target* teleporting) + ) + ) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) + ) + (go-virtual idle) + ) + (spawn (-> self part) (-> self root trans)) + (sound-play "launch-idle" :id (-> self sound-id)) + (if (and (and *target* + (and (>= (+ 2867.2 (-> (the-as collide-shape (-> self root)) root-prim prim-core world-sphere w)) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + ) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) + ) + (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) + ) + ) + :code (behavior () + (sound-play "launch-start") + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate deactivated (launcher) + :virtual #t + :code sleep-code + ) + +;; definition for method 11 of type launcher +(defmethod init-from-entity! ((this launcher) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-4) + ) + (set! (-> s4-0 nav-radius) 13926.4) + (let ((v1-6 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-6 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-6 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (update-transforms (the-as collide-shape (-> this root))) + (set! (-> this active-distance) 409600.0) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) + (let ((s4-1 (res-lump-value arg0 'mode uint128 :time -1000000000.0))) + (let ((v1-14 (-> this level name))) + (set! (-> this part) (create-launch-control + (cond + ((= v1-14 'beach) + (-> *part-group-id-table* 7) + ) + ((= v1-14 'swamp) + (-> *part-group-id-table* 9) + ) + (else + (-> *part-group-id-table* 8) + ) + ) + this + ) + ) + ) + (let ((v1-20 (logand (the-as int s4-1) 255))) + (cond + ((= (the-as uint v1-20) 1) + (set! (-> this camera) cam-launcher-longfall) + ) + ((= (the-as uint v1-20) 2) + (set! (-> this camera) #f) + ) + (else + (set! (-> this camera) cam-launcher-shortfall) + ) + ) + ) + ) + (let ((v1-25 (res-lump-struct arg0 'alt-vector vector))) + (when v1-25 + (set-vector! (-> this dest) (-> v1-25 x) (-> v1-25 y) (-> v1-25 z) 1.0) + (set! (-> this seek-time) (the-as time-frame (the int (* 300.0 (-> v1-25 w))))) + ) + ) + (set! (-> this sound-id) (new-sound-id)) + (nav-mesh-connect-from-ent this) + (go (method-of-object this idle)) + ) + +;; definition for function launcher-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior launcher-init-by-other launcher ((arg0 vector) (arg1 float) (arg2 int) (arg3 float)) + (stack-size-set! (-> self main-thread) 128) + (let ((s2-0 (new 'process 'collide-shape self (collide-list-enum hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s2-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s2-0 total-prims) (the-as uint 1)) + (set! (-> s2-0 root-prim) v1-4) + ) + (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) + (let ((v1-7 (-> s2-0 root-prim))) + (set! (-> s2-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s2-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> self root) s2-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (set-vector! (-> self root quat) 0.0 0.0 0.0 1.0) + (update-transforms (the-as collide-shape (-> self root))) + (set! (-> self spring-height) arg1) + (set! (-> self active-distance) arg3) + (let ((v1-18 (-> self level name))) + (set! (-> self part) (create-launch-control + (cond + ((= v1-18 'beach) + (-> *part-group-id-table* 7) + ) + ((= v1-18 'swamp) + (-> *part-group-id-table* 9) + ) + (else + (-> *part-group-id-table* 8) + ) + ) + self + ) + ) + ) + (case (logand arg2 255) + ((1) + (set! (-> self camera) cam-launcher-longfall) + ) + ((2) + (set! (-> self camera) #f) + ) + (else + (set! (-> self camera) cam-launcher-shortfall) + ) + ) + (let ((v1-29 (res-lump-struct (-> self entity) 'alt-vector vector))) + (when v1-29 + (set-vector! (-> self dest) (-> v1-29 x) (-> v1-29 y) (-> v1-29 z) 1.0) + (set! (-> self seek-time) (the-as time-frame (the int (* 300.0 (-> v1-29 w))))) + ) + ) + (set! (-> self sound-id) (new-sound-id)) + (go-virtual idle) + (none) + ) + +;; failed to figure out what this is: +(defstate active (touch-tracker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (case message + (('touched) + (let ((v1-1 (ppointer->process (-> self parent)))) + (when (!= v1-1 proc) + (cond + ((= (-> self event) 'attack) + (send-event + proc + (-> self event) + :from v1-1 + #f + (static-attack-info ((mode (-> self event-mode)) (id (new-attack-id)))) + ) + ) + ((-> self event) + (send-event proc (-> self event) :from v1-1) + ) + (else + (let ((t0-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> t0-5 from) (process->ppointer proc)) + (set! (-> t0-5 num-params) argc) + (set! (-> t0-5 message) message) + (set! (-> t0-5 param 0) (-> block param 0)) + (set! (-> t0-5 param 1) (-> block param 1)) + (set! (-> t0-5 param 2) (-> block param 2)) + (set! (-> t0-5 param 3) (-> block param 3)) + (set! (-> t0-5 param 4) (-> block param 4)) + (set! (-> t0-5 param 5) (-> block param 5)) + (send-event-function v1-1 t0-5) + ) + ) + ) + ) + ) + ) + (('target) + (set! v0-0 (process->handle (the-as process (-> block param 0)))) + (set! (-> self target) (the-as handle v0-0)) + v0-0 + ) + (('event) + (set! (-> self event) (the-as symbol (-> block param 0))) + (set! v0-0 (-> block param 1)) + (set! (-> self event-mode) (the-as symbol v0-0)) + v0-0 + ) + (('exit) + (set! v0-0 (-> block param 0)) + (set! (-> self run-function) (the-as (function object) v0-0)) + v0-0 + ) + (('eval) + ((the-as (function touch-tracker object) (-> block param 0)) self) + ) + (('function) + (set! v0-0 (-> block param 0)) + (set! (-> self callback) (the-as (function touch-tracker none) v0-0)) + v0-0 + ) + ) + ) + :code (behavior () + (set-time! (-> self state-time)) + (while ((-> self run-function)) + (let* ((gp-0 (handle->process (-> self target))) + (a0-4 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (when a0-4 + (let* ((gp-1 (-> (the-as process-drawable a0-4) root)) + (a0-6 (if (type? gp-1 collide-shape) + gp-1 + ) + ) + ) + (if a0-6 + (set! (-> (the-as collide-shape (-> self root)) trans quad) + (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere quad) + ) + ) + ) + ) + ) + (if (-> self callback) + ((-> self callback) self) + ) + (update-transforms (the-as collide-shape (-> self root))) + (let ((a1-3 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-3 options) (overlaps-others-options oo1)) + (set! (-> a1-3 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-3 tlist) *touching-list*) + (find-overlapping-shapes (the-as collide-shape (-> self root)) a1-3) + ) + (suspend) + ) + (let ((v1-21 (-> (the-as collide-shape (-> self root)) root-prim))) + (set! (-> v1-21 prim-core collide-as) (collide-spec)) + (set! (-> v1-21 prim-core collide-with) (collide-spec)) + ) + 0 + (suspend) + 0 + ) + ) + +;; definition for function touch-tracker-init +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior touch-tracker-init touch-tracker ((arg0 vector) (arg1 float) (arg2 time-frame)) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec jak enemy)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + ) + ) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 arg1) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-9 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self duration) arg2) + (set! (-> self target) (the-as handle #f)) + (set! (-> self event) #f) + (set! (-> self callback) #f) + (set! (-> self run-function) + (lambda :behavior touch-tracker () (not (time-elapsed? (-> self state-time) (-> self duration)))) + ) + (set! (-> self event-hook) (-> (method-of-object self active) event)) + (go-virtual active) + (none) + ) + +;; definition for method 22 of type explosion +;; WARN: Return type mismatch int vs none. +(defmethod explosion-method-22 ((this explosion)) + 0 + (none) + ) + +;; definition for function explosion-init-by-other +;; INFO: Used lq/sq +(defbehavior explosion-init-by-other explosion ((arg0 explosion-init-params)) + (mem-copy! (the-as pointer (-> self params)) (the-as pointer arg0) 72) + (logclear! (-> self mask) (process-mask actor-pause movie)) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum hit-by-player)))) + (set! (-> s5-0 penetrate-using) (penetrate explode)) + (let ((v1-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-5 prim-core action) (collide-action solid)) + (set-vector! (-> v1-5 local-sphere) 0.0 0.0 0.0 0.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-5) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-8 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-8 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-8 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (set! (-> (the-as collide-shape (-> self root)) event-self) 'touched) + (set! (-> self root trans quad) (-> arg0 spawn-point quad)) + (quaternion-copy! (-> self root quat) (-> arg0 spawn-quat)) + (vector-identity! (-> self root scale)) + (vector-float*! (-> self root scale) (-> self root scale) (-> arg0 scale)) + (trs-matrix-calc! (-> self root) (-> self mat)) + (let ((v1-19 (-> (the-as collide-shape (-> self root)) root-prim))) + (set! (-> v1-19 local-sphere w) (-> arg0 radius)) + (set! (-> v1-19 prim-core world-sphere w) (-> arg0 radius)) + (set! (-> v1-19 prim-core collide-with) (-> arg0 collide-with)) + ) + (let* ((v1-20 *game-info*) + (a0-19 (+ (-> v1-20 attack-id) 1)) + ) + (set! (-> v1-20 attack-id) a0-19) + (set! (-> self attack-id) a0-19) + ) + (let ((a0-20 (-> arg0 group))) + (when a0-20 + (set! (-> self duration) (-> a0-20 duration)) + (set! (-> self linger-duration) (-> a0-20 linger-duration)) + (set! (-> self part) (create-launch-control a0-20 self)) + ) + ) + (let ((v1-26 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> v1-26 sphere quad) (-> self root trans quad)) + (vector-reset! (-> v1-26 velocity)) + (set! (-> v1-26 sphere r) (* 2.0 (-> arg0 radius))) + (set! (-> v1-26 notify-radius) 204800.0) + (set! (-> v1-26 danger-level) 1.0) + (set! (-> v1-26 decay-rate) 0.0) + (set! (-> v1-26 flags) (the-as uint 1)) + (set! (-> v1-26 danger-type) (the-as uint 5)) + (send-event *traffic-manager* 'add-danger-sphere v1-26) + ) + (explosion-method-22 self) + (go-virtual explode) + ) + +;; definition for function explosion-spawn-legacy-version +(defun explosion-spawn-legacy-version ((arg0 process-drawable) (arg1 type) (arg2 explosion-init-params)) + (let ((s4-0 (get-process *default-dead-pool* arg1 #x4000 1))) + (when s4-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s4-0 arg0 "explosion" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 explosion-init-by-other arg2) + (-> s4-0 ppointer) + ) + ) + ) + +;; definition for function explosion-spawn +;; WARN: Return type mismatch process vs none. +(defun explosion-spawn ((arg0 process-drawable) (arg1 type) (arg2 explosion-init-params)) + (let* ((gp-0 (the-as process #f)) + (s3-0 (get-process *default-dead-pool* explosion #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type explosion activate))) + (t9-1 (the-as explosion s3-0) (the-as process-tree arg1) "explosion" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 explosion-init-by-other arg0) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (none) + ) + +;; definition for function find-closest-solid-sphere-prim +(defun find-closest-solid-sphere-prim ((arg0 collide-shape) (arg1 vector) (arg2 collide-spec)) + (let ((gp-0 (the-as collide-shape-prim #f))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 x) (the-as float #x7f800000)) + (let ((s2-0 (-> arg0 root-prim)) + (s1-0 1) + ) + (when (zero? (-> s2-0 prim-core prim-type)) + (let ((v1-3 s2-0)) + (set! s2-0 (-> (the-as collide-shape-prim-group v1-3) child 0)) + (set! s1-0 (the-as int (-> v1-3 specific 0))) + ) + ) + (while (nonzero? s1-0) + (+! s1-0 -1) + (when (and (= (-> s2-0 prim-core prim-type) -1) + (logtest? (-> s2-0 prim-core action) (collide-action solid)) + (logtest? (-> s2-0 prim-core collide-as) arg2) + ) + (set! (-> s3-0 y) (vector-vector-distance arg1 (the-as vector (-> s2-0 prim-core)))) + (set! (-> s3-0 y) (fmax 0.0 (- (-> s3-0 y) (-> s2-0 prim-core world-sphere w)))) + (when (< (-> s3-0 y) (-> s3-0 x)) + (set! (-> s3-0 x) (-> s3-0 y)) + (set! gp-0 s2-0) + ) + ) + (&+! s2-0 80) + ) + ) + ) + gp-0 + ) + ) + +;; definition for symbol *explosion-debug-sphere*, type sphere +(define *explosion-debug-sphere* (new 'static 'sphere)) + +;; failed to figure out what this is: +(defstate explode (explosion) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (a0-13 process)) + (case message + (('touched) + (let ((s4-0 (new 'stack-no-clear 'mystery-cquery-type0))) + (set! (-> s4-0 explosion-trans quad) + (-> (the-as collide-shape (-> self root)) root-prim prim-core world-sphere quad) + ) + (let* ((s2-0 proc) + (s3-0 (if (type? s2-0 process-drawable) + s2-0 + ) + ) + ) + (when (and s3-0 (!= s3-0 (handle->process (-> self params ignore-proc)))) + (let ((v1-6 (find-closest-solid-sphere-prim + (the-as collide-shape (-> (the-as process-drawable s3-0) root)) + (-> s4-0 explosion-trans) + (-> self params collide-with) + ) + ) + ) + (cond + (v1-6 + (set! (-> s4-0 proc-trans quad) (-> v1-6 prim-core world-sphere quad)) + ) + ((begin + (let ((s2-2 proc)) + (set! a0-13 (if (type? s2-2 process-focusable) + s2-2 + ) + ) + ) + a0-13 + ) + (set! (-> s4-0 proc-trans quad) (-> (get-trans (the-as process-focusable a0-13) 3) quad)) + ) + (else + (let* ((s2-4 (-> (the-as process-focusable s3-0) root)) + (v1-12 (if (type? s2-4 collide-shape) + s2-4 + ) + ) + ) + (if v1-12 + (set! (-> s4-0 proc-trans quad) (-> v1-12 root-prim prim-core world-sphere quad)) + (set! (-> s4-0 proc-trans quad) (-> (the-as process-focusable s3-0) root trans quad)) + ) + ) + ) + ) + ) + (set! (-> s4-0 dist) (vector-vector-distance (-> s4-0 proc-trans) (-> s4-0 explosion-trans))) + (set! (-> s4-0 dist) (fmax 0.0 (- (-> s4-0 dist) (-> s4-0 proc-trans w)))) + (set! (-> s4-0 probe) -1.0) + (when (< 0.0 (-> s4-0 dist)) + (set! (-> s4-0 cquery start-pos quad) (-> s4-0 explosion-trans quad)) + (vector-! (-> s4-0 cquery move-dist) (-> s4-0 proc-trans) (-> s4-0 explosion-trans)) + (let ((v1-23 (-> s4-0 cquery))) + (set! (-> v1-23 radius) 40.96) + (set! (-> v1-23 collide-with) (collide-spec backgnd)) + (set! (-> v1-23 ignore-process0) #f) + (set! (-> v1-23 ignore-process1) #f) + (set! (-> v1-23 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-23 action-mask) (collide-action solid)) + ) + (set! (-> s4-0 probe) (fill-and-probe-using-line-sphere *collide-cache* (-> s4-0 cquery))) + ) + (when (< (-> s4-0 probe) 0.0) + (let ((s3-1 (new 'stack-no-clear 'inline-array 'vector 2))) + (vector-! (-> s3-1 0) (-> s4-0 proc-trans) (-> s4-0 explosion-trans)) + (set! (-> s3-1 1 x) (- 1.0 (fmin 1.0 (/ (-> s4-0 dist) (-> self params radius))))) + (set! (-> s3-1 1 y) (+ 1.0 (* (-> s3-1 1 x) (+ -1.0 (-> self params damage-scale))))) + (set! (-> s3-1 1 z) (* (-> s3-1 1 y) (-> self params damage))) + (vector-normalize! (-> s3-1 0) (-> s3-1 1 w)) + (send-event + proc + 'attack + (-> block param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (-> self attack-id)) + (damage (-> s3-1 1 z)) + (vehicle-damage-factor (-> self params vehicle-damage-factor)) + (vehicle-impulse-factor (-> self params vehicle-impulse-factor)) + (mode 'explode) + (attacker-velocity (-> s3-1 0)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code (behavior () + (set-time! (-> self start-time)) + (when (nonzero? (-> self params collide-with)) + (update-transforms (the-as collide-shape (-> self root))) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (the-as collide-shape (-> self root)) a1-0) + ) + ) + (let ((v1-11 (-> (the-as collide-shape (-> self root)) root-prim))) + (set! (-> v1-11 prim-core collide-as) (collide-spec)) + (set! (-> v1-11 prim-core collide-with) (collide-spec)) + ) + 0 + (while (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self duration)))) + (sparticle-launch-control-method-17 (-> self part) (-> self mat)) + (suspend) + ) + (set-time! (-> self start-time)) + (while (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self linger-duration)))) + (suspend) + ) + ) + ) + +;; definition for function process-drawable-random-point! +(defun process-drawable-random-point! ((arg0 process-drawable) (arg1 vector)) + (let ((v1-1 (-> arg0 node-list length)) + (s4-0 (-> arg0 root)) + ) + (cond + ((>= v1-1 7) + (let ((v1-2 (rand-vu-int-range 3 (+ v1-1 -1)))) + (vector<-cspace! arg1 (-> arg0 node-list data v1-2)) + ) + ) + ((and (nonzero? s4-0) (type? s4-0 collide-shape)) + (vector+! + arg1 + (the-as vector (-> (the-as collide-shape s4-0) root-prim prim-core)) + (rand-vu-sphere-point! arg1 (-> (the-as collide-shape s4-0) root-prim prim-core world-sphere w)) + ) + ) + (else + (vector+! arg1 (-> arg0 root trans) (rand-vu-sphere-point! arg1 (-> arg0 draw bounds w))) + ) + ) + ) + arg1 + ) + +;; definition for function process-drawable-pair-random-point! +;; INFO: Used lq/sq +(defun process-drawable-pair-random-point! ((arg0 process-drawable) (arg1 process-drawable) (arg2 vector) (arg3 float)) + (let ((s4-0 (new-stack-vector0)) + (s3-0 (new-stack-vector0)) + ) + (process-drawable-random-point! arg0 s4-0) + (process-drawable-random-point! arg1 s3-0) + (vector-lerp! arg2 s4-0 s3-0 arg3) + ) + ) + +;; definition of type simple-prim +(deftype simple-prim (process-drawable) + ((strip prim-strip) + ) + (:state-methods + active + ) + (:methods + (init-strip! (_type_) none) + (strip-setup (_type_) none) + (get-alpha (_type_) int) + (allocate-trans-and-strip! (_type_) prim-strip) + (get-color (_type_) rgba) + ) + ) + +;; definition for method 3 of type simple-prim +(defmethod inspect ((this simple-prim)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tstrip: ~A~%" (-> this strip)) + (label cfg-4) + this + ) + +;; definition for method 11 of type simple-prim +(defmethod init-from-entity! ((this simple-prim) (arg0 entity-actor)) + (allocate-trans-and-strip! this) + (process-entity-set! this arg0) + (process-drawable-from-entity! this arg0) + (let ((v1-3 ((method-of-type res-lump get-property-struct) + (-> this entity) + 'trans-offset + 'interp + -1000000000.0 + *zero-vector* + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (vector+! (-> this root trans) (-> this root trans) (the-as vector v1-3)) + ) + (let ((f0-0 (res-lump-float (-> this entity) 'scale :default 1.0))) + (vector-float*! (-> this root scale) (-> this root scale) f0-0) + ) + (vector-float*! (-> this root scale) (-> this root scale) 4096.0) + (let ((f0-2 (res-lump-float (-> this entity) 'rotoffset))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-2) + ) + (let ((f0-3 (res-lump-float (-> this entity) 'tiltmin))) + (quaternion-rotate-local-x! (-> this root quat) (-> this root quat) f0-3) + ) + (set! (-> this strip tex-id) (new 'static 'texture-id :index #x3 :page #x1)) + (go (method-of-object this active)) + ) + +;; definition for method 24 of type simple-prim +(defmethod allocate-trans-and-strip! ((this simple-prim)) + "Allocate transform and strip." + (set! (-> this root) (new 'process 'trsqv)) + (quaternion-identity! (-> this root quat)) + (let ((v0-2 (new 'process 'prim-strip 4 (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)))) + (set! (-> this strip) v0-2) + v0-2 + ) + ) + +;; definition for function simple-prim-init-by-other +;; INFO: Used lq/sq +(defbehavior simple-prim-init-by-other simple-prim ((arg0 vector) (arg1 vector) (arg2 texture-id)) + (allocate-trans-and-strip! self) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root scale quad) (-> arg1 quad)) + (set! (-> self strip tex-id) arg2) + (go-virtual active) + ) + +;; definition for method 22 of type simple-prim +;; WARN: Return type mismatch int vs none. +(defmethod strip-setup ((this simple-prim)) + (set! (-> this strip num-verts) (the-as uint 4)) + (set! (-> this strip alpha) *simple-prim-alpha-blend*) + (set! (-> this strip adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip data0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate active (simple-prim) + :virtual #t + :enter (behavior () + '() + ) + :trans (behavior () + (strip-setup self) + (init-strip! self) + ) + :code sleep-code + ) + +;; definition for method 23 of type simple-prim +(defmethod get-alpha ((this simple-prim)) + 128 + ) + +;; definition for method 25 of type simple-prim +(defmethod get-color ((this simple-prim)) + *color-gray* + ) + +;; definition for method 21 of type simple-prim +;; INFO: Used lq/sq +;; WARN: Return type mismatch rgba vs none. +(defmethod init-strip! ((this simple-prim)) + (quaternion-normalize! (-> this root quat)) + (let ((s2-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (gp-0 (get-alpha this)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (get-color this)) + ) + (vector-normalize! s2-0 (-> this root scale x)) + (vector-normalize! s3-0 (-> this root scale y)) + (let ((v1-8 (-> this strip data))) + (vector+! s4-0 (-> this root trans) s2-0) + (vector+! s4-0 s4-0 s3-0) + (set! (-> v1-8 0 pos quad) (-> s4-0 quad)) + (set! (-> v1-8 0 stq z) 0.0) + (set! (-> v1-8 0 stq x) 0.0) + (set! (-> v1-8 0 stq y) 0.0) + (set! (-> v1-8 0 col) s5-0) + (set! (-> v1-8 0 col a) gp-0) + (let ((v1-9 (-> v1-8 1))) + (vector+float*! s4-0 (-> this root trans) s2-0 -1.0) + (vector+! s4-0 s4-0 s3-0) + (set! (-> v1-9 pos quad) (-> s4-0 quad)) + (set! (-> v1-9 stq z) 0.0) + (set! (-> v1-9 stq x) 1.0) + (set! (-> v1-9 stq y) 0.0) + (set! (-> v1-9 col) s5-0) + (set! (-> v1-9 col a) gp-0) + (let ((v1-10 (&+ v1-9 32))) + (vector+! s4-0 (-> this root trans) s2-0) + (vector+float*! s4-0 s4-0 s3-0 -1.0) + (set! (-> v1-10 pos quad) (-> s4-0 quad)) + (set! (-> v1-10 stq z) 0.0) + (set! (-> v1-10 stq x) 0.0) + (set! (-> v1-10 stq y) 1.0) + (set! (-> v1-10 col) s5-0) + (set! (-> v1-10 col a) gp-0) + (let ((v1-11 (&+ v1-10 32))) + (vector+float*! s4-0 (-> this root trans) s2-0 -1.0) + (vector+float*! s4-0 s4-0 s3-0 -1.0) + (set! (-> v1-11 pos quad) (-> s4-0 quad)) + (set! (-> v1-11 stq z) 0.0) + (set! (-> v1-11 stq x) 1.0) + (set! (-> v1-11 stq y) 1.0) + (set! (-> v1-11 col) s5-0) + (set! (-> v1-11 col a) gp-0) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 7 of type simple-prim +(defmethod relocate ((this simple-prim) (offset int)) + (if (nonzero? (-> this strip)) + (&+! (-> this strip) offset) + ) + (call-parent-method this offset) + ) + +;; definition of type simple-prim-zbuf-mask +(deftype simple-prim-zbuf-mask (simple-prim) + () + ) + +;; definition for method 3 of type simple-prim-zbuf-mask +(defmethod inspect ((this simple-prim-zbuf-mask)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type simple-prim inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 22 of type simple-prim-zbuf-mask +;; WARN: Return type mismatch int vs none. +(defmethod strip-setup ((this simple-prim-zbuf-mask)) + (set! (-> this strip num-verts) (the-as uint 4)) + (set! (-> this strip alpha) *simple-prim-additive*) + (set! (-> this strip adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip data0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + ) + (set! (-> this strip bucket) (bucket-id bucket569)) + (set! (-> this strip sink) (the-as uint 65)) + (none) + ) + +;; definition for method 25 of type simple-prim-zbuf-mask +(defmethod get-color ((this simple-prim-zbuf-mask)) + *color-black* + ) + +;; definition of type simple-prim-particle-binding +(deftype simple-prim-particle-binding (simple-prim) + ((color rgba) + (lifetime time-frame) + ) + (:state-methods + die + ) + (:methods + (setup! (_type_ int sparticle-cpuinfo sparticle-launchinfo) none) + ) + ) + +;; definition for method 3 of type simple-prim-particle-binding +(defmethod inspect ((this simple-prim-particle-binding)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type simple-prim inspect))) + (t9-0 this) + ) + (format #t "~2Tcolor: ~D~%" (-> this color)) + (format #t "~2Tlifetime: ~D~%" (-> this lifetime)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (label cfg-4) + this + ) + +;; definition for method 25 of type simple-prim-particle-binding +(defmethod get-color ((this simple-prim-particle-binding)) + (-> this color) + ) + +;; failed to figure out what this is: +(defstate die (simple-prim-particle-binding) + :virtual #t + :code nothing + ) + +;; failed to figure out what this is: +(defstate active (simple-prim-particle-binding) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (init-strip! self) + (if (time-elapsed? (-> self state-time) (-> self lifetime)) + (go-virtual die) + ) + ) + :code sleep-code + ) + +;; definition for method 27 of type simple-prim-particle-binding +;; WARN: Return type mismatch int vs none. +(defmethod setup! ((this simple-prim-particle-binding) (arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + "Set up this prim with the given particle info." + (set! (-> this lifetime) (seconds 5)) + (set! (-> this root scale x) (-> arg2 launchrot w)) + (set! (-> this root scale y) (-> arg2 conerot w)) + (set! (-> this color r) (the int (* 128.0 (-> arg2 rotate-x)))) + (set! (-> this color g) (the int (* 128.0 (-> arg2 rotate-y)))) + (set! (-> this color b) (the int (* 128.0 (-> arg2 rotate-z)))) + (set! (-> this color a) (the int (* 128.0 (-> arg2 coneradius)))) + (set-vector! (-> this root trans) (-> arg2 launchrot x) (-> arg2 launchrot y) (-> arg2 launchrot z) 1.0) + (set! (-> this strip adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip data0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + ) + (cond + ((logtest? (-> arg1 flags) (sp-cpuinfo-flag aux-list)) + (set! (-> this strip alpha) *simple-prim-additive*) + (set! (-> this color) *color-black*) + ) + ((logtest? (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-3)) + (set! (-> this strip alpha) *simple-prim-additive*) + ) + (else + (set! (-> this strip alpha) *simple-prim-alpha-blend*) + ) + ) + (set! (-> this strip num-verts) (the-as uint 4)) + (none) + ) + +;; definition for function birth-func-simple-prim +(defun birth-func-simple-prim ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s3-0 (get-process *default-dead-pool* simple-prim-particle-binding #x4000 1))) + (setup! + (the-as simple-prim-particle-binding (-> (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 *entity-pool* "prim" (the-as pointer #x70004000)) + ) + (run-now-in-process + s3-0 + simple-prim-init-by-other + *zero-vector* + *zero-vector* + (new 'static 'texture-id :index #x3 :page #x1) + ) + (-> s3-0 ppointer) + ) + 0 + ) + ) + arg0 + arg1 + arg2 + ) + ) + (none) + ) + +;; definition of type part-controller +(deftype part-controller (process) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (spawn-delay time-frame) + (current-part-index uint16) + (state-time time-frame) + (next-reset-time time-frame) + (reset-interval-min time-frame) + (reset-interval-max time-frame) + (particle-launchers (array (pointer sparticle-launch-group))) + (spawn-sound sound-name) + ) + (:state-methods + active + ) + ) + +;; definition for method 3 of type part-controller +;; INFO: Used lq/sq +(defmethod inspect ((this part-controller)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tspawn-delay: ~D~%" (-> this spawn-delay)) + (format #t "~2Tcurrent-part-index: ~D~%" (-> this current-part-index)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tnext-reset-time: ~D~%" (-> this next-reset-time)) + (format #t "~2Treset-interval-min: ~D~%" (-> this reset-interval-min)) + (format #t "~2Treset-interval-max: ~D~%" (-> this reset-interval-max)) + (format #t "~2Tparticle-launchers: ~A~%" (-> this particle-launchers)) + (format #t "~2Tspawn-sound: ~D~%" (-> this spawn-sound)) + (label cfg-7) + this + ) + +;; definition for method 7 of type part-controller +(defmethod relocate ((this part-controller) (offset int)) + (if (nonzero? (-> this particle-launchers)) + (&+! (-> this particle-launchers) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 12 of type part-controller +(defmethod run-logic? ((this part-controller)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 11 of type part-controller +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this part-controller) (arg0 entity-actor)) + (local-vars (sv-16 res-tag) (sv-32 string)) + (stack-size-set! (-> this main-thread) 32) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-3 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-3 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-3)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (when (<= (-> this actor-group-count) 0) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) + (return 0) + ) + (let ((a0-9 ((method-of-type res-lump get-property-struct) + arg0 + 'sound-name + 'interp + -1000000000.0 + "" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! (-> this spawn-sound) (string->sound-name (the-as string a0-9))) + ) + (let ((a3-2 (+ 0 (-> this actor-group 0 length)))) + (set! (-> this particle-launchers) + (the-as (array (pointer sparticle-launch-group)) (new 'process 'boxed-array pointer a3-2)) + ) + ) + (set! (-> this particle-launchers length) 0) + (dotimes (s4-0 (min 1 (-> this actor-group-count))) + (dotimes (s3-0 (-> this actor-group s4-0 length)) + (set! sv-32 "#f") + (set! (-> this particle-launchers (-> this particle-launchers length)) + (entity-lookup-part-group + (the-as entity-actor (-> this actor-group s4-0 data s3-0 actor)) + (& sv-32) + 'art-name + ) + ) + (+! (-> this particle-launchers length) 1) + ) + ) + (set! (-> this spawn-delay) (the-as time-frame (the int (* 300.0 (res-lump-float arg0 'delay :default 1.0))))) + (let ((s4-1 (the int (* 300.0 (res-lump-float arg0 'base-time :default 4.0)))) + (v1-50 (the int (* 300.0 (res-lump-float arg0 'offset-time :default 2.0)))) + ) + (set! (-> this reset-interval-min) (the-as time-frame (- s4-1 v1-50))) + (set! (-> this reset-interval-max) (the-as time-frame (+ s4-1 v1-50))) + ) + (go (method-of-object this active)) + ) + +;; failed to figure out what this is: +(defstate active (part-controller) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self next-reset-time) (+ (current-time) + (-> self reset-interval-min) + (mod + (the-as int (rand-uint31-gen *random-generator*)) + (+ (- 1 (-> self reset-interval-min)) (-> self reset-interval-max)) + ) + ) + ) + ) + :trans (behavior () + (when (< (-> self next-reset-time) (current-time)) + (set! (-> self current-part-index) (the-as uint 0)) + (set! (-> self state-time) 0) + (set! (-> self next-reset-time) (+ (current-time) + (-> self reset-interval-min) + (mod + (the-as int (rand-uint31-gen *random-generator*)) + (+ (- 1 (-> self reset-interval-min)) (-> self reset-interval-max)) + ) + ) + ) + ) + (when (and (time-elapsed? (-> self state-time) (-> self spawn-delay)) + (< (-> self current-part-index) (the-as uint (-> self particle-launchers length))) + ) + (when (-> self particle-launchers (-> self current-part-index)) + (let ((gp-1 (-> self actor-group 0 data (-> self current-part-index) actor extra trans))) + (sound-play-by-name (-> self spawn-sound) (new-sound-id) 1024 0 0 (sound-group) gp-1) + (cond + ((logtest? (-> self particle-launchers (-> self current-part-index) 0 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-2 + (let ((t9-4 (method-of-type part-tracker-subsampler activate))) + (t9-4 + (the-as part-tracker-subsampler gp-2) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-5 run-function-in-process) + (a0-18 gp-2) + (a1-3 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) + (-> self particle-launchers (-> self current-part-index) 0) + ) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-5) a0-18 a1-3 *part-tracker-subsampler-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-3 + (let ((t9-7 (method-of-type part-tracker activate))) + (t9-7 (the-as part-tracker gp-3) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-8 run-function-in-process) + (a0-23 gp-3) + (a1-6 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> self particle-launchers (-> self current-part-index) 0)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-8) a0-23 a1-6 *part-tracker-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + ) + ) + ) + (+! (-> self current-part-index) 1) + (set-time! (-> self state-time)) + ) + ) + :code sleep-code + ) + +;; definition of type sound-controller +(deftype sound-controller (process) + ((spawn-sound sound-name) + (sync sync-linear :inline) + (prev-val float) + (pos vector :inline) + ) + (:state-methods + active + die + ) + ) + +;; definition for method 3 of type sound-controller +;; INFO: Used lq/sq +(defmethod inspect ((this sound-controller)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tspawn-sound: ~D~%" (-> this spawn-sound)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tprev-val: ~f~%" (-> this prev-val)) + (format #t "~2Tpos: #~%" (-> this pos)) + (label cfg-4) + this + ) + +;; definition for method 11 of type sound-controller +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this sound-controller) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 32) + (let ((a0-3 (the-as string ((method-of-type res-lump get-property-struct) + arg0 + 'sound-name + 'interp + -1000000000.0 + "" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (set! (-> this spawn-sound) (string->sound-name a0-3)) + ) + (set! (-> this pos quad) (-> arg0 extra trans quad)) + (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-5 0)) + (if #f + (set! v1-5 (logior v1-5 1)) + ) + (set! (-> a1-3 sync-type) 'sync-linear) + (set! (-> a1-3 sync-flags) (the-as sync-flags v1-5)) + ) + (set! (-> a1-3 entity) arg0) + (set! (-> a1-3 period) (the-as uint #x6fc23b000)) + (set! (-> a1-3 percent) 0.0) + (initialize! (-> this sync) a1-3) + ) + (set! (-> this prev-val) (get-norm! (-> this sync) 0)) + (go (method-of-object this active)) + ) + +;; definition for method 10 of type sound-controller +(defmethod deactivate ((this sound-controller)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate die (sound-controller) + :virtual #t + :code (behavior () + '() + ) + ) + +;; failed to figure out what this is: +(defstate active (sound-controller) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual die) + ) + (('reset) + (-> self sync) + (let ((t9-1 (method-of-type sync-linear sync-info-method-15))) + 0 + (t9-1) + ) + ) + (('play) + (sound-play-by-name (-> self spawn-sound) (new-sound-id) 1024 0 0 (sound-group) (-> self pos)) + ) + ) + ) + :trans (behavior () + (let ((f30-0 (get-norm! (-> self sync) 0))) + (if (< f30-0 (-> self prev-val)) + (sound-play-by-name (-> self spawn-sound) (new-sound-id) 1024 0 0 (sound-group) (-> self pos)) + ) + (set! (-> self prev-val) f30-0) + ) + ) + :code sleep-code + ) + +;; definition of type sound-on-path +(deftype sound-on-path (process-drawable) + "An [[ambient-sound]] that is being moved along a path." + ((spawn-sound sound-name) + (loop-sound uint32 :offset 228) + (amb-sound ambient-sound) + (is-spooling? symbol) + ) + (:state-methods + active + die + no-play + ) + ) + +;; definition for method 3 of type sound-on-path +;; INFO: Used lq/sq +(defmethod inspect ((this sound-on-path)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tspawn-sound: ~D~%" (-> this spawn-sound)) + (format #t "~2Tpath: ~A~%" (-> this path)) + (format #t "~2Tloop-sound: ~D~%" (-> this loop-sound)) + (format #t "~2Tamb-sound: ~A~%" (-> this amb-sound)) + (format #t "~2Tis-spooling?: ~A~%" (-> this is-spooling?)) + (label cfg-4) + this + ) + +;; definition for method 10 of type sound-on-path +(defmethod deactivate ((this sound-on-path)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this amb-sound)) + (stop! (-> this amb-sound)) + ) + (if (nonzero? (-> this loop-sound)) + (sound-stop (the-as sound-id (-> this loop-sound))) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; definition for method 7 of type sound-on-path +;; WARN: Return type mismatch process-drawable vs sound-on-path. +(defmethod relocate ((this sound-on-path) (offset int)) + (if (nonzero? (-> this amb-sound)) + (&+! (-> this amb-sound) offset) + ) + (the-as sound-on-path ((method-of-type process-drawable relocate) this offset)) + ) + +;; definition for method 11 of type sound-on-path +(defmethod init-from-entity! ((this sound-on-path) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 32) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (let ((s4-0 ((method-of-type res-lump get-property-struct) + arg0 + 'sound-name + 'interp + -1000000000.0 + "" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! (-> this is-spooling?) (nonzero? (res-lump-value arg0 'spooling-val uint128 :time -1000000000.0))) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logclear! (-> this mask) (process-mask actor-pause)) + (when (= s4-0 "") + (go (method-of-object this no-play)) + (return 0) + ) + (cond + ((-> this is-spooling?) + (set! (-> this loop-sound) + (the-as + uint + (add-process *gui-control* this (gui-channel background) (gui-action queue) (the-as string s4-0) -99.0 0) + ) + ) + ) + (else + (set! (-> this amb-sound) (new 'process 'ambient-sound (the-as basic s4-0) (-> this root trans) 0.0)) + (let ((f0-0 (res-lump-float arg0 'sound-falloff-far :default 245760.0))) + (set-falloff-far! (-> this amb-sound) f0-0) + ) + (update-vol! (-> this amb-sound) 1.0) + (update-pitch-mod! (-> this amb-sound) 0.0) + ) + ) + ) + (go (method-of-object this active)) + ) + +;; definition for method 12 of type sound-on-path +(defmethod run-logic? ((this sound-on-path)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; failed to figure out what this is: +(defstate die (sound-on-path) + :virtual #t + :code (behavior () + '() + ) + ) + +;; failed to figure out what this is: +(defstate no-play (sound-on-path) + :virtual #t + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate active (sound-on-path) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual die) + ) + ) + ) + :trans (behavior () + (let ((f0-0 (path-control-method-25 (-> self path) (target-pos 0))) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (get-point-at-percent-along-path! (-> self path) gp-1 f0-0 'interp) + (set! (-> self root trans quad) (-> gp-1 quad)) + (cond + ((-> self is-spooling?) + (case (get-status *gui-control* (the-as sound-id (-> self loop-sound))) + (((gui-status ready)) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self loop-sound)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + ) + (else + (update-trans! (-> self amb-sound) gp-1) + (update! (-> self amb-sound)) + ) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate active (external-camera-controller) + :virtual #t + :trans (behavior () + (set-zero! *camera-smush-control*) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status no-kill) #t) + (set-setting! 'calm #t 0.0 0) + (while (not (process-grab? *target* #f)) + (suspend) + ) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 450.0 0) + (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0.0 0) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (-> self pause-time)) + (suspend) + ) + ) + (if (-> self blur) + (set-setting! 'blur-a 'abs 0.5 0) + ) + (remove-setting! 'mode-name) + (remove-setting! 'entity-name) + (remove-setting! 'interp-time) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.5)) + (suspend) + ) + ) + (while (not (process-release? *target*)) + (suspend) + ) + (remove-setting! 'interp-time) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 0.5)) + (suspend) + ) + ) + (remove-setting! 'blur-a) + (process-entity-status! self (entity-perm-status no-kill) #f) + ) + ) + +;; definition for function external-camera-controller-init-by-other +(defbehavior external-camera-controller-init-by-other external-camera-controller ((arg0 entity) (arg1 time-frame) (arg2 symbol)) + (process-entity-set! self arg0) + (set! (-> self pause-time) arg1) + (set! (-> self blur) arg2) + (go-virtual active) + ) + +;; definition of type level-exit +(deftype level-exit (process-drawable) + ((minimap connection-minimap) + (task-counter uint32) + (ent basic) + ) + (:state-methods + active + ) + ) + +;; definition for method 3 of type level-exit +(defmethod inspect ((this level-exit)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Ttask-counter: ~D~%" (-> this task-counter)) + (format #t "~2Tent: ~A~%" (-> this ent)) + (label cfg-4) + this + ) + +;; definition for method 11 of type level-exit +(defmethod init-from-entity! ((this level-exit) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this minimap) #f) + (set! (-> this task-counter) (the-as uint 0)) + (set! (-> this ent) arg0) + (go (method-of-object this active)) + ) + +;; definition for method 12 of type level-exit +(defmethod run-logic? ((this level-exit)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 10 of type level-exit +(defmethod deactivate ((this level-exit)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this minimap) + (kill-callback (-> *minimap* engine) (-> this minimap)) + ) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate active (level-exit) + :virtual #t + :trans (behavior () + (set! (-> self task-counter) (-> *game-info* task-counter)) + (if *bigmap* + (bigmap-method-16 *bigmap*) + ) + (let ((gp-0 (res-lump-struct (-> self entity) 'on-running structure))) + (cond + ((or (not gp-0) (and gp-0 (script-eval (the-as pair gp-0)))) + (if (not (-> self minimap)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 14) (the-as int #f) (the-as vector #t) 0)) + ) + ) + (else + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + ) + ) + ) + ) + :code sleep-code + ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/projectile-h_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/projectile-h_REF.gc index 845104e9fbb..63fa34ed7cd 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/projectile-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/projectile-h_REF.gc @@ -3,11 +3,13 @@ ;; definition of type projectile (deftype projectile (process-drawable) - ((starting-pos vector :inline) - (starting-dir vector :inline) - (target-pos vector :inline) - (base-target-pos vector :inline) - (pre-move-transv vector :inline) + ((parent (pointer process-drawable) :override) + (root collide-shape-moving :override) + (starting-pos vector :inline) + (starting-dir vector :inline) + (target-pos vector :inline) + (base-target-pos vector :inline) + (pre-move-transv vector :inline) (timeout time-frame) (spawn-time time-frame) (options projectile-options) @@ -19,7 +21,7 @@ (move (function projectile none)) (pick-target (function projectile none)) (max-speed float) - (old-dist float 16) + (old-dist float 16) (old-dist-count int32) (hits int32) (max-hits int32) @@ -34,30 +36,32 @@ (stop-speed meters) (invinc-time time-frame) (desired-target uint64) - (desired-target-pos vector :inline) + (desired-target-pos vector :inline) ) + (:state-methods + die + dissipate + impact + moving + ) (:methods - (projectile-method-20 () none) - (projectile-method-21 () none) - (projectile-method-22 () none) - (projectile-method-23 () none) - (projectile-method-24 () none) - (projectile-method-25 () none) - (projectile-method-26 () none) - (projectile-method-27 () none) - (projectile-method-28 () none) - (projectile-method-29 () none) - (projectile-method-30 () none) - (projectile-method-31 () none) - (projectile-method-32 () none) - (projectile-method-33 () none) - (projectile-method-34 () none) - (projectile-method-35 () none) - (projectile-method-36 () none) - (projectile-method-37 () none) - (projectile-method-38 () none) - (projectile-method-39 () none) - (projectile-method-40 () none) + (projectile-method-24 (_type_) none) + (projectile-method-25 (_type_) none) + (projectile-method-26 (_type_) none) + (projectile-method-27 (_type_) none) + (play-impact-sound (_type_ projectile-options) none) + (projectile-method-29 (_type_) none) + (setup-collision! (_type_) none) + (projectile-method-31 (_type_) none) + (projectile-method-32 (_type_) none) + (go-impact! (_type_) none) + (projectile-method-34 (_type_) none) + (event-handler! (_type_ process int symbol event-message-block) object) + (handle-proj-hit! (_type_ process event-message-block) object) + (deal-damage! (_type_ process event-message-block) symbol) + (made-impact? (_type_) symbol) + (projectile-method-39 (_type_) none) + (projectile-method-40 (_type_) int) ) ) @@ -172,10 +176,12 @@ (tumble-quat quaternion :inline) (gravity float) ) + (:state-methods + sitting + ) (:methods - (projectile-bounce-method-41 () none) - (projectile-bounce-method-42 () none) - (projectile-bounce-method-43 () none) + (projectile-bounce-method-42 (_type_) none) + (projectile-bounce-method-43 (_type_) none) ) ) @@ -197,7 +203,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc new file mode 100644 index 00000000000..2bf48c28ae4 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc @@ -0,0 +1,744 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function cshape-reaction-projectile +(defun cshape-reaction-projectile ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (let ((s5-0 (cshape-reaction-default arg0 arg1 arg2 arg3))) + (case (-> arg1 best-other-tri pat material) + (((pat-material stopproj)) + (send-event (-> arg0 process) 'die) + ) + ) + s5-0 + ) + ) + +;; definition for method 39 of type projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-39 ((this projectile)) + 0 + (none) + ) + +;; definition for method 35 of type projectile +(defmethod event-handler! ((this projectile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('tracked) + (let ((v0-0 (the-as object (process->handle (the-as process (-> arg3 param 0)))))) + (set! (-> this last-target) (the-as handle v0-0)) + v0-0 + ) + ) + (('touched 'touch) + (handle-proj-hit! this arg0 arg3) + ) + (('die) + (projectile-method-34 this) + ) + ) + ) + +;; definition for function projectile-event-handler +;; WARN: Return type mismatch object vs projectile. +(defbehavior projectile-event-handler projectile ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as projectile (event-handler! self arg0 arg1 arg2 arg3)) + ) + +;; definition for method 37 of type projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs symbol. +(defmethod deal-damage! ((this projectile) (arg0 process) (arg1 event-message-block)) + (let ((v1-1 (new 'stack 'attack-info))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 mode) (-> this attack-mode)) + (set! (-> a0-2 id) (-> this attack-id)) + (set! (-> a0-2 mask) (attack-mask mode id)) + ) + (when (!= (-> this owner-handle) #f) + (set! (-> v1-1 attacker) (-> this owner-handle)) + (logior! (-> v1-1 mask) (attack-mask attacker)) + ) + (when (logtest? (-> this options) (projectile-options po13)) + (set! (-> v1-1 attacker-velocity quad) (-> this pre-move-transv quad)) + (logior! (-> v1-1 mask) (attack-mask attacker-velocity)) + ) + (set! (-> v1-1 damage) (-> this damage)) + (set! (-> v1-1 vehicle-damage-factor) (-> this vehicle-damage-factor)) + (set! (-> v1-1 vehicle-impulse-factor) (-> this vehicle-impulse-factor)) + (logior! (-> v1-1 mask) (attack-mask damage vehicle-damage-factor vehicle-impulse-factor)) + (when (logtest? (projectile-options po18) (-> this options)) + (set! (-> v1-1 invinc-time) (-> this invinc-time)) + (logior! (-> v1-1 mask) (attack-mask invinc-time)) + ) + (the-as symbol (send-event + arg0 + (if (logtest? (projectile-options po19) (-> this options)) + 'attack-invinc + 'attack + ) + arg1 + v1-1 + ) + ) + ) + ) + +;; definition for method 36 of type projectile +(defmethod handle-proj-hit! ((this projectile) (arg0 process) (arg1 event-message-block)) + (when (-> this attack-mode) + (let* ((a2-1 (-> arg1 param 0)) + (s5-0 (deal-damage! this arg0 (the-as event-message-block a2-1))) + ) + (when s5-0 + (let ((v1-2 (-> this notify-handle))) + (send-event (handle->process v1-2) 'notify 'attack arg0) + ) + (+! (-> this hits) 1) + (when (and (>= (-> this hits) (-> this max-hits)) + (not (and (-> this next-state) (= (-> this next-state name) 'impact))) + ) + (if (= s5-0 'no-impact) + (logior! (-> this options) (projectile-options po20)) + ) + (go (method-of-object this impact)) + ) + ) + ) + ) + ) + +;; definition for method 34 of type projectile +;; WARN: Return type mismatch symbol vs none. +(defmethod projectile-method-34 ((this projectile)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) + (go (method-of-object this impact)) + ) + #t + (none) + ) + +;; definition for method 24 of type projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this projectile)) + 0 + (none) + ) + +;; definition for method 25 of type projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this projectile)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) + ) + 0 + (none) + ) + +;; definition for method 26 of type projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this projectile)) + 0 + (none) + ) + +;; definition for method 27 of type projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-27 ((this projectile)) + 0 + (none) + ) + +;; definition for method 28 of type projectile +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this projectile) (arg0 projectile-options)) + 0 + (none) + ) + +;; definition for method 29 of type projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-29 ((this projectile)) + (when (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + (set! (-> this sound-id) (new 'static 'sound-id)) + 0 + ) + 0 + (none) + ) + +;; definition for method 38 of type projectile +(defmethod made-impact? ((this projectile)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a1-0 t1-0)) + (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (handle->process (-> this ignore-handle))) + (set! (-> a1-0 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a1-0 action-mask) (collide-action solid)) + ) + (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) + ) + ) + +;; definition for function projectile-move-fill-all-dirs +;; WARN: Return type mismatch int vs none. +(defun projectile-move-fill-all-dirs ((arg0 projectile)) + (let ((v1-0 (-> arg0 root)) + (a2-0 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> a2-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a2-0 ignore-process0) arg0) + (set! (-> a2-0 ignore-process1) (handle->process (-> arg0 ignore-handle))) + (set! (-> a2-0 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a2-0 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-0 (-> v1-0 transv) a2-0 (meters 0)) + ) + 0 + (none) + ) + +;; definition for function projectile-move-fill-line-sphere +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun projectile-move-fill-line-sphere ((arg0 projectile)) + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg0 root))) + (let ((a1-0 (new 'stack-no-clear 'collide-query))) + (let ((a2-0 (-> gp-0 root-prim))) + (set! (-> a1-0 start-pos quad) (-> gp-0 trans quad)) + (let ((v1-1 (-> a1-0 move-dist))) + (.lvf vf1 (&-> (-> gp-0 transv) quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-1 quad) vf1) + ) + (let ((v1-2 a1-0)) + (set! (-> v1-2 radius) (-> a2-0 prim-core world-sphere w)) + (set! (-> v1-2 collide-with) (-> a2-0 prim-core collide-with)) + (set! (-> v1-2 ignore-process0) arg0) + (set! (-> v1-2 ignore-process1) (handle->process (-> arg0 ignore-handle))) + (set! (-> v1-2 ignore-pat) (-> gp-0 pat-ignore-mask)) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + ) + (fill-using-line-sphere *collide-cache* a1-0) + ) + (integrate-and-collide! gp-0 (-> gp-0 transv)) + ) + 0 + (none) + ) + ) + +;; definition for function projectile-update-velocity-add-gravity +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun projectile-update-velocity-add-gravity ((arg0 projectile)) + (vector-v++! (-> arg0 root transv) (compute-acc-due-to-gravity (-> arg0 root) (new-stack-vector0) 1.0)) + 0 + (none) + ) + +;; definition for function projectile-update-velocity-space-wars +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun projectile-update-velocity-space-wars ((arg0 projectile)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target-pos) (-> arg0 root trans)))) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root transv) 1.0)) + (f30-0 (vector-length (-> arg0 root transv))) + ) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (vector-flatten! s5-1 s5-1 (-> arg0 root local-normal)) + ) + (vector-normalize-copy! s4-0 s5-1 1.0) + (if (and (or (not (handle->process (-> arg0 last-target))) + (zero? (-> (the-as collide-shape (-> (the-as process-drawable (handle->process (-> arg0 last-target))) root)) + root-prim + prim-core + collide-as + ) + ) + ) + (< (vector-dot s4-0 s3-0) 0.0) + ) + (go (method-of-object arg0 dissipate)) + ) + (vector-deg-slerp (-> arg0 root transv) s3-0 s4-0 (-> arg0 tween)) + (vector-normalize! (-> arg0 root transv) f30-0) + ) + (vector+! (-> arg0 root transv) (-> arg0 root transv) s5-1) + ) + (vector-v++! (-> arg0 root transv) (compute-acc-due-to-gravity (-> arg0 root) (new-stack-vector0) 0.0)) + (if (< (-> arg0 max-speed) (vector-length (-> arg0 root transv))) + (vector-normalize! (-> arg0 root transv) (-> arg0 max-speed)) + ) + (if (logtest? (-> arg0 options) (projectile-options po0)) + (set! (-> arg0 root transv y) -40960.0) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate moving (projectile) + :virtual #t + :event projectile-event-handler + :exit (behavior () + (projectile-method-29 self) + ) + :trans (behavior () + (if (time-elapsed? (-> self spawn-time) (-> self timeout)) + (go-virtual dissipate) + ) + (let ((t9-1 (-> self pick-target))) + (if t9-1 + (t9-1 self) + ) + ) + (let ((t9-2 (-> self update-velocity))) + (if t9-2 + (t9-2 self) + ) + ) + (when (logtest? (-> self options) (projectile-options po1)) + (seek! (-> self tween) 1.0 (* 0.5 (seconds-per-frame))) + (let ((f0-4 (vector-vector-distance (-> self root trans) (-> self target-pos)))) + (cond + ((< f0-4 20480.0) + (seek! (-> self tween) 1.0 (* 3.0 (seconds-per-frame))) + ) + ((< f0-4 40960.0) + (seek! (-> self tween) 1.0 (seconds-per-frame)) + ) + ) + ) + ) + (let ((gp-0 (-> self root))) + (set! (-> self pre-move-transv quad) (-> gp-0 transv quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> gp-0 trans quad)) + ((-> self move) self) + (projectile-method-39 self) + (set! (-> self old-dist (-> self old-dist-count)) (* 0.0625 (vector-vector-distance s5-0 (-> gp-0 trans)))) + ) + ) + (set! (-> self old-dist-count) (logand (+ (-> self old-dist-count) 1) 15)) + (let ((f0-14 0.0)) + (countdown (v1-38 16) + (+! f0-14 (-> self old-dist v1-38)) + ) + (if (or (and (logtest? (-> self options) (projectile-options po4)) + (and (logtest? (-> self root status) (collide-status touch-wall)) (< f0-14 2048.0)) + ) + (< f0-14 (-> self stop-speed)) + ) + (go-impact! self) + ) + ) + ) + :code (behavior () + (until #f + (projectile-method-25 self) + (play-impact-sound self (projectile-options po0 po1)) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate impact (projectile) + :virtual #t + :event projectile-event-handler + :enter (behavior () + (projectile-method-26 self) + (play-impact-sound self (projectile-options po0)) + ) + :code (behavior () + (suspend) + (go-virtual die) + ) + ) + +;; failed to figure out what this is: +(defstate dissipate (projectile) + :virtual #t + :event projectile-event-handler + :enter (behavior () + (projectile-method-27 self) + (play-impact-sound self (projectile-options po1)) + ) + :code (behavior () + (suspend) + (go-virtual die) + ) + ) + +;; failed to figure out what this is: +(defstate die (projectile) + :virtual #t + :code (behavior () + (let ((v1-0 (-> self notify-handle))) + (send-event (handle->process v1-0) 'notify 'die) + ) + (cleanup-for-death self) + ) + ) + +;; definition for method 31 of type projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-31 ((this projectile)) + 0 + (none) + ) + +;; definition for method 30 of type projectile +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this projectile)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-projectile) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec backgnd crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set-vector! (-> v1-6 local-sphere) 0.0 5324.8 0.0 5324.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 2)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 32 of type projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-32 ((this projectile)) + (go (method-of-object this moving)) + 0 + (none) + ) + +;; definition for method 33 of type projectile +;; WARN: Return type mismatch object vs none. +(defmethod go-impact! ((this projectile)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) + (go (method-of-object this impact)) + ) + (none) + ) + +;; definition for method 10 of type projectile +(defmethod deactivate ((this projectile)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (projectile-method-29 this) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; definition for method 40 of type projectile +(defmethod projectile-method-40 ((this projectile)) + 32 + ) + +;; definition for function projectile-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs object. +(defbehavior projectile-init-by-other projectile ((arg0 projectile-init-by-other-params)) + (let ((a1-0 (projectile-method-40 self))) + (stack-size-set! (-> self main-thread) a1-0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-entity-set! self (-> arg0 ent)) + (set! (-> self charge-level) (-> arg0 charge)) + (set! (-> self options) (-> arg0 options)) + (set! (-> self notify-handle) (-> arg0 notify-handle)) + (set! (-> self owner-handle) (-> arg0 owner-handle)) + (set! (-> self ignore-handle) (-> arg0 ignore-handle)) + (set! (-> self attack-id) (-> arg0 attack-id)) + (set! (-> self damage) (if (logtest? (-> arg0 options) (projectile-options po14)) + (-> arg0 damage) + 2.0 + ) + ) + (set! (-> self vehicle-damage-factor) (if (logtest? (-> arg0 options) (projectile-options po15)) + (-> arg0 vehicle-damage-factor) + 1.0 + ) + ) + (set! (-> self vehicle-impulse-factor) (if (logtest? (projectile-options po16) (-> arg0 options)) + (-> arg0 vehicle-impulse-factor) + 1.0 + ) + ) + (set! (-> self attack-mode) #f) + (set! (-> self max-speed) 40960.0) + (set! (-> self tween) 1.0) + (set! (-> self last-target) (the-as handle #f)) + (set! (-> self timeout) (-> arg0 timeout)) + (set! (-> self max-hits) 1) + (set-time! (-> self spawn-time)) + (set! (-> self update-velocity) #f) + (set! (-> self move) projectile-move-fill-line-sphere) + (set! (-> self pick-target) #f) + (set! (-> self stop-speed) 204.8) + (set! (-> self desired-target) (-> arg0 target-handle)) + (set! (-> self desired-target-pos quad) (-> arg0 target-pos quad)) + (countdown (v1-29 16) + (set! (-> self old-dist v1-29) 4095996000.0) + ) + (logior! (-> self options) (projectile-options po4)) + (setup-collision! self) + (let ((s5-0 (-> self root))) + (when (type? s5-0 collide-shape-moving) + (set! (-> self root dynam gravity y) 1228800.0) + (set! (-> self root dynam gravity-length) 1228800.0) + (set! (-> self root dynam gravity-max) 1228800.0) + ) + (logior! (-> self mask) (process-mask projectile)) + (logclear! (-> self mask) (process-mask enemy)) + (set! (-> s5-0 trans quad) (-> arg0 pos quad)) + (set! (-> self starting-pos quad) (-> arg0 pos quad)) + (quaternion-copy! (-> s5-0 quat) (-> self parent 0 root quat)) + (vector-identity! (-> s5-0 scale)) + (set! (-> s5-0 transv quad) (-> arg0 vel quad)) + (set! (-> self pre-move-transv quad) (-> arg0 vel quad)) + (vector-normalize-copy! (-> self starting-dir) (-> arg0 vel) 1.0) + (vector+float*! (-> self base-target-pos) (-> s5-0 trans) (-> self starting-dir) 2048000.0) + ) + (set! (-> self target-pos quad) (-> self base-target-pos quad)) + (set! (-> self event-hook) projectile-event-handler) + (projectile-method-31 self) + (update-transforms (-> self root)) + (projectile-method-24 self) + (play-impact-sound self (projectile-options)) + (when (logtest? (projectile-options po17) (-> self options)) + (if (made-impact? self) + (go-virtual impact) + ) + ) + (projectile-method-32 self) + 0 + ) + +;; definition for function projectile-bounce-update-velocity +;; WARN: Return type mismatch int vs none. +(defbehavior projectile-bounce-update-velocity projectile ((arg0 projectile-bounce)) + (set! (-> arg0 root transv y) (- (-> arg0 root transv y) (* (-> arg0 gravity) (seconds-per-frame)))) + 0 + (none) + ) + +;; definition for method 43 of type projectile-bounce +;; WARN: Return type mismatch int vs none. +(defmethod projectile-bounce-method-43 ((this projectile-bounce)) + 0 + (none) + ) + +;; definition for method 40 of type projectile-bounce +(defmethod projectile-method-40 ((this projectile-bounce)) + 256 + ) + +;; definition for function projectile-bounce-falling-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior projectile-bounce-falling-post projectile-bounce () + (let ((gp-0 (-> self root)) + (s4-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (projectile-bounce-update-velocity self) + (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-v++! s5-0 (-> gp-0 transv)) + (let* ((a0-4 gp-0) + (t9-2 (method-of-object a0-4 find-ground)) + (a2-0 #x100249) + (a3-0 4096.0) + (t0-0 81920.0) + (t1-0 1024.0) + ) + (when (t9-2 a0-4 s4-0 (the-as collide-spec a2-0) a3-0 t0-0 t1-0) + (let ((f30-0 (+ (-> gp-0 gspot-pos y) (-> self root root-prim local-sphere w)))) + (when (>= f30-0 (-> s5-0 y)) + (projectile-bounce-method-43 self) + (set! (-> s5-0 y) f30-0) + (vector-reset! (-> gp-0 transv)) + ) + ) + ) + ) + (move-to-point! gp-0 s5-0) + ) + (transform-post) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate sitting (projectile-bounce) + :virtual #t + :event projectile-event-handler + :trans (behavior () + (projectile-bounce-method-42 self) + (if (time-elapsed? (-> self spawn-time) (-> self timeout)) + (go-virtual impact) + ) + ) + :code sleep-code + :post projectile-bounce-falling-post + ) + +;; definition for method 42 of type projectile-bounce +;; WARN: Return type mismatch int vs none. +(defmethod projectile-bounce-method-42 ((this projectile-bounce)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate dissipate (projectile-bounce) + :virtual #t + :enter (behavior () + (go-virtual impact) + ) + ) + +;; definition for method 33 of type projectile-bounce +;; WARN: Return type mismatch object vs none. +(defmethod go-impact! ((this projectile-bounce)) + (go (method-of-object this sitting)) + (none) + ) + +;; definition for method 25 of type projectile-bounce +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this projectile-bounce)) + (ja-post) + 0 + (none) + ) + +;; definition for function projectile-bounce-move +(defun projectile-bounce-move ((arg0 projectile-bounce)) + (seek-toward-heading-vec! (-> arg0 root) (-> arg0 root transv) 131072.0 (seconds 0.1)) + (quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> arg0 tumble-quat)) + (projectile-move-fill-all-dirs arg0) + (none) + ) + +;; definition for function projectile-bounce-reaction +(defun projectile-bounce-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (cshape-reaction-update-state arg0 arg1 arg3) + (let ((f30-0 (vector-dot arg3 (-> arg0 surface-normal))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (vector-float*! s2-0 (-> arg0 surface-normal) (* f30-0 (rand-vu-float-range 1.6 2.2))) + (vector-! arg2 arg3 s2-0) + ) + (-> arg0 status) + ) + +;; definition for method 39 of type projectile-bounce +;; WARN: Return type mismatch sound-id vs none. +(defmethod projectile-method-39 ((this projectile-bounce)) + (let* ((a2-0 (-> this root)) + (v1-0 (-> a2-0 status)) + ) + (if (logtest? v1-0 (collide-status touch-surface)) + (vector-float*! (-> a2-0 transv) (-> a2-0 transv) 0.6) + ) + (when (and (logtest? v1-0 (collide-status impact-surface)) + (time-elapsed? (-> this played-bounce-time) (seconds 0.3)) + ) + (set-time! (-> this played-bounce-time)) + (sound-play "dark-shot-bounc") + ) + ) + (none) + ) + +;; definition for method 30 of type projectile-bounce +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this projectile-bounce)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) projectile-bounce-reaction) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate jak-dark-shot)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 819.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 2)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set-collide-with! + (-> this root) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set-collide-as! (-> this root) (collide-spec projectile)) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +;; definition for method 31 of type projectile-bounce +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-31 ((this projectile-bounce)) + (set! (-> this max-speed) 450560.0) + (set! (-> this timeout) (seconds 1.6)) + (set! (-> this update-velocity) projectile-bounce-update-velocity) + (set! (-> this move) projectile-bounce-move) + (set! (-> this gravity) 184320.0) + (set! (-> this root dynam gravity y) 184320.0) + (set! (-> this root dynam gravity-length) 184320.0) + (set! (-> this root dynam gravity-max) 184320.0) + (let ((f0-5 1092.2667)) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-5) + ) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/secrets-menu_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/secrets-menu_REF.gc new file mode 100644 index 00000000000..cf96ae8cb6e --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/secrets-menu_REF.gc @@ -0,0 +1,395 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *menu-secrets-array*, type (array secret-item-option) +(define *menu-secrets-array* (new 'static 'boxed-array :type secret-item-option + (new 'static 'secret-item-option + :name (text-id progress-secrets-weapon-upgrades) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-red-ammo-capacity) + :cost 4 + :secret (game-secrets gun-upgrade-ammo-red) + :avail-after (game-task-node arena-fight-3-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-yellow-ammo-capacity) + :cost 4 + :secret (game-secrets gun-upgrade-ammo-yellow) + :avail-after (game-task-node arena-fight-3-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-blue-ammo-capacity) + :cost 4 + :secret (game-secrets gun-upgrade-ammo-blue) + :avail-after (game-task-node mine-boss-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-dark-ammo-capacity) + :cost 4 + :secret (game-secrets gun-upgrade-ammo-dark) + :avail-after (game-task-node city-blow-barricade-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-yellow-1) + :cost 6 + :secret (game-secrets gun-upgrade-yellow-1) + :avail-after (game-task-node arena-fight-2-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-red-1) + :cost 6 + :secret (game-secrets gun-upgrade-red-1) + :avail-after (game-task-node arena-fight-2-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-blue-1) + :cost 6 + :secret (game-secrets gun-upgrade-blue-1) + :avail-after (game-task-node arena-fight-3-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-dark-1) + :cost 6 + :secret (game-secrets gun-upgrade-dark-1) + :avail-after (game-task-node city-blow-barricade-resolution) + :flags (secret-item-option-flags sf3) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-yellow-2) + :cost 8 + :secret (game-secrets gun-upgrade-yellow-2) + :avail-after (game-task-node arena-fight-3-resolution) + :required-secrets (game-secrets gun-upgrade-yellow-1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-red-2) + :cost 8 + :secret (game-secrets gun-upgrade-red-2) + :avail-after (game-task-node arena-fight-3-resolution) + :required-secrets (game-secrets gun-upgrade-red-1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-blue-2) + :cost 8 + :secret (game-secrets gun-upgrade-blue-2) + :avail-after (game-task-node mine-boss-resolution) + :required-secrets (game-secrets gun-upgrade-blue-1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-dark-2) + :cost 8 + :secret (game-secrets gun-upgrade-dark-2) + :avail-after (game-task-node temple-defend-resolution) + :required-secrets (game-secrets gun-upgrade-dark-1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-yellow-3) + :cost 10 + :secret (game-secrets gun-upgrade-yellow-3) + :avail-after (game-task-node city-gun-course-1-resolution) + :required-secrets (game-secrets gun-upgrade-yellow-2) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-red-3) + :cost 10 + :secret (game-secrets gun-upgrade-red-3) + :avail-after (game-task-node city-gun-course-2-resolution) + :required-secrets (game-secrets gun-upgrade-red-2) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-blue-3) + :cost 10 + :secret (game-secrets gun-upgrade-blue-3) + :avail-after (game-task-node city-destroy-grid-resolution) + :required-secrets (game-secrets gun-upgrade-blue-2) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gun-upgrade-dark-3) + :cost 10 + :secret (game-secrets gun-upgrade-dark-3) + :avail-after (game-task-node city-blow-tower-resolution) + :required-secrets (game-secrets gun-upgrade-dark-2) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-gungame-ratchet) + :cost 5 + :secret (game-secrets gungame-ratchet) + :avail-after (game-task-node city-gun-course-2-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-vehicle-upgrades) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-vehicle-hit-points) + :cost 15 + :secret (game-secrets vehicle-hit-points) + :avail-after (game-task-node nest-hunt-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-vehicle-fox) + :cost 15 + :secret (game-secrets vehicle-fox) + :avail-after (game-task-node desert-oasis-defense-introduction) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-vehicle-mirage) + :cost 15 + :secret (game-secrets vehicle-mirage) + :avail-after (game-task-node desert-artifact-race-2-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-vehicle-x-ride) + :cost 20 + :secret (game-secrets vehicle-x-ride) + :avail-after (game-task-node desert-artifact-race-2-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-unlimited-turbos) + :cost 30 + :secret (game-secrets unlimited-turbos) + :avail-after (game-task-node factory-boss-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-crazy-stuff) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-toggle-beard) + :cost 2 + :secret (game-secrets toggle-beard) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-big-head) + :cost 3 + :secret (game-secrets big-head) + :avail-after (game-task-node city-start-introduction) + :mask-secrets (game-secrets little-head) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-little-head) + :cost 3 + :secret (game-secrets little-head) + :avail-after (game-task-node city-start-introduction) + :mask-secrets (game-secrets big-head) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-kleever-diaper) + :cost 4 + :secret (game-secrets kleever-diaper) + :avail-after (game-task-node desert-course-race-resolution) + :flags (secret-item-option-flags sf1 sf3) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-bad-weather) + :cost 5 + :secret (game-secrets bad-weather) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-hflip-screen) + :cost 5 + :secret (game-secrets hflip-screen) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-fast-movie) + :cost 5 + :secret (game-secrets fast-movie) + :avail-after (game-task-node city-start-introduction) + :mask-secrets (game-secrets slow-movie) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-slow-movie) + :cost 5 + :secret (game-secrets slow-movie) + :avail-after (game-task-node city-start-introduction) + :mask-secrets (game-secrets fast-movie) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-expert-options) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-level-select-act-1) + :cost 5 + :secret (game-secrets level-select-1) + :avail-after (game-task-node mine-boss-resolution) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-level-select-act-2) + :cost 5 + :secret (game-secrets level-select-2) + :avail-after (game-task-node factory-boss-resolution) + :required-secrets (game-secrets level-select-1) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-level-select-act-3) + :cost 5 + :secret (game-secrets level-select-3) + :avail-after (game-task-node desert-final-boss-resolution) + :required-secrets (game-secrets level-select-2) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-hero-mode) + :cost 5 + :secret (game-secrets hero-mode) + :avail-after (game-task-node desert-final-boss-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-cheats) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-board-fast) + :cost 5 + :secret (game-secrets board-fast) + :avail-after (game-task-node desert-oasis-defense-resolution) + :flags (secret-item-option-flags sf1 sf3) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-darkjak-tracking) + :cost 3 + :secret (game-secrets darkjak-tracking) + :avail-after (game-task-node city-destroy-darkeco-resolution) + :flags (secret-item-option-flags sf1 sf3) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-button-invis) + :cost 25 + :secret (game-secrets button-invis) + :avail-after (game-task-node desert-final-boss-resolution) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-endless-ammo) + :cost 50 + :secret (game-secrets endless-ammo) + :avail-after (game-task-node desert-final-boss-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-invulnerable) + :cost 100 + :secret (game-secrets invulnerable) + :avail-after (game-task-node desert-final-boss-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-endless-dark) + :cost 50 + :secret (game-secrets endless-dark) + :avail-after (game-task-node desert-final-boss-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-endless-light) + :cost 50 + :secret (game-secrets endless-light) + :avail-after (game-task-node desert-final-boss-resolution) + :flags (secret-item-option-flags sf1) + ) + (new 'static 'secret-item-option + :name (text-id progress-secrets-art-gallery) + :secret (game-secrets gs20) + :avail-after (game-task-node city-start-introduction) + :flags (secret-item-option-flags sf0) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-scrap-book) + :cost 2 + :secret (game-secrets scrap-book-1) + :avail-after (game-task-node mine-boss-resolution) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-mega-scrap-book) + :cost 2 + :secret (game-secrets scrap-book-2) + :avail-after (game-task-node desert-final-boss-resolution) + :required-secrets (game-secrets scrap-book-1) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-jak1-mdl-viewer) + :cost 2 + :secret (game-secrets model-viewer-1) + :avail-after (game-task-node mine-boss-resolution) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-jak2-mdl-viewer) + :cost 2 + :secret (game-secrets model-viewer-2) + :avail-after (game-task-node factory-boss-resolution) + :required-secrets (game-secrets model-viewer-1) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-jak3-mdl-viewer) + :cost 2 + :secret (game-secrets model-viewer-3) + :avail-after (game-task-node desert-final-boss-resolution) + :required-secrets (game-secrets model-viewer-2) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-scene-player-act-1) + :cost 2 + :secret (game-secrets scene-player-1) + :avail-after (game-task-node mine-boss-resolution) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-scene-player-act-2) + :cost 2 + :secret (game-secrets scene-player-2) + :avail-after (game-task-node factory-boss-resolution) + :required-secrets (game-secrets scene-player-1) + :flags (secret-item-option-flags sf2) + ) + (new 'static 'secret-item-option + :name (text-id progress-scene-player-act-3) + :cost 2 + :secret (game-secrets scene-player-3) + :avail-after (game-task-node desert-final-boss-resolution) + :required-secrets (game-secrets scene-player-2) + ) + (new 'static 'secret-item-option + :name (text-id progress-title-commentary) + :cost 2 + :secret (game-secrets title-commentary) + :avail-after (game-task-node desert-final-boss-resolution) + :required-secrets (game-secrets scene-player-3) + :flags (secret-item-option-flags sf2 sf4) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc new file mode 100644 index 00000000000..cc4c0b1b0e7 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc @@ -0,0 +1,810 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type vent +(deftype vent (process-drawable) + ((root collide-shape :override) + (show-particles symbol) + (collect-effect sparticle-launch-group) + (collect-effect2 sparticle-launch-group) + (collect-effect-time time-frame) + (blocker entity-actor) + (block-func (function vent symbol)) + (pickup-handle handle) + ) + (:methods + (init! (_type_ entity-actor int) object) + ) + (:states + vent-blocked + (vent-pickup handle) + vent-wait-for-touch + ) + ) + +;; definition for method 3 of type vent +(defmethod inspect ((this vent)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tshow-particles: ~A~%" (-> this show-particles)) + (format #t "~2Tcollect-effect: ~A~%" (-> this collect-effect)) + (format #t "~2Tcollect-effect2: ~A~%" (-> this collect-effect2)) + (format #t "~2Tcollect-effect-time: ~D~%" (-> this collect-effect-time)) + (format #t "~2Tblocker: ~A~%" (-> this blocker)) + (format #t "~2Tblock-func: ~A~%" (-> this block-func)) + (format #t "~2Tpickup-handle: ~D~%" (-> this pickup-handle)) + (label cfg-4) + this + ) + +;; definition for method 20 of type vent +;; INFO: Used lq/sq +(defmethod init! ((this vent) (arg0 entity-actor) (arg1 int)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-6 local-sphere) 0.0 10240.0 0.0 12288.0) + (set! (-> s3-0 total-prims) (the-as uint 1)) + (set! (-> s3-0 root-prim) v1-6) + ) + (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) + (let ((v1-9 (-> s3-0 root-prim))) + (set! (-> s3-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s3-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s3-0) + ) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (update-transforms (-> this root)) + (set! (-> this root pause-adjust-distance) 409600.0) + (set! (-> this fact) (new 'process 'fact-info this (the-as pickup-type arg1) (-> *FACT-bank* eco-full-inc))) + (set! (-> this block-func) (the-as (function vent symbol) true-func)) + (case (-> this fact pickup-type) + (((pickup-type eco-blue)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 156) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 169)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 155)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-blue" (-> this root trans) 0.0)) + ) + (((pickup-type eco-red)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 160) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 171)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 159)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-red" (-> this root trans) 0.0)) + ) + (((pickup-type eco-green) (pickup-type health)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 148) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 141)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 124)) + (case (-> this fact pickup-type) + (((pickup-type eco-green)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-loop" (-> this root trans) 0.0)) + ) + (else + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-green" (-> this root trans) 0.0)) + ) + ) + ) + (((pickup-type eco-yellow)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 162) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 170)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 165)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-yellow" (-> this root trans) 0.0)) + ) + ) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (when (-> this blocker) + (logior! (-> this fact options) (actor-option blocked)) + (set! (-> this block-func) + (lambda ((arg0 vent)) + (not (logtest? (-> arg0 blocker extra perm status) (entity-perm-status subtask-complete))) + ) + ) + ) + (set! (-> this show-particles) #t) + (when (logtest? (-> this fact options) (actor-option blocked)) + (when (logtest? (-> this fact options) (actor-option draw-blocker)) + (case (-> this fact pickup-type) + (((pickup-type eco-blue)) + (set! (-> this block-func) + (lambda ((arg0 vent)) (not (task-complete? *game-info* (game-task eco-blue-button)))) + ) + ) + (((pickup-type eco-red)) + (set! (-> this block-func) + (lambda ((arg0 vent)) (not (task-complete? *game-info* (game-task eco-red-button)))) + ) + ) + (((pickup-type eco-yellow)) + (set! (-> this block-func) + (lambda ((arg0 vent)) (not (task-complete? *game-info* (game-task eco-yellow-button)))) + ) + ) + ) + ) + (if ((-> this block-func) this) + (go vent-blocked) + ) + ) + (go vent-wait-for-touch) + ) + +;; definition for function vent-standard-event-handler +(defbehavior vent-standard-event-handler vent ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('show-particles) + (let ((v0-0 (the-as object (-> arg3 param 0)))) + (set! (-> self show-particles) (the-as symbol v0-0)) + v0-0 + ) + ) + (('hide) + (set! (-> self block-func) (the-as (function vent symbol) true-func)) + (go vent-blocked) + ) + ) + ) + +;; failed to figure out what this is: +(defstate vent-wait-for-touch (vent) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (or (= message 'touch) (= message 'attack)) + (or (!= (-> self fact pickup-type) 5) + (and *target* + (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> *target* game features) + ) + (-> *setting-control* user-current board-trail) + (focus-test? *target* board) + ) + ) + (= (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) #t) + ) + (go vent-pickup (process->handle proc)) + ) + (vent-standard-event-handler proc argc message block) + ) + :code (behavior () + (until #f + (let ((a0-0 (-> self part)) + (a1-0 (-> self root trans)) + (gp-0 (-> self sound)) + ) + (if (and (nonzero? a0-0) (-> self show-particles)) + (spawn a0-0 a1-0) + ) + (if (nonzero? gp-0) + (update! gp-0) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate vent-blocked (vent) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('show) + (go vent-wait-for-touch) + ) + ) + ) + :code (behavior () + (until #f + (if (not ((-> self block-func) self)) + (go vent-wait-for-touch) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate vent-pickup (vent) + :event vent-standard-event-handler + :code (behavior ((arg0 handle)) + (when (-> self show-particles) + (when (nonzero? (-> self collect-effect)) + (when (time-elapsed? (-> self collect-effect-time) (seconds 1)) + (let* ((s5-0 (handle->process arg0)) + (gp-0 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (when gp-0 + (let* ((s5-1 (-> (the-as process-focusable gp-0) root)) + (v1-9 (if (type? s5-1 collide-shape) + s5-1 + ) + ) + ) + (when v1-9 + (cond + ((logtest? (-> self collect-effect flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-9 root-prim prim-core world-sphere quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-2 + (let ((t9-3 (method-of-type part-tracker-subsampler activate))) + (t9-3 (the-as part-tracker-subsampler s5-2) gp-0 "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-4 run-function-in-process) + (a0-13 s5-2) + (a1-10 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> self collect-effect)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) part-tracker-track-target) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-4) a0-13 a1-10 *part-tracker-subsampler-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-9 root-prim prim-core world-sphere quad)) + (let ((s5-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-3 + (let ((t9-6 (method-of-type part-tracker activate))) + (t9-6 (the-as part-tracker s5-3) gp-0 "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-7 run-function-in-process) + (a0-18 s5-3) + (a1-13 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> self collect-effect)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) part-tracker-track-target) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-7) a0-18 a1-13 *part-tracker-params-default*) + ) + (-> s5-3 ppointer) + ) + ) + ) + ) + (cond + ((logtest? (-> self collect-effect2 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-9 (method-of-type part-tracker-subsampler activate))) + (t9-9 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-10 run-function-in-process) + (a0-25 gp-1) + (a1-16 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> self collect-effect2)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) part-tracker-move-to-target) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-10) a0-25 a1-16 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-12 (method-of-type part-tracker activate))) + (t9-12 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-13 run-function-in-process) + (a0-32 gp-2) + (a1-19 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> self collect-effect2)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) part-tracker-move-to-target) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-13) a0-32 a1-19 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + (set-time! (-> self collect-effect-time)) + ) + ) + ) + ) + ) + ) + ) + (go vent-wait-for-touch) + ) + ) + +;; definition of type ecovent +(deftype ecovent (vent) + () + ) + +;; definition for method 3 of type ecovent +(defmethod inspect ((this ecovent)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vent inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type ecovent +(defmethod init-from-entity! ((this ecovent) (arg0 entity-actor)) + (init! this arg0 5) + ) + +;; definition of type light-eco-vent +(deftype light-eco-vent (process-drawable) + ((part2 sparticle-launch-control) + (pickup-time time-frame) + (touch-time time-frame) + ) + (:state-methods + (open symbol) + (close symbol) + ) + ) + +;; definition for method 3 of type light-eco-vent +(defmethod inspect ((this light-eco-vent)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tpart2: ~A~%" (-> this part2)) + (format #t "~2Tpickup-time: ~D~%" (-> this pickup-time)) + (format #t "~2Ttouch-time: ~D~%" (-> this touch-time)) + (label cfg-4) + this + ) + +;; definition for method 7 of type light-eco-vent +;; WARN: Return type mismatch process-drawable vs light-eco-vent. +(defmethod relocate ((this light-eco-vent) (offset int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) offset) + ) + (the-as light-eco-vent ((method-of-type process-drawable relocate) this offset)) + ) + +;; definition for method 10 of type light-eco-vent +(defmethod deactivate ((this light-eco-vent)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part2)) + (kill-particles (-> this part2)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-light-eco-vent light-eco-vent light-eco-vent-lod0-jg light-eco-vent-close-open-ja + ((light-eco-vent-lod0-mg (meters 20)) + (light-eco-vent-lod1-mg (meters 40)) + (light-eco-vent-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate open (light-eco-vent) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape (-> self root)) + (the-as uint 2) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape (-> (the-as process-drawable proc) root)) + (collide-action solid) + (collide-action) + ) + (begin + (if (time-elapsed? (-> self touch-time) (seconds 0.1)) + (sound-play "light-charge") + ) + (set-time! (-> self touch-time)) + (time-elapsed? (-> self pickup-time) (seconds 0.015)) + ) + (= (send-event proc 'get-pickup (-> self fact pickup-type) 100.0) #t) + ) + ) + (if (and (time-elapsed? (-> self pickup-time) (seconds 0.1)) + (not (logtest? (-> self fact options) (actor-option no-reaction))) + ) + (send-event proc 'powerup) + ) + (set-time! (-> self pickup-time)) + #f + ) + ) + :trans (behavior () + (if (not (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + ) + (go-virtual close #f) + ) + ) + :code (behavior ((arg0 symbol)) + (when (not arg0) + (while (not (ja-max? 0)) + (ja :num! (seek!)) + (transform-post) + (suspend) + ) + ) + (ja :num-func num-func-identity :frame-num max) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + :post (behavior () + (let ((a0-0 (-> self part)) + (v1-0 (-> self part2)) + (a1-1 (-> self root trans)) + (gp-0 (-> self sound)) + ) + (cond + ((time-elapsed? (-> self touch-time) (seconds 0.1)) + (if (nonzero? a0-0) + (spawn a0-0 a1-1) + ) + ) + (else + (if (nonzero? v1-0) + (spawn v1-0 a1-1) + ) + ) + ) + (if (nonzero? gp-0) + (update! gp-0) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate close (light-eco-vent) + :virtual #t + :trans (behavior () + (if (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + (go-virtual open #f) + ) + ) + :code (behavior ((arg0 symbol)) + (stop! (-> self sound)) + (when (not arg0) + (while (not (ja-min? 0)) + (ja :num! (seek! 0.0)) + (transform-post) + (suspend) + ) + ) + (ja :num-func num-func-identity :frame-num 0.0) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + ) + +;; definition for method 11 of type light-eco-vent +(defmethod init-from-entity! ((this light-eco-vent) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec collectable)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> s3-0 local-sphere) 0.0 4096.0 0.0 12288.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 3) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 6144.0 0.0 2457.6) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 10240.0 0.0 2457.6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-light) (-> *FACT-bank* eco-full-inc)) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-light-eco-vent" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 144) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 145) this)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-light" (-> this root trans) 0.0)) + (set-falloff-far! (-> this sound) 81920.0) + (set-falloff-mode! (-> this sound) 9) + (if (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + (go (method-of-object this open) #t) + (go (method-of-object this close) #t) + ) + ) + +;; definition of type dark-eco-vent +(deftype dark-eco-vent (process-drawable) + ((part2 sparticle-launch-control) + (pickup-time time-frame) + (touch-time time-frame) + ) + (:state-methods + (open symbol) + (close symbol) + ) + ) + +;; definition for method 3 of type dark-eco-vent +(defmethod inspect ((this dark-eco-vent)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tpart2: ~A~%" (-> this part2)) + (format #t "~2Tpickup-time: ~D~%" (-> this pickup-time)) + (format #t "~2Ttouch-time: ~D~%" (-> this touch-time)) + (label cfg-4) + this + ) + +;; definition for method 7 of type dark-eco-vent +;; WARN: Return type mismatch process-drawable vs dark-eco-vent. +(defmethod relocate ((this dark-eco-vent) (offset int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) offset) + ) + (the-as dark-eco-vent ((method-of-type process-drawable relocate) this offset)) + ) + +;; definition for method 10 of type dark-eco-vent +(defmethod deactivate ((this dark-eco-vent)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part2)) + (kill-particles (-> this part2)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-dark-eco-vent dark-eco-vent dark-eco-vent-lod0-jg dark-eco-vent-close-open-ja + ((dark-eco-vent-lod0-mg (meters 20)) + (dark-eco-vent-lod1-mg (meters 40)) + (dark-eco-vent-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate open (dark-eco-vent) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape (-> self root)) + (the-as uint 2) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry (-> block param 0)) + (the-as collide-shape (-> (the-as process-drawable proc) root)) + (collide-action solid) + (collide-action) + ) + (begin + (if (time-elapsed? (-> self touch-time) (seconds 0.1)) + (sound-play "dark-charge") + ) + (set-time! (-> self touch-time)) + (time-elapsed? (-> self pickup-time) (seconds 0.015)) + ) + (= (send-event proc 'get-pickup (-> self fact pickup-type) 100.0) #t) + ) + ) + (if (and (time-elapsed? (-> self pickup-time) (seconds 0.1)) + (not (logtest? (-> self fact options) (actor-option no-reaction))) + ) + (send-event proc 'powerup) + ) + (set-time! (-> self pickup-time)) + #f + ) + ) + :trans (behavior () + (if (not (logtest? (the-as game-feature (logand (game-feature feature58) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + ) + (go-virtual close #f) + ) + ) + :code (behavior ((arg0 symbol)) + (when (not arg0) + (while (not (ja-max? 0)) + (ja :num! (seek!)) + (transform-post) + (suspend) + ) + ) + (ja :num-func num-func-identity :frame-num max) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + :post (behavior () + (let ((a0-0 (-> self part)) + (v1-0 (-> self part2)) + (a1-1 (-> self root trans)) + (gp-0 (-> self sound)) + ) + (cond + ((time-elapsed? (-> self touch-time) (seconds 0.1)) + (if (nonzero? a0-0) + (spawn a0-0 a1-1) + ) + ) + (else + (if (nonzero? v1-0) + (spawn v1-0 a1-1) + ) + ) + ) + (if (nonzero? gp-0) + (update! gp-0) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate close (dark-eco-vent) + :virtual #t + :trans (behavior () + (if (logtest? (the-as game-feature (logand (game-feature feature58) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + (go-virtual open #f) + ) + ) + :code (behavior ((arg0 symbol)) + (stop! (-> self sound)) + (when (not arg0) + (while (not (ja-min? 0)) + (ja :num! (seek! 0.0)) + (transform-post) + (suspend) + ) + ) + (if (nonzero? (-> self part)) + (kill-particles (-> self part)) + ) + (ja :num-func num-func-identity :frame-num 0.0) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + ) + +;; definition for method 11 of type dark-eco-vent +(defmethod init-from-entity! ((this dark-eco-vent) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec collectable)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> s3-0 local-sphere) 0.0 4096.0 0.0 12288.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 3) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 6144.0 0.0 2457.6) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 10240.0 0.0 2457.6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type eco-pill-dark) (-> *FACT-bank* eco-full-inc))) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-vent" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 146) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 147) this)) + (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-dark" (-> this root trans) 0.0)) + (set-falloff-far! (-> this sound) 81920.0) + (set-falloff-mode! (-> this sound) 9) + (go (method-of-object this open) #t) + ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc new file mode 100644 index 00000000000..255a8a865bd --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc @@ -0,0 +1,693 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-talkbox-speak + :id 122 + :flags (sp4 sp6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 90) (degrees 0) (degrees 0)) + :parts ((sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 0.435) :length (seconds 0.1)) + (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 0.5) :length (seconds 0.117) :offset 5) + (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 1.1) :length (seconds 0.085) :offset 35) + (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 0.835) :length (seconds 0.2) :offset 15) + (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 1.55) :length (seconds 0.25) :offset 60) + ) + ) + +;; failed to figure out what this is: +(defpart 407 + :init-specs ((:texture (new 'static 'texture-id :index #x7a :page #x4)) + (:birth-func 'birth-func-set-vel) + (:num 0.0 0.3) + (:y (meters 0.15)) + (:z (meters 0.4)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 408) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 408 + :init-specs ((:fade-a -0.64)) + ) + +;; definition of type camera-remote +(deftype camera-remote (camera-slave) + () + ) + +;; definition for method 3 of type camera-remote +(defmethod inspect ((this camera-remote)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type camera-slave inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type remote +(deftype remote (process-drawable) + ((parent (pointer camera-slave) :override) + (base-trans vector :inline) + (focus focus :inline) + (seeker cam-float-seeker :inline) + (start-time time-frame) + (blend float) + (twist float) + (speak-effect? symbol) + ) + (:state-methods + enter + idle + exit + ) + (:methods + (init (_type_) none) + (get-track-pt-and-scale (_type_ vector) float) + (post-common (_type_) none) + ) + ) + +;; definition for method 3 of type remote +(defmethod inspect ((this remote)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tbase-trans: ~`vector`P~%" (-> this base-trans)) + (format #t "~2Tfocus: #~%" (-> this focus)) + (format #t "~2Tseeker: #~%" (-> this seeker)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Tblend: ~f~%" (-> this blend)) + (format #t "~2Ttwist: ~f~%" (-> this twist)) + (format #t "~2Tspeak-effect?: ~A~%" (-> this speak-effect?)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-voicebox talk-box talk-box-lod0-jg talk-box-idle-ja + ((talk-box-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 10 + :light-index 1 + ) + +;; definition for method 24 of type remote +;; INFO: Used lq/sq +(defmethod get-track-pt-and-scale ((this remote) (arg0 vector)) + (let ((s4-0 (handle->process (-> this focus handle)))) + (when s4-0 + (set! (-> arg0 quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + (let ((a0-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s4-0) 0)))) + (vector+float*! arg0 arg0 a0-7 (* -16384.0 (- 1.0 (-> this blend)))) + ) + ) + ) + (lerp-scale 1.0 0.0 (-> this blend) 0.8 1.0) + ) + +;; definition for method 25 of type remote +;; WARN: Return type mismatch int vs none. +(defmethod post-common ((this remote)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (ja-post) + (if (type? (-> this root) collide-shape) + (update-transforms (the-as collide-shape (-> this root))) + ) + (when (and (nonzero? (-> this part)) (and (or (and (-> this next-state) (= (-> this next-state name) 'idle)) + (and (-> this next-state) (= (-> this next-state name) 'enter)) + ) + (-> this speak-effect?) + ) + ) + (let ((v1-15 + (vector-float*! (new 'stack-no-clear 'vector) (-> this parent 0 velocity) (-> pp clock frames-per-second)) + ) + (a0-8 *particle-vel*) + ) + (let ((a1-4 (-> this node-list data 3 bone transform fvec))) + (let ((a2-1 20480.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-4 quad)) + ) + (.lvf vf4 (&-> v1-15 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-8 quad) vf6) + ) + (let ((v1-16 *particle-vel*) + (a0-9 *particle-vel*) + (f0-2 300.0) + ) + (vector-float*! v1-16 a0-9 (/ 1.0 f0-2)) + ) + (sparticle-launch-control-method-18 (-> this part) (-> this node-list data 3)) + ) + 0 + (none) + ) + ) + ) + +;; definition for function remote-track +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior remote-track remote () + (let ((gp-0 (handle->process (-> self focus handle))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self parent 0 trans quad)) + (let ((f30-0 (get-track-pt-and-scale self s5-0))) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> self parent 0 trans quad)) + (vector-lerp! (-> self root trans) a1-2 s5-0 (-> self blend)) + ) + (+! (-> self root trans y) (* 1638.4 (sin (* 54.613335 (the float (mod (current-time) 1200)))))) + (let ((s5-1 (new 'stack-no-clear 'quaternion))) + (forward-up->quaternion + s5-1 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (target-pos 8) (-> self root trans)) 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (rotate-toward-orientation! (-> self root) s5-1 65536.0 5461.3335 150 150 0.0) + ) + (when gp-0 + (let* ((gp-1 (-> (the-as process-focusable gp-0) root)) + (s4-1 (-> self root trans)) + (f0-6 + (deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-1 (-> gp-1 trans)))) + ) + ) + (if (< 0.0 f0-6) + (seek! (-> self twist) -0.4 (* 0.3 (seconds-per-frame))) + (seek! (-> self twist) 0.4 (* 0.3 (seconds-per-frame))) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer self)) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'blocked-side?) + (case (send-event-function (ppointer->process (-> self parent)) a1-9) + ((1) + (set! (-> self twist) 0.5) + ) + ((2) + (set! (-> self twist) -0.5) + ) + ((3) + (set! (-> self twist) 0.0) + ) + ) + ) + (send-event (ppointer->process (-> self parent)) 'joystick (-> self twist) -1.0) + ) + (set! (-> self root scale x) f30-0) + (set! (-> self root scale y) f30-0) + (set! (-> self root scale z) f30-0) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate enter (remote) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual exit) + ) + (('speak-effect) + (let ((v0-0 (the-as object (-> block param 0)))) + (set! (-> self speak-effect?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (set! (-> self start-time) (-> *display* game-clock frame-counter)) + (let* ((gp-0 (ppointer->process (-> self parent 0 parent))) + (a1-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (if a1-1 + (try-update-focus (-> self focus) (the-as process-focusable a1-1)) + ) + ) + ) + :trans (behavior () + (remote-track) + (let ((a0-1 (handle->process (-> self focus handle)))) + (if (and a0-1 (< 0.1 (-> self blend))) + (point-toward-point-clear-roll-pitch! (-> self root) (get-trans (the-as process-focusable a0-1) 0)) + ) + ) + ) + :code (behavior () + (let* ((gp-0 (ppointer->process (-> self parent 0 parent))) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (if (and a0-1 (focus-test? (the-as process-focusable a0-1) pilot)) + (send-event + (ppointer->process (-> self parent)) + 'set-dist + (new 'static 'vector :z 8192.0 :w 1.0) + (new 'static 'vector :y 20480.0 :z 12288.0 :w 1.0) + ) + (send-event + (ppointer->process (-> self parent)) + 'set-dist + (new 'static 'vector :z 16384.0 :w 1.0) + (new 'static 'vector :y 20480.0 :z 40960.0 :w 1.0) + ) + ) + ) + (init (-> self seeker) 1.0 0.01 0.022222223 0.1) + (set! (-> self seeker target) 0.0) + (while (< 0.0001 (-> self blend)) + (update! (-> self seeker) 0.0) + (set! (-> self blend) (-> self seeker value)) + (suspend) + ) + (set! (-> self blend) 0.0) + (go-virtual idle) + ) + :post (behavior () + (post-common self) + ) + ) + +;; failed to figure out what this is: +(defstate idle (remote) + :virtual #t + :event (-> (method-of-type remote enter) event) + :trans remote-track + :code (behavior () + (while (handle->process (-> self focus handle)) + (suspend) + (ja :num! (loop!)) + ) + (go-virtual exit) + ) + :post (-> (method-of-type remote enter) post) + ) + +;; failed to figure out what this is: +(defstate exit (remote) + :virtual #t + :trans remote-track + :code (behavior () + (set! (-> self blend) 1.0) + (send-event (ppointer->process (-> self parent)) 'change-state empty-state) + (suspend) + 0 + ) + :post (-> (method-of-type remote enter) post) + ) + +;; definition for method 23 of type remote +;; WARN: Return type mismatch remote vs none. +(defmethod init ((this remote)) + (reset-to-collide-spec (-> this focus) (collide-spec jak player-list)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-voicebox" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this blend) 1.0) + (set! (-> this draw light-index) (the-as uint 30)) + (set! (-> this speak-effect?) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 122) this)) + (none) + ) + +;; failed to figure out what this is: +(defstate cam-remote (camera-slave) + :event (-> cam-string event) + :enter (-> cam-string enter) + :trans (behavior () + (if (or (not *camera*) + (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) + (not (-> self child)) + ) + (deactivate self) + ) + ) + :code (-> cam-string code) + ) + +;; definition of type voicebox +(deftype voicebox (remote) + ((hint handle) + ) + ) + +;; definition for method 3 of type voicebox +(defmethod inspect ((this voicebox)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type remote inspect))) + (t9-0 this) + ) + (format #t "~2Thint: ~D~%" (-> this hint)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate exit (voicebox) + :virtual #t + :code (behavior () + (remove-setting! 'sound-flava) + (set-time! (-> self state-time)) + (set! (-> self seeker target) 1.0) + (while (and (< (-> self blend) 0.9999) (not (and (not (handle->process (-> self hint))) + (time-elapsed? (-> self state-time) (seconds 0.05)) + (-> *setting-control* user-current hint) + ) + ) + ) + (update! (-> self seeker) 0.0) + (set! (-> self blend) (-> self seeker value)) + (suspend) + ) + (set! (-> self blend) 1.0) + (send-event (ppointer->process (-> self parent)) 'change-state empty-state) + (suspend) + (cleanup-for-death self) + ) + ) + +;; definition for function voicebox-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior voicebox-init-by-other voicebox ((arg0 vector) (arg1 handle)) + (set! (-> self hint) arg1) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self base-trans quad) (-> arg0 quad)) + (init self) + (set! (-> self event-hook) (-> (method-of-object self enter) event)) + (go-virtual enter) + (none) + ) + +;; definition for function voicebox-spawn +(defun voicebox-spawn ((arg0 process-drawable) (arg1 vector)) + (with-pp + (when *camera* + (let ((s4-0 (process-spawn + camera-remote + :init cam-slave-init + cam-remote + #f + :name "camera-remote" + :from *camera-dead-pool* + :to arg0 + ) + ) + ) + (if s4-0 + (process-spawn voicebox arg1 (process->handle pp) :name "voicebox" :to (ppointer->process s4-0)) + ) + ) + ) + ) + ) + +;; definition of type judge +(deftype judge (remote) + ((root collide-shape :override) + (total-time time-frame) + (beep-time time-frame) + (hud-timer handle) + (score uint8) + (timer? symbol) + ) + (:state-methods + wait + ) + (:methods + (setup-collision! (_type_) none) + ) + ) + +;; definition for method 3 of type judge +(defmethod inspect ((this judge)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type remote inspect))) + (t9-0 this) + ) + (format #t "~2Ttotal-time: ~D~%" (-> this total-time)) + (format #t "~2Tbeep-time: ~D~%" (-> this beep-time)) + (format #t "~2Thud-timer: ~D~%" (-> this hud-timer)) + (format #t "~2Tscore: ~D~%" (-> this score)) + (format #t "~2Ttimer?: ~A~%" (-> this timer?)) + (label cfg-4) + this + ) + +;; definition for method 24 of type judge +;; INFO: Used lq/sq +(defmethod get-track-pt-and-scale ((this judge) (arg0 vector)) + (set! (-> arg0 quad) (-> this base-trans quad)) + 1.0 + ) + +;; definition for method 25 of type judge +;; WARN: Return type mismatch int vs none. +(defmethod post-common ((this judge)) + (ja-post) + (if (type? (-> this root) collide-shape) + (update-transforms (-> this root)) + ) + (when (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'idle) (= v1-6 'enter)) + ) + ) + (if *target* + (set! (-> *game-info* score) (-> *target* fact trick-point)) + ) + (when (-> this timer?) + (let ((v1-17 (the-as int (- (-> this total-time) (- (-> *display* game-clock frame-counter) (-> this start-time))))) + ) + (if (< (the-as time-frame v1-17) 0) + (set! v1-17 0) + ) + (set! (-> *game-info* timer) (the-as time-frame v1-17)) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate wait (judge) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (sound-play "judge-stop") + (go-virtual exit) + ) + (('touch 'attack) + (when *camera* + (let ((s4-0 (process-spawn + camera-remote + :init cam-slave-init + cam-remote + #f + :name "camera-remote" + :from *camera-dead-pool* + :to proc + ) + ) + (s5-2 (if (type? proc process-focusable) + proc + ) + ) + ) + (when s4-0 + (change-parent self (ppointer->process s4-0)) + (try-update-focus (-> self focus) (the-as process-focusable s5-2)) + (go-virtual enter) + ) + ) + ) + ) + (('waiting) + #t + ) + ) + ) + :code (behavior () + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate enter (judge) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual exit) + ) + (('speak-effect) + (let ((v0-0 (the-as object (-> block param 0)))) + (set! (-> self speak-effect?) (the-as symbol v0-0)) + v0-0 + ) + ) + (('judging) + #t + ) + ) + ) + :enter (behavior () + (set! (-> self start-time) (-> *display* game-clock frame-counter)) + (send-event *target* 'get-pickup (pickup-type trick-judge) (if (-> self timer?) + (the float (-> self total-time)) + #x4d2d08e0 + ) + ) + (sound-play "judge-start") + (if (-> self timer?) + (set! (-> self hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (judge) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (sound-play "judge-stop") + (go-virtual exit) + ) + (('judging) + #t + ) + ) + ) + :code (behavior () + (while (let ((a0-2 (handle->process (-> self focus handle)))) + (and a0-2 (!= (send-event a0-2 'test-pickup (pickup-type trick-judge)) 0.0)) + ) + (suspend) + (ja :num! (loop!)) + ) + (if (-> self timer?) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + ) + (go-virtual exit) + ) + ) + +;; definition for method 27 of type judge +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this judge)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list tobot)) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 16384.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type judge +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this judge) (arg0 entity-actor)) + (setup-collision! this) + (init this) + (process-drawable-from-entity! this arg0) + (+! (-> this root trans y) 4096.0) + (set! (-> this base-trans quad) (-> this root trans quad)) + (set! (-> this total-time) (seconds 90)) + (go (method-of-object this wait)) + ) + +;; definition for function judge-init-by-other +;; INFO: Used lq/sq +(defbehavior judge-init-by-other judge ((arg0 vector) (arg1 uint) (arg2 symbol)) + (process-entity-set! self (the-as entity #f)) + (set! (-> self score) arg1) + (setup-collision! self) + (init self) + (vector-identity! (-> self root scale)) + (quaternion-identity! (-> self root quat)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self base-trans quad) (-> self root trans quad)) + (set! (-> self total-time) (seconds 90)) + (set! (-> self timer?) arg2) + (go-virtual wait) + ) + +;; definition for function judge-spawn +;; WARN: Return type mismatch (pointer process) vs (pointer judge). +(defun judge-spawn ((arg0 process-tree) (arg1 vector) (arg2 uint) (arg3 object)) + (process-spawn judge arg1 arg2 arg3 :name "judge" :to arg0) + ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/water-h_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/water-h_REF.gc new file mode 100644 index 00000000000..13e3ac5cede --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/water-h_REF.gc @@ -0,0 +1,395 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type water-control +(deftype water-control (basic) + ((flags water-flag) + (process target) + (joint-index int32) + (top-y-offset float) + (attack-id uint32) + (enter-water-time time-frame) + (wade-time time-frame) + (on-water-time time-frame) + (enter-swim-time time-frame) + (swim-time time-frame) + (base-height meters) + (wade-height meters) + (swim-height meters) + (surface-height meters) + (bottom-height meters) + (collide-height meters) + (height meters) + (height-offset float 4) + (base-ocean-offset meters :overlay-at (-> height-offset 0)) + (real-ocean-offset meters :overlay-at (-> height-offset 0)) + (ocean-offset meters :overlay-at (-> height-offset 1)) + (bob-offset meters :overlay-at (-> height-offset 2)) + (align-offset meters :overlay-at (-> height-offset 3)) + (swim-depth meters :offset 108) + (bob smush-control :inline) + (ripple handle) + (ripple-size meters) + (wake-size meters) + (bottom vector 2 :inline) + (top vector 2 :inline) + (enter-water-pos vector :inline) + (drip-old-pos vector :inline) + (drip-joint-index int32) + (drip-wetness float) + (drip-time time-frame) + (drip-speed float) + (drip-height meters) + (drip-mult float) + (distort-time time-frame) + (enter-water-sound sound-name) + (normal vector :inline) + ) + (:methods + (new (symbol type process int float float float) _type_) + (water-control-method-9 () none) + (water-control-method-10 () none) + (start-bobbing! (_type_ float int int) none) + (distance-from-surface (_type_) float) + (spawn-ripples (_type_ float vector int vector symbol) none) + (display-water-marks? (_type_) symbol) + (water-control-method-15 () none) + (water-control-method-16 () none) + (water-control-method-17 () none) + ) + ) + +;; definition for method 3 of type water-control +;; INFO: Used lq/sq +(defmethod inspect ((this water-control)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (water-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (water-flag active)) (water-flag active)) + (format #t "active ") + ) + (if (= (logand s5-0 (water-flag deadly)) (water-flag deadly)) + (format #t "deadly ") + ) + (if (= (logand (water-flag touch-water-good) s5-0) (shl #x8000 16)) + (format #t "touch-water-good ") + ) + (if (= (logand s5-0 (water-flag lava)) (water-flag lava)) + (format #t "lava ") + ) + (if (= (logand (water-flag jump-out) s5-0) (water-flag jump-out)) + (format #t "jump-out ") + ) + (if (= (logand (water-flag head-under-water) s5-0) (water-flag head-under-water)) + (format #t "head-under-water ") + ) + (if (= (logand s5-0 (water-flag under-water)) (water-flag under-water)) + (format #t "under-water ") + ) + (if (= (logand s5-0 (water-flag swamp)) (water-flag swamp)) + (format #t "swamp ") + ) + (if (= (logand s5-0 (water-flag dark-eco)) (water-flag dark-eco)) + (format #t "dark-eco ") + ) + (if (= (logand (water-flag part-water) s5-0) (water-flag part-water)) + (format #t "part-water ") + ) + (if (= (logand (water-flag break-surface) s5-0) (water-flag break-surface)) + (format #t "break-surface ") + ) + (if (= (logand (water-flag over-water) s5-0) (water-flag over-water)) + (format #t "over-water ") + ) + (if (= (logand s5-0 (water-flag use-ocean)) (water-flag use-ocean)) + (format #t "use-ocean ") + ) + (if (= (logand s5-0 (water-flag flow)) (water-flag flow)) + (format #t "flow ") + ) + (if (= (logand (water-flag wading) s5-0) (water-flag wading)) + (format #t "wading ") + ) + (if (= (logand (water-flag part-rings) s5-0) (water-flag part-rings)) + (format #t "part-rings ") + ) + (if (= (logand (water-flag part-drip) s5-0) (water-flag part-drip)) + (format #t "part-drip ") + ) + (if (= (logand (water-flag part-splash) s5-0) (water-flag part-splash)) + (format #t "part-splash ") + ) + (if (= (logand s5-0 (water-flag swim-ground)) (water-flag swim-ground)) + (format #t "swim-ground ") + ) + (if (= (logand s5-0 (water-flag tar)) (water-flag tar)) + (format #t "tar ") + ) + (if (= (logand (water-flag swimming) s5-0) (water-flag swimming)) + (format #t "swimming ") + ) + (if (= (logand s5-0 (water-flag mud)) (water-flag mud)) + (format #t "mud ") + ) + (if (= (logand (water-flag event) s5-0) (water-flag event)) + (format #t "event ") + ) + (if (= (logand (water-flag bouncing) s5-0) (water-flag bouncing)) + (format #t "bouncing ") + ) + (if (= (logand s5-0 (water-flag use-water-anim)) (water-flag use-water-anim)) + (format #t "use-water-anim ") + ) + (if (= (logand (water-flag spawn-drip) s5-0) (water-flag spawn-drip)) + (format #t "spawn-drip ") + ) + (if (= (logand s5-0 (water-flag can-swim)) (water-flag can-swim)) + (format #t "can-swim ") + ) + (if (= (logand (water-flag touch-water) s5-0) (water-flag touch-water)) + (format #t "touch-water ") + ) + (if (= (logand s5-0 (water-flag no-grab-sound)) (water-flag no-grab-sound)) + (format #t "no-grab-ground ") + ) + (if (= (logand s5-0 (water-flag can-wade)) (water-flag can-wade)) + (format #t "can-wade ") + ) + (if (= (logand (water-flag find-water) s5-0) (water-flag find-water)) + (format #t "find-water ") + ) + (if (= (logand s5-0 (water-flag can-ground)) (water-flag can-ground)) + (format #t "can-ground ") + ) + ) + (format #t ")~%") + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~1Ttop-y-offset: ~f~%" (-> this top-y-offset)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tenter-water-time: ~D~%" (-> this enter-water-time)) + (format #t "~1Twade-time: ~D~%" (-> this wade-time)) + (format #t "~1Ton-water-time: ~D~%" (-> this on-water-time)) + (format #t "~1Tenter-swim-time: ~D~%" (-> this enter-swim-time)) + (format #t "~1Tswim-time: ~D~%" (-> this swim-time)) + (format #t "~1Tbase-height: (meters ~m)~%" (-> this base-height)) + (format #t "~1Twade-height: (meters ~m)~%" (-> this wade-height)) + (format #t "~1Tswim-height: (meters ~m)~%" (-> this swim-height)) + (format #t "~1Tsurface-height: (meters ~m)~%" (-> this surface-height)) + (format #t "~1Tbottom-height: (meters ~m)~%" (-> this bottom-height)) + (format #t "~1Tcollide-height: (meters ~m)~%" (-> this collide-height)) + (format #t "~1Theight: (meters ~m)~%" (-> this height)) + (format #t "~1Theight-offset[4] @ #x~X~%" (-> this height-offset)) + (format #t "~1Tbase-ocean-offset: (meters ~m)~%" (-> this base-ocean-offset)) + (format #t "~1Treal-ocean-offset: (meters ~m)~%" (-> this base-ocean-offset)) + (format #t "~1Tocean-offset: (meters ~m)~%" (-> this ocean-offset)) + (format #t "~1Tbob-offset: (meters ~m)~%" (-> this bob-offset)) + (format #t "~1Talign-offset: (meters ~m)~%" (-> this align-offset)) + (format #t "~1Tswim-depth: (meters ~m)~%" (-> this swim-depth)) + (format #t "~1Tbob: #~%" (-> this bob)) + (format #t "~1Tripple: ~D~%" (-> this ripple)) + (format #t "~1Tripple-size: (meters ~m)~%" (-> this ripple-size)) + (format #t "~1Twake-size: (meters ~m)~%" (-> this wake-size)) + (format #t "~1Tbottom[2] @ #x~X~%" (-> this bottom)) + (format #t "~1Ttop[2] @ #x~X~%" (-> this top)) + (format #t "~1Tenter-water-pos: ~`vector`P~%" (-> this enter-water-pos)) + (format #t "~1Tdrip-old-pos: ~`vector`P~%" (-> this drip-old-pos)) + (format #t "~1Tdrip-joint-index: ~D~%" (-> this drip-joint-index)) + (format #t "~1Tdrip-wetness: ~f~%" (-> this drip-wetness)) + (format #t "~1Tdrip-time: ~D~%" (-> this drip-time)) + (format #t "~1Tdrip-speed: ~f~%" (-> this drip-speed)) + (format #t "~1Tdrip-height: (meters ~m)~%" (-> this drip-height)) + (format #t "~1Tdrip-mult: ~f~%" (-> this drip-mult)) + (format #t "~1Tdistort-time: ~D~%" (-> this distort-time)) + (format #t "~1Tenter-water-sound: ~D~%" (-> this enter-water-sound)) + (format #t "~1Tnormal: #~%" (-> this normal)) + (label cfg-68) + this + ) + +;; definition for method 14 of type water-control +(defmethod display-water-marks? ((this water-control)) + *display-water-marks* + ) + +;; definition for method 0 of type water-control +;; INFO: Used lq/sq +(defmethod new water-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 int) (arg2 float) (arg3 float) (arg4 float)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 process) (the-as target arg0)) + (set! (-> v0-0 joint-index) arg1) + (set! (-> v0-0 wade-height) arg4) + (set! (-> v0-0 swim-height) arg3) + (set! (-> v0-0 bottom-height) 32768.0) + (set! (-> v0-0 ripple-size) 1638.4) + (set! (-> v0-0 wake-size) 3072.0) + (set! (-> v0-0 ripple) (the-as handle #f)) + (set! (-> v0-0 drip-mult) 1.0) + (set! (-> v0-0 top-y-offset) arg2) + (let* ((v1-6 *game-info*) + (a0-2 (+ (-> v1-6 attack-id) 1)) + ) + (set! (-> v1-6 attack-id) a0-2) + (set! (-> v0-0 attack-id) a0-2) + ) + (set! (-> v0-0 enter-water-sound) (static-sound-name "swim-enter")) + v0-0 + ) + ) + +;; definition for method 12 of type water-control +(defmethod distance-from-surface ((this water-control)) + (- (-> this top 0 y) (-> this height)) + ) + +;; definition of type water-vol +(deftype water-vol (process-hidden) + () + ) + +;; definition for method 3 of type water-vol +(defmethod inspect ((this water-vol)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) + (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) + (format #t "process-tree ") + ) + (if (= (logand s5-0 (process-mask target)) (process-mask target)) + (format #t "target ") + ) + (if (= (logand (process-mask collectable) s5-0) (process-mask collectable)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand s5-0 (process-mask sleep-code)) (process-mask sleep-code)) + (format #t "sleep-code ") + ) + (if (= (logand s5-0 (process-mask actor-pause)) (process-mask actor-pause)) + (format #t "actor-pause ") + ) + (if (= (logand (process-mask metalhead) s5-0) (shl #x8000 16)) + (format #t "metalhead ") + ) + (if (= (logand (process-mask bot) s5-0) (process-mask bot)) + (format #t "bot ") + ) + (if (= (logand (process-mask vehicle) s5-0) (process-mask vehicle)) + (format #t "vehicle ") + ) + (if (= (logand (process-mask enemy) s5-0) (process-mask enemy)) + (format #t "enemy ") + ) + (if (= (logand (process-mask entity) s5-0) (process-mask entity)) + (format #t "entity ") + ) + (if (= (logand s5-0 (process-mask heap-shrunk)) (process-mask heap-shrunk)) + (format #t "heap-shrunk ") + ) + (if (= (logand (process-mask sidekick) s5-0) (process-mask sidekick)) + (format #t "sidekick ") + ) + (if (= (logand s5-0 (process-mask going)) (process-mask going)) + (format #t "going ") + ) + (if (= (logand s5-0 (process-mask execute)) (process-mask execute)) + (format #t "execute ") + ) + (if (= (logand (process-mask civilian) s5-0) (process-mask civilian)) + (format #t "civilian ") + ) + (if (= (logand (process-mask death) s5-0) (process-mask death)) + (format #t "death ") + ) + (if (= (logand (process-mask guard) s5-0) (process-mask guard)) + (format #t "guard ") + ) + (if (= (logand s5-0 (process-mask no-kill)) (process-mask no-kill)) + (format #t "no-kill ") + ) + (if (= (logand (process-mask kg-robot) s5-0) (process-mask kg-robot)) + (format #t "kg-robot ") + ) + (if (= (logand (process-mask platform) s5-0) (process-mask platform)) + (format #t "platform ") + ) + (if (= (logand s5-0 (process-mask freeze)) (process-mask freeze)) + (format #t "freeze ") + ) + (if (= (logand s5-0 (process-mask sleep)) (process-mask sleep)) + (format #t "sleep ") + ) + (if (= (logand s5-0 (process-mask progress)) (process-mask progress)) + (format #t "progress ") + ) + (if (= (logand s5-0 (process-mask menu)) (process-mask menu)) + (format #t "menu ") + ) + (if (= (logand (process-mask camera) s5-0) (process-mask camera)) + (format #t "camera ") + ) + (if (= (logand (process-mask ambient) s5-0) (process-mask ambient)) + (format #t "ambient ") + ) + (if (= (logand s5-0 (process-mask dark-effect)) (process-mask dark-effect)) + (format #t "dark-effect ") + ) + (if (= (logand (process-mask crate) s5-0) (process-mask crate)) + (format #t "crate ") + ) + (if (= (logand s5-0 (process-mask kernel-run)) (process-mask kernel-run)) + (format #t "kernel-run ") + ) + (if (= (logand s5-0 (process-mask movie)) (process-mask movie)) + (format #t "movie ") + ) + (if (= (logand s5-0 (process-mask pause)) (process-mask pause)) + (format #t "pause ") + ) + ) + (format #t ")~%") + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tprev-state: ~A~%" (-> this prev-state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Tstate-stack: ~A~%" (-> this state-stack)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) + (label cfg-68) + this + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/engine/debug/history_REF.gc b/test/decompiler/reference/jak3/engine/debug/history_REF.gc new file mode 100644 index 00000000000..667c953eb68 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/debug/history_REF.gc @@ -0,0 +1,729 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) + +;; definition for function history-channel->string +(defun history-channel->string ((arg0 history-channel)) + (case arg0 + (((history-channel friction)) + "friction" + ) + (((history-channel transv-out)) + "transv-out" + ) + (((history-channel pat)) + "pat" + ) + (((history-channel transv-in)) + "transv-in" + ) + (((history-channel trans)) + "trans" + ) + (((history-channel local-normal)) + "local-normal" + ) + (((history-channel collide-status)) + "collide-status" + ) + (((history-channel time)) + "time" + ) + (((history-channel intersect)) + "intersect" + ) + (((history-channel surface-normal)) + "surface-normal" + ) + (((history-channel transv)) + "transv" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition of type history-elt +(deftype history-elt (structure) + ((record-tag-bytes uint8 4) + (record-tag uint32 :overlay-at (-> record-tag-bytes 0)) + (record-id uint16 :overlay-at (-> record-tag-bytes 0)) + (owner uint8 :overlay-at (-> record-tag-bytes 2)) + (channel history-channel :offset 4) + (timestamp time-frame) + (origin vector :inline) + (bytes uint8 16) + (vector vector :inline :overlay-at (-> bytes 0)) + (float float :overlay-at (-> bytes 0)) + (collide-status collide-status :overlay-at (-> bytes 0)) + (collide-reaction-flag uint32 :overlay-at (-> bytes 8)) + (pat pat-surface :overlay-at (-> bytes 0)) + ) + ) + +;; definition for method 3 of type history-elt +(defmethod inspect ((this history-elt)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'history-elt) + (format #t "~1Trecord-tag-bytes[4] @ #x~X~%" (-> this record-tag-bytes)) + (format #t "~1Trecord-tag: ~D~%" (-> this record-tag)) + (format #t "~1Trecord-id: ~D~%" (-> this record-id)) + (format #t "~1Towner: ~D~%" (-> this owner)) + (format #t "~1Tchannel: ~D~%" (-> this channel)) + (format #t "~1Ttimestamp: ~D~%" (-> this timestamp)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this vector)) + (format #t "~1Tvector: #~%" (-> this vector)) + (format #t "~1Tfloat: ~f~%" (-> this vector x)) + (format #t "~1Tcollide-status: ~D~%" (-> this collide-status)) + (format #t "~1Tcollide-reaction-flag: ~D~%" (-> this vector z)) + (format #t "~1Tpat: ~D~%" (-> this vector x)) + (label cfg-4) + this + ) + +;; definition of type history-iterator +(deftype history-iterator (basic) + ((max-age uint32) + (owner uint8) + (proc process) + (out object) + (channel-mask uint64) + (index int32) + (done? symbol) + ) + (:methods + (new (symbol type uint) _type_) + (frame-counter-delta (_type_ history-elt) time-frame) + (update-entries! (_type_) history-elt) + (get-age (_type_ history-elt) float) + ) + ) + +;; definition for method 3 of type history-iterator +(defmethod inspect ((this history-iterator)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmax-age: ~D~%" (-> this max-age)) + (format #t "~1Towner: ~D~%" (-> this owner)) + (format #t "~1Tproc: ~A~%" (-> this proc)) + (format #t "~1Tout: ~A~%" (-> this out)) + (format #t "~1Tchannel-mask: ~D~%" (-> this channel-mask)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tdone?: ~A~%" (-> this done?)) + (label cfg-4) + this + ) + +;; definition of type history +(deftype history (basic) + ((alloc-index int32) + (allocated-length int32) + (elts history-elt :inline :dynamic) + ) + (:methods + (new (symbol type int) _type_) + (clear-record-tags! (_type_ history-channel uint uint) history-elt) + (clear-history-entries! (_type_) none) + ) + ) + +;; definition for method 3 of type history +(defmethod inspect ((this history)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Talloc-index: ~D~%" (-> this alloc-index)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Telts[0] @ #x~X~%" (-> this elts)) + (label cfg-4) + this + ) + +;; definition for method 4 of type history +(defmethod length ((this history)) + (-> this allocated-length) + ) + +;; definition for method 5 of type history +;; WARN: Return type mismatch uint vs int. +(defmethod asize-of ((this history)) + (the-as int (+ (-> this type size) (* 48 (-> this allocated-length)))) + ) + +;; definition for method 0 of type history +(defmethod new history ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* 48 arg0)))))) + (set! (-> v0-0 allocated-length) arg0) + v0-0 + ) + ) + +;; definition for method 10 of type history +;; WARN: Return type mismatch int vs none. +(defmethod clear-history-entries! ((this history)) + (set! (-> this alloc-index) 0) + (countdown (v1-0 (-> this allocated-length)) + (let ((a1-3 (-> this elts v1-0))) + (set! (-> a1-3 record-tag) (the-as uint 0)) + (set! (-> a1-3 timestamp) 0) + ) + 0 + ) + 0 + (none) + ) + +;; definition (perm) for symbol *history*, type history +(define-perm *history* history (new 'debug 'history 4096)) + +;; failed to figure out what this is: +(clear-history-entries! *history*) + +;; definition for method 9 of type history +;; WARN: new jak 2 until loop case, check carefully +(defmethod clear-record-tags! ((this history) (arg0 history-channel) (arg1 uint) (arg2 uint)) + (let* ((t1-0 (-> this alloc-index)) + (v1-0 (-> this elts)) + (v0-0 (-> v1-0 t1-0)) + ) + (let ((t2-0 (-> v0-0 record-tag)) + (t0-2 (-> v0-0 timestamp)) + ) + (set! (-> v0-0 channel) arg0) + (set! (-> v0-0 record-id) arg1) + (set! (-> v0-0 owner) arg2) + (set! (-> v0-0 timestamp) (-> *display* base-clock frame-counter)) + (let* ((a1-4 (-> this allocated-length)) + (a2-2 (mod (+ t1-0 1) a1-4)) + ) + (set! (-> this alloc-index) a2-2) + (when (nonzero? t2-0) + (until #f + (let ((a0-4 (-> v1-0 a2-2))) + (if (!= t0-2 (-> a0-4 timestamp)) + (return v0-0) + ) + (set! (-> a0-4 record-tag) (the-as uint 0)) + ) + (set! a2-2 (mod (+ a2-2 1) a1-4)) + ) + #f + ) + ) + ) + v0-0 + ) + ) + +;; definition for method 0 of type history-iterator +(defmethod new history-iterator ((allocation symbol) (type-to-make type) (arg0 uint)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 max-age) arg0) + (set! (-> v0-0 owner) (the-as uint 1)) + (set! (-> v0-0 proc) #f) + (set! (-> v0-0 out) *stdcon*) + (set! (-> v0-0 channel-mask) (the-as uint -1)) + (set! (-> v0-0 index) (-> *history* alloc-index)) + (set! (-> v0-0 done?) #f) + v0-0 + ) + ) + +;; definition for method 10 of type history-iterator +(defmethod update-entries! ((this history-iterator)) + (let ((v1-0 *history*) + (a1-2 (-> *display* base-clock frame-counter)) + ) + (while (not (-> this done?)) + (let ((a2-1 (+ (-> this index) -1))) + (if (< a2-1 0) + (set! a2-1 (+ (-> v1-0 allocated-length) -1)) + ) + (set! (-> this index) a2-1) + (if (= a2-1 (-> v1-0 alloc-index)) + (set! (-> this done?) #t) + ) + (let ((a2-5 (-> v1-0 elts a2-1))) + (when (nonzero? (-> a2-5 record-tag)) + (when (< (the-as time-frame (-> this max-age)) (- a1-2 (-> a2-5 timestamp))) + (set! (-> this done?) #t) + (return (the-as history-elt #f)) + ) + (if (= (-> a2-5 owner) (-> this owner)) + (return a2-5) + ) + ) + ) + ) + ) + ) + (the-as history-elt #f) + ) + +;; definition for method 11 of type history-iterator +(defmethod get-age ((this history-iterator) (arg0 history-elt)) + (- 1.0 (fmin 1.0 (/ (the float (+ (- 1 (-> arg0 timestamp)) (-> *display* base-clock frame-counter))) + (the float (+ (-> this max-age) 1)) + ) + ) + ) + ) + +;; definition for method 9 of type history-iterator +(defmethod frame-counter-delta ((this history-iterator) (arg0 history-elt)) + (- (-> *display* base-clock frame-counter) (-> arg0 timestamp)) + ) + +;; definition for function history-print +;; INFO: Used lq/sq +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Return type mismatch int vs none. +;; WARN: new jak 2 until loop case, check carefully +(defun history-print ((arg0 history-iterator)) + (local-vars + (sv-16 object) + (sv-24 int) + (sv-32 int) + (sv-40 history-elt) + (sv-48 time-frame) + (sv-56 uint) + (sv-64 collide-status) + (sv-72 float) + (sv-80 string) + (sv-96 string) + ) + (set! sv-16 (-> arg0 out)) + (set! sv-24 -1) + (set! sv-32 0) + (until #f + (set! sv-40 (update-entries! arg0)) + (if (not sv-40) + (goto cfg-71) + ) + (when (logtest? (-> arg0 channel-mask) (ash 1 (the-as int (-> sv-40 channel)))) + (set! sv-48 (frame-counter-delta arg0 sv-40)) + (set! sv-56 (-> sv-40 record-id)) + (cond + ((!= sv-24 sv-48) + (set! sv-24 (the-as int sv-48)) + (set! sv-32 (the-as int sv-56)) + (format sv-16 "~3D ~4X " sv-48 (-> sv-40 record-id)) + ) + ((!= sv-32 sv-56) + (set! sv-32 (the-as int sv-56)) + (format sv-16 " ~4X " (-> sv-40 record-id)) + ) + (else + (format sv-16 " ") + ) + ) + (let ((v1-22 (-> sv-40 channel))) + (cond + ((or (= v1-22 (history-channel trans)) + (or (= v1-22 (history-channel transv)) + (= v1-22 (history-channel transv-in)) + (= v1-22 (history-channel transv-out)) + (= v1-22 (history-channel intersect)) + ) + ) + (format + sv-16 + "~-15S: ~14Mm ~14Mm ~14Mm~%" + (history-channel->string (-> sv-40 channel)) + (-> sv-40 vector x) + (-> sv-40 vector y) + (-> sv-40 vector z) + ) + ) + ((or (= v1-22 (history-channel local-normal)) (= v1-22 (history-channel surface-normal))) + (format + sv-16 + "~-15S: ~14f ~14f ~14f~%" + (history-channel->string (-> sv-40 channel)) + (-> sv-40 vector x) + (-> sv-40 vector y) + (-> sv-40 vector z) + ) + ) + ((= v1-22 (history-channel pat)) + (let* ((s2-0 (-> sv-40 vector x)) + (s5-2 format) + (s4-2 sv-16) + (s3-2 "~-15S: #x~6X mode:~-8S material:~-10S event:~S~%") + (s1-0 (history-channel->string (-> sv-40 channel))) + (s0-0 s2-0) + ) + (set! sv-80 (pat-mode->string (the-as pat-surface s2-0))) + (set! sv-96 (pat-material->string (the-as pat-surface s2-0))) + (let ((t2-0 (pat-event->string (the-as pat-surface s2-0)))) + (s5-2 s4-2 s3-2 s1-0 s0-0 sv-80 sv-96 t2-0) + ) + ) + ) + ((= v1-22 (history-channel collide-status)) + (set! sv-64 (-> sv-40 collide-status)) + (set! sv-72 (-> sv-40 vector z)) + (format sv-16 "~-15S: #x~6X " (history-channel->string (-> sv-40 channel)) sv-64) + (let ((s5-4 sv-64)) + (if (= (logand s5-4 (collide-status touch-background)) (collide-status touch-background)) + (format sv-16 "touch-background ") + ) + (if (= (logand s5-4 (collide-status on-special-surface)) (collide-status on-special-surface)) + (format sv-16 "on-special-surface ") + ) + (if (= (logand s5-4 (collide-status touch-wall)) (collide-status touch-wall)) + (format sv-16 "touch-wall ") + ) + (if (= (logand s5-4 (collide-status on-surface)) (collide-status on-surface)) + (format sv-16 "on-surface ") + ) + (if (= (logand s5-4 (collide-status impact-surface)) (collide-status impact-surface)) + (format sv-16 "impact-surface ") + ) + (if (= (logand s5-4 (collide-status touch-ceiling)) (collide-status touch-ceiling)) + (format sv-16 "touch-ceiling ") + ) + (if (= (logand s5-4 (collide-status on-ground)) (collide-status on-ground)) + (format sv-16 "on-ground ") + ) + (if (= (logand s5-4 (collide-status glance)) (collide-status glance)) + (format sv-16 "glance ") + ) + (if (= (logand s5-4 (collide-status blocked)) (collide-status blocked)) + (format sv-16 "blocked ") + ) + (if (= (logand s5-4 (collide-status touch-edge)) (collide-status touch-edge)) + (format sv-16 "touch-edge ") + ) + (if (= (logand s5-4 (collide-status touch-ceiling-sticky)) (collide-status touch-ceiling-sticky)) + (format sv-16 "touch-ceiling-sticky ") + ) + (if (= (logand s5-4 (collide-status on-water)) (collide-status on-water)) + (format sv-16 "on-water ") + ) + (if (= (logand s5-4 (collide-status touch-actor)) (collide-status touch-actor)) + (format sv-16 "touch-actor ") + ) + (if (= (logand (collide-status probe-hit) s5-4) (collide-status probe-hit)) + (format sv-16 "probe-hit ") + ) + (if (= (logand s5-4 (collide-status stuck)) (collide-status stuck)) + (format sv-16 "stuck ") + ) + (if (= (logand s5-4 (collide-status no-touch)) (collide-status no-touch)) + (format sv-16 "no-touch ") + ) + (if (= (logand s5-4 (collide-status touch-surface)) (collide-status touch-surface)) + (format sv-16 "touch-surface ") + ) + ) + (format sv-16 " #x~6X~%" sv-72) + ) + ((= v1-22 (history-channel friction)) + (let ((f30-0 (-> sv-40 vector x))) + (format sv-16 "~-15S: ~f~%" (history-channel->string (-> sv-40 channel)) f30-0) + ) + ) + ) + ) + ) + ) + #f + (label cfg-71) + 0 + (none) + ) + +;; definition for function history-draw +;; WARN: Return type mismatch int vs none. +;; WARN: new jak 2 until loop case, check carefully +(defun history-draw ((arg0 history-iterator)) + (local-vars (sv-16 vector) (sv-20 vector) (sv-24 number)) + (set! sv-16 (the-as vector #f)) + (set! sv-20 (the-as vector #f)) + (set! sv-24 0) + (until #f + (let ((s5-0 (update-entries! arg0))) + (if (not s5-0) + (goto cfg-34) + ) + (when (logtest? (-> arg0 channel-mask) (ash 1 (the-as int (-> s5-0 channel)))) + (let* ((f0-0 (get-age arg0 s5-0)) + (v1-8 (the int (lerp 4.0 128.0 f0-0))) + ) + (case (-> s5-0 channel) + (((history-channel trans)) + (if sv-16 + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + sv-16 + (-> s5-0 vector) + (the-as rgba (logior #xffff00 (shl v1-8 24))) + #f + (the-as rgba -1) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffff00 (shl v1-8 24)))) + ) + (set! sv-16 (-> s5-0 vector)) + ) + (((history-channel intersect)) + (if sv-20 + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + sv-20 + (-> s5-0 vector) + (the-as rgba (logior #xffffff (shl v1-8 24))) + #f + (the-as rgba -1) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffffff (shl v1-8 24)))) + ) + (set! sv-20 (-> s5-0 vector)) + ) + (((history-channel transv)) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 origin) + (-> s5-0 vector) + (meters 0.000024414063) + (the-as rgba (logior (shl v1-8 24) #xff00)) + ) + ) + (((history-channel transv-in)) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 origin) + (-> s5-0 vector) + (meters 0.000024414063) + (the-as rgba (logior #x408040 (shl v1-8 24))) + ) + ) + (((history-channel transv-out)) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 origin) + (-> s5-0 vector) + (meters 0.000024414063) + (the-as rgba (logior #x404080 (shl v1-8 24))) + ) + ) + (((history-channel local-normal) (history-channel surface-normal)) + (let ((t1-7 + (logand (the-as uint (-> *pat-mode-info* (shr (shl (the-as int sv-24) 54) 61) hilite-color)) + (the-as uint #xffffffff00ffffff) + ) + ) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 origin) + (-> s5-0 vector) + (meters 1) + (the-as rgba (logior t1-7 (shl v1-8 24))) + ) + ) + ) + (((history-channel pat)) + (set! sv-24 (-> s5-0 vector x)) + ) + (((history-channel friction)) + (let ((f0-3 (-> s5-0 vector x)) + (a3-10 (new 'stack-no-clear 'vector)) + ) + (set-vector! a3-10 0.0 (* -8192.0 f0-3) 0.0 1.0) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 origin) + a3-10 + (meters 0.00024414062) + (the-as rgba (logior #xffffff (shl v1-8 24))) + ) + ) + ) + ) + ) + ) + ) + ) + #f + (label cfg-34) + 0 + (none) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/engine/debug/viewer_REF.gc b/test/decompiler/reference/jak3/engine/debug/viewer_REF.gc new file mode 100644 index 00000000000..39f548d14fd --- /dev/null +++ b/test/decompiler/reference/jak3/engine/debug/viewer_REF.gc @@ -0,0 +1,284 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *viewer-sg*, type skeleton-group +(define *viewer-sg* (new 'static 'skeleton-group + :bounds (new 'static 'vector :w 16384.0) + :lod-dist (new 'static 'array float 6 4095996000.0 0.0 0.0 0.0 0.0 0.0) + :clothing #f + ) + ) + +;; definition of type viewer +(deftype viewer (process-drawable) + ((janim art-joint-anim) + ) + (:states + viewer-process + ) + ) + +;; definition for method 3 of type viewer +(defmethod inspect ((this viewer)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tjanim: ~A~%" (-> this janim)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate viewer-process (viewer) + :code (behavior () + (until #f + (ja-no-eval :group! (-> self janim) + :num! (seek! (the float (+ (-> self janim frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel keep-other-velocities adjust-quat) + 1.0 + 1.0 + 1.0 + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; definition for symbol viewer-string, type string +(define viewer-string (new 'global 'string 64 (the-as string #f))) + +;; definition for symbol viewer-ja-name, type string +(define viewer-ja-name (new 'global 'string 64 (the-as string #f))) + +;; definition for symbol viewer-geo-name, type string +(define viewer-geo-name (new 'global 'string 64 (the-as string #f))) + +;; definition for function actor-get-arg! +(defun actor-get-arg! ((arg0 string) (arg1 string) (arg2 string)) + (let ((s5-0 (-> arg2 data)) + (gp-0 (-> arg0 data)) + ) + (set! (-> gp-0 0) (the-as uint 0)) + (dotimes (s2-0 (- (length arg2) (+ (length arg1) 2))) + (when (= (-> s5-0 0) 45) + (let ((s1-0 #f)) + (dotimes (s0-0 (length arg1)) + (if (!= (-> s5-0 (+ s0-0 1)) (-> arg1 data s0-0)) + (goto cfg-10) + ) + ) + (if (= (-> s5-0 (+ (length arg1) 1)) 45) + (set! s1-0 #t) + ) + (label cfg-10) + (when s1-0 + (let ((v1-22 (&+ s5-0 (+ (length arg1) 2)))) + (while (and (!= (-> v1-22 0) 45) (nonzero? (-> v1-22 0))) + (set! (-> gp-0 0) (-> v1-22 0)) + (set! v1-22 (&-> v1-22 1)) + (set! gp-0 (&-> gp-0 1)) + ) + ) + (set! (-> gp-0 0) (the-as uint 0)) + (return #t) + ) + ) + ) + (set! s5-0 (&-> s5-0 1)) + ) + ) + #f + ) + +;; definition for function art-part-name +(defun art-part-name ((arg0 string)) + (let ((gp-0 (-> arg0 data))) + (while (nonzero? (-> gp-0 0)) + (when (= (-> gp-0 0) 45) + (copyn-string<-charp + viewer-string + (&-> gp-0 1) + (- (length arg0) (the-as int (+ (- -1 (the-as int (-> arg0 data))) (the-as int gp-0)))) + ) + (return viewer-string) + ) + (set! gp-0 (&-> gp-0 1)) + ) + ) + (clear viewer-string) + ) + +;; definition for function init-viewer +(defbehavior init-viewer viewer ((arg0 string) (arg1 string)) + (let* ((s5-0 *level*) + (s3-0 (method-of-object s5-0 art-group-get-by-name)) + ) + (format (clear *temp-string*) "skel-~S" arg0) + (let ((a1-3 (s3-0 s5-0 *temp-string* (the-as (pointer level) #f)))) + (cond + (a1-3 + (initialize-skeleton self (the-as skeleton-group a1-3) (the-as pair 0)) + (cond + ((>= (-> self skel active-channels) (the-as uint 1)) + (set! (-> self janim) (-> self skel channel 0 frame-group)) + ) + (else + (let ((v1-8 (-> self draw art-group))) + (dotimes (a0-5 (-> v1-8 length)) + (when (= (-> v1-8 data a0-5 type) art-joint-anim) + (set! (-> self janim) (the-as art-joint-anim (-> v1-8 data a0-5))) + (ja-channel-set! 1) + (goto cfg-10) + ) + ) + ) + (go process-drawable-art-error "anim") + ) + ) + (label cfg-10) + (set! (-> self align) (new 'process 'align-control self)) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + (go viewer-process) + ) + (else + (actor-get-arg! viewer-ja-name "ja" arg1) + (actor-get-arg! viewer-geo-name "geo" arg1) + (let ((s2-1 (load-to-heap-by-name (-> self level art-group) arg0 'load global 0)) + (s5-1 (the-as int #f)) + (s4-1 (the-as int #f)) + (s3-1 (the-as int #f)) + ) + (when s2-1 + (dotimes (s1-0 (-> s2-1 length)) + (cond + ((not (-> s2-1 data s1-0)) + ) + ((and (not s4-1) + (= (-> s2-1 data s1-0 type) merc-ctrl) + (or (zero? (length viewer-geo-name)) (string= (art-part-name (-> s2-1 data s1-0 name)) viewer-geo-name)) + ) + (set! s4-1 s1-0) + ) + ((= (-> s2-1 data s1-0 type) art-joint-geo) + (set! s3-1 s1-0) + ) + ((and (= (-> s2-1 data s1-0 type) art-joint-anim) + (or (zero? (length viewer-ja-name)) (string= (art-part-name (-> s2-1 data s1-0 name)) viewer-ja-name)) + ) + (set! s5-1 s1-0) + ) + ) + (if (and s4-1 s3-1 s5-1) + (goto cfg-44) + ) + ) + ) + (label cfg-44) + (cond + ((and s4-1 s3-1 s5-1) + (set! (-> self janim) (the-as art-joint-anim (-> s2-1 data s5-1))) + (let ((a1-13 *viewer-sg*)) + (set! (-> a1-13 art-group-name) arg0) + (set! (-> a1-13 jgeo) s3-1) + (set! (-> a1-13 janim) s5-1) + (set! (-> a1-13 mgeo 0) s4-1) + (initialize-skeleton self a1-13 (the-as pair 0)) + ) + (set! (-> self align) (new 'process 'align-control self)) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + (go viewer-process) + ) + (else + (go process-drawable-art-error arg0) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 11 of type viewer +(defmethod init-from-entity! ((this viewer) (arg0 entity-actor)) + (set! *viewer* this) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (let ((s4-0 (-> arg0 etype))) + (if (valid? s4-0 type (the-as string #f) #f 0) + (init-viewer (symbol->string (-> s4-0 symbol)) (res-lump-struct arg0 'name string)) + (go process-drawable-art-error "unknown") + ) + ) + ) + +;; definition for function init-viewer-for-other +;; INFO: Used lq/sq +(defbehavior init-viewer-for-other viewer ((arg0 string) (arg1 vector) (arg2 entity-actor)) + (set! *viewer* self) + (process-entity-set! self arg2) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg1 quad)) + (quaternion-identity! (-> self root quat)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (init-viewer arg0 arg0) + ) + +;; definition for function add-a-bunch +;; INFO: Used lq/sq +(defun add-a-bunch ((arg0 string) (arg1 int) (arg2 int) (arg3 float) (arg4 process-tree) (arg5 entity-actor)) + (local-vars (sv-32 int) (sv-48 process) (sv-64 vector)) + (dotimes (s0-0 arg1) + (set! sv-32 0) + (while (< sv-32 arg2) + (set! sv-64 (new 'stack-no-clear 'vector)) + (set! (-> sv-64 quad) (the-as uint128 0)) + (position-in-front-of-camera! sv-64 40960.0 4096.0) + (+! (-> sv-64 x) (the float (* (- s0-0 (/ arg1 2)) (the int arg3)))) + (+! (-> sv-64 z) (the float (* (- sv-32 (/ arg2 2)) (the int arg3)))) + (set! sv-48 (get-process *default-dead-pool* viewer #x4000 1)) + (when sv-48 + (let ((t9-2 (method-of-type viewer activate))) + (t9-2 (the-as viewer sv-48) arg4 "viewer" (the-as pointer #x70004000)) + ) + (let ((t9-3 run-function-in-process) + (a0-7 sv-48) + (a1-4 init-viewer-for-other) + (a2-4 arg0) + (t0-1 arg5) + ) + ((the-as (function object object object object object none) t9-3) a0-7 a1-4 a2-4 sv-64 t0-1) + ) + (-> sv-48 ppointer) + ) + (set! sv-32 (+ sv-32 1)) + ) + ) + #f + ) + +;; definition for function birth-viewer +;; WARN: Return type mismatch symbol vs object. +(defun birth-viewer ((arg0 process) (arg1 entity-actor)) + (set! (-> arg0 type) viewer) + (init-entity arg0 arg1 viewer) + #t + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc index c5960476185..62c41ce8abb 100644 --- a/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc @@ -19,7 +19,7 @@ control over memory layout for use with DMA." (drawable-method-12 () none) (collect-stats (_type_) none) (debug-draw (_type_) none) - (drawable-method-15 () none) + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8)) (collect-regions (_type_ sphere int region-prim-list) none) ) ) diff --git a/test/decompiler/reference/jak3/engine/entity/entity-h_REF.gc b/test/decompiler/reference/jak3/engine/entity/entity-h_REF.gc index 11eccb22cd1..434e4dc4a80 100644 --- a/test/decompiler/reference/jak3/engine/entity/entity-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/entity/entity-h_REF.gc @@ -300,7 +300,7 @@ that gets accessed by the accompanying process." ;; definition of type actor-group (deftype actor-group (inline-array-class) - ((data actor-reference :dynamic) + ((data actor-reference :inline :dynamic) ) ) diff --git a/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc b/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc index 05db30f0057..26283b96c6f 100644 --- a/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc @@ -15,10 +15,10 @@ ) (:methods (new (symbol type process-drawable) _type_) - (effect-control-method-9 () none) - (effect-control-method-10 () none) + (effect-control-method-9 (_type_) none) + (do-effect (_type_ symbol float int) none) (effect-control-method-11 () none) - (effect-control-method-12 () none) + (play-effect-sound (_type_ symbol float int basic sound-name) int) (set-channel-offset! (_type_ int) none) (effect-control-method-14 () none) ) @@ -69,7 +69,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/game/fact-h_REF.gc b/test/decompiler/reference/jak3/engine/game/fact-h_REF.gc index 87454cb823c..69e567b4b08 100644 --- a/test/decompiler/reference/jak3/engine/game/fact-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/fact-h_REF.gc @@ -353,7 +353,7 @@ ) (:methods (new (symbol type process pickup-type float) _type_) - (fact-info-method-9 () none) + (drop-pickup (_type_ symbol process-tree fact-info int symbol) (pointer process)) (reset! (_type_ symbol) none) (pickup-collectable! (_type_ pickup-type float handle) float) ) diff --git a/test/decompiler/reference/jak3/engine/game/game-h_REF.gc b/test/decompiler/reference/jak3/engine/game/game-h_REF.gc index 79f875fa323..e492b0d39d1 100644 --- a/test/decompiler/reference/jak3/engine/game/game-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-h_REF.gc @@ -346,9 +346,9 @@ to have a type with a large number of slots which can be turned into real method (test symbol) ) (:methods - (attack-info-method-9 () none) - (attack-info-method-10 () none) - (attack-info-method-11 () none) + (attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none) + (compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info) + (combine! (_type_ attack-info process-drawable) attack-info) ) ) @@ -473,6 +473,7 @@ to have a type with a large number of slots which can be turned into real method (blend float 3) (group uint32 5) ) + :pack-me ) ;; definition for method 3 of type ground-tween-info diff --git a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc index a6eaafee71b..4c2ae440d42 100644 --- a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc @@ -475,7 +475,7 @@ (('game 'boot) (+! (-> this task-counter) 1) (reset! (-> *display* total-game-clock)) - (set! (-> this features) (game-feature feature20 feature40 darkjak-bomb0 darkjak-bomb1)) + (set! (-> this features) (game-feature sidekick darkjak darkjak-bomb0 darkjak-bomb1)) (set! (-> this debug-features) (game-feature)) (set! (-> this old-features) (game-feature)) (set! (-> this items) (game-items)) @@ -940,7 +940,7 @@ (if (or (!= (handle->process pickup-handle) (handle->process (-> this eco-source))) (>= (- (-> *display* game-clock frame-counter) (-> this eco-source-time)) (seconds 0.5)) ) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-green-eco") ) (send-event (-> this process) 'color-effect 'health (seconds 0.2)) (when (handle->process pickup-handle) @@ -1004,7 +1004,7 @@ ((< 0.0 amount) (set! (-> this eco-green-pickup-time) (-> *display* game-clock frame-counter)) (seek! (-> this eco-green) (-> this eco-green-max) amount) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-green-eco") (send-event (-> this process) 'color-effect 'eco-green (seconds 0.2)) ) (else @@ -1016,7 +1016,7 @@ (((pickup-type eco-pill-dark)) (when (< 0.0 amount) (if (>= (- (-> *display* game-clock frame-counter) (-> this eco-pill-dark-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "get-dark-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-dark-eco") ) (send-event (-> this process) 'color-effect 'eco-pill-dark (seconds 0.2)) (cond @@ -1066,7 +1066,7 @@ ) ) ) - (sound-play-by-name (static-sound-name "get-light-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-light-eco") ) (if (< (-> this process game eco-pill-light) (* 0.95 (-> *FACT-bank* eco-pill-light-max-default))) (send-event (-> this process) 'color-effect 'eco-pill-light (seconds 0.2)) @@ -1090,7 +1090,7 @@ (fmax 0.0 (fmin (+ (-> this trick-point) amount) (-> *FACT-bank* trick-point-max))) ) (when (!= amount 0.0) - (sound-play-by-name (static-sound-name "get-trick-point") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-trick-point") (process-spawn-function process (lambda :behavior process @@ -1153,7 +1153,7 @@ (((pickup-type money)) (when (< 0.0 amount) (if (>= (- (-> *display* game-clock frame-counter) (-> this money-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "money-pickup") ) (set! (-> this money-pickup-time) (-> *display* game-clock frame-counter)) ) @@ -1162,7 +1162,7 @@ (((pickup-type gem)) (when (< 0.0 amount) (if (>= (- (-> *display* game-clock frame-counter) (-> this gem-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "gem-pickup") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "gem-pickup") ) (set! (-> this gem-pickup-time) (-> *display* game-clock frame-counter)) ) @@ -1172,7 +1172,7 @@ (((pickup-type skill)) (when (< 0.0 amount) (if (>= (- (-> *display* game-clock frame-counter) (-> this skill-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "skill-pickup") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "skill-pickup") ) (set! (-> this skill-pickup-time) (-> *display* game-clock frame-counter)) ) @@ -1348,16 +1348,16 @@ (let ((v1-285 pickup)) (cond ((= v1-285 (pickup-type eco-blue)) - (sound-play-by-name (static-sound-name "get-blue-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-blue-eco") ) ((or (= v1-285 (pickup-type eco-green)) (= v1-285 (pickup-type health))) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-green-eco") ) ((= v1-285 (pickup-type eco-yellow)) - (sound-play-by-name (static-sound-name "get-yellow-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-yellow-eco") ) ((= v1-285 (pickup-type eco-red)) - (sound-play-by-name (static-sound-name "get-red-eco") (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play "get-red-eco") ) ) ) @@ -1930,7 +1930,7 @@ (if (and (not (paused?)) (zero? (-> this number)) (-> *setting-control* user-current player-control-override)) (override-player-controls) ) - (when (logtest? (-> *game-info* secrets) (game-secrets screen-flip)) + (when (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! (-> this leftx) (- 255 (the-as int (-> this leftx)))) (set! (-> this rightx) (- 255 (the-as int (-> this rightx)))) ) @@ -2163,7 +2163,7 @@ (set! (-> gp-0 pov-camera-handle) (the-as handle #f)) (set! (-> gp-0 other-camera-handle) (the-as handle #f)) (set! (-> gp-0 features) (game-feature - feature5 + gun gun-red-1 gun-red-2 gun-red-3 @@ -2177,16 +2177,16 @@ gun-dark-2 gun-dark-3 board - feature20 - feature37 + sidekick + board-launch feature39 - feature40 + darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 feature44 feature45 - feature46 + lightjak lightjak-regen lightjak-swoop lightjak-freeze diff --git a/test/decompiler/reference/jak3/engine/game/game-save_REF.gc b/test/decompiler/reference/jak3/engine/game/game-save_REF.gc index 08fa336c06b..66194a413f9 100644 --- a/test/decompiler/reference/jak3/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-save_REF.gc @@ -632,37 +632,37 @@ (set! (-> save game-time) (+ -300000 (-> *display* total-game-clock frame-counter))) (set! (-> save info-int32 12) (the-as int (logand (game-secrets hero-mode - gs1 - gs2 - gs3 - gs4 - gs5 - gs6 - gs7 - gs8 - gs9 - gs10 - gs11 - gs12 - gs13 - gs14 - screen-flip - gs16 - gs17 - gs18 - gs19 + scene-player-1 + scene-player-2 + scene-player-3 + title-commentary + level-select-1 + level-select-2 + level-select-3 + scrap-book-1 + scrap-book-2 + scrap-book-3 + model-viewer-1 + model-viewer-2 + model-viewer-3 + toggle-beard + hflip-screen + endless-ammo + invulnerable + endless-dark + endless-light gs20 gs21 gungame-ratchet - gs23 - gs24 - gs25 - gs26 - gs27 - gs28 - gs29 - gs30 - gs31 + big-head + little-head + fast-movie + slow-movie + unlimited-turbos + vehicle-hit-points + board-fast + vehicle-fox + vehicle-mirage ) (-> this secrets) ) @@ -671,37 +671,37 @@ (set! (-> save info-int32 13) (the-as int (shr (the-as int (-> this secrets)) 32))) (set! (-> save info-int32 10) (the-as int (logand (game-secrets hero-mode - gs1 - gs2 - gs3 - gs4 - gs5 - gs6 - gs7 - gs8 - gs9 - gs10 - gs11 - gs12 - gs13 - gs14 - screen-flip - gs16 - gs17 - gs18 - gs19 + scene-player-1 + scene-player-2 + scene-player-3 + title-commentary + level-select-1 + level-select-2 + level-select-3 + scrap-book-1 + scrap-book-2 + scrap-book-3 + model-viewer-1 + model-viewer-2 + model-viewer-3 + toggle-beard + hflip-screen + endless-ammo + invulnerable + endless-dark + endless-light gs20 gs21 gungame-ratchet - gs23 - gs24 - gs25 - gs26 - gs27 - gs28 - gs29 - gs30 - gs31 + big-head + little-head + fast-movie + slow-movie + unlimited-turbos + vehicle-hit-points + board-fast + vehicle-fox + vehicle-mirage ) (-> this purchase-secrets) ) @@ -714,7 +714,7 @@ feature2 feature3 feature4 - feature5 + gun gun-red-1 gun-red-2 gun-red-3 @@ -729,7 +729,7 @@ gun-dark-3 board feature19 - feature20 + sidekick feature21 feature22 gun-upgrade-yellow-ammo-1 diff --git a/test/decompiler/reference/jak3/engine/game/pilot-h_REF.gc b/test/decompiler/reference/jak3/engine/game/pilot-h_REF.gc new file mode 100644 index 00000000000..5ad22178ed0 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/game/pilot-h_REF.gc @@ -0,0 +1,116 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type vehicle-controls +(deftype vehicle-controls (structure) + ((steering float) + (throttle float) + (brake float) + (lean-z float) + (handbrake float) + (flags vehicle-controls-flag) + (prev-flags vehicle-controls-flag) + (pad0 uint8 2) + ) + :pack-me + ) + +;; definition for method 3 of type vehicle-controls +(defmethod inspect ((this vehicle-controls)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-controls) + (format #t "~1Tsteering: ~f~%" (-> this steering)) + (format #t "~1Tthrottle: ~f~%" (-> this throttle)) + (format #t "~1Tbrake: ~f~%" (-> this brake)) + (format #t "~1Tlean-z: ~f~%" (-> this lean-z)) + (format #t "~1Thandbrake: ~f~%" (-> this handbrake)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tprev-flags: ~D~%" (-> this prev-flags)) + (format #t "~1Tpad0[2] @ #x~X~%" (-> this pad0)) + (label cfg-4) + this + ) + +;; definition of type pilot-info +(deftype pilot-info (basic) + ((entity entity) + (vehicle handle) + (left-right-bias float) + (left-right-min float) + (left-right-max float) + (left-right-interp float) + (front-back-interp float) + (up-down-interp float) + (up-down-accel-factor float) + (front-back-accel-factor float) + (left-right-accel-factor float) + (stance uint8) + (seat-index int8) + (backup-nav-radius float) + (cam-side-shift float) + (enable-cam-side-shift symbol) + (gun? symbol) + (controls vehicle-controls :inline) + (accel-array vector 8 :inline) + (local-accel vector :inline) + (pilot-trans vector :inline) + (pilot-quat vector :inline) + (pilot-scale vector :inline) + (underwater-time time-frame) + (as-daxter? symbol) + (art-group-backup art-group) + (hud-health handle) + (hud-turbo handle) + (jumping? symbol) + ) + ) + +;; definition for method 3 of type pilot-info +(defmethod inspect ((this pilot-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tvehicle: #x~X~%" (-> this vehicle)) + (format #t "~1Tleft-right-bias: ~f~%" (-> this left-right-bias)) + (format #t "~1Tleft-right-min: ~f~%" (-> this left-right-min)) + (format #t "~1Tleft-right-max: ~f~%" (-> this left-right-max)) + (format #t "~1Tleft-right-interp: ~f~%" (-> this left-right-interp)) + (format #t "~1Tfront-back-interp: ~f~%" (-> this front-back-interp)) + (format #t "~1Tup-down-interp: ~f~%" (-> this up-down-interp)) + (format #t "~1Tup-down-accel-factor: ~f~%" (-> this up-down-accel-factor)) + (format #t "~1Tfront-back-accel-factor: ~f~%" (-> this front-back-accel-factor)) + (format #t "~1Tleft-right-accel-factor: ~f~%" (-> this left-right-accel-factor)) + (format #t "~1Tstance: ~D~%" (-> this stance)) + (format #t "~1Tseat-index: ~D~%" (-> this seat-index)) + (format #t "~1Tbackup-nav-radius: ~f~%" (-> this backup-nav-radius)) + (format #t "~1Tcam-side-shift: ~f~%" (-> this cam-side-shift)) + (format #t "~1Tenable-cam-side-shift: ~A~%" (-> this enable-cam-side-shift)) + (format #t "~1Tgun?: ~A~%" (-> this gun?)) + (format #t "~1Tcontrols: #~%" (-> this controls)) + (format #t "~1Taccel-array: ~`vector`P~%" (-> this accel-array)) + (format #t "~1Tlocal-accel: ~`vector`P~%" (-> this local-accel)) + (format #t "~1Tpilot-trans: ~`vector`P~%" (-> this pilot-trans)) + (format #t "~1Tpilot-quat: ~`vector`P~%" (-> this pilot-quat)) + (format #t "~1Tpilot-scale: ~`vector`P~%" (-> this pilot-scale)) + (format #t "~1Tunderwater-time: ~D~%" (-> this underwater-time)) + (format #t "~1Tas-daxter?: ~A~%" (-> this as-daxter?)) + (format #t "~1Tart-group-backup: ~A~%" (-> this art-group-backup)) + (format #t "~1Thud-health: ~D~%" (-> this hud-health)) + (format #t "~1Thud-turbo: ~D~%" (-> this hud-turbo)) + (format #t "~1Tjumping?: ~A~%" (-> this jumping?)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/game/settings_REF.gc b/test/decompiler/reference/jak3/engine/game/settings_REF.gc index 068ffceee20..497d957b3c3 100644 --- a/test/decompiler/reference/jak3/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/settings_REF.gc @@ -1404,7 +1404,7 @@ (set! (-> s5-0 play-hints) (-> s4-0 play-hints)) (set! (-> s5-0 sound-bank-load) (-> s4-0 sound-bank-load)) (set! (-> s5-0 subtitle) (-> s4-0 subtitle)) - (set! (-> s5-0 beard) (if (logtest? (-> *game-info* secrets) (game-secrets gs14)) + (set! (-> s5-0 beard) (if (logtest? (-> *game-info* secrets) (game-secrets toggle-beard)) (not (-> s4-0 beard)) (-> s4-0 beard) ) @@ -1804,7 +1804,10 @@ (set! (-> s5-0 screeny) (-> s4-0 screeny)) (set! (-> *video-params* display-dy) (* (/ (-> s4-0 screeny) 2) 2)) ) - (set-horizontal-flip-flag *blit-displays-work* (logtest? (-> *game-info* secrets) (game-secrets screen-flip))) + (set-horizontal-flip-flag + *blit-displays-work* + (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) + ) (set! (-> s5-0 letterbox-speed) (-> s4-0 letterbox-speed)) (seek! (-> s5-0 letterbox) @@ -2453,7 +2456,3 @@ (set! (-> v1-228 extra-follow-height) 0.0) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc b/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc new file mode 100644 index 00000000000..0774fac2258 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc @@ -0,0 +1,473 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-rod-of-god com-rod-of-god com-rod-of-god-lod0-jg com-rod-of-god-idle-ja + ((com-rod-of-god-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 10 + ) + +;; definition of type task-arrow +(deftype task-arrow (process-drawable) + ((pos vector :inline) + (theta float) + (phi float) + (dist float) + (smoothed-dist float) + (max-dist float) + (flags task-arrow-flags) + (map-icon uint16) + (minimap connection-minimap) + (hud-dist handle) + (base-quat quaternion :inline) + (base-scale float) + (rod-of-god-scale float) + (moving symbol) + (death-pending? symbol) + (alpha float) + (choir-sound ambient-sound) + (draw-back basic) + ) + (:state-methods + idle + die + leave + ) + (:methods + (task-arrow-method-23 (_type_ vector) none) + (draw-arrow (_type_) none) + ) + ) + +;; definition for method 3 of type task-arrow +(defmethod inspect ((this task-arrow)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tpos: #~%" (-> this pos)) + (format #t "~2Ttheta: ~f~%" (-> this theta)) + (format #t "~2Tphi: ~f~%" (-> this phi)) + (format #t "~2Tdist: ~f~%" (-> this dist)) + (format #t "~2Tsmoothed-dist: ~f~%" (-> this smoothed-dist)) + (format #t "~2Tmax-dist: ~f~%" (-> this max-dist)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tmap-icon: ~D~%" (-> this map-icon)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Thud-dist: ~D~%" (-> this hud-dist)) + (format #t "~2Tbase-quat: #~%" (-> this base-quat)) + (format #t "~2Tbase-scale: ~f~%" (-> this base-scale)) + (format #t "~2Trod-of-god-scale: ~f~%" (-> this rod-of-god-scale)) + (format #t "~2Tmoving: ~A~%" (-> this moving)) + (format #t "~2Tdeath-pending?: ~A~%" (-> this death-pending?)) + (format #t "~2Talpha: ~f~%" (-> this alpha)) + (format #t "~2Tchoir-sound: ~A~%" (-> this choir-sound)) + (format #t "~2Tdraw-back: ~A~%" (-> this draw-back)) + (label cfg-4) + this + ) + +;; definition for method 10 of type task-arrow +;; WARN: Return type mismatch int vs none. +(defmethod deactivate ((this task-arrow)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (send-event (handle->process (-> this hud-dist)) 'hide-and-die) + (if (nonzero? (-> this choir-sound)) + (stop! (-> this choir-sound)) + ) + ((method-of-type process-drawable deactivate) this) + 0 + (none) + ) + +;; definition for method 23 of type task-arrow +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod task-arrow-method-23 ((this task-arrow) (arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'cquery-with-vec))) + (set! (-> s5-0 vec0 quad) (-> arg0 quad)) + (set! (-> s5-0 cquery start-pos quad) (-> s5-0 vec0 quad)) + (+! (-> s5-0 cquery start-pos y) 20480.0) + (set-vector! (-> s5-0 cquery move-dist) 0.0 -81920.0 0.0 1.0) + (let ((v1-4 (-> s5-0 cquery))) + (set! (-> v1-4 radius) 1024.0) + (set! (-> v1-4 collide-with) (collide-spec backgnd)) + (set! (-> v1-4 ignore-process0) #f) + (set! (-> v1-4 ignore-process1) #f) + (set! (-> v1-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-4 action-mask) (collide-action solid)) + ) + (let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* (-> s5-0 cquery)))) + (if (>= f0-7 0.0) + (vector+float*! (-> s5-0 vec0) (-> s5-0 cquery start-pos) (-> s5-0 cquery move-dist) f0-7) + ) + ) + (set! (-> arg0 quad) (-> s5-0 vec0 quad)) + ) + 0 + (none) + ) + +;; definition for method 24 of type task-arrow +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw-arrow ((this task-arrow)) + (when (not (logtest? (-> this flags) (task-arrow-flags taf7))) + (if (or (-> this death-pending?) + (logtest? (-> this flags) (task-arrow-flags taf4)) + (= (the int (-> this rod-of-god-scale)) 0) + ) + (update-vol! (-> this choir-sound) (-> this rod-of-god-scale)) + (update-vol! (-> this choir-sound) 1.0) + ) + (update! (-> this choir-sound)) + ) + (cond + ((logtest? (-> this flags) (task-arrow-flags taf0)) + (if (and (not (handle->process (-> this hud-dist))) *target*) + (set! (-> this hud-dist) + (ppointer->handle (process-spawn hud-progress :init hud-init-by-other :name "hud-progress" :to *target*)) + ) + ) + (let ((s5-1 (get-trail-for-connection *minimap* (-> this minimap) #f))) + (if (and s5-1 (nonzero? (-> s5-1 last-updated))) + (set! (-> this dist) (get-distance-with-path s5-1 (target-pos 0) (-> this pos))) + ) + ) + (if (= (-> this max-dist) 0.0) + (set! (-> this max-dist) (-> this dist)) + ) + (let ((f0-7 (- (-> this dist) (-> this smoothed-dist)))) + (if (< (fabs f0-7) 40960.0) + (+! (-> this smoothed-dist) (* 10.0 (seconds-per-frame) f0-7)) + (set! (-> this smoothed-dist) (-> this dist)) + ) + ) + (let ((f1-5 (/ (-> this smoothed-dist) (-> this max-dist)))) + (set! (-> *game-info* distance) (- 1.0 (fmax 0.0 (fmin 1.0 f1-5)))) + ) + ) + (else + (let ((a0-20 (handle->process (-> this hud-dist)))) + (when a0-20 + (send-event a0-20 'hide-and-die) + (set! (-> this hud-dist) (the-as handle #f)) + ) + ) + ) + ) + (cond + ((logtest? (-> this flags) (task-arrow-flags taf2)) + ) + ((-> this moving) + (cond + ((logtest? (-> this flags) (task-arrow-flags taf6)) + (set! (-> this root trans quad) (-> this pos quad)) + (if (logtest? (-> this flags) (task-arrow-flags taf4)) + (seek! (-> this rod-of-god-scale) 0.0 (* 8.0 (seconds-per-frame))) + (seek! (-> this rod-of-god-scale) 1.0 (* 8.0 (seconds-per-frame))) + ) + ) + (else + (set! (-> this rod-of-god-scale) (- (-> this rod-of-god-scale) (* 8.0 (seconds-per-frame)))) + (when (< (-> this rod-of-god-scale) 0.0) + (set! (-> this rod-of-god-scale) 0.0) + (set! (-> this moving) #f) + (let ((f0-26 81920.0)) + (cond + ((< (* f0-26 f0-26) (vector-vector-xz-distance-squared (-> this pos) (-> this root trans))) + (kill-callback (-> *minimap* engine) (-> this minimap)) + (set! (-> this root trans quad) (-> this pos quad)) + (if (not (logtest? (-> this flags) (task-arrow-flags taf5))) + (set! (-> this minimap) (add-icon! *minimap* this (-> this map-icon) (the-as int #f) (the-as vector #t) 0)) + ) + ) + (else + (set! (-> this root trans quad) (-> this pos quad)) + ) + ) + ) + ) + ) + ) + ) + (else + (set! (-> this pos quad) (-> this root trans quad)) + (if (logtest? (-> this flags) (task-arrow-flags taf4)) + (seek! (-> this rod-of-god-scale) 0.0 (* 8.0 (seconds-per-frame))) + (seek! (-> this rod-of-god-scale) 1.0 (* 8.0 (seconds-per-frame))) + ) + (if (and (-> this death-pending?) + (and (logtest? (-> this flags) (task-arrow-flags taf4)) (= (the int (-> this rod-of-god-scale)) 0)) + ) + (go (method-of-object this die)) + ) + ) + ) + (cond + ((not (logtest? (-> this flags) (task-arrow-flags taf2))) + (let ((f0-39 (-> this base-scale)) + (f30-1 (-> this rod-of-god-scale)) + ) + (set-vector! (-> this root scale) (* f30-1 f0-39) 600.0 (* f30-1 f0-39) 1.0) + (set-vector! (-> this draw color-emissive) 0.5 0.5 0.3 1.0) + (vector-float*! + (the-as vector (-> this draw color-emissive)) + (the-as vector (-> this draw color-emissive)) + (* (-> this alpha) (rand-vu-float-range 0.55 0.7)) + ) + (set! (-> *part-id-table* 410 init-specs 9 initial-valuef) + (* (-> this alpha) (rand-vu-float-range 80.0 96.0)) + ) + (set! (-> *part-id-table* 411 init-specs 9 initial-valuef) + (* (-> this alpha) (rand-vu-float-range 80.0 96.0)) + ) + (let ((f1-18 (lerp-scale 18432.0 44236.8 (- (-> (math-camera-pos) y) (-> this root trans y)) 12288.0 49152.0)) + (f0-56 (* 0.16666667 (-> this base-scale) f30-1)) + ) + (set! (-> *part-id-table* 410 init-specs 3 initial-valuef) (* f1-18 f0-56)) + (set! (-> *part-id-table* 410 init-specs 5 initial-valuef) (* 73728.0 f0-56)) + (set! (-> *part-id-table* 411 init-specs 3 initial-valuef) (* 0.25 f0-56 f1-18)) + (set! (-> *part-id-table* 411 init-specs 5 initial-valuef) (* 18432.0 f0-56)) + (if (or (not (logtest? (-> this flags) (task-arrow-flags taf4))) (< 0.0 f0-56)) + (spawn (-> this part) (-> this root trans)) + ) + ) + ) + ) + (else + (+! (-> this theta) (* 32768.0 (seconds-per-frame))) + (+! (-> this phi) (* 9102.223 (seconds-per-frame))) + (set! (-> this root trans quad) (-> this pos quad)) + (set! (-> this root trans y) (+ 28672.0 (* 4096.0 (cos (-> this theta))) (-> this pos y))) + ) + ) + (when (logtest? (-> this flags) (task-arrow-flags taf1)) + (quaternion-axis-angle! (-> this root quat) 0.0 1.0 0.0 (-> this phi)) + (quaternion-normalize! (quaternion*! (-> this root quat) (-> this base-quat) (-> this root quat))) + ) + (transform-post) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (task-arrow) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-2 object)) + (case message + (('set-position) + (let ((a0-3 (the-as object (-> block param 0)))) + (set! (-> self pos quad) (-> (the-as vector a0-3) quad)) + ) + (if (logtest? (-> self flags) (task-arrow-flags taf3)) + (task-arrow-method-23 self (-> self pos)) + ) + (let ((f0-0 4096.0)) + (when (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> self pos) (-> self root trans))) + (set! v0-2 #t) + (set! (-> self moving) (the-as symbol v0-2)) + v0-2 + ) + ) + ) + (('leave) + (if (logtest? (-> self flags) (task-arrow-flags taf2)) + (go-virtual die) + (go-virtual leave) + ) + ) + (('set-scale) + (set! (-> self base-scale) (the-as float (-> block param 0))) + ) + (('set-alpha) + (set! (-> self alpha) (the-as float (-> block param 0))) + ) + (('hide-keep-minimap) + (set! v0-2 (logior (-> self flags) (task-arrow-flags taf4))) + (set! (-> self flags) (the-as task-arrow-flags v0-2)) + v0-2 + ) + (('hide 'die) + (if (= message 'die) + (set! (-> self death-pending?) #t) + ) + (when (-> self minimap) + (kill-callback (-> *minimap* engine) (-> self minimap)) + (set! (-> self minimap) #f) + ) + (set! v0-2 (logior (-> self flags) (task-arrow-flags taf4))) + (set! (-> self flags) (the-as task-arrow-flags v0-2)) + v0-2 + ) + (('show) + (logclear! (-> self flags) (task-arrow-flags taf4)) + (when (and (not (-> self minimap)) (not (logtest? (-> self flags) (task-arrow-flags taf5)))) + (set! v0-2 (add-icon! *minimap* self (-> self map-icon) (the-as int #f) (the-as vector #t) 0)) + (set! (-> self minimap) (the-as connection-minimap v0-2)) + v0-2 + ) + ) + (('modify-flags) + (let ((v1-35 (-> block param 0)) + (a1-6 (-> block param 1)) + ) + (set! v0-2 (logior (logclear (-> self flags) a1-6) v1-35)) + ) + (set! (-> self flags) (the-as task-arrow-flags v0-2)) + v0-2 + ) + (('map-icon) + (kill-callback (-> *minimap* engine) (-> self minimap)) + (let ((a2-2 (-> block param 0))) + (set! (-> self map-icon) a2-2) + (set! v0-2 (add-icon! *minimap* self a2-2 (the-as int #f) (the-as vector #t) 0)) + ) + (set! (-> self minimap) (the-as connection-minimap v0-2)) + v0-2 + ) + ) + ) + :code sleep-code + :post (behavior () + (when (logtest? (-> self flags) (task-arrow-flags taf8)) + (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> self root trans)))) + 0.0 + (set! (-> self alpha) (lerp-scale 0.0 1.0 f0-0 40960.0 122880.0)) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> (math-camera-matrix) fvec quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (math-camera-pos) (-> self root trans)))) + (set! (-> gp-1 y) 0.0) + (set! (-> s5-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-normalize! s5-1 1.0) + (vector-negate-in-place! gp-1) + (vector+! gp-1 gp-1 s5-1) + ) + (vector-normalize! gp-1 1.0) + (quaternion-look-at! (-> self root quat) gp-1 *up-vector*) + ) + (draw-arrow self) + ) + ) + +;; failed to figure out what this is: +(defstate leave (task-arrow) + :virtual #t + :code (behavior () + (set! (-> self moving) #t) + (while (-> self moving) + (suspend) + ) + (cleanup-for-death self) + ) + :post (behavior () + (draw-arrow self) + ) + ) + +;; failed to figure out what this is: +(defstate die (task-arrow) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (kill-callback (-> *minimap* engine) (-> self minimap)) + (set! (-> self minimap) #f) + ) + ) + :code (behavior () + (cleanup-for-death self) + ) + ) + +;; definition for function task-arrow-init-by-other +;; INFO: Used lq/sq +(defbehavior task-arrow-init-by-other task-arrow ((arg0 task-arrow-params)) + (set! (-> self death-pending?) #f) + (set! (-> self flags) (-> arg0 flags)) + (set! (-> self map-icon) (-> arg0 map-icon)) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec camera-blocker)) + (set! (-> v1-4 prim-core action) (collide-action solid)) + (set! (-> v1-4 transform-index) 3) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-4) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-7 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (set! (-> self pos quad) (-> arg0 pos quad)) + (if (logtest? (-> self flags) (task-arrow-flags taf3)) + (task-arrow-method-23 self (-> self pos)) + ) + (set! (-> self root trans quad) (-> self pos quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (quaternion-copy! (-> self base-quat) (-> arg0 quat)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (set! (-> self base-scale) 6.0) + (set! (-> self alpha) 1.0) + (set! (-> self hud-dist) (the-as handle #f)) + (set! (-> self max-dist) 0.0) + (set! (-> self theta) 0.0) + (set! (-> self phi) 0.0) + (set! (-> self minimap) #f) + (if (not (logtest? (-> self flags) (task-arrow-flags taf5))) + (set! (-> self minimap) (add-icon! *minimap* self (-> arg0 map-icon) (the-as int #f) (the-as vector #t) 0)) + ) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 123) self)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-rod-of-god" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self draw lod-set lod 0 dist) 4096000.0) + (set! (-> self draw bounds w) 1228800.0) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (when (not (logtest? (-> self flags) (task-arrow-flags taf7))) + (set! (-> self choir-sound) (new 'process 'ambient-sound "god-rod" (-> self root trans) 0.0)) + (set-falloff-far! (-> self choir-sound) 163840.0) + (update-vol! (-> self choir-sound) 1.0) + (update-pitch-mod! (-> self choir-sound) 0.0) + ) + (set! (-> self rod-of-god-scale) 0.0) + (set! (-> self moving) #f) + (logclear! (-> self mask) (process-mask actor-pause movie)) + (process-entity-status! self (entity-perm-status no-kill) #t) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + ) + +;; definition for method 7 of type task-arrow +(defmethod relocate ((this task-arrow) (offset int)) + (if (nonzero? (-> this choir-sound)) + (&+! (-> this choir-sound) offset) + ) + (call-parent-method this offset) + ) + +;; definition for function task-arrow-spawn +(defun task-arrow-spawn ((arg0 task-arrow-params) (arg1 process-tree)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn task-arrow arg0 :name "task-arrow" :to arg1))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) diff --git a/test/decompiler/reference/jak3/engine/geometry/path-h_REF.gc b/test/decompiler/reference/jak3/engine/geometry/path-h_REF.gc index 425543dece2..b63f6afa860 100644 --- a/test/decompiler/reference/jak3/engine/geometry/path-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/geometry/path-h_REF.gc @@ -17,14 +17,14 @@ These path-controls are typically allocated on a process heap." ) (:methods (new (symbol type process symbol float entity symbol) _type_) - (path-control-method-9 () none) + (path-control-method-9 (_type_) none) (path-control-method-10 () none) (path-control-method-11 () none) (path-control-method-12 () none) (path-control-method-13 () none) - (path-control-method-14 () none) + (get-point-at-percent-along-path! (_type_ vector float symbol) vector) (path-control-method-15 () none) - (path-control-method-16 () none) + (displacement-between-points-at-percent-normalized! (_type_ vector float) vector) (get-num-segments (_type_) float) (path-control-method-18 () none) (get-num-verts (_type_) int) @@ -33,7 +33,7 @@ These path-controls are typically allocated on a process heap." (path-control-method-22 () none) (path-control-method-23 () none) (path-control-method-24 () none) - (path-control-method-25 () none) + (path-control-method-25 (_type_ vector) float) (path-control-method-26 () none) (path-control-method-27 () none) (path-control-method-28 () none) @@ -262,7 +262,3 @@ These path-controls are typically allocated on a process heap." ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/geometry/vol-h_REF.gc b/test/decompiler/reference/jak3/engine/geometry/vol-h_REF.gc new file mode 100644 index 00000000000..ecd1b99ffa4 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/geometry/vol-h_REF.gc @@ -0,0 +1,141 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type plane-volume +(deftype plane-volume (structure) + ((volume-type symbol) + (point-count int16) + (normal-count int16) + (first-point (pointer vector)) + (first-normal (pointer vector)) + (num-planes int32) + (plane (inline-array plane)) + ) + :pack-me + (:methods + (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume) + (debug-draw (_type_) none) + (point-in-vol? (_type_ vector float) symbol) + ) + ) + +;; definition for method 3 of type plane-volume +(defmethod inspect ((this plane-volume)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'plane-volume) + (format #t "~1Tvolume-type: ~A~%" (-> this volume-type)) + (format #t "~1Tpoint-count: ~D~%" (-> this point-count)) + (format #t "~1Tnormal-count: ~D~%" (-> this normal-count)) + (format #t "~1Tfirst-point: #~%" (-> this first-point)) + (format #t "~1Tfirst-normal: #~%" (-> this first-normal)) + (format #t "~1Tnum-planes: ~D~%" (-> this num-planes)) + (format #t "~1Tplane: #x~X~%" (-> this plane)) + (label cfg-4) + this + ) + +;; definition of type vol-control +(deftype vol-control (basic) + ((flags vol-flags) + (process process-drawable) + (pos-vol-count int32) + (pos-vol plane-volume 32 :inline) + (neg-vol-count int32) + (neg-vol plane-volume 32 :inline) + (debug-point vector-array) + (debug-normal vector-array) + ) + (:methods + (new (symbol type process-drawable) _type_) + (debug-draw (_type_) none) + (vol-control-method-10 (_type_ plane) symbol) + (should-display? (_type_) symbol) + ) + ) + +;; definition for method 3 of type vol-control +(defmethod inspect ((this vol-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X~%" (-> this flags)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tpos-vol-count: ~D~%" (-> this pos-vol-count)) + (format #t "~1Tpos-vol[32] @ #x~X~%" (-> this pos-vol)) + (format #t "~1Tneg-vol-count: ~D~%" (-> this neg-vol-count)) + (format #t "~1Tneg-vol[32] @ #x~X~%" (-> this neg-vol)) + (format #t "~1Tdebug-point: ~A~%" (-> this debug-point)) + (format #t "~1Tdebug-normal: ~A~%" (-> this debug-normal)) + (label cfg-4) + this + ) + +;; definition for method 0 of type vol-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs vol-control. +(defmethod new vol-control ((allocation symbol) (type-to-make type) (arg0 process-drawable)) + (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as vol-control gp-0)) + (go process-drawable-art-error "memory") + (set! gp-0 0) + (goto cfg-13) + ) + (set! (-> (the-as vol-control gp-0) process) arg0) + (let* ((s5-1 (-> (the-as vol-control gp-0) process entity)) + (s4-0 (-> ((method-of-type res-lump lookup-tag-idx) s5-1 'vol 'base -1000000000.0) lo)) + ) + (when (>= (the-as int s4-0) 0) + (let ((s3-0 (the-as int s4-0)) + (s2-0 (-> s5-1 tag s4-0)) + ) + 0 + (while (= (-> s2-0 name) (-> s5-1 tag s4-0 name)) + (let ((v1-12 (make-property-data s5-1 0.0 (the-as res-tag-pair s3-0) (the-as pointer #f))) + (a0-8 (-> (the-as vol-control gp-0) pos-vol (-> (the-as vol-control gp-0) pos-vol-count))) + ) + (set! (-> a0-8 num-planes) (the-as int (-> s2-0 elt-count))) + (set! (-> a0-8 plane) (the-as (inline-array plane) v1-12)) + ) + (+! (-> (the-as vol-control gp-0) pos-vol-count) 1) + (+! s3-0 1) + (set! s2-0 (-> s5-1 tag s3-0)) + ) + ) + ) + ) + (let* ((s5-2 (-> (the-as vol-control gp-0) process entity)) + (s4-1 (-> ((method-of-type res-lump lookup-tag-idx) s5-2 'cutoutvol 'base -1000000000.0) lo)) + ) + (when (>= (the-as int s4-1) 0) + (let ((s3-1 (the-as int s4-1)) + (s2-1 (-> s5-2 tag s4-1)) + ) + 0 + (while (= (-> s2-1 name) (-> s5-2 tag s4-1 name)) + (let ((v1-31 (make-property-data s5-2 0.0 (the-as res-tag-pair s3-1) (the-as pointer #f))) + (a0-19 (-> (the-as vol-control gp-0) neg-vol (-> (the-as vol-control gp-0) neg-vol-count))) + ) + (set! (-> a0-19 num-planes) (the-as int (-> s2-1 elt-count))) + (set! (-> a0-19 plane) (the-as (inline-array plane) v1-31)) + ) + (+! (-> (the-as vol-control gp-0) neg-vol-count) 1) + (+! s3-1 1) + (set! s2-1 (-> s5-2 tag s3-1)) + ) + ) + ) + ) + (label cfg-13) + (the-as vol-control gp-0) + ) + ) + +;; definition for method 11 of type vol-control +(defmethod should-display? ((this vol-control)) + (and *display-vol-marks* (logtest? (-> this flags) (vol-flags display?))) + ) diff --git a/test/decompiler/reference/jak3/engine/geometry/vol_REF.gc b/test/decompiler/reference/jak3/engine/geometry/vol_REF.gc new file mode 100644 index 00000000000..240d769e3d8 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/geometry/vol_REF.gc @@ -0,0 +1,266 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function plane-volume-intersect-dist +(defun plane-volume-intersect-dist ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((f0-1 (vector-dot arg1 arg0)) + (f1-1 (vector-dot arg2 arg0)) + ) + (if (< 0.00001 (fabs f1-1)) + (/ (- (-> arg0 w) f0-1) f1-1) + 409600000.0 + ) + ) + ) + +;; definition for method 9 of type plane-volume +;; INFO: Used lq/sq +(defmethod plane-volume-method-9 ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) + (local-vars + (sv-144 vector) + (sv-148 float) + (sv-152 int) + (sv-160 vector) + (sv-176 vector) + (sv-192 vector) + (sv-208 vector) + (sv-224 vector) + (sv-240 int) + (sv-256 int) + ) + (set! (-> this volume-type) arg0) + (set! (-> this point-count) 0) + (set! (-> this first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) + (set! (-> this normal-count) 0) + (set! (-> this first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) + (dotimes (s3-0 (-> this num-planes)) + (set! sv-176 (new 'stack-no-clear 'vector)) + (set! (-> sv-176 quad) (the-as uint128 0)) + (set! sv-192 (new 'stack-no-clear 'vector)) + (set! (-> sv-192 quad) (the-as uint128 0)) + (set! sv-208 (new 'stack-no-clear 'vector)) + (set! (-> sv-208 quad) (the-as uint128 0)) + (set! sv-224 (new 'stack-no-clear 'vector)) + (set! (-> sv-224 quad) (the-as uint128 0)) + 0.0 + 0.0 + 0.0 + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((s1-0 (new-stack-vector0)) + (s0-0 0) + (s2-0 (-> this plane)) + ) + (set! sv-240 0) + (while (< sv-240 (-> this num-planes)) + (when (!= s3-0 sv-240) + (vector-float*! sv-176 (the-as vector (-> s2-0 sv-240)) (-> s2-0 sv-240 w)) + (vector-cross! sv-192 (the-as vector (-> s2-0 sv-240)) (the-as vector (-> s2-0 s3-0))) + (vector-normalize! sv-192 1.0) + (vector-cross! sv-208 sv-192 (the-as vector (-> s2-0 sv-240))) + (vector-normalize! sv-208 1.0) + (let ((f0-4 (plane-volume-intersect-dist (-> s2-0 s3-0) sv-176 sv-208))) + (when (!= f0-4 409600000.0) + (vector+float*! sv-224 sv-176 sv-208 f0-4) + (set! sv-144 (new-stack-vector0)) + (set! sv-148 (the-as float 0.0)) + (set! sv-152 0) + (set! sv-160 (new-stack-vector0)) + (set! (-> sv-144 quad) (-> sv-224 quad)) + (set! sv-256 0) + (while (< sv-256 (-> this num-planes)) + (when (and (!= sv-256 s3-0) (!= sv-256 sv-240)) + (let ((f0-6 (plane-volume-intersect-dist (-> s2-0 sv-256) sv-144 sv-192))) + (cond + ((= f0-6 409600000.0) + ) + ((zero? sv-152) + (vector+float*! sv-144 sv-144 sv-192 f0-6) + (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (set! sv-148 (the-as float 8192000.0)) + (set! sv-152 1) + ) + ((begin (vector-float*! sv-224 sv-192 f0-6) (>= (vector-dot sv-224 sv-160) 0.0)) + ) + ((>= (vector-dot sv-224 (the-as vector (-> s2-0 sv-256))) 0.0) + (when (< (fabs f0-6) (fabs sv-148)) + (set! sv-148 f0-6) + (set! sv-152 (+ sv-152 1)) + ) + ) + (else + (vector+float*! sv-144 sv-144 sv-192 f0-6) + (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (set! sv-152 (+ sv-152 1)) + (if (< (fabs f0-6) (fabs sv-148)) + (set! sv-148 (- sv-148 f0-6)) + (set! sv-148 (the-as float 0.0)) + ) + ) + ) + ) + ) + (set! sv-256 (+ sv-256 1)) + ) + (cond + ((zero? sv-152) + ) + ((= sv-148 0.0) + ) + (else + (dotimes (v1-75 (-> this num-planes)) + (when (and (!= v1-75 s3-0) (!= v1-75 sv-240)) + (if (< 4096.0 (- (vector-dot sv-144 (the-as vector (-> s2-0 v1-75))) (-> s2-0 v1-75 w))) + (goto cfg-42) + ) + ) + ) + (vector+float*! sv-224 sv-144 sv-192 sv-148) + (cond + ((< (-> arg1 allocated-length) (+ (-> arg1 length) 2)) + (format 0 "ERROR : vol-control #x~X out of volume points~%" this) + ) + (else + (set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad)) + (set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad)) + (+! (-> arg1 length) 2) + (+! (-> this point-count) 2) + ) + ) + (vector+! s1-0 s1-0 sv-144) + (vector+! s1-0 s1-0 sv-224) + (+! s0-0 2) + ) + ) + ) + ) + ) + (label cfg-42) + (set! sv-240 (+ sv-240 1)) + ) + (when (nonzero? s0-0) + (vector-float*! s1-0 s1-0 (/ 1.0 (the float s0-0))) + (cond + ((< (-> arg2 allocated-length) (+ (-> arg2 length) 2)) + (format 0 "ERROR : vol-control #x~X out of volume normals~%" this) + ) + (else + (set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad)) + (set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad)) + (+! (-> arg2 length) 2) + (set! (-> this normal-count) (+ (-> this normal-count) 2)) + ) + ) + ) + ) + ) + this + ) + +;; definition for method 10 of type plane-volume +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this plane-volume)) + (let* ((v1-0 (-> this volume-type)) + (s5-0 (cond + ((= v1-0 'vol) + (the-as uint #x8000c000) + ) + ((= v1-0 'pvol) + (the-as uint #x80808080) + ) + (else + (the-as uint #x800000c0) + ) + ) + ) + (s4-0 (-> this first-point)) + ) + (dotimes (s3-0 (/ (-> this point-count) 2)) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (the-as vector s4-0) + (the-as vector (&-> s4-0 4)) + (the-as rgba s5-0) + #f + (the-as rgba -1) + ) + (set! s4-0 (&-> s4-0 8)) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type plane-volume +(defmethod point-in-vol? ((this plane-volume) (arg0 vector) (arg1 float)) + (dotimes (v1-0 (-> this num-planes)) + (if (< arg1 (- (vector-dot arg0 (the-as vector (-> this plane v1-0))) (-> this plane v1-0 w))) + (return #f) + ) + ) + #t + ) + +;; definition for method 9 of type vol-control +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this vol-control)) + (with-pp + (let ((a0-1 this)) + (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) (vol-flags display?))) + (logtest? (-> this flags) (vol-flags vol-flags-1)) + ) + (when (zero? (-> this debug-point)) + (let ((s5-0 pp)) + (set! pp (-> this process)) + (let ((s4-0 0)) + (dotimes (v1-8 (-> this pos-vol-count)) + (+! s4-0 (-> this pos-vol v1-8 num-planes)) + ) + (dotimes (v1-11 (-> this neg-vol-count)) + (+! s4-0 (-> this neg-vol v1-11 num-planes)) + ) + (set! (-> this debug-point) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> this debug-normal) (new 'debug 'vector-array (* 10 s4-0))) + ) + (set! pp s5-0) + ) + (set! (-> this debug-point length) 0) + (set! (-> this debug-normal length) 0) + (dotimes (s5-1 (-> this pos-vol-count)) + (plane-volume-method-9 (-> this pos-vol s5-1) 'vol (-> this debug-point) (-> this debug-normal)) + ) + (dotimes (s5-2 (-> this neg-vol-count)) + (plane-volume-method-9 (-> this neg-vol s5-2) 'vol (-> this debug-point) (-> this debug-normal)) + ) + ) + (dotimes (s5-3 (-> this pos-vol-count)) + (debug-draw (-> this pos-vol s5-3)) + ) + (dotimes (s5-4 (-> this neg-vol-count)) + (debug-draw (-> this neg-vol s5-4)) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 10 of type vol-control +(defmethod vol-control-method-10 ((this vol-control) (arg0 plane)) + (dotimes (s4-0 (-> this neg-vol-count)) + (if (point-in-vol? (-> this neg-vol s4-0) arg0 0.0) + (return #f) + ) + ) + (dotimes (s4-1 (-> this pos-vol-count)) + (if (point-in-vol? (-> this pos-vol s4-1) arg0 0.0) + (return #t) + ) + ) + #f + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/background/subdivide-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/subdivide-h_REF.gc index 1f077ace25e..1d5d378fc16 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/subdivide-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/subdivide-h_REF.gc @@ -200,8 +200,10 @@ Interestingly, dma-area went from a union of all the -dma types to a plain array "Scratchpad memory layout for regions." ((region-prim-list region-prim-list :inline) (pos vector :inline) - (ray vector :inline :offset 1328) - (region-enter-count int32 :offset 1360) + (exit-pos vector :inline) + (ray vector :inline) + (exit-ray vector :inline) + (region-enter-count int32) (region-enter-list region 320) (region-enter-prim-list drawable-region-sphere 320) (region-exit-count int32) @@ -215,10 +217,10 @@ Interestingly, dma-area went from a union of all the -dma types to a plain array (region-start-prim-list drawable-region-sphere 320) ) (:methods - (region-prim-area-method-9 () none) - (region-prim-area-method-10 () none) - (region-prim-area-method-11 () none) - (region-prim-area-method-12 () none) + (track-entered-region! (_type_ drawable-region-sphere) int) + (track-exited-region! (_type_ drawable-region-sphere) int) + (track-inside-region! (_type_ drawable-region-sphere) int) + (track-start-region! (_type_ drawable-region-sphere) int) ) ) @@ -321,7 +323,3 @@ Interestingly, dma-area went from a union of all the -dma types to a plain array ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1-h_REF.gc index 791c7184b4a..52b1064baf2 100644 --- a/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1-h_REF.gc @@ -137,7 +137,7 @@ This matrix is likely not used by generic VU1, but is used by the merc -> generi (num-strips uint32 :overlay-at (-> giftag data 3)) (num-dps uint32 :overlay-at (-> adnops 0 word 3)) (kick-offset uint32 :offset 108) - (shader gcf-shader :dynamic) + (shader gcf-shader :inline :dynamic) ) ) @@ -183,7 +183,3 @@ This matrix is likely not used by generic VU1, but is used by the merc -> generi ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc index 14765bd3386..f0f8490a29f 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc @@ -262,11 +262,11 @@ particle system itself. This type just holds the launching-related state." (:methods (sparticle-launch-control-method-14 () none) (sparticle-launch-control-method-15 () none) - (sparticle-launch-control-method-16 () none) - (sparticle-launch-control-method-17 () none) - (sparticle-launch-control-method-18 () none) - (sparticle-launch-control-method-19 () none) - (sparticle-launch-control-method-20 () none) + (spawn (_type_ vector) object) + (sparticle-launch-control-method-17 (_type_ matrix) none) + (sparticle-launch-control-method-18 (_type_ cspace) none) + (kill-particles (_type_) none) + (sparticle-launch-control-method-20 (_type_ float) none) ) ) @@ -305,12 +305,12 @@ particle system itself. This type just holds the launching-related state." (sp-system sparticle-system) (sp-launcher sparticle-launcher) (spawn-mat matrix :inline) - (inited? basic) + (inited? symbol) ) (:methods (new (symbol type sparticle-system sparticle-launcher float) _type_) (sparticle-subsampler-method-9 () none) - (sparticle-subsampler-method-10 () none) + (sparticle-subsampler-method-10 (_type_ matrix) none) ) ) @@ -366,7 +366,3 @@ particle system itself. This type just holds the launching-related state." ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/level/level-h_REF.gc b/test/decompiler/reference/jak3/engine/level/level-h_REF.gc index 306d2b9cd1c..b82a0a1f0e9 100644 --- a/test/decompiler/reference/jak3/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/level/level-h_REF.gc @@ -668,7 +668,7 @@ (level-group-method-19 () none) (level-get-target-inside (_type_) level) (level-group-method-21 () none) - (art-group-get-by-name (_type_ string (pointer uint32)) art-group) + (art-group-get-by-name (_type_ string (pointer level)) art-group) (level-group-method-23 () none) (level-group-method-24 () none) (level-group-method-25 () none) diff --git a/test/decompiler/reference/jak3/engine/level/level-info_REF.gc b/test/decompiler/reference/jak3/engine/level/level-info_REF.gc index 262f1a62a3a..b02794a0505 100644 --- a/test/decompiler/reference/jak3/engine/level/level-info_REF.gc +++ b/test/decompiler/reference/jak3/engine/level/level-info_REF.gc @@ -11968,7 +11968,7 @@ :index #xc8 :task-level #x6 :master-level 'wasall - :level-flags (level-flags lf9 lf12 lf13 lf21) + :level-flags (level-flags lf9 lf12 lf13 desert) :packages '("dust-stormp" "desert") :run-packages '("common") :memory-mode (level-memory-mode tiny-center-small) @@ -13468,7 +13468,7 @@ :index #xca :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13580,7 +13580,7 @@ :index #xcd :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13830,7 +13830,7 @@ :index #xce :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13880,7 +13880,7 @@ :index #xcf :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13930,7 +13930,7 @@ :index #xd0 :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -13984,7 +13984,7 @@ :index #xd1 :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -14094,7 +14094,7 @@ :index #xd2 :task-level #x6 :master-level 'desert - :level-flags (level-flags lf9 lf12 lf21) + :level-flags (level-flags lf9 lf12 desert) :packages '("elecgate" "desertg") :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -14295,7 +14295,7 @@ :index #xd4 :task-level #x6 :master-level 'desert - :level-flags (level-flags lf1 lf9 lf12 lf21) + :level-flags (level-flags lf1 lf9 lf12 desert) :packages '() :run-packages '("common") :memory-mode (level-memory-mode tiny-edge) @@ -15943,7 +15943,7 @@ (new 'static 'continue-point :name "nstb-crystal" :level 'nstb - :flags (continue-flags no-auto continue-flag-15 record-path) + :flags (continue-flags no-auto copy-entity-pos record-path) :trans (new 'static 'vector :x 6744972.5 :y -392779.78 :z 2620850.2 :w 1.0) :camera-trans (new 'static 'vector :x 6772533.0 :y -371657.94 :z 2664031.0 :w 1.0) :quat (new 'static 'vector4h :data (new 'static 'array int16 4 0 #x7a77 0 -9518)) diff --git a/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc b/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc new file mode 100644 index 00000000000..9faa1616ad3 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc @@ -0,0 +1,1246 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) + +;; definition for function matrix->axis-angle +(defun matrix->axis-angle ((arg0 vector) (arg1 matrix)) + (let ((s5-0 (matrix->quaternion (new 'stack-no-clear 'quaternion) arg1))) + (vector-normalize-copy! arg0 (the-as vector s5-0) 1.0) + (set! (-> arg0 w) (* 2.0 (acos (-> s5-0 w)))) + ) + ) + +;; definition for method 9 of type ragdoll-edit-info +(defmethod has-joint? ((this ragdoll-edit-info) (arg0 ragdoll-joint)) + (dotimes (v1-0 (-> this child-stack-num)) + (if (= (-> this child-stack v1-0) arg0) + (return #t) + ) + ) + #f + ) + +;; definition for method 10 of type ragdoll-edit-info +(defmethod ragdoll-edit-info-method-10 ((this ragdoll-edit-info) (arg0 object) (arg1 ragdoll-joint)) + (dotimes (v1-0 (-> this child-stack-num)) + (if (= (-> this child-stack v1-0 joint-index) arg1) + (return #t) + ) + ) + #f + ) + +;; definition for method 11 of type ragdoll-edit-info +;; WARN: Return type mismatch int vs none. +(defmethod fill-child-stack! ((this ragdoll-edit-info) (arg0 ragdoll)) + "Fill the `child-stack` with the joints of the given ragdoll." + (let ((v1-0 (-> this affect))) + (cond + ((zero? v1-0) + (set! (-> this child-stack-num) 1) + (set! (-> this child-stack 0) (-> arg0 ragdoll-joints (-> this current-joint))) + ) + ((= v1-0 1) + (set! (-> this child-stack-num) 1) + (set! (-> this child-stack 0) (-> arg0 ragdoll-joints (-> this current-joint))) + (let ((s4-0 (+ (-> this current-joint) 1)) + (a0-6 #t) + ) + (while (< s4-0 (the-as int (-> arg0 num-joints))) + (let ((v1-15 (-> arg0 ragdoll-joints s4-0))) + (set! a0-6 (and (< (-> v1-15 parent-joint) 0) a0-6)) + (cond + ((or a0-6 (and (>= (-> v1-15 parent-joint) 0) + (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> v1-15 parent-joint))) + ) + ) + (set! (-> this child-stack (-> this child-stack-num)) (-> arg0 ragdoll-joints s4-0)) + (set! (-> this child-stack-num) (min 60 (+ (-> this child-stack-num) 1))) + (set! a0-6 #t) + ) + (else + (set! a0-6 #f) + ) + ) + ) + (+! s4-0 1) + ) + ) + ) + ((= v1-0 2) + (dotimes (v1-29 (the-as int (-> arg0 num-joints))) + (set! (-> this child-stack v1-29) (-> arg0 ragdoll-joints v1-29)) + ) + (set! (-> this child-stack-num) (the-as int (-> arg0 num-joints))) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type ragdoll-edit-info +;; WARN: Return type mismatch int vs none. +(defmethod ragdoll-edit-info-method-12 ((this ragdoll-edit-info)) + (if (cpad-pressed? 0 up) + (+! (-> this current-func) -1) + ) + (if (cpad-pressed? 0 left) + (+! (-> this current-func) -4) + ) + (if (cpad-pressed? 0 down) + (+! (-> this current-func) 1) + ) + (if (cpad-pressed? 0 right) + (+! (-> this current-func) 4) + ) + (cond + ((< (the-as int (-> this current-func)) 0) + (set! (-> this current-func) (the-as uint 9)) + ) + ((>= (the-as int (-> this current-func)) 10) + (set! (-> this current-func) (the-as uint 0)) + 0 + ) + ) + (none) + ) + +;; definition for method 13 of type ragdoll-edit-info +;; WARN: Return type mismatch int vs none. +(defmethod cycle-joints! ((this ragdoll-edit-info) (arg0 ragdoll)) + "Cycle through joints based on controller input." + (when (cpad-pressed? 0 r1) + (+! (-> this current-joint) 1) + (if (cpad-hold? 0 l1) + (+! (-> this current-joint) 4) + ) + ) + (when (cpad-pressed? 0 l1) + (+! (-> this current-joint) -1) + (if (cpad-hold? 0 r1) + (+! (-> this current-joint) -4) + ) + ) + (if (< (-> this current-joint) 0) + (set! (-> this current-joint) (the-as int (+ (-> arg0 num-joints) -1))) + ) + (when (>= (-> this current-joint) (the-as int (-> arg0 num-joints))) + (set! (-> this current-joint) 0) + 0 + ) + (none) + ) + +;; definition for method 14 of type ragdoll-edit-info +;; INFO: Used lq/sq +(defmethod ragdoll-edit-info-method-14 ((this ragdoll-edit-info) + (arg0 matrix) + (arg1 vector) + (arg2 (inline-array ragdoll-joint)) + (arg3 ragdoll) + (arg4 process-drawable) + ) + (let ((s2-0 (get-parent-joint arg3 arg2))) + (cond + (s2-0 + (quaternion->matrix arg0 (-> s2-0 quat)) + (set! (-> arg1 quad) (-> s2-0 position quad)) + arg1 + ) + ((< (-> arg2 0 parent-joint) 0) + (quaternion->matrix arg0 (-> arg4 root quat)) + (set! (-> arg1 quad) (-> arg4 root trans quad)) + arg1 + ) + (else + (let* ((v1-8 arg0) + (a3-1 (-> arg4 node-list data (-> arg2 0 parent-joint) bone transform)) + (a0-7 (-> a3-1 rvec quad)) + (a1-6 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-8 rvec quad) a0-7) + (set! (-> v1-8 uvec quad) a1-6) + (set! (-> v1-8 fvec quad) a2-1) + (set! (-> v1-8 trans quad) a3-2) + ) + (vector<-cspace! arg1 (-> arg4 node-list data (-> arg2 0 parent-joint))) + ) + ) + ) + ) + +;; definition for method 15 of type ragdoll-edit-info +;; WARN: Return type mismatch symbol vs none. +(defmethod ragdoll-edit-info-method-15 ((this ragdoll-edit-info)) + (dotimes (s5-0 (-> this child-stack-num)) + (let ((s4-0 (-> this child-stack s5-0))) + (case (-> this analog-func) + ((5) + (let ((s3-0 add-debug-text-3d) + (s2-0 #t) + (s1-0 577) + ) + (format (clear *temp-string*) "~%~R~%" (-> s4-0 max-angle)) + (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* (-> s4-0 position) (font-color orange) (the-as vector2h #f)) + ) + ) + ((3) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-1 577) + ) + (format (clear *temp-string*) "~%~R~%" (-> s4-0 axial-slop)) + (s3-1 s2-1 (the-as bucket-id s1-1) *temp-string* (-> s4-0 position) (font-color orange) (the-as vector2h #f)) + ) + ) + ((4) + (let ((s3-2 add-debug-text-3d) + (s2-2 #t) + (s1-2 577) + ) + (format (clear *temp-string*) "~%~M~%" (-> s4-0 joint-length)) + (s3-2 s2-2 (the-as bucket-id s1-2) *temp-string* (-> s4-0 position) (font-color orange) (the-as vector2h #f)) + ) + ) + ((6) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 position) + (-> s4-0 coll-rad) + (new 'static 'rgba :b #xff :a #x80) + ) + ) + ((8) + (let ((s3-3 add-debug-text-3d) + (s2-3 #t) + (s1-3 577) + ) + (format + (clear *temp-string*) + "~%~f ~f ~f ~f~%" + (-> s4-0 quat x) + (-> s4-0 quat y) + (-> s4-0 quat z) + (-> s4-0 quat w) + ) + (s3-3 s2-3 (the-as bucket-id s1-3) *temp-string* (-> s4-0 position) (font-color orange) (the-as vector2h #f)) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 16 of type ragdoll-edit-info +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod ragdoll-edit-info-method-16 ((this ragdoll-edit-info) (arg0 ragdoll) (arg1 process-drawable)) + (local-vars + (sv-4352 ragdoll-joint) + (sv-4368 matrix) + (sv-4384 vector) + (sv-4400 matrix) + (sv-4416 matrix) + (sv-4432 vector) + (sv-4448 quaternion) + (sv-4464 matrix) + (sv-4480 matrix) + (sv-4496 matrix) + ) + (let ((s3-0 (new 'stack-no-clear 'inline-array 'matrix 60))) + (dotimes (v1-0 60) + (let ((a0-2 (the-as matrix (-> s3-0 v1-0 rvec)))) + (set! (-> a0-2 rvec quad) (the-as uint128 0)) + (set! (-> a0-2 uvec quad) (the-as uint128 0)) + (set! (-> a0-2 fvec quad) (the-as uint128 0)) + (set! (-> a0-2 trans quad) (the-as uint128 0)) + ) + ) + (dotimes (s2-0 (the-as int (-> arg0 num-joints))) + (let ((s0-0 (-> arg0 ragdoll-joints s2-0))) + (set! sv-4352 (get-parent-joint arg0 (the-as (inline-array ragdoll-joint) s0-0))) + (set! sv-4368 (the-as matrix (-> s3-0 s2-0 rvec))) + (let ((s1-0 (new 'stack-no-clear 'matrix))) + (cond + (sv-4352 + (set! sv-4416 + (matrix-axis-angle! (new 'stack-no-clear 'matrix) (-> s0-0 pre-tform) (- (-> s0-0 pre-tform w))) + ) + (set! sv-4432 (new 'stack-no-clear 'vector)) + (let* ((v1-11 s1-0) + (a3-0 + (the-as + matrix + (-> s3-0 + (/ (the-as uint (&- (the-as pointer sv-4352) (the-as uint (the-as pointer (-> arg0 ragdoll-joints))))) + (the-as uint 192) + ) + rvec + ) + ) + ) + (a0-9 (-> a3-0 rvec quad)) + (a1-5 (-> a3-0 uvec quad)) + (a2-2 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-11 rvec quad) a0-9) + (set! (-> v1-11 uvec quad) a1-5) + (set! (-> v1-11 fvec quad) a2-2) + (set! (-> v1-11 trans quad) a3-1) + ) + (set! (-> sv-4432 quad) (-> s1-0 trans quad)) + (vector-reset! (-> s1-0 trans)) + (when (and (-> this auto-setup-now) + (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index))) + ) + (set! sv-4384 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s0-0 position) sv-4432) 1.0)) + (set! sv-4400 (new 'stack-no-clear 'matrix)) + (matrix*! sv-4416 sv-4416 s1-0) + (matrix-from-two-vectors! sv-4400 (-> sv-4416 uvec) sv-4384) + (matrix*! sv-4416 sv-4416 sv-4400) + (matrix-transpose! sv-4400 s1-0) + (matrix*! sv-4416 sv-4416 sv-4400) + (matrix->axis-angle (-> s0-0 pre-tform) sv-4416) + ) + (let ((t9-10 matrix*!) + (a0-21 s1-0) + (a2-8 s1-0) + ) + (t9-10 a0-21 sv-4416 a2-8) + ) + (set! (-> s1-0 trans quad) (-> sv-4432 quad)) + (vector-! (-> sv-4368 uvec) (-> s0-0 position) (-> sv-4352 position)) + (vector-normalize! (-> sv-4368 uvec) 1.0) + (vector-flatten! (-> sv-4368 rvec) (-> s1-0 rvec) (-> sv-4368 uvec)) + (vector-normalize! (-> sv-4368 rvec) 1.0) + (vector-cross! (-> sv-4368 fvec) (-> sv-4368 rvec) (-> sv-4368 uvec)) + (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) + (set! (-> sv-4368 rvec w) 0.0) + (set! (-> sv-4368 uvec w) 0.0) + (set! (-> sv-4368 fvec w) 0.0) + ) + ((= s0-0 (-> arg0 ragdoll-joints)) + (quaternion->matrix sv-4368 (-> s0-0 quat)) + (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) + (quaternion->matrix s1-0 (-> arg1 root quat)) + (set! (-> s1-0 trans quad) (-> arg1 root trans quad)) + ) + (else + (let* ((v1-43 sv-4368) + (a3-2 (-> arg1 node-list data (-> s0-0 joint-index) bone transform)) + (a0-43 (-> a3-2 rvec quad)) + (a1-27 (-> a3-2 uvec quad)) + (a2-10 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> v1-43 rvec quad) a0-43) + (set! (-> v1-43 uvec quad) a1-27) + (set! (-> v1-43 fvec quad) a2-10) + (set! (-> v1-43 trans quad) a3-3) + ) + (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) + (let* ((a2-11 s1-0) + (a3-4 sv-4368) + (v1-46 (-> a3-4 rvec quad)) + (a0-46 (-> a3-4 uvec quad)) + (a1-28 (-> a3-4 fvec quad)) + (a3-5 (-> a3-4 trans quad)) + ) + (set! (-> a2-11 rvec quad) v1-46) + (set! (-> a2-11 uvec quad) a0-46) + (set! (-> a2-11 fvec quad) a1-28) + (set! (-> a2-11 trans quad) a3-5) + ) + (vector<-cspace! (-> s1-0 trans) (-> arg1 node-list data (-> s0-0 parent-joint))) + ) + ) + (when (and (-> this auto-setup-now) + (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index))) + ) + (set! sv-4464 (new 'stack-no-clear 'matrix)) + (set! sv-4480 (new 'stack-no-clear 'matrix)) + (let* ((a2-13 sv-4464) + (a3-6 sv-4368) + (v1-56 (-> a3-6 rvec quad)) + (a0-49 (-> a3-6 uvec quad)) + (a1-32 (-> a3-6 fvec quad)) + (a3-7 (-> a3-6 trans quad)) + ) + (set! (-> a2-13 rvec quad) v1-56) + (set! (-> a2-13 uvec quad) a0-49) + (set! (-> a2-13 fvec quad) a1-32) + (set! (-> a2-13 trans quad) a3-7) + ) + (vector-reset! (-> sv-4464 trans)) + (matrix-transpose! sv-4464 sv-4464) + (set! sv-4448 (matrix->quaternion + (new 'stack-no-clear 'quaternion) + (-> arg1 node-list data (-> s0-0 joint-index) bone transform) + ) + ) + (quaternion-normalize! sv-4448) + (quaternion->matrix sv-4480 sv-4448) + (matrix*! sv-4480 sv-4480 sv-4464) + (matrix->axis-angle (-> s0-0 geo-tform) sv-4480) + ) + (case (-> this skel-visible) + ((1) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> sv-4368 trans) + (-> s1-0 trans) + (new 'static 'rgba :r #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + (when (or (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + (zero? (-> this analog-func)) + (not (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index)))) + ) + (let ((f30-0 0.25)) + (if (and (nonzero? (-> this analog-func)) + (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index))) + ) + (set! f30-0 0.35) + ) + (add-debug-matrix #t (bucket-id debug-no-zbuf1) sv-4368 (* 4096.0 f30-0)) + ) + ) + (set! sv-4496 + (matrix-axis-angle! (new 'stack-no-clear 'matrix) (-> s0-0 geo-tform) (- (-> s0-0 geo-tform w))) + ) + (matrix*! sv-4496 sv-4496 sv-4368) + (set! (-> sv-4496 trans quad) (-> (the-as matrix sv-4368) trans quad)) + (let ((t9-30 add-debug-matrix) + (a0-66 #t) + (a1-46 577) + (a3-10 #x4419999a) + ) + (t9-30 a0-66 (the-as bucket-id a1-46) sv-4496 (the-as meters a3-10)) + ) + (let ((a2-22 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> s0-0 quat)))) + (set! (-> a2-22 trans quad) (-> (the-as matrix sv-4368) trans quad)) + (add-debug-matrix #t (bucket-id debug-no-zbuf1) a2-22 (meters 0.15)) + ) + (when (or (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + (nonzero? (-> this analog-func)) + (not (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index)))) + ) + (let ((f30-1 0.25)) + (if (and (zero? (-> this analog-func)) + (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index))) + ) + (set! f30-1 0.35) + ) + (add-debug-matrix #t (bucket-id debug-no-zbuf1) s1-0 (* 4096.0 f30-1)) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for function show-maya-skeleton +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun show-maya-skeleton ((arg0 process-drawable) (arg1 int) (arg2 int)) + (local-vars (sv-96 symbol) (sv-112 int) (sv-128 (function _varargs_ object))) + (when arg0 + (dotimes (s3-0 (-> arg0 node-list length)) + (let ((s2-0 (new 'stack-no-clear 'matrix)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (let* ((v1-1 s2-0) + (a3-0 (-> arg0 node-list data s3-0 bone transform)) + (a0-4 (-> a3-0 rvec quad)) + (a1-2 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-1 rvec quad) a0-4) + (set! (-> v1-1 uvec quad) a1-2) + (set! (-> v1-1 fvec quad) a2-1) + (set! (-> v1-1 trans quad) a3-1) + ) + (vector<-cspace! (-> s2-0 trans) (-> arg0 node-list data s3-0)) + (when (or (= arg1 -1) (= arg1 s3-0)) + (add-debug-matrix #t (bucket-id debug-no-zbuf1) s2-0 (the-as meters arg2)) + (let ((s0-0 add-debug-text-3d)) + (set! sv-96 #t) + (set! sv-112 577) + (set! sv-128 format) + (let ((a0-9 (clear *temp-string*)) + (a1-6 "~%~D ~S~%") + (a2-3 s3-0) + (a3-5 (if (-> arg0 node-list data s3-0 joint) + (-> arg0 node-list data s3-0 joint name) + "?" + ) + ) + ) + (sv-128 a0-9 a1-6 a2-3 a3-5) + ) + (let ((a2-4 *temp-string*) + (a3-6 (-> s2-0 trans)) + (t0-0 4) + (t1-0 #f) + ) + (s0-0 sv-96 (the-as bucket-id sv-112) a2-4 a3-6 (the-as font-color t0-0) (the-as vector2h t1-0)) + ) + ) + ) + (let ((a1-8 (-> arg0 node-list data s3-0 parent))) + (when a1-8 + (vector<-cspace! s1-0 a1-8) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s2-0 trans) + s1-0 + (new 'static 'rgba :g #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function ragdoll-print-default-joints +;; WARN: Return type mismatch object vs none. +(defun ragdoll-print-default-joints ((arg0 process-drawable)) + (cond + (arg0 + (dotimes (s5-0 (-> arg0 node-list length)) + (let ((s4-0 (-> arg0 node-list data s5-0 joint))) + (when s4-0 + (let* ((s3-0 (-> s4-0 parent)) + (s2-0 (or (not s3-0) (= (-> s3-0 number) (+ (-> s4-0 number) -1)))) + ) + (if (not s2-0) + (format #t "~%") + ) + (format #t "(:joint-name ~15S :parent-joint ~15S )~%" (-> s4-0 name) (if s2-0 + "-1" + (-> s3-0 name) + ) + ) + ) + ) + ) + ) + ) + (else + (format 0 "ragdoll-print-default-joints called with no process~%") + ) + ) + (none) + ) + +;; definition for method 17 of type ragdoll-edit-info +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ragdoll-edit-info-method-17 ((this ragdoll-edit-info) (arg0 ragdoll) (arg1 process-drawable)) + (local-vars (v0-23 object) (v0-32 object) (sv-848 matrix) (sv-864 matrix) (sv-880 matrix)) + (set! (-> this last-frame-dur) (- (current-time) (-> this last-frame))) + (set-time! (-> this last-frame)) + (when (cpad-pressed? 0 l2) + (set! (-> this editing) (not (-> this editing))) + (cond + ((-> this editing) + (set! *external-cam-mode* 'locked) + ) + (*target* + (set! *external-cam-mode* #f) + ) + (else + (set! *external-cam-mode* 'pad-0) + ) + ) + ) + (cond + ((or (not (-> this editing)) (cpad-hold? 0 r2)) + (if (not (-> this editing)) + (format *stdcon* "press l2 to edit ragdoll~%") + (format *stdcon* "release r2 to continue editing ragdoll~%") + ) + (if (or (cpad-hold? 0 r2) (not *target*)) + (set! *external-cam-mode* 'pad-0) + ) + (fill-child-stack! this arg0) + ) + (else + (set! *external-cam-mode* 'locked) + (ragdoll-edit-info-method-12 this) + (cycle-joints! this arg0) + (fill-child-stack! this arg0) + (set! (-> this auto-setup-now) #f) + (let ((s2-0 ">") + (s3-0 " ") + ) + (if (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + (set! s2-0 " ") + ) + (format *stdcon* " r1/l1: select joint ~D~%" (-> this current-joint)) + (format *stdcon* " dpad: select function~%") + (format *stdcon* " r2/l2: move camera~%") + (format *stdcon* " r2: advance single-step~%") + (format *stdcon* " x, tri: toggle/call~%") + (format *stdcon* " rpush: stop editing~%") + (format *stdcon* "------------------------~%") + (let ((t9-13 format) + (a0-19 *stdcon*) + (a1-13 " ~S analog: ~S~%") + (a2-2 (if (zero? (-> this current-func)) + s2-0 + s3-0 + ) + ) + (v1-42 (-> this analog-func)) + ) + (t9-13 a0-19 a1-13 a2-2 (cond + ((zero? v1-42) + "rotate parent" + ) + ((= v1-42 1) + "rotate geo" + ) + ((= v1-42 2) + "global scale" + ) + ((= v1-42 3) + "axial slop" + ) + ((= v1-42 4) + "length" + ) + ((= v1-42 5) + "max angle" + ) + ((= v1-42 6) + "collision radius" + ) + ((= v1-42 7) + "rotate orient" + ) + ((= v1-42 8) + "rotate" + ) + (else + "???" + ) + ) + ) + ) + (let* ((v1-46 (-> arg0 ragdoll-joints (-> this current-joint))) + (t9-14 format) + (a0-21 *stdcon*) + (a1-14 " ~S joint type: ~S~%") + (a2-4 (if (= (-> this current-func) 1) + s2-0 + s3-0 + ) + ) + (v1-47 (-> v1-46 joint-type)) + ) + (t9-14 a0-21 a1-14 a2-4 (cond + ((zero? v1-47) + "cone" + ) + ((= v1-47 1) + "hinge" + ) + (else + "???" + ) + ) + ) + ) + (format *stdcon* " ~S auto setup~%" (if (= (-> this current-func) 2) + s2-0 + s3-0 + ) + ) + (let ((t9-16 format) + (a0-23 *stdcon*) + (a1-16 " ~S skel: ~S~%") + (a2-8 (if (= (-> this current-func) 3) + s2-0 + s3-0 + ) + ) + (v1-50 (-> this skel-visible)) + ) + (t9-16 a0-23 a1-16 a2-8 (cond + ((zero? v1-50) + "visible" + ) + ((= v1-50 1) + "calculated" + ) + ((= v1-50 2) + "hidden" + ) + ((= v1-50 3) + "maya" + ) + ((= v1-50 4) + "ragdoll+maya" + ) + (else + "???" + ) + ) + ) + ) + (let ((t9-17 format) + (a0-24 *stdcon*) + (a1-17 " ~S run: ~S~%") + (a2-10 (if (= (-> this current-func) 4) + s2-0 + s3-0 + ) + ) + (v1-52 (-> this single-step)) + ) + (t9-17 a0-24 a1-17 a2-10 (cond + ((zero? v1-52) + "free" + ) + ((= v1-52 1) + "r2 single step" + ) + ((= v1-52 2) + "locked" + ) + (else + "???" + ) + ) + ) + ) + (format + *stdcon* + " ~S collision: ~S~%" + (if (= (-> this current-func) 5) + s2-0 + s3-0 + ) + (if (-> this collision) + "on" + "off" + ) + ) + (format + *stdcon* + " ~S gravity: ~S~%" + (if (= (-> this current-func) 6) + s2-0 + s3-0 + ) + (if (-> this gravity) + "on" + "off" + ) + ) + (format + *stdcon* + " ~S mirror: ~S~%" + (if (= (-> this current-func) 7) + s2-0 + s3-0 + ) + (if (= (-> arg1 node-list data 2 param0) cspace<-parented-matrix-joint-flip-z!) + "on" + "off" + ) + ) + (let ((t9-21 format) + (a0-28 *stdcon*) + (a1-21 " ~S affect: ~S~%") + (a2-18 (if (= (-> this current-func) 8) + s2-0 + s3-0 + ) + ) + (v1-60 (-> this affect)) + ) + (t9-21 a0-28 a1-21 a2-18 (cond + ((zero? v1-60) + "current" + ) + ((= v1-60 1) + "children" + ) + ((= v1-60 2) + "all" + ) + (else + "???" + ) + ) + ) + ) + (format *stdcon* " ~S print to listener~%" (cond + ((= (-> this current-func) 9) + (empty) + s2-0 + ) + (else + s3-0 + ) + ) + ) + ) + (let ((v1-62 0)) + (if (cpad-pressed? 0 x) + (+! v1-62 1) + ) + (if (cpad-pressed? 0 triangle) + (+! v1-62 -1) + ) + (when (nonzero? v1-62) + (let ((a0-43 (-> this current-func))) + (set! v0-23 + (cond + ((zero? a0-43) + (set! v0-23 (+ (-> this analog-func) v1-62)) + (set! (-> this analog-func) (the-as uint v0-23)) + v0-23 + ) + ((= a0-43 1) + (let ((a0-48 (-> arg0 ragdoll-joints (-> this current-joint)))) + (+! (-> a0-48 joint-type) v1-62) + (cond + ((< (the-as int (-> a0-48 joint-type)) 0) + (set! (-> a0-48 joint-type) (the-as uint 1)) + ) + ((>= (the-as int (-> a0-48 joint-type)) 2) + (set! (-> a0-48 joint-type) (the-as uint 0)) + 0 + ) + ) + (dotimes (v1-70 (-> this child-stack-num)) + (set! (-> this child-stack v1-70 joint-type) (-> a0-48 joint-type)) + ) + ) + #f + ) + ((= a0-43 2) + (set! (-> this auto-setup-now) (the-as basic #t)) + (if (= (-> arg1 node-list data 2 param0) cspace<-parented-matrix-joint-flip-z!) + (format 0 "WARNING: auto setup invoked on mirrored ragdoll--this probably won't work right.~%") + ) + (if (!= (-> this affect) 2) + (format 0 "WARNING: auto setup invoked with affect not set to all.~%") + ) + ) + ((= a0-43 3) + (+! (-> this skel-visible) v1-62) + (cond + ((< (the-as int (-> this skel-visible)) 0) + (set! v0-23 4) + (set! (-> this skel-visible) (the-as uint v0-23)) + v0-23 + ) + ((>= (the-as int (-> this skel-visible)) 5) + (set! (-> this skel-visible) (the-as uint 0)) + 0 + ) + ) + ) + ((= a0-43 4) + (+! (-> this single-step) v1-62) + (cond + ((< (the-as int (-> this single-step)) 0) + (set! v0-23 2) + (set! (-> this single-step) (the-as uint v0-23)) + v0-23 + ) + ((>= (the-as int (-> this single-step)) 3) + (set! (-> this single-step) (the-as uint 0)) + 0 + ) + ) + ) + ((= a0-43 5) + (set! v0-23 (not (-> this collision))) + (set! (-> this collision) (the-as symbol v0-23)) + v0-23 + ) + ((= a0-43 6) + (set! v0-23 (not (-> this gravity))) + (set! (-> this gravity) (the-as symbol v0-23)) + v0-23 + ) + ((= a0-43 7) + (cond + ((= (-> arg1 node-list data 2 param0) cspace<-parented-matrix-joint-flip-z!) + (set! v0-23 (-> arg1 node-list data 2)) + (set! (-> (the-as cspace v0-23) param0) + (the-as (function cspace transformq none) cspace<-parented-matrix-joint!) + ) + (set! (-> (the-as cspace v0-23) param1) #f) + (set! (-> (the-as cspace v0-23) param2) #f) + ) + (else + (set! v0-23 (-> arg1 node-list data 2)) + (set! (-> (the-as cspace v0-23) param0) + (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!) + ) + (set! (-> (the-as cspace v0-23) param1) #f) + (set! (-> (the-as cspace v0-23) param2) #f) + ) + ) + v0-23 + ) + ((= a0-43 8) + (set! v0-23 (+ (-> this affect) v1-62)) + (set! (-> this affect) (the-as uint v0-23)) + v0-23 + ) + ((= a0-43 9) + (format #t "~%") + (format + #t + ":orient-tform (~7f ~7f ~7f ~9R)~%" + (-> arg0 orient-tform x) + (-> arg0 orient-tform y) + (-> arg0 orient-tform z) + (-> arg0 orient-tform w) + ) + (format #t ":scale (~7f ~7f ~7f)~%" (-> arg0 scale x) (-> arg0 scale y) (-> arg0 scale z)) + (dotimes (s3-1 (the-as int (-> arg0 num-joints))) + (let ((s2-1 (-> arg0 ragdoll-joints s3-1))) + (if (!= (-> s2-1 parent-joint) -1) + (format #t "~%") + ) + (format #t "(:joint-name ~15S " (-> arg1 node-list data (-> s2-1 joint-index) joint name)) + (set! v0-32 + (cond + ((= (-> s2-1 parent-joint) -1) + (format #t ":parent-joint ~15D " -1) + v0-32 + ) + (else + (let ((a2-30 (get-parent-joint arg0 (the-as (inline-array ragdoll-joint) s2-1)))) + (if a2-30 + (format #t ":parent-joint ~15S " (-> arg1 node-list data (-> a2-30 joint-index) joint name)) + ) + ) + ) + ) + ) + (let ((t9-33 format) + (a0-69 #t) + (a1-45 ":joint-type ~S ") + (v1-106 (-> s2-1 joint-type)) + ) + (t9-33 a0-69 a1-45 (cond + ((= v1-106 1) + "hinge" + ) + ((zero? v1-106) + " cone" + ) + (else + "???" + ) + ) + ) + ) + (format #t ":axial-slop ~9R " (-> s2-1 axial-slop)) + (format #t ":max-angle ~9R " (-> s2-1 max-angle)) + (format #t ":coll-rad ~7M " (-> s2-1 coll-rad)) + (let ((a2-39 (sound-name->string (-> s2-1 hit-sound)))) + (if (zero? (-> a2-39 data 0)) + (set! a2-39 "\"\"") + ) + (format #t ":hit-sound ~15s " a2-39) + ) + (format + #t + ":pre-tform (~7f ~7f ~7f ~9R) " + (-> s2-1 pre-tform x) + (-> s2-1 pre-tform y) + (-> s2-1 pre-tform z) + (-> s2-1 pre-tform w) + ) + (format + #t + ":geo-tform (~7f ~7f ~7f ~9R))~%" + (-> s2-1 geo-tform x) + (-> s2-1 geo-tform y) + (-> s2-1 geo-tform z) + (-> s2-1 geo-tform w) + ) + ) + ) + (format #t "~%") + ) + (else + (format 0 "~%ERROR: bad ragdoll-edit-func~%") + ) + ) + ) + ) + ) + ) + (cond + ((< (the-as int (-> this analog-func)) 0) + (set! (-> this analog-func) (the-as uint 8)) + ) + ((>= (the-as int (-> this analog-func)) 9) + (set! (-> this analog-func) (the-as uint 0)) + 0 + ) + ) + (cond + ((< (the-as int (-> this affect)) 0) + (set! (-> this affect) (the-as uint 2)) + ) + ((>= (the-as int (-> this affect)) 3) + (set! (-> this affect) (the-as uint 0)) + 0 + ) + ) + (let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 48.0 110.0 1.0)) + (f28-0 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 48.0 110.0 1.0)) + (f26-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 1.0)) + ) + (when (or (!= f30-0 0.0) (!= f28-0 0.0) (!= f26-0 0.0)) + (let ((v1-135 (-> this analog-func))) + (cond + ((or (zero? v1-135) (= v1-135 1) (= v1-135 7) (= v1-135 8)) + (set! f30-0 (* 546.13336 f30-0)) + (set! f28-0 (* -546.13336 f28-0)) + (set! f26-0 (* 546.13336 f26-0)) + ) + ((= v1-135 2) + (let ((f0-25 (* 0.01 f30-0))) + (set! f30-0 (+ 1.0 f0-25)) + ) + (let ((f0-27 (* -0.01 f28-0))) + (set! f28-0 (+ 1.0 f0-27)) + ) + (let ((f0-29 (* 0.01 f26-0))) + (set! f26-0 (+ 1.0 f0-29)) + ) + ) + ((or (= v1-135 5) (= v1-135 3)) + (set! f30-0 (* 45.511112 f30-0)) + (set! f28-0 (* -45.511112 f28-0)) + (set! f26-0 (* 45.511112 f26-0)) + ) + ((or (= v1-135 4) (= v1-135 6)) + (set! f30-0 (* 40.96 f30-0)) + (set! f28-0 (* -40.96 f28-0)) + (set! f26-0 (* 40.96 f26-0)) + ) + ) + ) + (case (-> this analog-func) + ((7) + (let* ((s3-2 (-> arg0 orient-tform)) + (s2-2 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s3-2 (- (-> s3-2 w)))) + ) + (let ((t9-47 matrix-rotate-xyz!) + (a0-96 (new 'stack-no-clear 'matrix)) + (a1-64 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-64 x) f30-0) + (set! (-> a1-64 y) f28-0) + (set! (-> a1-64 z) f26-0) + (set! (-> a1-64 w) 1.0) + (let ((s1-0 (t9-47 a0-96 a1-64)) + (s0-0 (new 'stack-no-clear 'matrix)) + ) + (let ((a2-46 (new 'stack-no-clear 'vector))) + (ragdoll-edit-info-method-14 this s0-0 a2-46 (-> arg0 ragdoll-joints) arg0 arg1) + ) + (matrix*! s2-2 s0-0 s2-2) + (matrix*! s2-2 s1-0 s2-2) + (matrix-transpose! s0-0 s0-0) + (matrix*! s2-2 s0-0 s2-2) + ) + ) + (matrix->axis-angle s3-2 s2-2) + ) + ) + ((2) + (set! (-> arg0 scale x) (* (-> arg0 scale x) f30-0)) + (set! (-> arg0 scale y) (* (-> arg0 scale y) f28-0)) + (set! (-> arg0 scale z) (* (-> arg0 scale z) f26-0)) + ) + (else + (dotimes (s3-3 (-> this child-stack-num)) + (let ((s2-3 (-> this child-stack s3-3)) + (v1-164 (-> this analog-func)) + ) + (cond + ((zero? v1-164) + (let* ((s2-4 (-> s2-3 pre-tform)) + (s1-1 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s2-4 (- (-> s2-4 w)))) + ) + (let ((t9-55 matrix-rotate-xyz!) + (a0-105 (new 'stack-no-clear 'matrix)) + (a1-72 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-72 x) f30-0) + (set! (-> a1-72 y) f28-0) + (set! (-> a1-72 z) f26-0) + (set! (-> a1-72 w) 1.0) + (let ((s0-1 (t9-55 a0-105 a1-72))) + (set! sv-848 (new 'stack-no-clear 'matrix)) + (let ((a2-51 (new 'stack-no-clear 'vector))) + (ragdoll-edit-info-method-14 + this + sv-848 + a2-51 + (the-as (inline-array ragdoll-joint) (-> this child-stack s3-3)) + arg0 + arg1 + ) + ) + (matrix*! s1-1 sv-848 s1-1) + (matrix*! s1-1 s0-1 s1-1) + ) + ) + (matrix-transpose! sv-848 sv-848) + (let ((t9-60 matrix*!) + (a0-110 s1-1) + (a2-54 s1-1) + ) + (t9-60 a0-110 sv-848 a2-54) + ) + (matrix->axis-angle s2-4 s1-1) + ) + ) + ((= v1-164 1) + (let* ((s1-2 (-> s2-3 geo-tform)) + (s0-2 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s1-2 (- (-> s1-2 w)))) + ) + (let ((t9-63 matrix-rotate-xyz!) + (a0-114 (new 'stack-no-clear 'matrix)) + (a1-80 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-80 x) f30-0) + (set! (-> a1-80 y) f28-0) + (set! (-> a1-80 z) f26-0) + (set! (-> a1-80 w) 1.0) + (set! sv-864 (t9-63 a0-114 a1-80)) + ) + (set! sv-880 (new 'stack-no-clear 'matrix)) + (let ((a2-56 (new 'stack-no-clear 'vector))) + (ragdoll-edit-info-method-14 + this + sv-880 + a2-56 + (the-as (inline-array ragdoll-joint) (-> this child-stack s3-3)) + arg0 + arg1 + ) + ) + (let ((a2-58 (matrix-axis-angle! (new 'stack-no-clear 'matrix) (-> s2-3 pre-tform) (- (-> s2-3 pre-tform w))))) + (matrix*! sv-880 sv-880 a2-58) + ) + (matrix*! s0-2 sv-880 s0-2) + (let ((t9-68 matrix*!) + (a0-119 s0-2) + (a2-60 s0-2) + ) + (t9-68 a0-119 sv-864 a2-60) + ) + (matrix-transpose! sv-880 sv-880) + (let ((t9-70 matrix*!) + (a0-121 s0-2) + (a2-61 s0-2) + ) + (t9-70 a0-121 sv-880 a2-61) + ) + (matrix->axis-angle s1-2 s0-2) + ) + ) + ((= v1-164 5) + (set! (-> s2-3 max-angle) (fmin 65536.0 (fmax 0.0 (+ (-> s2-3 max-angle) f28-0)))) + ) + ((= v1-164 3) + (set! (-> s2-3 axial-slop) (fmin 65536.0 (fmax 0.0 (+ (-> s2-3 axial-slop) f28-0)))) + ) + ((= v1-164 4) + (set! (-> s2-3 joint-length) (fmax 40.96 (+ (-> s2-3 joint-length) f28-0))) + ) + ((= v1-164 6) + (set! (-> s2-3 coll-rad) (fmax 0.0 (+ (-> s2-3 coll-rad) f28-0))) + ) + ((= v1-164 8) + (let ((t9-72 matrix-rotate-xyz!) + (a0-128 (new 'stack-no-clear 'matrix)) + (a1-89 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-89 x) f30-0) + (set! (-> a1-89 y) f28-0) + (set! (-> a1-89 z) f26-0) + (set! (-> a1-89 w) 1.0) + (let* ((a1-90 (t9-72 a0-128 a1-89)) + (a2-62 (matrix->quaternion (new 'stack-no-clear 'quaternion) a1-90)) + ) + (quaternion*! (-> s2-3 quat) (-> s2-3 quat) a2-62) + ) + ) + (quaternion-normalize! (-> s2-3 quat)) + ) + (else + (format *stdcon* "~%ERROR: bad ragdoll-analog-func~%") + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((v1-183 (-> this skel-visible))) + (if (or (zero? v1-183) (= v1-183 4) (= v1-183 1)) + (ragdoll-edit-info-method-15 this) + ) + ) + (if (or (-> this auto-setup-now) (case (-> this skel-visible) + ((1) + #t + ) + ) + ) + (ragdoll-edit-info-method-16 this arg0 arg1) + ) + (let ((v1-194 (-> this skel-visible))) + (if (or (= v1-194 3) (= v1-194 4)) + (show-maya-skeleton arg1 -1 #x4499999a) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/physics/ragdoll-h_REF.gc b/test/decompiler/reference/jak3/engine/physics/ragdoll-h_REF.gc index 5001383ed0b..332485cd043 100644 --- a/test/decompiler/reference/jak3/engine/physics/ragdoll-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/ragdoll-h_REF.gc @@ -13,21 +13,21 @@ (skel-visible uint64) (current-joint int8) (auto-setup-now basic) - (child-stack object 60) + (child-stack ragdoll-joint 60) (child-stack-num int8) - (last-frame uint64) - (last-frame-dur uint64) + (last-frame time-frame) + (last-frame-dur time-frame) ) (:methods - (ragdoll-edit-info-method-9 () none) - (ragdoll-edit-info-method-10 () none) - (ragdoll-edit-info-method-11 () none) - (ragdoll-edit-info-method-12 () none) - (ragdoll-edit-info-method-13 () none) - (ragdoll-edit-info-method-14 () none) - (ragdoll-edit-info-method-15 () none) - (ragdoll-edit-info-method-16 () none) - (ragdoll-edit-info-method-17 () none) + (has-joint? (_type_ ragdoll-joint) symbol) + (ragdoll-edit-info-method-10 (_type_ object ragdoll-joint) symbol) + (fill-child-stack! (_type_ ragdoll) none) + (ragdoll-edit-info-method-12 (_type_) none) + (cycle-joints! (_type_ ragdoll) none) + (ragdoll-edit-info-method-14 (_type_ matrix vector (inline-array ragdoll-joint) ragdoll process-drawable) vector) + (ragdoll-edit-info-method-15 (_type_) none) + (ragdoll-edit-info-method-16 (_type_ ragdoll process-drawable) none) + (ragdoll-edit-info-method-17 (_type_ ragdoll process-drawable) none) ) ) @@ -80,7 +80,7 @@ (axial-slop float) (max-angle float) (coll-rad float) - (hit-sound uint128) + (hit-sound sound-name) ) ) @@ -110,7 +110,7 @@ ((orient-tform vector :inline) (scale vector :inline) (bg-collide-with collide-spec) - (joint-setup basic) + (joint-setup (array ragdoll-joint-setup)) ) ) @@ -139,17 +139,17 @@ (pre-tform vector :inline) (geo-tform vector :inline) (axial-slop float) - (max-angle float) + (max-angle degrees) (joint-length float) (coll-rad float) - (ragdoll-joint-flags uint32) + (ragdoll-joint-flags ragdoll-joint-flag) (joint-type uint64) (joint-index int8) (parent-joint int8) (parent-index int8) (num-children int8) (old-param0 basic) - (hit-sound uint128) + (hit-sound sound-name) (ground-pat uint32) (user0 int32) (original-speed float) @@ -205,14 +205,14 @@ (compress-vel-parallel float) (momentum float) (maximum-stretch float) - (turn-off-start uint64) - (turn-off-duration uint64) - (copy-velocity-start uint64) + (turn-off-start time-frame) + (turn-off-duration time-frame) + (copy-velocity-start time-frame) (root-offset vector :inline) (rotate-vel quaternion :inline) (rotate-adj quaternion :inline) (rotate-adj-count int8) - (ragdoll-flags uint32) + (ragdoll-flags ragdoll-flag) (flex-blend float) (stable-joints int8) (ragdoll-joint-remap uint8 100) @@ -221,23 +221,23 @@ (water-info water-info :inline) ) (:methods - (ragdoll-method-9 () none) - (ragdoll-method-10 () none) - (ragdoll-method-11 () none) - (ragdoll-method-12 () none) - (ragdoll-method-13 () none) - (ragdoll-method-14 () none) - (ragdoll-method-15 () none) - (ragdoll-method-16 () none) - (ragdoll-method-17 () none) - (ragdoll-method-18 () none) - (ragdoll-method-19 () none) - (ragdoll-method-20 () none) - (ragdoll-method-21 () none) - (ragdoll-method-22 () none) - (ragdoll-method-23 () none) - (ragdoll-method-24 () none) - (ragdoll-method-25 () none) + (ragdoll-method-9 (_type_ matrix process-drawable) none) + (ragdoll-method-10 (_type_ process-drawable symbol vector symbol) none) + (turn-off-for-duration! (_type_ time-frame) none) + (get-parent-joint (_type_ (inline-array ragdoll-joint)) ragdoll-joint) + (ragdoll-method-13 (_type_ ragdoll-edit-info) none) + (ragdoll-method-14 (_type_) none) + (ragdoll-method-15 (_type_ process-drawable matrix) none) + (ragdoll-setup! (_type_ process-drawable ragdoll-setup) none) + (ragdoll-method-17 (_type_ process-drawable) none) + (ragdoll-method-18 (_type_) none) + (ragdoll-method-19 (_type_ vector int object vector) none) + (ragdoll-method-20 (_type_ vector) none) + (ragdoll-method-21 (_type_ vector vector float) vector) + (get-max-angle-for-joint-idx (_type_ int) degrees) + (ragdoll-method-23 (_type_ vector vector float symbol) none) + (ragdoll-method-24 (_type_ vector int) none) + (ragdoll-method-25 (_type_ process-drawable) none) ) ) @@ -281,16 +281,19 @@ ;; definition of type ragdoll-proc (deftype ragdoll-proc (process) - ((ragdoll ragdoll) + ((parent (pointer process-drawable) :override) + (ragdoll ragdoll) (last-attack-id uint32) ) + (:state-methods + idle + ) (:methods - (ragdoll-proc-method-14 () none) - (ragdoll-proc-method-15 () none) - (ragdoll-proc-method-16 () none) - (ragdoll-proc-method-17 () none) - (ragdoll-proc-method-18 () none) - (ragdoll-proc-method-19 () none) + (ragdoll-proc-method-15 (_type_ symbol vector symbol) none) + (ragdoll-proc-method-16 (_type_ int) none) + (ragdoll-proc-method-17 (_type_ matrix) none) + (ragdoll-proc-method-18 (_type_ ragdoll-edit-info process) none) + (ragdoll-proc-method-19 (_type_) none) ) ) @@ -311,7 +314,8 @@ ;; definition of type wings-ragdoll-proc (deftype wings-ragdoll-proc (ragdoll-proc) - () + ((parent (pointer wings) :override) + ) ) ;; definition for method 3 of type wings-ragdoll-proc @@ -329,7 +333,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/physics/trajectory-h_REF.gc b/test/decompiler/reference/jak3/engine/physics/trajectory-h_REF.gc index 553c4e2aa5b..d301cd45efc 100644 --- a/test/decompiler/reference/jak3/engine/physics/trajectory-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/trajectory-h_REF.gc @@ -50,7 +50,7 @@ (new (symbol type process-drawable int float collide-spec) _type_) (initialize (_type_ process-drawable int float collide-spec) impact-control) (impact-control-method-10 () none) - (impact-control-method-11 () none) + (impact-control-method-11 (_type_ collide-query process pat-surface) float) ) ) @@ -99,7 +99,7 @@ (new (symbol type vector vector) _type_) (initialize (_type_ vector vector) point-tracker) (point-tracker-method-10 () none) - (point-tracker-method-11 () none) + (point-tracker-method-11 (_type_ vector vector vector float) vector) ) ) @@ -134,8 +134,8 @@ (move-start-time time-frame) ) (:methods - (combo-tracker-method-12 () none) - (combo-tracker-method-13 () none) + (combo-tracker-method-12 (_type_ vector vector process time-frame) combo-tracker) + (combo-tracker-method-13 (_type_ handle vector float vector float) process-focusable) ) ) @@ -243,7 +243,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc index b9858f92d7a..d4a2ba08c29 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc @@ -586,7 +586,7 @@ (defmethod deactivate ((this process-drawable)) "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this part)) - ((method-of-object (-> this part) sparticle-launch-control-method-19)) + (kill-particles (-> this part)) ) (if (nonzero? (-> this sound)) (stop! (-> this sound)) @@ -682,8 +682,8 @@ (set! (-> a0-6 prim-core collide-as) (collide-spec)) (set! (-> a0-6 prim-core collide-with) (collide-spec)) ) - (set! (-> v1-12 unknown-word0) 0) - (set! (-> v1-12 unknown-word1) 0) + (set! (-> v1-12 backup-collide-as) (collide-spec)) + (set! (-> v1-12 backup-collide-with) (collide-spec)) 0 ) ) @@ -916,7 +916,7 @@ (s3-0 (method-of-object s4-0 art-group-get-by-name)) ) (format (clear *temp-string*) "skel-~S" name) - (let ((s4-1 (s3-0 s4-0 *temp-string* (the-as (pointer uint32) #f)))) + (let ((s4-1 (s3-0 s4-0 *temp-string* (the-as (pointer level) #f)))) (if (and (nonzero? s4-1) (valid? s4-1 skeleton-group (the-as string #f) #f 0)) (initialize-skeleton this (the-as skeleton-group s4-1) (the-as pair 0)) (go process-drawable-art-error name) @@ -1529,7 +1529,7 @@ (label cfg-45) (let ((a0-26 (-> gp-0 effect))) (if a0-26 - ((method-of-object a0-26 effect-control-method-9)) + (effect-control-method-9 a0-26) ) ) ) @@ -2377,7 +2377,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc index 05b4d5d471e..8a959166ba0 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc @@ -7,9 +7,9 @@ (focus-status focus-status) ) (:methods - (process-focusable-method-20 (_type_) int) + (process-mask->search-info-flag (_type_) search-info-flag) (get-trans (_type_ int) vector) - (get-quat (_type_) quaternion) + (get-quat (_type_ int) quaternion) (get-transv (_type_) vector) (time-to-apex-or-ground (_type_ int) int) (get-water-height (_type_) meters) @@ -33,20 +33,21 @@ ) ;; definition for method 20 of type process-focusable -(defmethod process-focusable-method-20 ((this process-focusable)) - (let ((v0-0 0)) +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this process-focusable)) + (let ((search-flag (search-info-flag))) (let ((mask (-> this mask))) (if (logtest? (process-mask crate) mask) - (set! v0-0 (logior v0-0 2)) + (set! search-flag (the-as search-info-flag (logior (the-as int search-flag) (search-info-flag crate)))) ) (if (logtest? (process-mask guard) mask) - (set! v0-0 (logior v0-0 4)) + (set! search-flag (the-as search-info-flag (logior (the-as int search-flag) (search-info-flag guard)))) ) (if (logtest? (process-mask enemy) mask) - (set! v0-0 (logior v0-0 16)) + (set! search-flag (the-as search-info-flag (logior (the-as int search-flag) (search-info-flag enemy)))) ) ) - v0-0 + (the-as search-info-flag search-flag) ) ) @@ -80,7 +81,7 @@ ) ;; definition for method 22 of type process-focusable -(defmethod get-quat ((this process-focusable)) +(defmethod get-quat ((this process-focusable) (arg0 int)) "Get the quaternion for this process." (-> this root quat) ) @@ -109,7 +110,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc index d7e6a0a4600..8dd3114d95d 100644 --- a/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc @@ -771,7 +771,7 @@ (sound-unit-vector-convert (-> gp-0 cam-forward) fwd) (sound-unit-vector-convert (-> gp-0 cam-left) left) (set! (-> gp-0 cam-scale) (the int (* 65536.0 scale))) - (set! (-> gp-0 cam-inverted) (if (logtest? (-> *game-info* secrets) (game-secrets screen-flip)) + (set! (-> gp-0 cam-inverted) (if (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) 1 0 ) diff --git a/test/decompiler/reference/jak3/engine/sound/speech-h_REF.gc b/test/decompiler/reference/jak3/engine/sound/speech-h_REF.gc index 5ef8495b059..2781c1f1c7a 100644 --- a/test/decompiler/reference/jak3/engine/sound/speech-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/sound/speech-h_REF.gc @@ -94,12 +94,12 @@ (speech-table (pointer speech-type-info)) ) (:methods - (speech-channel-method-9 () none) - (speech-channel-method-10 () none) - (speech-channel-method-11 () none) - (speech-channel-method-12 () none) - (speech-channel-method-13 () none) - (speech-channel-method-14 () none) + (speech-channel-method-9 (_type_ process-drawable speech-type) int) + (speech-channel-method-10 (_type_ handle) none) + (speech-channel-method-11 (_type_) none) + (reset-channel! (_type_) none) + (init! (_type_) none) + (speech-channel-method-14 (_type_ speech-type float) none) ) ) @@ -137,15 +137,15 @@ (speech-table speech-type-info 61) ) (:methods - (speech-control-method-9 () none) - (speech-control-method-10 () none) + (speech-table-reset! (_type_) none) + (speech-table-set! (_type_ speech-type speech-type-info) none) (speech-control-method-11 (_type_) none) - (speech-control-method-12 () none) - (speech-control-method-13 () none) - (speech-control-method-14 () none) - (speech-control-method-15 () none) - (speech-control-method-16 () none) - (speech-control-method-17 () none) + (speech-control-method-12 (_type_ process-drawable speech-type) none) + (speech-control-method-13 (_type_ process-drawable speech-type int) none) + (speech-control-method-14 (_type_ handle) none) + (speech-control-method-15 (_type_) none) + (speech-control-method-16 (_type_) none) + (speech-control-method-17 (_type_ speech-type float) none) ) ) diff --git a/test/decompiler/reference/jak3/engine/sound/speech_REF.gc b/test/decompiler/reference/jak3/engine/sound/speech_REF.gc new file mode 100644 index 00000000000..cd26e9cf98f --- /dev/null +++ b/test/decompiler/reference/jak3/engine/sound/speech_REF.gc @@ -0,0 +1,632 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 12 of type speech-channel +;; WARN: Return type mismatch int vs none. +(defmethod reset-channel! ((this speech-channel)) + (set! (-> this request handle) (the-as handle #f)) + (set! (-> this request priority) -10000000000000000000000000000000000000.0) + 0 + (none) + ) + +;; definition for method 13 of type speech-channel +;; WARN: Return type mismatch int vs none. +(defmethod init! ((this speech-channel)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) + (set! (-> this last-request priority) -10000000000000000000000000000000000000.0) + 0 + (none) + ) + +;; definition (debug) for function speech-type->string +(defun-debug speech-type->string ((arg0 speech-type)) + (case arg0 + (((speech-type race-daxter-start)) + "race-daxter-start" + ) + (((speech-type civ-f-touched-by-player)) + "civ-f-touched-by-player" + ) + (((speech-type civ-m-hit-by-player-vehicle)) + "civ-m-hit-by-player-vehicle" + ) + (((speech-type race-jak-lap)) + "race-jak-lap" + ) + (((speech-type race-jak-start)) + "race-jak-start" + ) + (((speech-type civ-m-player-stealing-vehicle)) + "civ-m-player-stealing-vehicle" + ) + (((speech-type race-daxter-got-hit)) + "race-daxter-got-hit" + ) + (((speech-type guard-go-hostile)) + "guard-go-hostile" + ) + (((speech-type race-jak-ambient)) + "race-jak-ambient" + ) + (((speech-type civ-f-shot-by-player)) + "civ-f-shot-by-player" + ) + (((speech-type guard-chatter)) + "guard-chatter" + ) + (((speech-type civ-f-alert)) + "civ-f-alert" + ) + (((speech-type civ-f-ambient)) + "civ-f-ambient" + ) + (((speech-type guard-generic-battle)) + "guard-generic-battle" + ) + (((speech-type guard-chatter-jak)) + "guard-chatter-jak" + ) + (((speech-type civ-f-avoiding-player-vehicle)) + "civ-f-avoiding-player-vehicle" + ) + (((speech-type guard-battle-victory-b)) + "guard-battle-victory-b" + ) + (((speech-type race-jak-pass)) + "race-jak-pass" + ) + (((speech-type race-daxter-jump)) + "race-daxter-jump" + ) + (((speech-type guard-bumped-by-jak)) + "guard-bumped-by-jak" + ) + (((speech-type race-errol-start)) + "race-errol-start" + ) + (((speech-type guard-bumped-by-jak-b)) + "guard-bumped-by-jak-b" + ) + (((speech-type race-daxter-pass)) + "race-daxter-pass" + ) + (((speech-type race-errol-win)) + "race-errol-win" + ) + (((speech-type race-jak-jump)) + "race-jak-jump" + ) + (((speech-type race-errol-got-passed)) + "race-errol-got-passed" + ) + (((speech-type race-daxter-hit)) + "race-daxter-hit" + ) + (((speech-type civ-f-hit-by-player-vehicle)) + "civ-f-hit-by-player-vehicle" + ) + (((speech-type guard-hit)) + "guard-hit" + ) + (((speech-type guard-go-hostile-b)) + "guard-go-hostile-b" + ) + (((speech-type civ-m-touched-by-player)) + "civ-m-touched-by-player" + ) + (((speech-type race-errol-last-lap)) + "race-errol-last-lap" + ) + (((speech-type guard-battle-victory)) + "guard-battle-victory" + ) + (((speech-type race-jak-last-lap)) + "race-jak-last-lap" + ) + (((speech-type race-jak-win)) + "race-jak-win" + ) + (((speech-type guard-chatter-b)) + "guard-chatter-b" + ) + (((speech-type race-errol-got-hit)) + "race-errol-got-hit" + ) + (((speech-type civ-m-cower)) + "civ-m-cower" + ) + (((speech-type race-errol-lose)) + "race-errol-lose" + ) + (((speech-type race-errrol-hit)) + "race-errol-hit" + ) + (((speech-type race-daxter-win)) + "race-daxter-win" + ) + (((speech-type race-daxter-ambient)) + "race-daxter-ambient" + ) + (((speech-type none)) + "none" + ) + (((speech-type guard-witness-death)) + "guard-witness-death" + ) + (((speech-type race-daxter-lap)) + "race-daxter-lap" + ) + (((speech-type civ-m-shot-by-player)) + "civ-m-shot-by-player" + ) + (((speech-type guard-change-targets-b)) + "guard-change-targets-b" + ) + (((speech-type civ-m-alert)) + "civ-m-alert" + ) + (((speech-type civ-m-ambient)) + "civ-m-ambient" + ) + (((speech-type civ-m-avoiding-player-vehicle)) + "civ-m-avoiding-player-vehicle" + ) + (((speech-type race-jak-hit)) + "race-jak-hit" + ) + (((speech-type race-errol-pass)) + "race-errol-pass" + ) + (((speech-type guard-chatter-jak-b)) + "guard-chatter-jak-b" + ) + (((speech-type guard-generic-battle-b)) + "guard-generic-battle-b" + ) + (((speech-type guard-witness-death-b)) + "guard-witness-death-b" + ) + (((speech-type race-errol-ambient)) + "race-errol-ambient" + ) + (((speech-type race-daxter-last-lap)) + "race-daxter-last-lap" + ) + (((speech-type civ-f-cower)) + "civ-f-cower" + ) + (((speech-type guard-hit-b)) + "guard-hit-b" + ) + (((speech-type guard-change-targets)) + "guard-change-targets" + ) + (((speech-type race-jak-got-hit)) + "race-jak-got-hit" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition (debug) for function gui-status->string +(defun-debug gui-status->string ((arg0 gui-status)) + (case arg0 + (((gui-status ready)) + "ready" + ) + (((gui-status active)) + "active" + ) + (((gui-status stop)) + "stop" + ) + (((gui-status unknown)) + "unknown" + ) + (((gui-status hide)) + "hide" + ) + (((gui-status pending)) + "pending" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition for method 11 of type speech-channel +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod speech-channel-method-11 ((this speech-channel)) + (local-vars (s3-0 int)) + (with-pp + (logclear! (-> this flags) (speech-channel-flag disable)) + (if (or (not (-> *setting-control* user-current speech-control)) + (level-group-method-28 *level*) + (nonzero? (-> this id)) + ) + (logior! (-> this flags) (speech-channel-flag disable)) + ) + (set! (-> this target-pos quad) (-> (target-pos 0) quad)) + (when (not (logtest? (-> this flags) (speech-channel-flag disable))) + (let ((s5-1 (-> this speech-table (-> this request speech-type)))) + (cond + (s5-1 + (let ((a0-8 (- (-> this update-time) (-> this request time))) + (v1-20 (handle->process (-> this request handle))) + ) + (if (and (!= (-> this request handle) #f) + (or (< (the-as time-frame (-> s5-1 request-timeout)) a0-8) + (not v1-20) + (let ((f0-0 245760.0)) + (< (* f0-0 f0-0) + (vector-vector-distance-squared (-> this target-pos) (-> (the-as process-drawable v1-20) root trans)) + ) + ) + ) + ) + (reset-channel! this) + ) + ) + (let ((s4-0 (handle->process (-> this request handle)))) + (when s4-0 + (when (and (>= (- (-> *display* game-clock frame-counter) (the-as int (-> s5-1 time))) + (the-as time-frame (-> s5-1 delay)) + ) + (>= (- (-> *display* game-clock frame-counter) (-> this end-time)) + (the-as time-frame (-> s5-1 delay-pre-time)) + ) + ) + (let ((s2-0 (-> s5-1 list length)) + (v1-40 (-> s5-1 play-index)) + ) + (when (> s2-0 0) + (cond + ((logtest? (-> s5-1 flags) (speech-type-flag random-order)) + (set! s3-0 (rand-vu-int-count s2-0)) + (when (= s3-0 (-> s5-1 play-index)) + (+! s3-0 1) + (if (>= s3-0 s2-0) + (set! s3-0 0) + ) + ) + ) + (else + (set! s3-0 (+ v1-40 1)) + (if (>= s3-0 s2-0) + (set! s3-0 0) + ) + ) + ) + (set! (-> s5-1 play-index) s3-0) + (let ((s2-1 (-> s5-1 list s3-0))) + (mem-copy! (the-as pointer (-> this last-request)) (the-as pointer (-> this request)) 21) + (set! (-> this start-time) (-> *display* game-clock frame-counter)) + (set! (-> this delay) (the-as uint (speech-channel-method-14 this (-> this request speech-type) 1.0))) + (if (logtest? (-> s5-1 flags) (speech-type-flag linked-next)) + (set! (-> this speech-table (+ (-> this request speech-type) 1) play-index) s3-0) + ) + (set! (-> this id) (add-process *gui-control* s4-0 (-> this gui-channel) (gui-action play) s2-1 -99.0 0)) + ) + (sound-params-set! *gui-control* (-> this id) #f -1 -1 -1 (-> *setting-control* user-current talker-volume)) + (reset-channel! this) + (if (nonzero? (-> this id)) + (logior! (-> this flags) (speech-channel-flag disable)) + ) + ) + ) + ) + ) + ) + ) + (else + (reset-channel! this) + ) + ) + ) + ) + (set! (-> this update-time) (-> *display* game-clock frame-counter)) + (when (nonzero? (-> this id)) + (let ((s4-1 (handle->process (-> this last-request handle)))) + (cond + ((and s4-1 (-> *setting-control* user-current speech-control)) + (when *sound-player-enable* + (let ((s5-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> s5-2 command) (sound-command set-param)) + (set! (-> s5-2 id) (-> this id)) + (set! (-> s5-2 params volume) (the int (* 1024.0 (-> *setting-control* user-current talker-volume)))) + (set! (-> s5-2 params fo-min) 15) + (set! (-> s5-2 params fo-max) 90) + (set! (-> s5-2 params fo-curve) 9) + (let ((a1-14 (-> (the-as process-drawable s4-1) root trans))) + (let ((s4-2 pp)) + (when (= a1-14 #t) + (if (and s4-2 (type? s4-2 process-drawable) (nonzero? (-> (the-as process-drawable s4-2) root))) + (set! a1-14 (-> (the-as process-drawable s4-2) root trans)) + (set! a1-14 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> s5-2 params trans) a1-14) + ) + (set! (-> s5-2 params mask) (the-as uint 481)) + (-> s5-2 id) + ) + ) + ) + (else + (set-action! + *gui-control* + (gui-action stop) + (-> this id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> this id) (new 'static 'sound-id)) + 0 + ) + ) + ) + (case (get-status *gui-control* (-> this id)) + (((gui-status pending)) + (when (>= (- (-> *display* game-clock frame-counter) (-> this start-time)) (seconds 1)) + (set-action! + *gui-control* + (gui-action stop) + (-> this id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this end-time) (-> this update-time)) + ) + ) + (((gui-status unknown)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) + (set! (-> this end-time) (-> this update-time)) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 14 of type speech-channel +;; WARN: Return type mismatch int vs none. +(defmethod speech-channel-method-14 ((this speech-channel) (arg0 speech-type) (arg1 float)) + (let ((s4-0 (-> this speech-table arg0))) + 0 + (let ((v0-1 + (the int + (* arg1 (the float (rand-vu-int-range (the-as int (-> s4-0 min-delay)) (the-as int (-> s4-0 max-delay))))) + ) + ) + ) + (set! (-> s4-0 delay) (the-as uint v0-1)) + (set! (-> s4-0 time) (the-as uint (-> *display* game-clock frame-counter))) + (when (logtest? (-> s4-0 flags) (speech-type-flag linked-next)) + (let ((v1-11 (-> this speech-table (+ arg0 1)))) + (set! (-> v1-11 delay) (the-as uint v0-1)) + (set! (-> v1-11 time) (the-as uint (-> *display* game-clock frame-counter))) + ) + ) + ) + ) + (none) + ) + +;; definition for method 9 of type speech-channel +(defmethod speech-channel-method-9 ((this speech-channel) (arg0 process-drawable) (arg1 speech-type)) + (let ((s3-0 (-> this speech-table arg1))) + (when (and s3-0 (>= (- (-> *display* game-clock frame-counter) (the-as int (-> s3-0 time))) + (the-as time-frame (-> s3-0 delay)) + ) + ) + (when (and (logtest? (-> s3-0 flags) (speech-type-flag skip-first-time)) + (logtest? (-> s3-0 flags) (speech-type-flag first-time)) + ) + (logclear! (-> s3-0 flags) (speech-type-flag first-time)) + (speech-channel-method-14 this arg1 1.0) + (return 0) + ) + (let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> this target-pos))) + (f1-0 245760.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (let* ((f1-3 -1.0) + (f2-0 409600.0) + (f0-2 (+ (* f0-0 (/ f1-3 (* f2-0 f2-0))) (the float (-> s3-0 priority)))) + ) + (when (< (-> this request priority) f0-2) + (set! (-> this request priority) f0-2) + (set! (-> this request handle) (process->handle arg0)) + (set! (-> this request speech-type) arg1) + (set! (-> this request time) (-> *display* game-clock frame-counter)) + ) + ) + ) + ) + ) + ) + 0 + ) + +;; definition for method 10 of type speech-channel +;; WARN: Return type mismatch int vs none. +(defmethod speech-channel-method-10 ((this speech-channel) (arg0 handle)) + (when (= arg0 (handle->process (-> this last-request handle))) + (set-action! + *gui-control* + (gui-action stop) + (-> this id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) + (set! (-> this last-request priority) -10000000000000000000000000000000000000.0) + ) + 0 + (none) + ) + +;; definition for method 12 of type speech-control +;; WARN: Return type mismatch int vs none. +(defmethod speech-control-method-12 ((this speech-control) (arg0 process-drawable) (arg1 speech-type)) + (let ((v1-2 (-> this speech-table arg1))) + (when v1-2 + (let ((a0-1 (-> this channel-array (-> v1-2 channel)))) + (if (not (logtest? (-> a0-1 flags) (speech-channel-flag disable))) + (speech-channel-method-9 a0-1 arg0 arg1) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 17 of type speech-control +(defmethod speech-control-method-17 ((this speech-control) (arg0 speech-type) (arg1 float)) + (let ((v1-2 (-> this speech-table arg0))) + (if v1-2 + (speech-channel-method-14 (-> this channel-array (-> v1-2 channel)) arg0 arg1) + ) + ) + (none) + ) + +;; definition for method 11 of type speech-control +;; WARN: Return type mismatch int vs none. +(defmethod speech-control-method-11 ((this speech-control)) + (dotimes (s5-0 2) + (speech-channel-method-11 (-> this channel-array s5-0)) + ) + 0 + (none) + ) + +;; definition for method 10 of type speech-control +;; WARN: Return type mismatch int vs none. +(defmethod speech-table-set! ((this speech-control) (arg0 speech-type) (arg1 speech-type-info)) + (set! (-> this speech-table arg0) arg1) + (logior! (-> arg1 flags) (speech-type-flag first-time)) + 0 + (none) + ) + +;; definition for method 14 of type speech-control +;; WARN: Return type mismatch int vs none. +(defmethod speech-control-method-14 ((this speech-control) (arg0 handle)) + (dotimes (s4-0 2) + (speech-channel-method-10 (-> this channel-array s4-0) arg0) + ) + 0 + (none) + ) + +;; definition for method 15 of type speech-control +;; WARN: Return type mismatch int vs none. +(defmethod speech-control-method-15 ((this speech-control)) + (speech-table-reset! this) + (let ((s5-0 (-> this channel-array))) + ((method-of-type speech-channel init!) (the-as speech-channel s5-0)) + (set! (-> s5-0 0 speech-table) (-> this speech-table)) + (set! (-> s5-0 0 gui-channel) (gui-channel guard)) + ) + (let ((s5-1 (-> this channel-array 1))) + (init! s5-1) + (set! (-> s5-1 speech-table) (-> this speech-table)) + (set! (-> s5-1 gui-channel) (gui-channel citizen)) + ) + 0 + (none) + ) + +;; definition for method 16 of type speech-control +;; WARN: Return type mismatch int vs none. +(defmethod speech-control-method-16 ((this speech-control)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel guard) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel citizen) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (dotimes (s5-0 2) + (reset-channel! (-> this channel-array s5-0)) + ) + 0 + (none) + ) + +;; definition for method 9 of type speech-control +;; WARN: Return type mismatch int vs none. +(defmethod speech-table-reset! ((this speech-control)) + (dotimes (v1-0 61) + (set! (-> this speech-table v1-0) #f) + ) + (dotimes (s5-0 2) + (reset-channel! (-> this channel-array s5-0)) + ) + (speech-table-set! this (speech-type none) (new 'static 'speech-type-info + :priority 3 + :delay-pre-time (seconds 1) + :request-timeout (seconds 1) + :min-delay (seconds 1) + :max-delay (seconds 1) + :list (new 'static 'boxed-array :type string) + ) + ) + 0 + (none) + ) + +;; definition for symbol *speech-control*, type speech-control +(define *speech-control* (new 'static 'speech-control)) + +;; failed to figure out what this is: +(speech-control-method-15 *speech-control*) + +;; definition for method 13 of type speech-control +;; WARN: Return type mismatch int vs none. +(defmethod speech-control-method-13 ((this speech-control) (arg0 process-drawable) (arg1 speech-type) (arg2 int)) + (if (not (-> *setting-control* user-current disable-guard-chatter?)) + (speech-control-method-12 this arg0 (+ arg1 (logand arg2 1))) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc new file mode 100644 index 00000000000..4c991fbfe2d --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc @@ -0,0 +1,531 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type board +(deftype board (process-drawable) + ((parent (pointer target) :override) + (control control-info :overlay-at root) + (shadow-backup shadow-geo :offset 208) + (main joint-mod) + (in-head-time time-frame) + ) + (:state-methods + (idle symbol) + use + hidden + ) + ) + +;; definition for method 3 of type board +(defmethod inspect ((this board)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tcontrol: ~A~%" (-> this root)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Tmain: ~A~%" (-> this main)) + (format #t "~2Tin-head-time: ~D~%" (-> this in-head-time)) + (label cfg-4) + this + ) + +;; definition of type board-info +(deftype board-info (basic) + ((board (pointer board)) + (camera-interp float) + (process (pointer target)) + (board-trans vector :inline) + (board-quat vector :inline) + (board-scale vector :inline) + (main joint-mod) + (upper-body joint-mod) + (mode-sound-bank connection) + (sound-bank-knob float) + (sound-air-knob float) + (wind-sound-id sound-id) + (wind-sound-pitch float) + (wind-sound-volume float) + (engine-sound-id sound-id) + (engine-sound-pitch float) + (engine-sound-volume float) + (bank-sound-id sound-id) + (bank-sound-pitch float) + (bank-sound-volume float) + (ride-sound-id sound-id) + (spin-sound-id sound-id) + (spin-sound-volume float) + (spin-sound-pitch float) + (turn-sound-id sound-id) + (trick-sound-id sound-id) + (jump-sound-id sound-id) + (eco-sound-id sound-id) + (eco-sound-volume float) + (charge-sound-id sound-id) + (adjust-time time-frame) + (up-vector vector 2 :inline) + (slow-transv vector :inline) + (board-time time-frame) + (board-get-on-time time-frame) + (in-air-time time-frame) + (last-jump-time time-frame) + (jump-end-time time-frame) + (unk-time-frame01 time-frame) + (stick-lock symbol) + (stick-off symbol) + (stance-info ground-tween-info :inline) + (mods-backup surface) + (attack-id uint32) + (latch? symbol) + (probe-intersect vector :inline) + (probe-normal vector :inline) + (probe-pat pat-surface) + (probe symbol) + (unstuck-time time-frame) + (stuck-count int32) + (thrust-scale float) + (flip-time time-frame) + (transv-max meters) + (turn-anim-tilt? symbol) + (turn-anim-mag float) + (turn-anim-targ float) + (turn-anim-frame float) + (unk-float000 float) + (unk-float001 float) + (turn-anim-vel float) + (turn-anim-duck float) + (turn-anim-duck-vel float) + (tilt-anim-frame vector :inline) + (tilt-anim-targ vector :inline) + (smack-surface-time time-frame) + (smack-speed meters) + (smack-normal vector :inline) + (glance-time time-frame) + (glance-speed meters) + (glance-in-transv vector :inline) + (glance-out-transv vector :inline) + (glance-normal vector :inline) + (on-flat-time time-frame) + (jump-land-time time-frame) + (slip-factor float) + (ground-on-dir vector :inline) + (ride-time time-frame) + (ride-start-time time-frame) + (ride-button-time time-frame) + (ride-lean-targ float) + (ride-lean float) + (ride-leanv float) + (ride-lean-mag float) + (ride-tilt-targ float) + (ride-tilt float) + (ride-tiltv float) + (ride-tilt-mag float) + (ride-lock symbol) + (ride-lock-on symbol) + (ride-speed meters) + (ride-mode uint32) + (ride-rot degrees) + (ride-rot-old degrees) + (ride-rot-abs degrees 2) + (ride-rotv-abs degrees) + (ride-touch-segment vector 2 :inline) + (ride-dir vector :inline) + (ride-vertex-length int16) + (ride-vertex-length-old int16) + (ride-vertex-base int16) + (ride-vertex-base2 int16) + (ride-vertex-index float) + (ride-vertex-index2 float) + (ride-vertex-index-old float) + (ride-vertex vector 3 :inline) + (ride-segment vector :inline) + (ride-dir-lean vector :inline) + (ride-pad-vector vector 1 :inline) + (ride-vertex-old vector 3 :inline) + (ride-segment-old vector :inline) + (ride-vertex-trail vector 128 :inline) + (halfpipe-side-time time-frame) + (halfpipe-jump-time time-frame) + (halfpipe-lip-time time-frame) + (halfpipe-time time-frame) + (halfpipe-gspot-time time-frame) + (halfpipe-lip-event symbol) + (spin-check-time time-frame) + (spin-time time-frame) + (spin-start-time time-frame) + (spin-start-dir vector :inline) + (spin-control float) + (spin-ground-start-time time-frame) + (spin-ground-time time-frame) + (spin-ground-press-time time-frame) + (flip-control float) + (flip-count int32) + (unk-time000 time-frame :offset 3152) + (tricky-time time-frame) + (tricky-exit-time time-frame) + (duck-start-time time-frame) + (unk-float005 float) + (unk-float006 float) + (unk-float007 float) + (trickx-count int32) + (unk-time001 time-frame :offset 3208) + (hold-start-time time-frame) + (hold-exit-time time-frame) + (l2-start-time time-frame) + (rotyv-max degrees) + (rotyv degrees) + (roty degrees) + (roty-cum degrees) + (unk-deg00 degrees) + (upper-body-rotyv-max degrees :offset 3260) + (upper-body-rotyv degrees) + (upper-body-roty degrees) + (cushion-base meters) + (cushion-offset meters) + (shock-offset meters) + (shock-offsetv meters) + (shock-rotx meters) + (effect-part sparticle-launch-control) + (charge-part sparticle-launch-control) + (trick-count int32) + (trick-array board-tricks 16) + (trick-points-array float 16 :offset 3368) + (trick-list board-tricks 16 :offset 3432) + (charge-start-time time-frame :offset 3496) + (charge-time time-frame) + (charge-progress float) + (zap-start-time time-frame :offset 3520) + ) + (:methods + (add-to-trick-list (_type_ board-tricks float) none) + (flush-trick-list (_type_) none) + ) + ) + +;; definition for method 3 of type board-info +(defmethod inspect ((this board-info)) + (when (not this) + (set! this this) + (goto cfg-19) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tboard: #x~X~%" (-> this board)) + (format #t "~1Tcamera-interp: ~f~%" (-> this camera-interp)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tboard-trans: ~`vector`P~%" (-> this board-trans)) + (format #t "~1Tboard-quat: ~`vector`P~%" (-> this board-quat)) + (format #t "~1Tboard-scale: ~`vector`P~%" (-> this board-scale)) + (format #t "~1Tmain: ~A~%" (-> this main)) + (format #t "~1Tupper-body: ~A~%" (-> this upper-body)) + (format #t "~1Tsound-bank-knob: ~f~%" (-> this sound-bank-knob)) + (format #t "~1Tsound-air-knob: ~f~%" (-> this sound-air-knob)) + (format #t "~1Twind-sound-id: ~D~%" (-> this wind-sound-id)) + (format #t "~1Twind-sound-pitch: ~f~%" (-> this wind-sound-pitch)) + (format #t "~1Twind-sound-volume: ~f~%" (-> this wind-sound-volume)) + (format #t "~1Tengine-sound-id: ~D~%" (-> this engine-sound-id)) + (format #t "~1Tengine-sound-pitch: ~f~%" (-> this engine-sound-pitch)) + (format #t "~1Tengine-sound-volume: ~f~%" (-> this engine-sound-volume)) + (format #t "~1Tbank-sound-id: ~D~%" (-> this bank-sound-id)) + (format #t "~1Tbank-sound-pitch: ~f~%" (-> this bank-sound-pitch)) + (format #t "~1Tbank-sound-volume: ~f~%" (-> this bank-sound-volume)) + (format #t "~1Tride-sound-id: ~D~%" (-> this ride-sound-id)) + (format #t "~1Tspin-sound-id: ~D~%" (-> this spin-sound-id)) + (format #t "~1Tspin-sound-volume: ~f~%" (-> this spin-sound-volume)) + (format #t "~1Tspin-sound-pitch: ~f~%" (-> this spin-sound-pitch)) + (format #t "~1Tup-vector[2] @ #x~X~%" (-> this up-vector)) + (format #t "~1Tslow-transv: #~%" (-> this slow-transv)) + (format #t "~1Tboard-time: ~D~%" (-> this board-time)) + (format #t "~1Tboard-get-on-time: ~D~%" (-> this board-get-on-time)) + (format #t "~1Tin-air-time: ~D~%" (-> this in-air-time)) + (format #t "~1Tstick-lock: ~A~%" (-> this stick-lock)) + (format #t "~1Tstick-off: ~A~%" (-> this stick-off)) + (format #t "~1Tstance-info: #~%" (-> this stance-info)) + (format #t "~1Tmods-backup: ~A~%" (-> this mods-backup)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tlatch?: ~A~%" (-> this latch?)) + (format #t "~1Tunstuck-time: ~D~%" (-> this unstuck-time)) + (format #t "~1Tstuck-count: ~D~%" (-> this stuck-count)) + (format #t "~1Tthrust-scale: ~f~%" (-> this thrust-scale)) + (format #t "~1Tflip-time: ~D~%" (-> this flip-time)) + (format #t "~1Ttransv-max: (meters ~m)~%" (-> this transv-max)) + (format #t "~1Tturn-anim-tilt?: ~A~%" (-> this turn-anim-tilt?)) + (format #t "~1Tturn-anim-mag: ~f~%" (-> this turn-anim-mag)) + (format #t "~1Tturn-anim-targ: ~f~%" (-> this turn-anim-targ)) + (format #t "~1Tturn-anim-frame: ~f~%" (-> this turn-anim-frame)) + (format #t "~1Tturn-anim-vel: ~f~%" (-> this turn-anim-vel)) + (format #t "~1Tturn-anim-duck: ~f~%" (-> this turn-anim-duck)) + (format #t "~1Tturn-anim-duck-vel: ~f~%" (-> this turn-anim-duck-vel)) + (format #t "~1Ttilt-anim-frame: ~`vector`P~%" (-> this tilt-anim-frame)) + (format #t "~1Ttilt-anim-targ: ~`vector`P~%" (-> this tilt-anim-targ)) + (format #t "~1Tsmack-surface-time: ~D~%" (-> this smack-surface-time)) + (format #t "~1Tsmack-speed: (meters ~m)~%" (-> this smack-speed)) + (format #t "~1Tsmack-normal: ~`vector`P~%" (-> this smack-normal)) + (format #t "~1Tglance-time: ~D~%" (-> this glance-time)) + (format #t "~1Tglance-speed: (meters ~m)~%" (-> this glance-speed)) + (format #t "~1Tglance-in-transv: ~`vector`P~%" (-> this glance-in-transv)) + (format #t "~1Tglance-out-transv: ~`vector`P~%" (-> this glance-out-transv)) + (format #t "~1Tglance-normal: ~`vector`P~%" (-> this glance-normal)) + (format #t "~1Ton-flat-time: ~D~%" (-> this on-flat-time)) + (format #t "~1Tjump-land-time: ~D~%" (-> this jump-land-time)) + (format #t "~1Tslip-factor: ~f~%" (-> this slip-factor)) + (format #t "~1Tground-on-dir: ~`vector`P~%" (-> this ground-on-dir)) + (format #t "~1Tride-time: ~D~%" (-> this ride-time)) + (format #t "~1Tride-start-time: ~D~%" (-> this ride-start-time)) + (format #t "~1Tride-button-time: ~D~%" (-> this ride-button-time)) + (format #t "~1Tride-lean-targ: ~f~%" (-> this ride-lean-targ)) + (format #t "~1Tride-lean: ~f~%" (-> this ride-lean)) + (format #t "~1Tride-leanv: ~f~%" (-> this ride-leanv)) + (format #t "~1Tride-lean-mag: ~f~%" (-> this ride-lean-mag)) + (format #t "~1Tride-tilt-targ: ~f~%" (-> this ride-tilt-targ)) + (format #t "~1Tride-tilt: ~f~%" (-> this ride-tilt)) + (format #t "~1Tride-tiltv: ~f~%" (-> this ride-tiltv)) + (format #t "~1Tride-tilt-mag: ~f~%" (-> this ride-tilt-mag)) + (format #t "~1Tride-lock: ~A~%" (-> this ride-lock)) + (format #t "~1Tride-lock-on: ~A~%" (-> this ride-lock-on)) + (format #t "~1Tride-speed: (meters ~m)~%" (-> this ride-speed)) + (format #t "~1Tride-mode: ~D~%" (-> this ride-mode)) + (format #t "~1Tride-rot: (deg ~r)~%" (-> this ride-rot)) + (format #t "~1Tride-rot-old: (deg ~r)~%" (-> this ride-rot-old)) + (format #t "~1Tride-rot-abs[2] @ #x~X~%" (-> this ride-rot-abs)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Tride-rot-abs: (deg ~r)~%" s5-0 (-> this ride-rot-abs s5-0)) + ) + (format #t "~1Tride-rotv-abs: (deg ~r)~%" (-> this ride-rotv-abs)) + (format #t "~1Tride-touch-segment[2] @ #x~X~%" (-> this ride-touch-segment)) + (dotimes (s5-1 2) + (format #t "~T [~D]~1Tride-touch-segment: ~`vector`P~%" s5-1 (-> this ride-touch-segment s5-1)) + ) + (format #t "~1Tride-dir: ~`vector`P~%" (-> this ride-dir)) + (format #t "~1Tride-vertex-length: ~D~%" (-> this ride-vertex-length)) + (format #t "~1Tride-vertex-length-old: ~D~%" (-> this ride-vertex-length-old)) + (format #t "~1Tride-vertex-base: ~D~%" (-> this ride-vertex-base)) + (format #t "~1Tride-vertex-base2: ~D~%" (-> this ride-vertex-base2)) + (format #t "~1Tride-vertex-index: ~f~%" (-> this ride-vertex-index)) + (format #t "~1Tride-vertex-index2: ~f~%" (-> this ride-vertex-index2)) + (format #t "~1Tride-vertex-index-old: ~f~%" (-> this ride-vertex-index-old)) + (format #t "~1Tride-vertex[3] @ #x~X~%" (-> this ride-vertex)) + (dotimes (s5-2 3) + (format #t "~T [~D]~1Tride-vertex: ~`vector`P~%" s5-2 (-> this ride-vertex s5-2)) + ) + (format #t "~1Tride-segment: ~`vector`P~%" (-> this ride-segment)) + (format #t "~1Tride-dir-lean: ~`vector`P~%" (-> this ride-dir-lean)) + (format #t "~1Tride-pad-vector[1] @ #x~X~%" (-> this ride-pad-vector)) + (format #t "~1Tride-vertex-old[3] @ #x~X~%" (-> this ride-vertex-old)) + (dotimes (s5-3 3) + (format #t "~T [~D]~1Tride-vertex-old: ~`vector`P~%" s5-3 (-> this ride-vertex-old s5-3)) + ) + (format #t "~1Tride-segment-old: ~`vector`P~%" (-> this ride-segment-old)) + (format #t "~1Tride-vertex-trail[128] @ #x~X~%" (-> this ride-vertex-trail)) + (dotimes (s5-4 128) + (format #t "~T [~D]~1Tride-vertex-trail: ~`vector`P~%" s5-4 (-> this ride-vertex-trail s5-4)) + ) + (format #t "~1Thalfpipe-side-time: ~D~%" (-> this halfpipe-side-time)) + (format #t "~1Thalfpipe-jump-time: ~D~%" (-> this halfpipe-jump-time)) + (format #t "~1Thalfpipe-lip-time: ~D~%" (-> this halfpipe-lip-time)) + (format #t "~1Thalfpipe-time: ~D~%" (-> this halfpipe-time)) + (format #t "~1Thalfpipe-gspot-time: ~D~%" (-> this halfpipe-gspot-time)) + (format #t "~1Thalfpipe-lip-event: ~A~%" (-> this halfpipe-lip-event)) + (format #t "~1Tspin-check-time: ~D~%" (-> this spin-check-time)) + (format #t "~1Tspin-time: ~D~%" (-> this spin-time)) + (format #t "~1Tspin-start-time: ~D~%" (-> this spin-start-time)) + (format #t "~1Tspin-start-dir: ~`vector`P~%" (-> this spin-start-dir)) + (format #t "~1Tspin-control: ~f~%" (-> this spin-control)) + (format #t "~1Tspin-ground-start-time: ~D~%" (-> this spin-ground-start-time)) + (format #t "~1Tspin-ground-time: ~D~%" (-> this spin-ground-time)) + (format #t "~1Tspin-ground-press-time: ~D~%" (-> this spin-ground-press-time)) + (format #t "~1Tflip-control: ~f~%" (-> this flip-control)) + (format #t "~1Tflip-count: ~D~%" (-> this flip-count)) + (format #t "~1Ttrickx-count: ~D~%" (-> this trickx-count)) + (format #t "~1Trotyv-max: (deg ~r)~%" (-> this rotyv-max)) + (format #t "~1Trotyv: (deg ~r)~%" (-> this rotyv)) + (format #t "~1Troty: (deg ~r)~%" (-> this roty)) + (format #t "~1Troty-cum: (deg ~r)~%" (&-> this roty-cum)) + (format #t "~1Tupper-body-rotyv-max: (deg ~r)~%" (-> this upper-body-rotyv-max)) + (format #t "~1Tupper-body-rotyv: (deg ~r)~%" (-> this upper-body-rotyv)) + (format #t "~1Tupper-body-roty: (deg ~r)~%" (-> this upper-body-roty)) + (format #t "~1Tcushion-base: (meters ~m)~%" (-> this cushion-base)) + (format #t "~1Tcushion-offset: (meters ~m)~%" (-> this cushion-offset)) + (format #t "~1Tshock-offset: (meters ~m)~%" (-> this shock-offset)) + (format #t "~1Tshock-offsetv: (meters ~m)~%" (-> this shock-offsetv)) + (format #t "~1Tshock-rotx: (meters ~m)~%" (-> this shock-rotx)) + (format #t "~1Ttrick-count: ~D~%" (-> this trick-count)) + (format #t "~1Tzap-start-time: ~D~%" (-> this zap-start-time)) + (label cfg-19) + this + ) + +;; definition of type target-board-bank +(deftype target-board-bank (basic) + ((jump-height-min meters) + (jump-height-max meters) + (duck-jump-height-min meters) + (duck-jump-height-max meters) + (turn-frames float) + (wall-kick-window time-frame) + (cushion meters) + (trickx-jump-height-min meters) + (trickx-jump-height-max meters) + (tricky-jump-height-min meters) + (tricky-jump-height-max meters) + (trickz-jump-height-min meters) + (trickz-jump-height-max meters) + (charge-jump-time time-frame) + (charge-jump-fade-time time-frame) + (charge-jump-height meters) + (zap-duration time-frame) + (zap-reset-time time-frame) + ) + ) + +;; definition for method 3 of type target-board-bank +(defmethod inspect ((this target-board-bank)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) + (format #t "~1Tjump-height-max: (meters ~m)~%" (-> this jump-height-max)) + (format #t "~1Tduck-jump-height-min: (meters ~m)~%" (-> this duck-jump-height-min)) + (format #t "~1Tduck-jump-height-max: (meters ~m)~%" (-> this duck-jump-height-max)) + (format #t "~1Tturn-frames: ~f~%" (-> this turn-frames)) + (format #t "~1Twall-kick-window: (seconds ~e)~%" (-> this wall-kick-window)) + (format #t "~1Tcushion: (meters ~m)~%" (-> this cushion)) + (format #t "~1Ttrickx-jump-height-min: (meters ~m)~%" (-> this trickx-jump-height-min)) + (format #t "~1Ttrickx-jump-height-max: (meters ~m)~%" (-> this trickx-jump-height-max)) + (format #t "~1Ttricky-jump-height-min: (meters ~m)~%" (-> this tricky-jump-height-min)) + (format #t "~1Ttricky-jump-height-max: (meters ~m)~%" (-> this tricky-jump-height-max)) + (format #t "~1Ttrickz-jump-height-min: (meters ~m)~%" (-> this trickz-jump-height-min)) + (format #t "~1Ttrickz-jump-height-max: (meters ~m)~%" (-> this trickz-jump-height-max)) + (format #t "~1Tcharge-jump-time: (seconds ~e)~%" (-> this charge-jump-time)) + (format #t "~1Tcharge-jump-fade-time: (seconds ~e)~%" (-> this charge-jump-fade-time)) + (format #t "~1Tcharge-jump-height: (meters ~m)~%" (-> this charge-jump-height)) + (format #t "~1Tzap-duration: ~D~%" (-> this zap-duration)) + (format #t "~1Tzap-reset-time: ~D~%" (-> this zap-reset-time)) + (label cfg-4) + this + ) + +;; definition for symbol *TARGET_BOARD-bank*, type target-board-bank +(define *TARGET_BOARD-bank* (new 'static 'target-board-bank + :jump-height-min (meters 1.01) + :jump-height-max (meters 3.5) + :duck-jump-height-min (meters 2.5) + :duck-jump-height-max (meters 5) + :turn-frames 10.0 + :wall-kick-window (seconds 0.05) + :cushion (meters 1) + :trickx-jump-height-min (meters 0.9) + :trickx-jump-height-max (meters 1.2) + :tricky-jump-height-min (meters 0.9) + :tricky-jump-height-max (meters 1.2) + :trickz-jump-height-min (meters 0.9) + :trickz-jump-height-max (meters 1.2) + :charge-jump-time (seconds 0.7) + :charge-jump-fade-time (seconds 0.25) + :charge-jump-height (meters 3.5) + :zap-duration (seconds 0.25) + :zap-reset-time (seconds 0.25) + ) + ) + +;; definition for function want-to-board? +;; INFO: Used lq/sq +(defbehavior want-to-board? target () + (and (logtest? (logand (game-feature board) (-> *setting-control* user-current features)) (-> self game features)) + (or (and (cpad-pressed? (-> self control cpad number) r2) + (or (!= *cheat-mode* 'debug) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) + ) + (not *pause-lock*) + (time-elapsed? (-> self control time-of-last-debug-heal) (seconds 0.1)) + (>= (-> self control last-time-on-surface) (-> self control time-of-last-debug-float)) + ) + (or (-> self board latch?) (= (-> *setting-control* user-current board) 'force)) + ) + (not (focus-test? self dead hit grabbed in-head edge-grab pole flut tube board pilot mech indax teleporting)) + (or (zero? (-> self board)) (time-elapsed? (-> self board board-time) (seconds 0.5))) + (not (logtest? (target-flags prevent-board invisible) (-> self target-flags))) + (< (-> self board board-time) (-> self control list-time-on-ground)) + (not (logtest? (surface-flag no-board) (-> self control current-surface flags))) + (or (not (logtest? (-> self control current-surface flags) (surface-flag duck))) (can-exit-duck? self)) + (not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (zero? (-> self lightjak shield-start-time)) + (not *artist-fix-visible*) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'sphere 3))) + (dotimes (s4-0 3) + ((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere) + ) + (let ((v1-56 (new 'stack-no-clear 'vector))) + (set! (-> v1-56 quad) (-> self control trans quad)) + (if (focus-test? self on-water) + (set! (-> v1-56 y) (-> self water height)) + ) + (set! (-> s5-0 0 quad) (-> v1-56 quad)) + (+! (-> s5-0 0 y) 8192.0) + (set! (-> s5-0 0 r) 2867.2) + (set! (-> s5-0 1 quad) (-> v1-56 quad)) + (+! (-> s5-0 1 y) 12288.0) + (set! (-> s5-0 1 r) 2867.2) + (set! (-> s5-0 2 quad) (-> v1-56 quad)) + ) + (+! (-> s5-0 2 y) 16384.0) + (set! (-> s5-0 2 r) 2867.2) + (let ((v1-60 gp-0)) + (set! (-> v1-60 spheres) s5-0) + (set! (-> v1-60 best-other-prim) (the-as collide-shape-prim 3)) + (set! (-> v1-60 collide-with) + (logclear + (-> self control root-prim prim-core collide-with) + (collide-spec civilian enemy vehicle-sphere projectile) + ) + ) + (set! (-> v1-60 ignore-process0) #f) + (set! (-> v1-60 ignore-process1) #f) + (set! (-> v1-60 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-60 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-60 action-mask) (collide-action solid)) + ) + ) + (and (if (fill-and-probe-using-spheres *collide-cache* gp-0) + #f + #t + ) + (begin (set! (-> self board latch?) #t) (time-elapsed? (-> self gun gun-time) (seconds 0.4))) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-board board board-lod0-jg board-board-idle-ja + ((board-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :shadow board-shadow-mg + :shadow-joint-index 3 + :light-index 1 + ) + +;; definition for symbol *board-shadow-control*, type shadow-control +(define *board-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #xa)) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w 81920.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc new file mode 100644 index 00000000000..1bf8071bd02 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc @@ -0,0 +1,3695 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function vector-vector-angle +(defun vector-vector-angle ((arg0 vector) (arg1 vector)) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (gp-0 (new 'stack-no-clear 'matrix)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (forward-up-nopitch->inv-matrix gp-0 (new 'static 'vector :z 1.0 :w 1.0) arg1) + (matrix-transpose! s4-0 gp-0) + (vector-matrix*! s3-0 arg0 s4-0) + (vector-y-angle s3-0) + ) + ) + +;; definition for function target-board-anim-trans +;; WARN: Return type mismatch float vs none. +(defbehavior target-board-anim-trans target () + (let ((f26-0 + (deg- + (quaternion-vector-y-angle (-> self control dir-targ) (-> self control local-normal)) + (quaternion-vector-y-angle (-> self control quat-for-control) (-> self control local-normal)) + ) + ) + (f28-0 + (* (deg- + (quaternion-vector-y-angle (-> self control quat-for-control) (-> self control local-normal)) + (quaternion-vector-y-angle (-> self control last-quat-for-control) (-> self control local-normal)) + ) + (-> self clock frames-per-second) + ) + ) + (f30-0 (-> self board turn-anim-targ)) + ) + (let ((f0-1 (lerp-scale 1.0 -1.0 f28-0 -32768.0 32768.0))) + (if (or (< (fabs f0-1) 0.1) (< (-> self control turn-to-magnitude) 0.3)) + (seek! (-> self board turn-anim-mag) 0.0 (* 8.0 (seconds-per-frame))) + (seek! (-> self board turn-anim-mag) f0-1 (* 2.0 (seconds-per-frame))) + ) + ) + (set! (-> self board turn-anim-targ) (+ (lerp-scale + (* 0.5 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.5 (-> *TARGET_BOARD-bank* turn-frames)) + f26-0 + -5461.3335 + 5461.3335 + ) + (lerp-scale + (* 0.3 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.3 (-> *TARGET_BOARD-bank* turn-frames)) + f28-0 + -32768.0 + 32768.0 + ) + (lerp-scale + (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (-> self board turn-anim-mag) + 1.0 + -1.0 + ) + ) + ) + (when (and (or (< (* f30-0 (-> self board turn-anim-targ)) 0.0) (= f30-0 0.0)) + (and (< (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) (fabs (- f30-0 (-> self board turn-anim-targ)))) + (>= (current-time) (-> self control turn-lockout-end-time)) + ) + ) + (let ((v1-50 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-50 command) (sound-command set-param)) + (set! (-> v1-50 id) (-> self board turn-sound-id)) + (set! (-> v1-50 params volume) -4) + (set! (-> v1-50 auto-time) 120) + (set! (-> v1-50 auto-from) 2) + (set! (-> v1-50 params mask) (the-as uint 17)) + (-> v1-50 id) + ) + (set! (-> self board turn-sound-id) (sound-play "board-turn")) + ) + ) + (set! (-> self board turn-anim-duck-vel) (* 0.98 (-> self board turn-anim-duck-vel))) + (+! (-> self board turn-anim-duck-vel) (* -8.0 (seconds-per-frame))) + (when (and (board-on-ground?) (time-elapsed? (-> self board unk-time-frame01) (seconds 0.2))) + (if (logtest? (-> self control status) (collide-status impact-surface)) + (+! (-> self board turn-anim-duck-vel) (lerp-scale 0.0 15.0 (-> self control normal-impact-vel) 0.0 81920.0)) + ) + (let ((f0-38 (vector-dot (the-as vector (-> self board up-vector)) (-> self board up-vector 1)))) + (if (< f0-38 1.0) + (+! (-> self board turn-anim-duck-vel) (* (lerp-scale 400.0 0.0 f0-38 0.6 1.0) (seconds-per-frame))) + ) + ) + ) + (none) + ) + +;; definition for function target-board-spin-check +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior target-board-spin-check target () + (when (and (or (cpad-pressed? (-> self control cpad number) r1) + (and (cpad-hold? (-> self control cpad number) r1) + (time-elapsed? (-> self board spin-check-time) (seconds 0.3)) + ) + ) + (and (not (and (and (-> self next-state) + (let ((v1-24 (-> self next-state name))) + (or (= v1-24 'target-board-trickx) (= v1-24 'target-board-tricky) (= v1-24 'target-board-hold)) + ) + ) + (not (time-elapsed? (-> self board spin-start-time) (seconds 0.5))) + ) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) + (= (-> self ext-anim) (target-anim board)) + ) + ) + (set-time! (-> self board spin-start-time)) + (set! (-> self board spin-start-dir quad) (-> self node-list data 3 bone transform fvec quad)) + (vector-flatten! (-> self control turn-to-alt-heading) (-> self control c-R-w fvec) *up-vector*) + (vector-normalize! (-> self control turn-to-alt-heading) 1.0) + (rot->dir-targ! (-> self control)) + (set! (-> self board rotyv-max) (lerp-scale + 218453.33 + 91022.22 + (the float (- (current-time) (-> self control last-time-on-surface))) + 0.0 + 300.0 + ) + ) + (set! (-> self board rotyv) 0.0) + (set! (-> self board roty) 0.0) + (set! (-> self board roty-cum) 0.0) + (set! (-> self board unk-deg00) 0.0) + (set! (-> self board spin-sound-id) (new 'static 'sound-id)) + (set! (-> self control mod-surface) *board-spin-mods*) + ) + (cond + ((and (cpad-hold? (-> self control cpad number) r1) + (or (= (-> self control mod-surface name) 'spin) + (not (time-elapsed? (-> self board spin-time) (seconds 0.05))) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) + (= (-> self ext-anim) (target-anim board)) + ) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self control mod-surface) *board-spin-mods*) + (set-time! (-> self board spin-time)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> gp-0 w) 0.0) + (let ((f28-0 (analog-input (the int (* 128.0 (-> gp-0 x))) 0.0 64.0 110.0 2184533.2)) + (f30-0 (analog-input (the int (* 128.0 (-> gp-0 z))) 0.0 96.0 110.0 1.0)) + ) + (if (and (zero? (-> self board spin-sound-id)) (< 5461.3335 (fabs (-> self board rotyv)))) + (set! (-> self board spin-sound-id) (sound-play "board-spin-loop")) + ) + (if (and (< (* 0.9 (fabs (-> self board spin-control))) (fabs f28-0)) + (>= (* (-> self board spin-control) f28-0) 0.0) + ) + (set! (-> self board spin-control) f28-0) + ) + (if (not (-> self control danger-mode)) + (target-danger-set! 'board-spin #f) + ) + (+! (-> self board rotyv) (* (-> self board spin-control) (seconds-per-frame))) + (when (and (< (fabs f28-0) 1092266.6) + (< (fabs (-> self board spin-control)) 1092266.6) + (< (* 0.9 (fabs (-> self board flip-control))) (fabs f30-0)) + (>= (* (-> self board flip-control) f30-0) 0.0) + (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) 4096.0) + ) + (set! (-> self board flip-control) f30-0) + (go + target-board-flip + (-> *TARGET_BOARD-bank* jump-height-min) + (-> *TARGET_BOARD-bank* jump-height-max) + (if (focus-test? self halfpipe) + 'halfpipe + ) + ) + ) + ) + ) + ) + (else + (set! (-> self control mod-surface) (-> self board mods-backup)) + ) + ) + (set-time! (-> self board spin-check-time)) + (cond + ((and (or (cpad-pressed? (-> self control cpad number) l1) + (< (-> self control last-time-on-surface) (-> self board duck-start-time)) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) + (= (-> self ext-anim) (target-anim board)) + ) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self control mod-surface) *board-spin-mods*) + (set-time! (-> self board unk-time000)) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (set! (-> gp-2 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) + (set! (-> gp-2 y) 0.0) + (set! (-> gp-2 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> gp-2 w) 0.0) + (let ((f30-1 (analog-input (the int (* 128.0 (-> gp-2 x))) 0.0 64.0 110.0 1.0)) + (f28-1 (analog-input (the int (* 128.0 (-> gp-2 z))) 0.0 96.0 110.0 1.0)) + ) + (when (and (< (fabs f30-1) 0.5) + (< (fabs (-> self board unk-float005)) 0.5) + (= (-> self board unk-float006) 0.0) + (< (* 0.9 (fabs (-> self board unk-float006))) (fabs f28-1)) + (>= (* (-> self board unk-float006) f28-1) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (time-elapsed? (-> self board tricky-exit-time) (seconds 0.05)) + (< (-> self board tricky-exit-time) (-> self board duck-start-time)) + ) + ) + ) + (set! (-> self board unk-float006) f28-1) + (go + target-board-tricky + (-> *TARGET_BOARD-bank* tricky-jump-height-min) + (-> *TARGET_BOARD-bank* tricky-jump-height-max) + (if (focus-test? self halfpipe) + 'halfpipe + ) + ) + ) + (when (and (< (fabs f28-1) 0.5) + (< (fabs (-> self board unk-float006)) 0.5) + (= (-> self board unk-float005) 0.0) + (< (* 0.9 (fabs (-> self board unk-float005))) (fabs f30-1)) + (>= (* (-> self board unk-float005) f30-1) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (time-elapsed? (-> self board tricky-exit-time) (seconds 0.05)) + ) + ) + ) + (set! (-> self board unk-float005) f30-1) + (go + target-board-trickx + (-> *TARGET_BOARD-bank* trickx-jump-height-min) + (-> *TARGET_BOARD-bank* trickx-jump-height-max) + (if (focus-test? self halfpipe) + 'halfpipe + ) + ) + ) + ) + ) + ) + ((and (or (cpad-pressed? (-> self control cpad number) l2) + (< (-> self control last-time-on-surface) (-> self board l2-start-time)) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) + (= (-> self ext-anim) (target-anim board)) + ) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self control mod-surface) *board-spin-mods*) + (set-time! (-> self board unk-time001)) + (let ((gp-5 (new 'stack-no-clear 'vector))) + (set! (-> gp-5 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) + (set! (-> gp-5 y) 0.0) + (set! (-> gp-5 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> gp-5 w) 0.0) + (let ((f30-2 (analog-input (the int (* 128.0 (-> gp-5 x))) 0.0 64.0 110.0 1.0)) + (f28-2 (analog-input (the int (* 128.0 (-> gp-5 z))) 0.0 96.0 110.0 1.0)) + ) + (when (and (< (fabs f30-2) 0.5) + (< (fabs (-> self board unk-float005)) 0.5) + (= (-> self board unk-float006) 0.0) + (< (* 0.9 (fabs (-> self board unk-float006))) (fabs f28-2)) + (>= (* (-> self board unk-float006) f28-2) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (time-elapsed? (-> self board hold-exit-time) (seconds 0.05)) + (< (-> self board hold-exit-time) (-> self board l2-start-time)) + ) + ) + ) + (set! (-> self board unk-float006) f28-2) + (go + target-board-hold + (-> *TARGET_BOARD-bank* trickz-jump-height-min) + (-> *TARGET_BOARD-bank* trickz-jump-height-max) + (if (focus-test? self halfpipe) + 'halfpipe + ) + ) + ) + (when (and (< (fabs f28-2) 0.5) + (< (fabs (-> self board unk-float006)) 0.5) + (= (-> self board unk-float005) 0.0) + (< (* 0.9 (fabs (-> self board unk-float005))) (fabs f30-2)) + (>= (* (-> self board unk-float005) f30-2) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (time-elapsed? (-> self board hold-exit-time) (seconds 0.05)) + ) + ) + ) + (set! (-> self board unk-float005) f30-2) + (go + target-board-hold + (-> *TARGET_BOARD-bank* trickz-jump-height-min) + (-> *TARGET_BOARD-bank* trickz-jump-height-max) + (if (focus-test? self halfpipe) + 'halfpipe + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for function target-board-halfpipe-trans +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-halfpipe-trans target () + (when (and (focus-test? self halfpipe) *camera*) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s5-0 (camera-master-method-15 *camera* (new 'stack-no-clear 'vector)))) + (vector-flatten! gp-0 (-> self control edge-grab-across-edge-dir) (-> *camera* local-down)) + (when (< (vector-dot gp-0 s5-0) 0.0) + (let* ((v1-11 (camera-master-method-14 *camera* (new 'stack-no-clear 'vector))) + (f0-3 (vector-dot (-> self control edge-grab-edge-dir) v1-11)) + (s4-1 (vector-float*! (new 'stack-no-clear 'vector) (-> self control edge-grab-edge-dir) f0-3)) + ) + (vector-flatten! s4-1 s4-1 (-> *camera* local-down)) + (if (< 0.0 (vector-dot s4-1 s5-0)) + (vector-negate! gp-0 s4-1) + ) + ) + ) + ) + (vector-normalize! gp-0 8192.0) + (+! (-> gp-0 y) 40960.0) + (vector+! gp-0 gp-0 (get-trans self 6)) + (vector-! gp-0 gp-0 (get-trans self 0)) + (send-event *camera* 'relative-position gp-0) + ) + (set-setting! 'matrix-blend-max-angle 'abs (degrees 12.000001) 0) + (set-setting! 'matrix-blend-max-partial 'abs 0.5 0) + ) + 0 + (none) + ) + +;; definition for function target-board-resolve-points +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-resolve-points target () + (when (= (-> self board main mode) (joint-mod-mode rotate)) + (let ((f0-1 (fabs (-> self board roty-cum)))) + (cond + ((>= f0-1 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-spin) 4000.0) + ) + ((>= f0-1 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-spin) 2000.0) + ) + ((>= f0-1 49152.0) + (add-to-trick-list (-> self board) (board-tricks board-spin) 500.0) + ) + ) + ) + ) + (set! (-> self board roty-cum) 0.0) + (set! (-> self board flip-count) 0) + (if (time-elapsed? (-> self board in-air-time) (seconds 0.2)) + (flush-trick-list (-> self board)) + ) + 0 + (none) + ) + +;; definition for function target-board-ground-check +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defbehavior target-board-ground-check target () + (when (board-on-ground?) + (when (!= (-> self board roty-cum) 0.0) + (let ((f30-0 (fabs (-> self board roty-cum))) + (f28-0 (vector-y-angle (-> self control transv))) + (f0-2 (y-angle (-> self control))) + ) + (if (not (time-elapsed? (-> self board halfpipe-time) (seconds 0.1))) + (set! f28-0 (+ 32768.0 f28-0)) + ) + (let ((f0-5 (fabs (deg-diff f0-2 f28-0)))) + (when (and (>= f30-0 41870.223) (>= 32768.0 f0-5)) + (cond + ((>= f30-0 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-boost) 2000.0) + ) + ((>= f30-0 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-boost) 1000.0) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-boost) 500.0) + ) + ) + (let ((f30-1 (lerp-scale 20480.0 40960.0 f30-0 49152.0 182044.44))) + (vector+float*! + (-> self control transv) + (-> self control transv) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + f30-1 + ) + ) + (if (< (vector-length (-> self control transv)) 114688.0) + (vector-normalize! (-> self control transv) 114688.0) + ) + (when (not (logtest? (-> self control old-status) (collide-status on-surface))) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (set! (-> gp-2 quad) (-> self control trans quad)) + (+! (-> gp-2 y) 2048.0) + (cond + ((logtest? (-> *part-group-id-table* 189 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-2 quad)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-1 + (let ((t9-11 (method-of-type part-tracker-subsampler activate))) + (t9-11 (the-as part-tracker-subsampler s5-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-12 run-function-in-process) + (a0-15 s5-1) + (a1-9 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 189)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-12) a0-15 a1-9 *part-tracker-subsampler-params-default*) + ) + (-> s5-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-2 quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-2 + (let ((t9-14 (method-of-type part-tracker activate))) + (t9-14 (the-as part-tracker s5-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-15 run-function-in-process) + (a0-20 s5-2) + (a1-12 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 189)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-15) a0-20 a1-12 *part-tracker-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + ) + (let ((s5-3 (process-spawn + manipy + :init manipy-init + gp-2 + (-> self entity) + (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (when s5-3 + (quaternion-copy! (-> (the-as process-drawable (-> s5-3 0)) root quat) (-> self control quat-for-control)) + (send-event (ppointer->process s5-3) 'anim-mode 'play1) + (send-event (ppointer->process s5-3) 'anim "idle") + (send-event (ppointer->process s5-3) 'speed 1.5) + (set-vector! (-> (the-as process-drawable (-> s5-3 0)) root scale) 0.2 0.4 0.2 1.0) + ) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) + (sound-play "board-boost") + ) + ) + ) + ) + ) + (target-board-resolve-points) + ) + (set! (-> self board turn-anim-tilt?) #t) + (none) + ) + +;; definition for function target-board-halfpipe-check +;; INFO: Used lq/sq +(defbehavior target-board-halfpipe-check target () + (local-vars (v0-3 collide-action)) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control ground-contact-normal) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (board-on-ground?) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (and (< (-> self control surface-angle) 0.3) (zero? (-> self board halfpipe-side-time))) + ) + (set-time! (-> self board halfpipe-side-time)) + (set! v0-3 (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset))) + (set! (-> self control root-prim prim-core action) v0-3) + v0-3 + ) + (else + (if (and (not (board-on-ground?)) + (nonzero? (-> self board halfpipe-side-time)) + (time-elapsed? (-> self board halfpipe-side-time) (seconds 0.05)) + ) + (go target-board-halfpipe) + ) + (when (time-elapsed? (-> self board halfpipe-side-time) (seconds 0.2)) + (set! (-> self board halfpipe-side-time) 0) + (set! v0-3 (logclear (-> self control root-prim prim-core action) (collide-action no-normal-reset))) + (set! (-> self control root-prim prim-core action) v0-3) + v0-3 + ) + ) + ) + ) + ) + +;; definition for function target-board-jump-trans +(defbehavior target-board-jump-trans target () + (when (and (!= (-> self state-time) (current-time)) (jump-hit-ground-stuck?)) + (set-time! (-> self board jump-land-time)) + (go target-board-hit-ground) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) + (target-board-smack-surface?) + ) + (if (and (cpad-pressed? (-> self control cpad number) 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))) + (not (logtest? (water-flag touch-water) (-> self water flags))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-wall-kick))) + (= (-> self ext-anim) (target-anim board)) + ) + ) + (go target-board-jump-kick) + ) + (target-board-spin-check) + (none) + ) + +;; failed to figure out what this is: +(defstate target-board-start (target) + :event target-board-handler + :exit target-board-exit + :code (behavior ((arg0 handle)) + (target-board-init) + (remove-exit) + (go target-board-get-on) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-board-stance (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('lip) + (when (and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< (-> self control poly-angle) 0.5) + (let ((s5-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control ground-contact-normal) + ) + ) + ) + (vector-normalize! s5-0 1.0) + (< 0.0 (vector-dot (-> self control transv) s5-0)) + ) + ) + (set-time! (-> self board halfpipe-lip-time)) + (set-time! (-> self board halfpipe-side-time)) + (set! (-> self board halfpipe-lip-event) (the-as symbol (-> block param 0))) + (let ((v0-2 (the-as object (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset)))) + ) + (set! (-> self control root-prim prim-core action) (the-as collide-action v0-2)) + v0-2 + ) + ) + ) + (('jump) + (sound-play "board-launch") + (go + target-board-jump + (the-as meters (-> block param 0)) + (the-as meters (-> block param 1)) + (the-as symbol (-> block param 2)) + ) + ) + (else + (target-board-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self control mod-surface) *board-walk-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + :exit (behavior () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-stance) (= v1-3 'target-board-duck-stance)) + ) + ) + ) + (set! (-> self board halfpipe-side-time) 0) + 0 + ) + (logclear! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self board turn-anim-tilt?) #f) + (when (not (and (-> self next-state) + (let ((v1-13 (-> self next-state name))) + (or (= v1-13 'target-board-stance) (= v1-13 'target-board-duck-stance) (= v1-13 'target-board-ride-edge)) + ) + ) + ) + (set! (-> self board turn-anim-frame) 0.0) + (set! (-> self board turn-anim-mag) 0.0) + (set! (-> self board turn-anim-vel) 0.0) + (set! (-> self board turn-anim-duck) 0.0) + ) + (target-board-exit) + ) + :trans (behavior () + (if (and (cpad-hold? (-> self control cpad number) l1) + (not (logtest? (-> self target-flags) (target-flags prevent-duck))) + (not (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout))) + ) + (go target-board-duck-stance) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control ground-contact-normal) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + ) + ) + ((and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (< (-> self control surface-angle) 0.5) + ) + (set-time! (-> self board halfpipe-jump-time)) + (vector-float*! + (-> self control transv) + (-> self control transv) + (+ 1.0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + ) + ) + (else + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + ) + ) + ) + (if (cpad-pressed? (-> self control cpad number) r1) + (set-time! (-> self board spin-ground-press-time)) + ) + (when (and (can-feet? #t) + (and (cpad-pressed? (-> self control cpad number) triangle) (< (target-height-above-ground) 8192.0)) + ) + (cond + ((= (-> self ext-anim) (target-anim board)) + (go target-board-turn-around) + ) + ((not (time-elapsed? (-> self board spin-ground-press-time) (seconds 0.3))) + (set-time! (-> self board spin-ground-start-time)) + ) + ) + ) + (target-board-halfpipe-check) + (if (target-board-smack-surface?) + 0 + ) + (target-board-anim-trans) + (cond + ((board-on-ground?) + (target-board-ground-check) + (set! (-> self control mod-surface) *board-walk-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + ((and (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) + (or (= (-> self control mod-surface name) 'spin) (< 4096.0 (target-height-above-ground))) + ) + (set! (-> self control mod-surface) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (target-board-spin-check) + ) + (else + (set! (-> self control mod-surface) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + ) + ) + :code (behavior () + (let ((gp-0 (-> self board stance-info))) + (let ((f30-0 0.0)) + (let ((s5-0 30) + (v1-3 (ja-group)) + ) + (when (not (and (and v1-3 (= v1-3 jakb-board-turn-left-ja)) (= (ja-group-size) 4))) + (let ((v1-10 (ja-group))) + (cond + ((and v1-10 (= v1-10 jakb-board-get-on-ja)) + (ja-channel-set! 1) + (ja-no-eval :group! jakb-board-get-on-land-ja :num! (seek! max 1.8) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.8)) + ) + (suspend) + (set! (-> self board turn-anim-duck) 1.0) + (set! (-> self board turn-anim-duck-vel) 15.0) + ) + ((let ((v1-45 (ja-group))) + (and v1-45 (= v1-45 jakb-board-turn-around-ja)) + ) + (set! s5-0 60) + ) + ) + ) + (ja-channel-push! 4 (the-as time-frame s5-0)) + (set! f30-0 (ja-frame-num 0)) + ) + ) + (ground-tween-initialize + gp-0 + (the-as uint 0) + (the-as uint jakb-board-turn-ja) + (the-as uint jakb-board-turn-up-ja) + (the-as uint jakb-board-turn-down-ja) + (the-as uint jakb-board-turn-right-ja) + (the-as uint jakb-board-turn-left-ja) + f30-0 + ) + ) + (ja :chan 3 :group! jakb-board-duck-turn-ja) + (until #f + (target-board-turn-anim 0) + (let ((f0-10 (* 1.6 (-> self control ctrl-slope-z))) + (f1-2 (* 1.6 (-> self control ctrl-slope-x))) + ) + (cond + ((not (-> self board turn-anim-tilt?)) + (set! f0-10 0.0) + (set! f1-2 0.0) + ) + ((= (-> self control ground-pat mode) (pat-mode halfpipe)) + (set! f0-10 0.0) + ) + ) + (ground-tween-update gp-0 f0-10 f1-2 0.1) + ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (cond + ((>= (-> self board turn-anim-duck) 0.0) + (let ((a0-31 (-> self skel root-channel 3))) + (let ((f0-14 (-> self board turn-anim-duck))) + (set! (-> a0-31 frame-interp 1) f0-14) + (set! (-> a0-31 frame-interp 0) f0-14) + ) + (set! (-> a0-31 frame-group) (the-as art-joint-anim jakb-board-duck-turn-ja)) + (set! (-> a0-31 param 0) 0.0) + (joint-control-channel-group-eval! a0-31 (the-as art-joint-anim jakb-board-duck-turn-ja) num-func-chan) + ) + ) + (else + (let ((a0-32 (-> self skel root-channel 3))) + (let ((f0-17 (- (-> self board turn-anim-duck)))) + (set! (-> a0-32 frame-interp 1) f0-17) + (set! (-> a0-32 frame-interp 0) f0-17) + ) + (set! (-> a0-32 frame-group) (the-as art-joint-anim jakb-board-air-turn-ja)) + (set! (-> a0-32 param 0) 0.0) + (joint-control-channel-group-eval! a0-32 (the-as art-joint-anim jakb-board-air-turn-ja) num-func-chan) + ) + ) + ) + (suspend) + (can-play-stance-amibent?) + ) + ) + #f + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-duck-stance (target) + :event (-> target-board-stance event) + :enter (behavior () + (set! (-> self control mod-surface) *board-duck-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + :exit (behavior () + (set! (-> self board turn-anim-duck-vel) -8.0) + ((-> target-board-stance exit)) + ) + :trans (behavior () + (if (and (or (not (cpad-hold? (-> self control cpad number) l1)) + (logtest? (-> self target-flags) (target-flags prevent-duck)) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + ) + (can-exit-duck? self) + ) + (go target-board-stance) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control ground-contact-normal) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + ) + ) + ((and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (< (-> self control surface-angle) 0.5) + ) + (let ((f30-0 (if (cpad-hold? (-> self control cpad number) l1) + (* (-> self board charge-progress) (-> *TARGET_BOARD-bank* charge-jump-height)) + 0.0 + ) + ) + ) + (sound-play "board-launch") + (when (!= (-> self board charge-progress) 0.0) + (cond + ((logtest? (-> *part-group-id-table* 191 flags) (sp-group-flag sp13)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-2 + (let ((t9-8 (method-of-type part-tracker-subsampler activate))) + (t9-8 (the-as part-tracker-subsampler gp-2) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-9 run-function-in-process) + (a0-35 gp-2) + (a1-7 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 191)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) (-> self node-list data 0 bone transform)) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-9) a0-35 a1-7 *part-tracker-subsampler-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + (else + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-3 + (let ((t9-11 (method-of-type part-tracker activate))) + (t9-11 (the-as part-tracker gp-3) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-12 run-function-in-process) + (a0-38 gp-3) + (a1-10 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 191)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) (-> self node-list data 0 bone transform)) + ((the-as (function object object object none) t9-12) a0-38 a1-10 *part-tracker-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + ) + ) + (set-time! (-> self board halfpipe-jump-time)) + (set! (-> self board charge-progress) 0.0) + (sound-stop (-> self board charge-sound-id)) + (vector-float*! + (-> self control transv) + (-> self control transv) + (+ 1.0 f30-0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + ) + ) + ) + (else + (flush-trick-list (-> self board)) + (deg-diff (vector-y-angle (-> self control c-R-w fvec)) (vector-y-angle (-> self control to-target-pt-xz))) + (go + target-board-jump + (-> *TARGET_BOARD-bank* duck-jump-height-min) + (-> *TARGET_BOARD-bank* duck-jump-height-max) + (the-as symbol *board-duck-jump-mods*) + ) + ) + ) + ) + ) + (if (cpad-pressed? (-> self control cpad number) r1) + (set-time! (-> self board spin-ground-press-time)) + ) + (if (and (cpad-hold? (-> self control cpad number) r1) + (can-feet? #t) + (not (time-elapsed? (-> self board spin-ground-press-time) (seconds 0.3))) + (board-turn-around?) + ) + (set-time! (-> self board spin-ground-start-time)) + ) + (target-board-halfpipe-check) + (if (target-board-smack-surface?) + 0 + ) + (target-board-anim-trans) + (set! (-> self board turn-anim-duck-vel) 8.0) + (cond + ((board-on-ground?) + (target-board-ground-check) + (set! (-> self control mod-surface) *board-duck-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + ((and (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) + (or (= (-> self control mod-surface name) 'spin) (< 4096.0 (target-height-above-ground))) + ) + (set! (-> self control mod-surface) *board-duck-jump-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (target-board-spin-check) + ) + (else + (set! (-> self control mod-surface) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + ) + ) + :code (-> target-board-stance code) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-jump (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'edge-grab) (not (time-elapsed? (-> self state-time) (seconds 0.1)))) + (return #f) + ) + (target-board-handler proc argc message block) + ) + :enter (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) + (local-vars + (sv-144 (function vector entity-actor skeleton-group vector manipy-options none :behavior manipy)) + (sv-160 entity-actor) + ) + (if (= arg2 'hit) + (set! arg2 #f) + ) + (when (not (time-elapsed? (-> self board ride-time) (seconds 0.5))) + (set! arg2 (the-as symbol *board-ride-jump-mods*)) + (let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0))) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + s2-0 + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set! (-> self control turn-lockout-end-time) + (+ (current-time) (the int (lerp-scale 225.0 0.0 (vector-dot s2-0 (-> self control c-R-w fvec)) -1.0 1.0))) + ) + ) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set-time! (-> self state-time)) + (let ((f30-0 0.0)) + (when (and (cpad-hold? (-> self control cpad number) l1) (!= (-> self board charge-progress) 0.0)) + (+! f30-0 (* (-> self board charge-progress) (-> *TARGET_BOARD-bank* charge-jump-height))) + (sound-play "board-launch") + (cond + ((logtest? (-> *part-group-id-table* 191 flags) (sp-group-flag sp13)) + (let ((s3-3 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s3-3 + (let ((t9-7 (method-of-type part-tracker-subsampler activate))) + (t9-7 (the-as part-tracker-subsampler s3-3) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-8 run-function-in-process) + (a0-14 s3-3) + (a1-8 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 191)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) (-> self node-list data 0 bone transform)) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-8) a0-14 a1-8 *part-tracker-subsampler-params-default*) + ) + (-> s3-3 ppointer) + ) + ) + ) + (else + (let ((s3-4 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s3-4 + (let ((t9-10 (method-of-type part-tracker activate))) + (t9-10 (the-as part-tracker s3-4) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-11 run-function-in-process) + (a0-17 s3-4) + (a1-11 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 191)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) (-> self node-list data 0 bone transform)) + ((the-as (function object object object none) t9-11) a0-17 a1-11 *part-tracker-params-default*) + ) + (-> s3-4 ppointer) + ) + ) + ) + ) + ) + (set! (-> self board charge-progress) 0.0) + (sound-stop (-> self board charge-sound-id)) + (cond + ((and (< 0.0 (-> self board shock-offsetv)) + (not (time-elapsed? (-> self board jump-land-time) (seconds 0.5))) + (time-elapsed? (-> self board ride-time) (seconds 0.5)) + ) + (let ((s3-5 (new 'stack-no-clear 'vector))) + (set! (-> s3-5 quad) (-> self control trans quad)) + (+! (-> s3-5 y) 2048.0) + (cond + ((logtest? (-> *part-group-id-table* 190 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s3-5 quad)) + (let ((s2-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s2-2 + (let ((t9-14 (method-of-type part-tracker-subsampler activate))) + (t9-14 (the-as part-tracker-subsampler s2-2) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-15 run-function-in-process) + (a0-28 s2-2) + (a1-14 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 190)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-15) a0-28 a1-14 *part-tracker-subsampler-params-default*) + ) + (-> s2-2 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s3-5 quad)) + (let ((s2-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s2-3 + (let ((t9-17 (method-of-type part-tracker activate))) + (t9-17 (the-as part-tracker s2-3) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-18 run-function-in-process) + (a0-33 s2-3) + (a1-17 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 190)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-18) a0-33 a1-17 *part-tracker-params-default*) + ) + (-> s2-3 ppointer) + ) + ) + ) + ) + (let* ((s1-1 (get-process *default-dead-pool* manipy #x20000 1)) + (s2-4 + (when s1-1 + (let ((t9-20 (method-of-type manipy activate))) + (t9-20 (the-as manipy s1-1) self "manipy" (the-as pointer #x70004000)) + ) + (let ((s2-5 run-function-in-process) + (s0-1 s1-1) + ) + (set! sv-144 manipy-init) + (set! sv-160 (-> self entity)) + (let ((t0-2 (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer level) #f))) + (t1-1 #f) + (t2-1 0) + ) + ((the-as (function object object object object object object object none) s2-5) + s0-1 + sv-144 + s3-5 + sv-160 + t0-2 + t1-1 + t2-1 + ) + ) + ) + (-> s1-1 ppointer) + ) + ) + ) + (when s2-4 + (quaternion-copy! (-> (the-as process-drawable (-> s2-4 0)) root quat) (-> self control quat-for-control)) + (send-event (ppointer->process s2-4) 'anim-mode 'play1) + (send-event (ppointer->process s2-4) 'anim "idle") + (send-event (ppointer->process s2-4) 'speed 1.5) + (set-vector! (-> (the-as process-drawable (-> s2-4 0)) root scale) 0.2 0.4 0.2 1.0) + ) + ) + ) + (set! f30-0 (+ 8192.0 f30-0)) + (add-to-trick-list (-> self board) (board-tricks board-quick-jump) 0.0) + (sound-play "board-q-jump") + ) + (else + (if (= (the-as object arg2) *board-duck-jump-mods*) + (add-to-trick-list (-> self board) (board-tricks board-duck-jump) 0.0) + (add-to-trick-list (-> self board) (board-tricks board-jump) 0.0) + ) + (set! (-> self board jump-sound-id) (sound-play "board-jump")) + ) + ) + (init-var-jump + (+ arg0 f30-0) + (+ arg1 f30-0) + #t + #f + (-> self control transv) + (if (time-elapsed? (-> self board last-jump-time) (seconds 0.1)) + 2.0 + 0.0 + ) + ) + ) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! arg2 (cond + ((the-as object arg2) + (empty) + arg2 + ) + (else + (the-as symbol *board-jump-mods*) + ) + ) + ) + (set! (-> self control mod-surface) (the-as surface arg2)) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :exit target-board-exit + :trans (behavior () + (target-board-jump-trans) + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (set! (-> self board shock-offset) (* 0.8 (-> self board shock-offset))) + ) + :code (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) + (cond + ((= arg2 'hit) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-board-hit-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + ((and (= (-> self ext-anim) (target-anim board)) (>= (the-as float (-> self control unknown-word04)) 20480.0)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! jakb-board-jump-high-ja :num! min) + (suspend) + (until (ja-done? 0) + (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f0-11 (- 25.0 (ja-aframe-num 0))) + (gp-1 (-> self skel root-channel 0)) + ) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group frames num-frames) -1))) + (let ((v1-49 (and (< 0.0 f30-0) (< 0.0 f0-11)))) + (set! (-> gp-1 param 1) + (cond + (v1-49 + (fmin (fmin 1.5 f0-11) (/ (* 5.0 f0-11) (the float (time-to-apex f30-0 -245760.0)))) + ) + ((< (seconds 0.165) (target-time-to-ground)) + 1.5 + ) + (else + 0.8 + ) + ) + ) + ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + (suspend) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + (else + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! jakb-board-jump-ja :num! min) + (suspend) + (until (ja-done? 0) + (let ((f30-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f0-20 (- 10.0 (ja-aframe-num 0))) + (gp-3 (-> self skel root-channel 0)) + ) + (set! (-> gp-3 param 0) (the float (+ (-> gp-3 frame-group frames num-frames) -1))) + (let ((v1-74 (and (< 0.0 f30-1) (< 0.0 f0-20)))) + (set! (-> gp-3 param 1) + (cond + (v1-74 + (fmin (fmin 1.5 f0-20) (/ (* 5.0 f0-20) (the float (time-to-apex f30-1 -245760.0)))) + ) + ((< (seconds 0.165) (target-time-to-ground)) + 0.5 + ) + (else + 0.25 + ) + ) + ) + ) + (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) + ) + (suspend) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + ) + (ja :group! jakb-board-jump-loop-ja) + (until #f + (suspend) + (ja :num! (loop!)) + ) + #f + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-halfpipe (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('edge-grab) + (format + #t + "halfpipe found edge ~m~%" + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + (let ((v1-6 *edge-grab-info*)) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (the-as vector (-> v1-6 world-vertex)) + (-> v1-6 world-vertex 1) + ) + 1.0 + ) + ) + (vector-cross! + (-> self control edge-grab-across-edge-dir) + (-> self control edge-grab-edge-dir) + (-> self control dynam gravity-normal) + ) + (let ((v1-11 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control edge-grab-across-edge-dir) (-> self control transv)))) + 0.0 + (vector-! + v1-11 + (-> self control transv) + (vector-float*! v1-11 (-> self control edge-grab-across-edge-dir) f0-2) + ) + ) + (let* ((f0-3 (vector-length v1-11)) + (f1-1 f0-3) + (f2-0 -2048.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control edge-grab-across-edge-dir) f2-0) + (vector-float*! v1-11 v1-11 (/ f0-3 f1-1)) + ) + ) + ) + ) + (('ramp) + (when (not (-> self control did-move-to-pole-or-max-jump-height)) + (let ((v0-3 (the-as object #t))) + (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float v0-3)) + v0-3 + ) + ) + ) + (('grenade) + (if (and (< (the-as float (-> block param 0)) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + (= (-> self ext-anim) (target-anim board)) + ) + (go target-board-grenade (process->handle proc)) + ) + ) + (else + (target-board-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self focus-status) (focus-status halfpipe)) + (set-time! (-> self state-time)) + (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self control mod-surface) *board-halfpipe-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self control sliding-start-time) 0) + (when (< (vector-dot (-> self control c-R-w uvec) (-> self control dynam gravity-normal)) 0.7) + (vector-matrix*! (-> self control transv-ctrl) (-> self control transv) (-> self control w-R-c)) + (set! (-> self control transv-ctrl y) 0.0) + (vector-matrix*! (-> self control transv) (-> self control transv-ctrl) (-> self control c-R-w)) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float #f)) + (target-method-28 *target* *collide-cache* *collide-edge-board-halfpipe-spec*) + (when (not (-> self control unknown-spool-anim00)) + (let ((gp-0 (vector-flatten! + (-> self control edge-grab-across-edge-dir) + (-> self control dynam gravity-normal) + (-> self control ground-contact-normal) + ) + ) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (vector-rotate-y! (-> self control edge-grab-edge-dir) (-> self control edge-grab-across-edge-dir) 16384.0) + (let ((v1-40 (new-stack-vector0))) + (let ((f0-5 (vector-dot gp-0 (-> self control transv)))) + 0.0 + (vector-! v1-40 (-> self control transv) (vector-float*! v1-40 gp-0 f0-5)) + ) + (let* ((f0-6 (vector-length v1-40)) + (f1-2 f0-6) + (f2-0 -2048.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) gp-0 f2-0) + (vector-float*! v1-40 v1-40 (/ f0-6 f1-2)) + ) + ) + ) + ) + ) + (if (or (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 20480.0) + (< (vector-dot + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + ) + 0.3 + ) + ) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + ) + :exit (behavior () + (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-flip) + (= v1-3 'target-board-hold) + (= v1-3 'target-board-trickx) + (= v1-3 'target-board-tricky) + (= v1-3 'target-board-grenade) + (= v1-3 'target-board-falling) + ) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status halfpipe)) + ) + (send-event *camera* 'relative-position #f) + (remove-setting! 'matrix-blend-max-angle) + (remove-setting! 'matrix-blend-max-partial) + (logclear! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (target-board-exit) + ) + :trans (behavior () + (when (and (or (= (the-as int (-> self control did-move-to-pole-or-max-jump-height)) #t) + (and (not (time-elapsed? (-> self board halfpipe-lip-time) (seconds 0.1))) + (= (-> self board halfpipe-lip-event) 'lipramp) + ) + ) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float 'done)) + (let ((v1-16 (new-stack-vector0)) + (f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-16 (-> self control transv) (vector-float*! v1-16 (-> self control dynam gravity-normal) f0-2)) + (let* ((f1-4 (vector-length v1-16)) + (f2-0 f1-4) + ) + (if (!= f1-4 0.0) + (set! f1-4 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-2) + (vector-float*! v1-16 v1-16 (/ f1-4 f2-0)) + ) + ) + ) + ) + (set-time! (-> self board halfpipe-time)) + (if (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + (set-time! (-> self board halfpipe-gspot-time)) + ) + (when (jump-hit-ground-stuck?) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (when (and (cpad-pressed? (-> self control cpad number) x) + (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.6)) + (not (time-elapsed? (-> self state-time) (-> *TARGET-bank* ground-timeout))) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (set-time! (-> self board halfpipe-jump-time)) + (vector-float*! + (-> self control transv) + (-> self control transv) + (+ 1.0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + ) + ) + (target-board-spin-check) + (cond + ((> (-> self control sliding-start-time) 0) + (cond + ((< 0.7 (-> self control turn-to-magnitude)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control edge-grab-across-edge-dir quad)) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (if (< 0.7 (vector-dot (-> self control to-target-pt-xz) gp-0)) + (+! (-> self control sliding-start-time) (- (current-time) (-> self clock old-frame-counter))) + (set! (-> self control sliding-start-time) 1) + ) + ) + ) + (else + (set! (-> self control sliding-start-time) 1) + ) + ) + ) + ((and (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (< (-> self board halfpipe-lip-time) (+ (-> self state-time) (seconds -0.2))) + ) + (set! (-> self control sliding-start-time) 1) + ) + ) + (when (or (>= (-> self control sliding-start-time) (seconds 0.05)) + (and (time-elapsed? (-> self board halfpipe-gspot-time) (seconds 0.5)) + (< (-> self board halfpipe-lip-time) (+ (-> self state-time) (seconds -0.2))) + ) + ) + (+! (-> self control transv x) (* 20480.0 (-> self control edge-grab-across-edge-dir x))) + (+! (-> self control transv z) (* 20480.0 (-> self control edge-grab-across-edge-dir z))) + (go target-board-stance) + ) + (target-board-halfpipe-trans) + ) + :code (behavior () + (cond + ((not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-board-jump-ja :num! (seek! (ja-aframe 8.0 0) 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0) 0.5)) + ) + (ja-no-eval :group! jakb-board-jump-ja :num! (seek! (ja-aframe 10.0 0) 0.2) :frame-num (ja-aframe 8.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0) 0.2)) + ) + (ja-no-eval :group! jakb-board-jump-ja :num! (seek! (ja-aframe 12.0 0) 0.1) :frame-num (ja-aframe 10.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0) 0.1)) + ) + (sleep-code) + ) + (else + ((the-as (function none) (-> target-board-stance code))) + ) + ) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-falling (target) + :event target-board-handler + :enter (behavior () + (if (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2) (not *pause-lock*)) + (set! (-> self control mod-surface) *board-air-mods*) + (set! (-> self control mod-surface) *board-jump-mods*) + ) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + :exit (-> target-board-halfpipe exit) + :trans (behavior () + (target-board-jump-trans) + (if (focus-test? self halfpipe) + (target-board-halfpipe-trans) + ) + (when (and (= *cheat-mode* 'debug) (and (cpad-hold? (-> self control cpad number) r2) (not *pause-lock*))) + (set! (-> self control mod-surface) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 jakb-board-jump-loop-ja)) + ) + ((let ((v1-8 (ja-group))) + (and v1-8 (= v1-8 jakb-board-noseflip-ja)) + ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.5)) + ) + ((let ((v1-22 (ja-group))) + (and v1-22 (or (= v1-22 jakb-board-flip-backward-ja) + (= v1-22 jakb-board-flip-backward-loop-ja) + (= v1-22 jakb-board-flip-forward-ja) + (= v1-22 jakb-board-flip-forward-loop-ja) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.2)) + ) + (else + (let ((v1-36 (ja-group))) + (cond + ((and v1-36 (= v1-36 jakb-board-spin-ja)) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.1)) + ) + (else + (ja-channel-push! 1 (seconds 0.5)) + ) + ) + ) + ) + ) + ) + (cond + ((focus-test? self halfpipe) + (ja :group! jakb-board-duck-turn-ja :num! (identity (ja-aframe 0.0 0))) + (loop + (suspend) + (ja-blend-eval) + ) + ) + (else + (ja :group! jakb-board-jump-loop-ja) + (loop + (suspend) + (ja-blend-eval) + (ja :num! (loop!)) + ) + ) + ) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-jump-kick (target) + :event target-board-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (sound-play "board-k-jump") + ) + :exit target-board-exit + :trans (behavior () + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (target-board-smack-surface?) + (cond + ((not (time-elapsed? (-> self board smack-surface-time) (seconds 0.2))) + (go target-board-wall-kick (-> self board smack-normal) (-> self board smack-speed)) + ) + ((not (time-elapsed? (-> self board glance-time) (seconds 0.2))) + (go + target-board-wall-kick + (vector-normalize-copy! (-> self control unknown-vector38) (-> self board glance-out-transv) 1.0) + (-> self board glance-speed) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-board-jump-kick-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 2)) + (ja :group! jakb-board-jump-loop-ja) + (until #f + (suspend) + (ja :num! (loop!)) + ) + #f + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-wall-kick (target) + :event target-board-handler + :enter (behavior ((arg0 vector) (arg1 float)) + (sound-play "board-kick") + (set! (-> self control transv quad) (-> arg0 quad)) + (vector-xz-normalize! (-> self control transv) (* 0.8 arg1)) + (set! (-> self control unknown-word04) (the-as uint (fmax 81920.0 (* 0.8 arg1)))) + (set! (-> self control unknown-vector38 quad) (-> arg0 quad)) + (set! (-> self control transv y) 0.0) + (vector-turn-to (vector-negate! (new 'stack-no-clear 'vector) (-> self control transv))) + (set! (-> self control transv y) (- (sqrtf (* 24576.0 (-> self control dynam gravity-length))) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *board-wall-kick-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self board smack-surface-time) 0) + 0 + ) + :exit target-board-exit + :trans target-board-jump-trans + :code (behavior ((arg0 vector) (arg1 float)) + (ja-no-eval :group! jakb-board-jump-kickoff-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (< 31.0 (ja-aframe-num 0))) + (go target-board-hit-ground) + ) + (let ((v1-21 (-> self control unknown-vector38))) + (set! (-> self control transv x) (-> v1-21 x)) + (set! (-> self control transv z) (-> v1-21 z)) + ) + (vector-xz-normalize! (-> self control transv) (the-as float (-> self control unknown-word04))) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek!)) + ) + enter-state + (go target-board-falling) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-flip (target) + :event (-> target-board-jump event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-word04) (the-as uint arg2)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set-time! (-> self state-time)) + (cond + ((= arg2 'halfpipe) + (logior! (-> self focus-status) (focus-status halfpipe)) + (target-board-halfpipe-trans) + ) + (else + (init-var-jump arg0 arg1 #t #f (-> self control transv) 1.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) + ) + ) + ) + (set! (-> self control mod-surface) *board-flip-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (let ((v1-25 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-25 command) (sound-command set-param)) + (set! (-> v1-25 id) (-> self board jump-sound-id)) + (set! (-> v1-25 params volume) -4) + (set! (-> v1-25 auto-time) 72) + (set! (-> v1-25 auto-from) 2) + (set! (-> v1-25 params mask) (the-as uint 17)) + (-> v1-25 id) + ) + (set! (-> self control unknown-sound-id00) (sound-play "board-flip")) + (target-start-attack) + (target-danger-set! 'board-spin #f) + ) + :exit (behavior () + (target-danger-set! 'harmless #f) + (set! (-> self board flip-control) 0.0) + (add-to-trick-list + (-> self board) + (board-tricks board-flip) + (+ (* 500.0 (the float (-> self board flip-count))) (if (>= (-> self board flip-count) 2) + 2000.0 + 0.0 + ) + ) + ) + (let ((v1-9 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-9 command) (sound-command set-param)) + (set! (-> v1-9 id) (-> self control unknown-sound-id00)) + (set! (-> v1-9 params volume) -4) + (set! (-> v1-9 auto-time) 24) + (set! (-> v1-9 auto-from) 2) + (set! (-> v1-9 params mask) (the-as uint 17)) + (-> v1-9 id) + ) + ((-> target-board-halfpipe exit)) + ) + :trans (behavior () + (cond + ((= (-> self control unknown-spool-anim00) 'halfpipe) + (target-board-halfpipe-trans) + ) + (else + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((gp-0 (>= (-> self board flip-control) 0.0))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 x) 0.0) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> s5-0 w) 1.0) + (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (s4-0 0) + ) + (while (not (and (or (not (cpad-hold? (-> self control cpad number) r1)) + (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) + ) + (nonzero? s4-0) + ) + ) + (cond + (gp-0 + (cond + ((zero? s4-0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-board-flip-forward-ja :num! (seek! (ja-aframe 15.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 15.0 0))) + ) + ) + (else + (ja-no-eval :group! jakb-board-flip-forward-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ((zero? s4-0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-board-flip-backward-ja :num! (seek! (ja-aframe 10.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0))) + ) + ) + (else + (ja-no-eval :group! jakb-board-flip-backward-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (+! (-> self board flip-count) 1) + (set! f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (+! s4-0 1) + ) + ) + ) + (cond + (gp-0 + (ja-no-eval :group! jakb-board-flip-forward-ja :num! (seek!) :frame-num (ja-aframe 15.0 0)) + (until (ja-done? 0) + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-board-flip-backward-ja :num! (seek!) :frame-num (ja-aframe 10.0 0)) + (until (ja-done? 0) + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (go target-board-falling) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-hold (target) + :event (-> target-board-jump event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-word04) (the-as uint arg2)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set-time! (-> self state-time)) + (set-time! (-> self board hold-start-time)) + (cond + ((= arg2 'halfpipe) + (logior! (-> self focus-status) (focus-status halfpipe)) + (target-board-halfpipe-trans) + ) + (else + (init-var-jump arg0 arg1 #t #f (-> self control transv) 1.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) + ) + ) + ) + (set! (-> self control mod-surface) *board-flip-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self control dynam gravity-length) 147456.0) + ) + :exit (behavior () + (set! (-> self board unk-float006) 0.0) + (set-time! (-> self board hold-exit-time)) + (let ((v1-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-3 command) (sound-command set-param)) + (set! (-> v1-3 id) (-> self board trick-sound-id)) + (set! (-> v1-3 params volume) -4) + (set! (-> v1-3 auto-time) 24) + (set! (-> v1-3 auto-from) 2) + (set! (-> v1-3 params mask) (the-as uint 17)) + (-> v1-3 id) + ) + (let ((v1-7 (ja-group))) + (if (and v1-7 (= v1-7 jakb-board-noseflip-ja)) + (sound-play "board-boots") + ) + ) + ((-> target-board-halfpipe exit)) + ) + :trans (behavior () + (target-board-spin-check) + (cond + ((= (-> self control unknown-spool-anim00) 'halfpipe) + (target-board-halfpipe-trans) + ) + (else + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> gp-0 w) 1.0) + (let ((f30-0 (analog-input (the int (* 128.0 (-> gp-0 x))) 0.0 96.0 110.0 1.0)) + (f28-0 (analog-input (the int (* 128.0 (-> gp-0 z))) 0.0 96.0 110.0 1.0)) + ) + (while (not (or (not (cpad-hold? (-> self control cpad number) l2)) + (jump-hit-ground-stuck?) + (< (target-time-to-ground) (seconds 0.3)) + ) + ) + (cond + ((and (< f30-0 0.0) (< (fabs f28-0) (fabs f30-0))) + (let ((v1-17 (ja-group))) + (cond + ((and v1-17 (= v1-17 jakb-board-method-cross-loop-ja)) + (ja :num! (loop!)) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-method-cross) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-method-cross-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-board-method-cross-loop-ja :num! min) + ) + ) + ) + ) + ((and (< f28-0 0.0) (< (fabs f30-0) (fabs f28-0))) + (let ((v1-61 (ja-group))) + (cond + ((and v1-61 (= v1-61 jakb-board-backgrab-loop-ja)) + (ja :num! (loop!)) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-backgrab) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-backgrab-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-board-backgrab-loop-ja :num! min) + ) + ) + ) + ) + ((and (< 0.0 f28-0) (< (fabs f30-0) (fabs f28-0))) + (let ((v1-105 (ja-group))) + (cond + ((and v1-105 (= v1-105 jakb-board-airwalk-loop-ja)) + (ja :num! (loop!)) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-airwalk) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-airwalk-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-board-airwalk-loop-ja :num! min) + ) + ) + ) + ) + (else + (let ((v1-147 (ja-group))) + (cond + ((and v1-147 (= v1-147 jakb-board-method-loop-ja)) + (ja :num! (loop!)) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-method) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-method-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-board-method-loop-ja :num! min) + ) + ) + ) + ) + ) + (suspend) + ) + ) + ) + (let ((v1-200 (ja-group))) + (cond + ((and v1-200 (= v1-200 jakb-board-method-loop-ja)) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-method-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-230 (ja-group))) + (and v1-230 (= v1-230 jakb-board-method-cross-loop-ja)) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-method-cross-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-260 (ja-group))) + (and v1-260 (= v1-260 jakb-board-backgrab-loop-ja)) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-backgrab-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-290 (ja-group))) + (and v1-290 (= v1-290 jakb-board-airwalk-loop-ja)) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-airwalk-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ) + ) + (let ((v1-318 (new-stack-vector0)) + (f0-83 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-318 + (-> self control transv) + (vector-float*! v1-318 (-> self control dynam gravity-normal) f0-83) + ) + (let* ((f1-11 (vector-length v1-318)) + (f2-4 f1-11) + ) + (if (< 0.0 f0-83) + (set! f0-83 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-83) + (vector-float*! v1-318 v1-318 (/ f1-11 f2-4)) + ) + ) + ) + (go target-board-falling) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-tricky (target) + :event (-> target-board-jump event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-word04) (the-as uint arg2)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set-time! (-> self state-time)) + (set-time! (-> self board tricky-time)) + (cond + ((= arg2 'halfpipe) + (logior! (-> self focus-status) (focus-status halfpipe)) + (target-board-halfpipe-trans) + ) + (else + (init-var-jump arg0 arg1 #t #f (-> self control transv) 1.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) + ) + ) + ) + (set! (-> self control mod-surface) *board-flip-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self control dynam gravity-length) 147456.0) + ) + :exit (behavior () + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (set! (-> self board unk-float006) 0.0) + (set-time! (-> self board tricky-exit-time)) + (let ((v1-10 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-10 command) (sound-command set-param)) + (set! (-> v1-10 id) (-> self board trick-sound-id)) + (set! (-> v1-10 params volume) -4) + (set! (-> v1-10 auto-time) 24) + (set! (-> v1-10 auto-from) 2) + (set! (-> v1-10 params mask) (the-as uint 17)) + (-> v1-10 id) + ) + (let ((v1-14 (ja-group))) + (if (and v1-14 (= v1-14 jakb-board-noseflip-ja)) + (sound-play "board-boots") + ) + ) + ((-> target-board-halfpipe exit)) + ) + :trans (behavior () + (target-board-spin-check) + (cond + ((= (-> self control unknown-spool-anim00) 'halfpipe) + (target-board-halfpipe-trans) + ) + (else + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 x) 0.0) + (set! (-> v1-0 y) 0.0) + (set! (-> v1-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> v1-0 w) 1.0) + (let ((f30-0 (analog-input (the int (* 128.0 (-> v1-0 z))) 0.0 96.0 110.0 1.0))) + (while (not (or (not (cpad-hold? (-> self control cpad number) l1)) + (jump-hit-ground-stuck?) + (< (target-time-to-ground) (seconds 0.3)) + ) + ) + (cond + ((< f30-0 0.0) + (add-to-trick-list (-> self board) (board-tricks board-kickspin) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-kickspin-a-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + (ja-no-eval :group! jakb-board-kickspin-b-ja :num! (seek! max 1.05) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.05)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (ja-no-eval :group! jakb-board-kickspin-c-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-92 (ja-group))) + (and v1-92 (= v1-92 jakb-board-nosegrab-loop-ja)) + ) + (ja :num! (loop!)) + ) + ((< 40960.0 (target-height-above-ground)) + (add-to-trick-list (-> self board) (board-tricks board-nosegrab) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-nosegrab")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-nosegrab-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-board-nosegrab-loop-ja :num! min) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-noseflip) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-noseflip")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-noseflip-ja :num! (seek! (ja-aframe 20.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + (goto cfg-40) + ) + ) + (suspend) + ) + ) + ) + (label cfg-40) + (let ((v1-168 (ja-group))) + (when (and v1-168 (= v1-168 jakb-board-nosegrab-loop-ja)) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-nosegrab-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ) + (let ((v1-196 (new-stack-vector0)) + (f0-53 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-196 + (-> self control transv) + (vector-float*! v1-196 (-> self control dynam gravity-normal) f0-53) + ) + (let* ((f1-5 (vector-length v1-196)) + (f2-2 f1-5) + ) + (if (< 0.0 f0-53) + (set! f0-53 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-53) + (vector-float*! v1-196 v1-196 (/ f1-5 f2-2)) + ) + ) + ) + (go target-board-falling) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-trickx (target) + :event (-> target-board-jump event) + :enter (-> target-board-tricky enter) + :exit (behavior () + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (sound-play "board-boots") + ((-> target-board-tricky exit)) + ) + :trans (behavior () + (target-board-spin-check) + (when (!= (-> self control unknown-spool-anim00) 'halfpipe) + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + ) + (when (jump-hit-ground-stuck?) + (set-time! (-> self board jump-land-time)) + (go target-board-hit-ground) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((gp-0 (>= (-> self board unk-float005) 0.0)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 x) 0.0) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control cpad lefty))))) + (set! (-> s5-0 w) 1.0) + (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (s4-0 0) + ) + (while (not (and (or (not (cpad-hold? (-> self control cpad number) r1)) + (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) + ) + (nonzero? s4-0) + ) + ) + (cond + (gp-0 + (add-to-trick-list (-> self board) (board-tricks board-kickflip) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-kickflip")) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! jakb-board-kickflip-a-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + (ja-no-eval :group! jakb-board-kickflip-b-ja :num! (seek! max 1.05) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.05)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (ja-no-eval :group! jakb-board-kickflip-c-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-board-spin) 500.0) + (set! (-> self board trick-sound-id) (sound-play "board-boardspin")) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-board-spin-ja :num! (seek! max 0.95) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.95)) + ) + ) + ) + (+! (-> self board trickx-count) 1) + (set! f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (+! s4-0 1) + ) + ) + ) + (go target-board-falling) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-hit-ground (target) + :event target-board-handler + :enter (behavior () + (logclear! (-> self focus-status) (focus-status halfpipe)) + (if (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + ) + :exit target-board-exit + :trans (behavior () + (if (and (cpad-hold? (-> self control cpad number) l1) + (not (logtest? (-> self target-flags) (target-flags prevent-duck))) + ) + (go target-board-duck-stance) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + (if (target-board-smack-surface?) + 0 + ) + ) + :code (behavior () + (set! (-> self control mod-surface) *board-walk-mods*) + (let ((v1-3 (ja-group))) + (cond + ((and v1-3 (or (= v1-3 jakb-board-method-end-ja) (= v1-3 jakb-board-nosegrab-end-ja))) + (ja-no-eval :num! (seek! max 1.5)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-18 (ja-group))) + (and v1-18 (= v1-18 jakb-board-method-loop-ja)) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-method-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-48 (ja-group))) + (and v1-48 (= v1-48 jakb-board-nosegrab-loop-ja)) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! jakb-board-nosegrab-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ) + ) + (go target-board-stance) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-turn-to (target) + :event target-board-handler + :enter (behavior ((arg0 vector) (arg1 time-frame)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (when (not (or (= (-> self control dynam gravity-length) 245760.0) + (not (time-elapsed? (-> self board ride-time) (seconds 0.2))) + ) + ) + (let ((v1-11 (new-stack-vector0)) + (f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-11 (-> self control transv) (vector-float*! v1-11 (-> self control dynam gravity-normal) f0-2)) + (let* ((f1-3 (vector-length v1-11)) + (f2-0 f1-3) + ) + (if (< f0-2 0.0) + (set! f0-2 (* 5.0 f0-2)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-2) + (vector-float*! v1-11 v1-11 (/ f1-3 f2-0)) + ) + ) + ) + ) + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *board-turn-to-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (set! (-> self control sliding-start-time) arg1) + (vector-normalize-copy! (-> self control unknown-vector38) arg0 1.0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control unknown-vector38) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set! (-> self control turn-lockout-end-time) (+ (current-time) arg1)) + ) + :exit target-board-exit + :trans (behavior () + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + (if (time-elapsed? (-> self state-time) (-> self control sliding-start-time)) + (go target-board-stance) + ) + (target-board-anim-trans) + (when (board-on-ground?) + (let ((gp-0 (-> self board turn-anim-tilt?))) + (target-board-ground-check) + (set! (-> self board turn-anim-tilt?) gp-0) + ) + ) + (set! (-> self board turn-anim-targ) (* 10.0 (-> self board turn-anim-targ))) + ) + :code (-> target-board-stance code) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-turn-around (target) + :event target-board-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self control mod-surface) *turn-around-mods*) + (set! (-> self control bend-target) 1.0) + ) + :exit (behavior () + (set-forward-vel 0.0) + (set! (-> self control ctrl-xz-vel) 0.0) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set! (-> self control bend-target) 0.0) + (target-board-exit) + ) + :trans (behavior () + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + (target-board-anim-trans) + (when (board-on-ground?) + (let ((gp-0 (-> self board turn-anim-tilt?))) + (target-board-ground-check) + (set! (-> self board turn-anim-tilt?) gp-0) + ) + ) + (set! (-> self board turn-anim-targ) (* 10.0 (-> self board turn-anim-targ))) + ) + :code (behavior () + (let ((f30-0 (-> self control ctrl-xz-vel)) + (gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control))) + ) + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! jakb-board-turn-around-ja :num! min) + (quaternion-rotate-y! (-> self control dir-targ) (-> self control quat-for-control) 32768.0) + (compute-alignment! (-> self align)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.25)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (set! (-> self control ctrl-xz-vel) + (* f30-0 (* 0.000024414063 (-> self clock frames-per-second) (-> self align delta trans z))) + ) + (vector-float*! (-> self control transv) gp-0 (-> self control ctrl-xz-vel)) + (let ((v1-31 (new-stack-vector0)) + (f1-2 (vector-dot (-> self control standard-dynamics gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-31 + (-> self control transv) + (vector-float*! v1-31 (-> self control standard-dynamics gravity-normal) f1-2) + ) + (let* ((f2-0 (vector-length v1-31)) + (f0-12 f2-0) + (f1-4 (fmax -8192.0 (fmin 8192.0 f1-2))) + (f2-1 (fmin 368640.0 f2-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control standard-dynamics gravity-normal) f1-4) + (vector-float*! v1-31 v1-31 (/ f2-1 f0-12)) + ) + ) + ) + ) + ) + (remove-exit) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set! (-> self control bend-target) 0.0) + (go target-board-stance) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-ride-edge (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('edge-grab 'push-transv 'push-trans) + #f + ) + (('end-mode) + (case (-> block param 0) + (('ride) + (when (-> block param 1) + (let ((v1-7 (/ (- (current-time) (-> self board ride-start-time)) 300))) + (if (> v1-7 0) + (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-7))) + ) + ) + ) + (when (< 32768.0 (-> self control ctrl-xz-vel)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + ) + (go target-board-turn-to (-> self control transv) (seconds 0.2)) + ) + (('board) + (go target-board-get-off (process->handle proc) #f) + ) + ) + ) + (else + (target-board-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set-time! (-> self state-time)) + (let ((v1-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-2 command) (sound-command set-param)) + (set! (-> v1-2 id) (-> self board charge-sound-id)) + (set! (-> v1-2 params volume) -4) + (set! (-> v1-2 auto-time) 24) + (set! (-> v1-2 auto-from) 2) + (set! (-> v1-2 params mask) (the-as uint 17)) + (-> v1-2 id) + ) + (logior! (-> self focus-status) (focus-status rail)) + (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control mod-surface) *board-ride-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (let ((v1-14 (-> self control transv-ctrl))) + (set! (-> self board ride-speed) (sqrtf (+ (* (-> v1-14 x) (-> v1-14 x)) (* (-> v1-14 z) (-> v1-14 z))))) + ) + (set! (-> self board ride-lean-targ) 0.0) + (set! (-> self board ride-lean) 0.0) + (set! (-> self board ride-leanv) 0.0) + (set! (-> self board ride-tilt-targ) 0.0) + (set! (-> self board ride-tilt) 0.0) + (set! (-> self board ride-tiltv) 0.0) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self board spin-control) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board flip-count) 0) + (set! (-> self board unk-float005) 0.0) + (set! (-> self board unk-float006) 0.0) + (set! (-> self control unknown-word04) (the-as uint #t)) + (set! (-> self control unknown-word04) (the-as uint 1000)) + (target-board-compute-edge) + (let ((f0-17 (vector-dot (-> self control c-R-w fvec) (-> self control edge-grab-edge-dir)))) + (cond + ((< 0.7 f0-17) + (set! (-> self board ride-mode) (the-as uint 0)) + (set! (-> self board ride-rot) 0.0) + ) + ((< f0-17 -0.7) + (set! (-> self board ride-mode) (the-as uint 1)) + (set! (-> self board ride-rot) 32768.0) + ) + (else + (let ((f0-21 (vector-dot (the-as vector (-> self control c-R-w)) (-> self control edge-grab-edge-dir)))) + (cond + ((< 0.7 f0-21) + (set! (-> self board ride-mode) (the-as uint 2)) + (set! (-> self board ride-rot) -16384.0) + ) + (else + (set! (-> self board ride-mode) (the-as uint 3)) + (set! (-> self board ride-rot) 16384.0) + ) + ) + ) + ) + ) + ) + (let ((f0-24 0.0)) + (if arg0 + (set! f0-24 (+ 250.0 f0-24)) + ) + (if (and (!= (-> self board ride-rot-old) -1.0) (!= (-> self board ride-rot) (-> self board ride-rot-old))) + (set! f0-24 (+ 500.0 f0-24)) + ) + (add-to-trick-list (-> self board) (board-tricks board-rail-jump) f0-24) + ) + ) + :exit (behavior () + (logclear! (-> self control status) (collide-status probe-hit)) + (let ((v1-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-2 command) (sound-command set-param)) + (set! (-> v1-2 id) (-> self board ride-sound-id)) + (set! (-> v1-2 params volume) -4) + (set! (-> v1-2 auto-time) 24) + (set! (-> v1-2 auto-from) 2) + (set! (-> v1-2 params mask) (the-as uint 17)) + (-> v1-2 id) + ) + ((-> target-board-stance exit)) + (set! (-> self neck flex-blend) 1.0) + (logclear! (-> self focus-status) (focus-status rail)) + (logclear! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self board ride-rot-old) (-> self board ride-rot)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let* ((s5-0 (new 'stack-no-clear 'collide-query)) + (a0-16 (-> self control)) + (t9-2 (method-of-object a0-16 find-ground)) + (a1-0 s5-0) + (a2-3 (logclear (-> self control root-prim prim-core collide-with) (collide-spec water))) + (a3-0 8192.0) + (t0-0 81920.0) + (t1-0 1024.0) + ) + (if (t9-2 a0-16 a1-0 a2-3 a3-0 t0-0 t1-0) + (set! (-> self control gspot-pat-surfce) (-> s5-0 best-other-tri pat)) + ) + ) + (if (< (-> self control trans y) (-> self control gspot-pos y)) + (set! (-> gp-0 quad) (-> self control gspot-pos quad)) + ) + (move-to-point! + (-> self control) + (vector+! (new 'stack-no-clear 'vector) gp-0 (new 'static 'vector :y 204.8 :w 1.0)) + ) + ) + ) + :trans (behavior () + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'board) + ) + (let ((v1-15 (/ (- (current-time) (-> self board ride-start-time)) 300))) + (if (> v1-15 0) + (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-15))) + ) + ) + (+! (-> self control trans y) 1228.8) + (go + target-board-jump + (-> *TARGET_BOARD-bank* jump-height-min) + (-> *TARGET_BOARD-bank* jump-height-max) + (the-as symbol *board-ride-jump-mods*) + ) + ) + (if (cpad-pressed? (-> self control cpad number) square) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + (if (-> self control unknown-spool-anim00) + (set-time! (-> self board ride-button-time)) + ) + (set! (-> self board turn-anim-targ) (* (-> self board ride-lean) (- (-> *TARGET_BOARD-bank* turn-frames)))) + (cond + ((= (-> self board ride-speed) 0.0) + (let ((v1-43 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-43 command) (sound-command set-param)) + (set! (-> v1-43 id) (-> self board ride-sound-id)) + (set! (-> v1-43 params volume) -4) + (set! (-> v1-43 auto-time) 24) + (set! (-> v1-43 auto-from) 2) + (set! (-> v1-43 params mask) (the-as uint 17)) + (-> v1-43 id) + ) + ) + (else + (let ((f30-1 + (* (lerp-scale 0.7 1.0 (fabs (-> self board ride-lean)) 0.0 1.0) + (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (* 0.5 (-> self control mod-surface transv-max))) + ) + ) + (f28-1 + (+ (lerp-scale 0.0 0.05 (fabs (-> self board ride-lean)) 0.0 1.0) + (lerp-scale -0.05 0.0 (fabs (-> self board ride-speed)) 0.0 (* 0.3 (-> self control mod-surface transv-max))) + ) + ) + ) + (if (!= (-> self control unknown-word04) (-> self control ground-pat material)) + (sound-stop (-> self board ride-sound-id)) + ) + (let* ((v1-65 (-> self control ground-pat material)) + (a0-44 (if (or (= v1-65 (pat-material wood)) (= v1-65 (pat-material crwood)) (= v1-65 (pat-material hdwood))) + (make-u128 (the-as uint #x646f6f772d6c69) (the-as uint #x61722d6472616f62)) + (make-u128 (the-as uint #x6c746d2d6c69) (the-as uint #x61722d6472616f62)) + ) + ) + ) + (sound-play-by-name + (the-as sound-name a0-44) + (-> self board ride-sound-id) + (the int (* 1024.0 f30-1)) + (the int (* 1524.0 f28-1)) + 0 + (sound-group) + #t + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint (-> self control ground-pat material))) + ) + ) + (when (< 4096.0 (-> self board ride-speed)) + (let ((gp-1 (vector+float*! (new 'stack-no-clear 'vector) (-> self control trans) (-> self board ride-dir) -4096.0)) + ) + (set! (-> *part-id-table* 670 init-specs 1 initial-valuef) + (lerp-scale 0.1 2.0 (fabs (-> self board ride-speed)) 0.0 (* 0.3 (-> self control mod-surface transv-max))) + ) + (launch-particles (-> *part-id-table* 670) gp-1) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (let* ((v1-1 (-> self board ride-mode)) + (gp-0 (cond + ((zero? v1-1) + jakb-board-ride-turn-front-ja + ) + ((= v1-1 1) + jakb-board-ride-turn-back-ja + ) + ((= v1-1 2) + jakb-board-ride-turn-left-ja + ) + ((= v1-1 3) + jakb-board-ride-turn-right-ja + ) + (else + (the-as art-element #f) + ) + ) + ) + ) + (when (!= (ja-group) gp-0) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) + ) + ) + (until #f + (ja :num-func num-func-identity + :frame-num (ja-aframe + (fmax -5.0 (fmin 5.0 (+ (* 3.0 (-> self board ride-lean)) + (* 0.5 (sin (* 145.63556 (the float (- (current-time) (-> self state-time)))))) + ) + ) + ) + 0 + ) + ) + (suspend) + ) + #f + ) + :post (behavior () + (target-board-ride-post) + ) + ) + +;; failed to figure out what this is: +(defstate target-board-grenade (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('target) + (handle->process (-> self control unknown-handle02)) + ) + (else + (target-board-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 handle)) + (logior! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self control unknown-handle02) arg0) + (set-time! (-> self state-time)) + (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self control mod-surface) *board-halfpipe-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (let ((v1-12 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-12 (-> self control transv) (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-1)) + (let* ((f1-2 (vector-length v1-12)) + (f2-0 f1-2) + ) + (if (and (!= f1-2 0.0) (< 2.0 (/ f0-1 f1-2))) + (set! f1-2 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-1) + (vector-float*! v1-12 v1-12 (/ f1-2 f2-0)) + ) + ) + ) + ) + :exit (behavior () + (send-event (handle->process (-> self control unknown-handle02)) 'exit) + ((-> target-board-halfpipe exit)) + ) + :trans (behavior () + (set-time! (-> self board halfpipe-time)) + (if (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + (set-time! (-> self board halfpipe-gspot-time)) + ) + (if (not (time-elapsed? (-> self state-time) (seconds 1))) + (vector+float*! + (-> self control transv) + (-> self control transv) + (-> self control dynam gravity-normal) + (* 122880.0 (seconds-per-frame)) + ) + ) + (when (jump-hit-ground-stuck?) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (when (time-elapsed? (-> self board halfpipe-gspot-time) (seconds 0.5)) + (+! (-> self control transv x) (* 20480.0 (-> self control edge-grab-across-edge-dir x))) + (+! (-> self control transv z) (* 20480.0 (-> self control edge-grab-across-edge-dir z))) + (go target-board-stance) + ) + ) + :code (behavior ((arg0 handle)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-board-grenade-ja :num! (seek! (ja-aframe 19.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0))) + ) + (let ((a1-5 (joint-node jakb-lod0-jg extra)) + (gp-2 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (let ((a0-7 (handle->process arg0))) + (set! (-> gp-2 ent) (if a0-7 + (-> a0-7 entity) + ) + ) + ) + (set! (-> gp-2 charge) 0.1) + (set! (-> gp-2 options) (projectile-options)) + (logclear! (-> gp-2 options) (projectile-options po14 po15 po16)) + (set! (-> gp-2 notify-handle) (the-as handle #f)) + (set! (-> gp-2 owner-handle) (the-as handle #f)) + (set! (-> gp-2 target-handle) (the-as uint #f)) + (set! (-> gp-2 target-pos quad) (the-as uint128 0)) + (set! (-> gp-2 ignore-handle) (process->handle self)) + (let* ((v1-27 *game-info*) + (a0-14 (+ (-> v1-27 attack-id) 1)) + ) + (set! (-> v1-27 attack-id) a0-14) + (set! (-> gp-2 attack-id) a0-14) + ) + (set! (-> gp-2 timeout) (seconds 4)) + (vector<-cspace! (-> gp-2 pos) a1-5) + (set! (-> gp-2 vel quad) (-> *zero-vector* quad)) + (spawn-projectile grenade gp-2 self *default-dead-pool*) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (sleep-code) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-get-on (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + message + (the-as attack-info (-> block param 1)) + proc + (the-as touching-shapes-entry (-> block param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self board shock-offsetv) 0.0) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control mod-surface) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control mod-surface)) + (let ((a0-5 (target-time-to-ground))) + (cond + ((logtest? (water-flag touch-water) (-> self water flags)) + (let ((v1-10 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-10 (-> self control transv) (vector-float*! v1-10 (-> self control dynam gravity-normal) f0-2)) + ) + (let* ((f0-3 (vector-length v1-10)) + (f1-1 f0-3) + (f2-2 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.33 (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) + (vector-float*! v1-10 v1-10 (/ f0-3 f1-1)) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + ((< a0-5 (seconds 0.25)) + (let ((v1-12 (new-stack-vector0))) + (let ((f0-6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-12 (-> self control transv) (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-6)) + ) + (let* ((f0-7 (vector-length v1-12)) + (f1-3 f0-7) + (f2-5 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.0016666667 (the float (- (seconds 0.66) a0-5)) (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-5) + (vector-float*! v1-12 v1-12 (/ f0-7 f1-3)) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + (else + (let ((v1-14 (new-stack-vector0))) + (let ((f0-10 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-14 (-> self control transv) (vector-float*! v1-14 (-> self control dynam gravity-normal) f0-10)) + ) + (let* ((f0-11 (vector-length v1-14)) + (f1-5 f0-11) + (f2-7 (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-7) + (vector-float*! v1-14 v1-14 (/ f0-11 f1-5)) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ) + ) + (let ((v1-17 (new-stack-vector0)) + (f0-14 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-17 (-> self control transv) (vector-float*! v1-17 (-> self control dynam gravity-normal) f0-14)) + (let* ((f2-8 (vector-length v1-17)) + (f1-8 f2-8) + ) + (if (< 81920.0 f2-8) + (set! f2-8 81920.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-14) + (vector-float*! v1-17 v1-17 (/ f2-8 f1-8)) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :exit target-board-exit + :code (behavior () + (send-event (ppointer->process (-> self board board)) 'open) + (ja-channel-push! 1 (the-as time-frame (if (-> self control unknown-spool-anim00) + 9 + 60 + ) + ) + ) + (let ((f30-1 (if (-> self control unknown-spool-anim00) + 1.25 + (fmax 1.0 (fmin 2.0 (/ 249.99 (the float (target-time-to-ground))))) + ) + ) + ) + (ja-no-eval :group! jakb-board-get-on-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (when (logtest? (-> self control status) (collide-status on-surface)) + (set! (-> self board turn-anim-duck-vel) 0.0) + (goto cfg-19) + ) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (set! (-> self board turn-anim-duck-vel) 15.0) + (while (not (jump-hit-ground-stuck?)) + (suspend) + ) + (label cfg-19) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (logior! (-> self control status) (collide-status on-surface)) + (go target-board-hit-ground) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-get-off (target) + :event (-> target-board-get-on event) + :enter (behavior ((arg0 handle) (arg1 symbol)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self board shock-offsetv) 0.0) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control mod-surface) (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvf 30.0 + :turnvv 18204.445 + :turnvvf 30.0 + :tiltv 131072.0 + :tiltvf 30.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (let ((a0-6 (target-time-to-ground))) + (cond + ((< a0-6 (seconds 0.207)) + (let ((v1-12 (new-stack-vector0))) + (let ((f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-12 (-> self control transv) (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-3)) + ) + (let* ((f0-4 (vector-length v1-12)) + (f1-1 f0-4) + (f2-2 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.0016666667 (the float (- (seconds 0.66) a0-6)) (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) + (vector-float*! v1-12 v1-12 (/ f0-4 f1-1)) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + (else + (let ((v1-14 (new-stack-vector0))) + (let ((f0-7 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-14 (-> self control transv) (vector-float*! v1-14 (-> self control dynam gravity-normal) f0-7)) + ) + (let* ((f0-8 (vector-length v1-14)) + (f1-3 f0-8) + (f2-4 (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-4) + (vector-float*! v1-14 v1-14 (/ f0-8 f1-3)) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + ) + :exit target-board-exit + :code (behavior ((arg0 handle) (arg1 symbol)) + (local-vars (v1-117 symbol) (a0-36 int)) + (let ((f30-0 1.5151515)) + (let ((v1-1 arg1)) + (cond + ((= v1-1 'hit) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-board-hit-get-off-ja :num! (seek! (ja-aframe 24.0 0) 2.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) 2.5)) + ) + ) + ((-> self control unknown-spool-anim00) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-board-get-off-pre-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (ja-no-eval :group! jakb-board-get-off-ja :num! (seek! (ja-aframe 24.0 0) f30-0) :frame-num 0.0) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (>= (ja-aframe-num 0) 14.0)) + (go target-falling #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) f30-0)) + ) + ) + (else + (set! f30-0 (fmax 0.5 (fmin 2.0 (/ 150.0 (the float (target-time-to-ground)))))) + (ja-channel-push! 1 (seconds 0.1)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (ja-no-eval :group! jakb-board-get-off-ja + :num! (seek! (ja-aframe 24.0 0) f30-0) + :frame-num (ja-aframe 11.0 0) + ) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (>= (ja-aframe-num 0) 14.0)) + (go target-falling #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) f30-0)) + ) + ) + ) + ) + (send-event (ppointer->process (-> self board board)) 'close) + (logclear! (-> self focus-status) (focus-status board)) + (set! (-> self control pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :board #x1) + ) + (ja-no-eval :num! (seek! max f30-0)) + ) + (while (let ((t9-36 ja-done?)) + (set! a0-36 0) + (not (t9-36 a0-36)) + ) + (if (jump-hit-ground-stuck?) + (go target-falling #f) + ) + (suspend) + (ja-eval) + ) + (set! (-> self board turn-anim-duck-vel) 15.0) + (if (and (board-on-ground?) + (let ((v1-115 #x100000)) + (set! a0-36 (the-as int (-> self water flags))) + (not (or (logtest? v1-115 (the-as water-flag a0-36)) + (begin + (let ((v1-118 #t)) + (set! a0-36 (the-as int (logand (-> self control status) (collide-status on-water)))) + (set! a0-36 a0-36) + (cmove-#f-zero v1-117 (the-as collide-status a0-36) v1-118) + ) + v1-117 + ) + ) + ) + ) + ) + (go target-hit-ground (the-as symbol a0-36)) + (go target-falling (if (= arg1 'hit) + 'hit + ) + ) + ) + ) + :post (behavior () + (set! (-> self control bend-speed) 0.0) + (set! (-> self control bend-target) 0.0) + (vector-seek! (-> self control draw-offset) *null-vector* (* 16384.0 (seconds-per-frame))) + (target-post) + (target-board-effect) + ) + ) + +;; failed to figure out what this is: +(defstate target-board-grab (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (case message + (('end-mode) + (case (-> block param 0) + (('grab) + (go target-board-stance) + ) + (('board) + (go target-grab 'stance) + ) + ) + ) + (('clone-anim) + (go target-board-clone-anim (process->handle (the-as process (-> block param 0)))) + ) + (('change-mode) + (case (-> block param 0) + (('normal) + (go target-grab 'stance) + ) + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self control mod-surface) *grab-mods*) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self target-flags) (target-flags tf2)) + (logior! (-> self focus-status) (focus-status grabbed)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self board stick-off) #t) + (let ((v1-9 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-9 command) (sound-command set-param)) + (set! (-> v1-9 id) (-> self board charge-sound-id)) + (set! (-> v1-9 params volume) -4) + (set! (-> v1-9 auto-time) 24) + (set! (-> v1-9 auto-from) 2) + (set! (-> v1-9 params mask) (the-as uint 17)) + (-> v1-9 id) + ) + ) + :exit (behavior () + (set! (-> self board stick-off) #f) + (logclear! (-> self target-flags) (target-flags tf2)) + (logclear! (-> self focus-status) (focus-status grabbed)) + (logclear! (-> self water flags) (water-flag jump-out)) + (target-board-exit) + ) + :code (behavior ((arg0 symbol)) + (let ((v1-2 (ja-group))) + (when (not (and v1-2 (= v1-2 jakb-board-stance-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-board-stance-ja :num! (identity (ja-aframe 0.0 0))) + ) + ) + (until #f + (set-forward-vel 0.0) + (suspend) + ) + #f + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-clone-anim (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ((-> target-board-grab event) proc argc message block) + ) + :enter (-> target-clone-anim enter) + :exit (behavior () + (set! (-> self control draw-offset y) (the-as float (-> self control unknown-word04))) + (set! (-> self control cspace-offset y) (-> self control draw-offset y)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + ((-> target-clone-anim exit)) + ((-> target-board-start exit)) + (vector-reset! (-> self control transv)) + ) + :code (behavior ((arg0 handle)) + (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) + (set! (-> self control draw-offset y) 0.0) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (clone-anim arg0 #t "") + (go target-board-stance) + ) + :post target-no-ja-move-post + ) + +;; failed to figure out what this is: +(defstate target-board-hit (target) + :event target-board-handler + :exit (behavior () + (when (not (and (-> self next-state) + (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-death) (= v1-3 'target-board-get-off) (= v1-3 'target-board-hit)) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status dead hit)) + (logclear! (-> self target-flags) (target-flags disable-attacks)) + ) + (let ((gp-1 (focus-test? self hit))) + (target-exit) + (if gp-1 + (logior! (-> self focus-status) (focus-status hit)) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (target-board-exit) + ) + :trans (behavior () + (when (= *cheat-mode* 'debug) + (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) + (set-time! (-> self control time-of-last-debug-heal)) + (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) + (go target-board-stance) + ) + ) + ) + :code (behavior ((arg0 symbol) (arg1 attack-info)) + (logclear! (-> self water flags) (water-flag jump-out)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-4 command) (sound-command set-param)) + (set! (-> v1-4 id) (-> self board charge-sound-id)) + (set! (-> v1-4 params volume) -4) + (set! (-> v1-4 auto-time) 24) + (set! (-> v1-4 auto-from) 2) + (set! (-> v1-4 params mask) (the-as uint 17)) + (-> v1-4 id) + ) + (set-time! (-> self state-time)) + (let ((gp-0 (-> self attack-info))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-8 gp-0)) + (set! (-> v1-8 attacker) (the-as handle #f)) + (set! (-> v1-8 mode) 'generic) + (set! (-> v1-8 shove-back) 6144.0) + (set! (-> v1-8 shove-up) 4915.2) + (set! (-> v1-8 angle) #f) + (set! (-> v1-8 trans quad) (-> self control trans quad)) + (set! (-> v1-8 control) 0.0) + (set! (-> v1-8 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout)) + (set! (-> v1-8 speed) 1.0) + (set! (-> v1-8 damage) (-> *FACT-bank* health-default-inc)) + (set! (-> v1-8 knock) (knocked-type knocked-type-0)) + ) + (case arg0 + (('shove) + (let ((v1-11 gp-0)) + (set! (-> v1-11 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-11 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-11 angle) 'shove) + ) + ) + ) + (combine! gp-0 arg1 self) + (when (not (logtest? (-> gp-0 mask) (attack-mask vector))) + (vector-z-quaternion! (-> gp-0 vector) (-> self control quat-for-control)) + (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) + (set! (-> gp-0 vector y) (-> gp-0 shove-up)) + ) + (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (let ((f0-12 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-12) + 'front + 'back + ) + ) + ) + ) + (cond + ((= arg0 'attack) + (logior! (-> self focus-status) (focus-status hit)) + (set-time! (-> self game hit-time)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) + (ja-channel-set! 0) + (let ((s3-2 (current-time))) + (until (time-elapsed? s3-2 (seconds 1)) + (suspend) + ) + ) + (move-to-point! (-> self control) s4-1) + ) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-stance) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (go target-death (-> gp-0 mode)) + ) + ) + ) + (('drown-death + 'sharkey + 'lava + 'fry + 'slime + 'dark-eco-pool + 'melt + 'instant-death + 'crush + 'death + 'grenade + 'big-explosion + 'bot + 'tentacle + ) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (if (= (-> self game mode) 'play) + (go target-death (-> gp-0 mode)) + ) + ) + (('death) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> gp-0 damage)) (the-as handle #f)) + ) + ) + (target-hit-effect gp-0) + ) + (else + (case (-> gp-0 mode) + (('burn 'burnup) + (sound-play "get-burned") + ) + ) + ) + ) + (when (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health)))) + (when (= (-> gp-0 knock) (knocked-type knocked-type-8)) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set-forward-vel (* -3.0 (-> gp-0 shove-back))) + (go target-board-get-off (the-as handle #f) 'hit) + ) + (if (= (-> gp-0 control) 1.0) + (go target-board-jump (-> gp-0 shove-up) (-> gp-0 shove-up) 'hit) + ) + ) + (set! (-> self control mod-surface) *smack-mods*) + (let ((v1-90 (ja-group))) + (when (not (and v1-90 (or (= v1-90 jakb-board-hit-ja) (= v1-90 jakb-board-hit-forward-ja)))) + (ja-channel-push! 1 (seconds 0.075)) + (if (or (= (-> gp-0 mode) 'shock) (= (-> gp-0 mode) 'shock-red) (= (-> gp-0 mode) 'shockup)) + (ja :group! jakb-board-hit-elec-ja :num! min) + (ja :group! jakb-board-hit-ja :num! min) + ) + ) + ) + (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-board-falling-anim-trans (-> gp-0 speed)) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (go target-death (-> gp-0 mode)) + ) + ) + enter-state + (go target-board-hit-ground) + ) + :post (behavior () + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (target-post) + (target-board-effect) + (case (-> self attack-info mode) + (('shock 'shock-red 'shockup) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.03)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (send-event self 'color-effect 'shock (seconds 0.2)) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) + ) + (target-board-joint-points) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/board/board-util_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-util_REF.gc new file mode 100644 index 00000000000..30850f0a251 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/board/board-util_REF.gc @@ -0,0 +1,238 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 7 of type board +;; WARN: Return type mismatch process-drawable vs board. +(defmethod relocate ((this board) (offset int)) + (if (nonzero? (-> this main)) + (&+! (-> this main) offset) + ) + (the-as board ((method-of-type process-drawable relocate) this offset)) + ) + +;; definition for function board-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior board-post board () + (let ((v1-0 (ppointer->process (-> self parent)))) + (set! (-> self root trans quad) (-> (the-as target v1-0) board board-trans quad)) + (let ((a0-4 (-> (the-as target v1-0) board board-quat quad))) + (set! (-> self root quat quad) a0-4) + ) + (set! (-> self root scale quad) (-> (the-as target v1-0) board board-scale quad)) + (set! (-> self draw light-index) (-> (the-as target v1-0) draw light-index)) + (let ((a0-10 (-> (the-as target v1-0) draw color-mult quad))) + (set! (-> self draw color-mult quad) a0-10) + ) + (let ((a0-12 (-> (the-as target v1-0) draw color-emissive quad))) + (set! (-> self draw color-emissive quad) a0-12) + ) + (set! (-> self draw force-fade) (-> (the-as target v1-0) draw force-fade)) + (set! (-> self draw global-effect) (-> (the-as target v1-0) draw global-effect)) + (set! (-> self draw death-vertex-skip) (-> self parent 0 draw death-vertex-skip)) + (set! (-> self draw death-effect) (-> self parent 0 draw death-effect)) + (set! (-> self draw death-timer) (-> self parent 0 draw death-timer)) + (set! (-> self draw death-timer-org) (-> self parent 0 draw death-timer-org)) + (set! (-> self draw death-draw-overlap) (-> self parent 0 draw death-draw-overlap)) + (let ((a0-39 (-> (the-as target v1-0) draw shadow-ctrl settings shadow-dir quad))) + (set! (-> self draw shadow-ctrl settings shadow-dir quad) a0-39) + ) + (cond + ((logtest? (-> (the-as target v1-0) draw shadow-ctrl settings flags) (shadow-flags disable-draw)) + (let ((a0-45 (-> self draw shadow-ctrl))) + (logior! (-> a0-45 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (else + (let ((a0-48 (-> self draw shadow-ctrl))) + (logclear! (-> a0-48 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + (if (or (logtest? (-> (the-as target v1-0) draw status) + (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2) + ) + (or (logtest? (-> (the-as target v1-0) target-effect) 1) + (zero? (-> (the-as target v1-0) skel active-channels)) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (if (logtest? (-> (the-as target v1-0) draw status) (draw-control-status force-fade)) + (logior! (-> self draw status) (draw-control-status force-fade)) + (logclear! (-> self draw status) (draw-control-status force-fade)) + ) + (if (logtest? (-> (the-as target v1-0) target-effect) 7) + (logior! (-> self draw global-effect) (draw-control-global-effect no-textures)) + (logclear! (-> self draw global-effect) (draw-control-global-effect no-textures)) + ) + (if (logtest? (-> (the-as target v1-0) target-effect) 56) + (logior! (-> self draw global-effect) (draw-control-global-effect rim-lights)) + (logclear! (-> self draw global-effect) (draw-control-global-effect rim-lights)) + ) + ) + (ja-post) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate hidden (board) + :virtual #t + :trans (behavior () + (let ((v1-0 (-> self parent))) + (if (not (focus-test? + (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) + ) + in-head + ) + ) + (go-virtual idle #t) + ) + ) + ) + :code (behavior () + (ja-channel-set! 0) + (ja-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate idle (board) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (go-virtual use) + ) + ) + ) + :trans (behavior () + (let ((v1-0 (-> self parent))) + (cond + ((focus-test? + (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) + ) + in-head + ) + (+! (-> self in-head-time) (- (current-time) (-> self clock old-frame-counter))) + (if (< (seconds 0.1) (-> self in-head-time)) + (go-virtual hidden) + ) + ) + (else + (set! (-> self in-head-time) 0) + 0 + ) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.1)) + (cond + (arg0 + (ja :group! board-close-ja :num! max) + ) + (else + (ja-no-eval :group! board-close-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (set! (-> self draw shadow) #f) + (sleep-code) + ) + :post board-post + ) + +;; failed to figure out what this is: +(defstate use (board) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (go-virtual idle #f) + ) + ) + ) + :trans (behavior () + (let ((v1-0 (-> self parent))) + (if v1-0 + (-> v1-0 0 self) + ) + ) + (let ((v1-2 (-> self parent))) + (cond + ((focus-test? + (the-as target (if v1-2 + (the-as target (-> v1-2 0 self)) + ) + ) + in-head + ) + (go-virtual hidden) + ) + ((let ((v1-9 #x40000) + (a0-3 (-> self parent)) + ) + (not (logtest? (the-as focus-status v1-9) (-> (the-as target (if a0-3 + (the-as target (-> a0-3 0 self)) + ) + ) + focus-status + ) + ) + ) + ) + (go-virtual idle #f) + ) + ) + ) + ) + :code (behavior () + (set! (-> self draw shadow) (-> self shadow-backup)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! board-open-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + ) + :post board-post + ) + +;; definition for function board-init +;; INFO: Used lq/sq +(defbehavior board-init board () + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-board" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-5 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *board-shadow-control* settings shadow-dir quad) v1-5) + ) + (set! (-> self draw shadow-ctrl) *board-shadow-control*) + (set! (-> self shadow-backup) (-> self draw shadow)) + (set! (-> self main) (new 'process 'joint-mod (joint-mod-mode flex-blend) self 3)) + (ja-channel-set! 0) + (go-virtual idle #t) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc new file mode 100644 index 00000000000..02c83392621 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc @@ -0,0 +1,3379 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *board-walk-mods*, type surface +(define *board-walk-mods* + (new 'static 'surface + :name 'run + :turnv 32768.0 + :turnvf 30.0 + :turnvv 131072.0 + :turnvvf 30.0 + :tiltv 131072.0 + :tiltvf 15.0 + :tiltvv 2621440.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor -0.125 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (if (< 0.9 (-> self control surface-angle)) + (set-time! (-> self board on-flat-time)) + ) + (cond + ((< (-> *setting-control* user-current board-max-speed) (-> self control ctrl-xz-vel)) + (set! (-> arg0 transv-max) + (lerp (-> self control ctrl-xz-vel) (-> *setting-control* user-current board-max-speed) 0.2) + ) + ) + ((and (logtest? (game-secrets board-fast) (-> self game secrets)) + (-> self current-level) + (logtest? (level-flags desert) (-> self current-level info level-flags)) + ) + (set! (-> arg0 transv-max) + (fmin (fmin 245760.0 (-> *setting-control* user-current board-max-speed)) (* 2.5 (-> arg0 transv-max))) + ) + (set! (-> arg0 target-speed) (* 3.5 (-> arg0 target-speed))) + ) + (else + (set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> *setting-control* user-current board-max-speed))) + ) + ) + (set! (-> self board slip-factor) + (lerp-scale 1.0 (-> arg0 slip-factor) (fabs (-> self control ctrl-slope-heading)) 0.0 1.0) + ) + (set! (-> arg0 slip-factor) (-> self board slip-factor)) + (set! (-> arg0 slope-up-factor) (-> arg1 slope-up-factor)) + (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) + (set! (-> arg0 seek0) + (lerp-scale + (* 0.1 (-> arg0 seek0)) + (-> arg0 seek0) + (the float (- (current-time) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (set! (-> arg0 seek90) + (lerp-scale + (* 0.1 (-> arg0 seek90)) + (-> arg0 seek90) + (the float (- (current-time) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (set! (-> arg0 vel-turn) + (lerp-scale 131072.0 (-> arg1 vel-turn) (the float (- (current-time) (-> self board spin-time))) 0.0 600.0) + ) + (set! (-> arg0 turnv) + (lerp-scale 91022.22 (-> arg1 turnv) (the float (- (current-time) (-> self board spin-time))) 0.0 600.0) + ) + (when (not (time-elapsed? (-> self board spin-ground-start-time) (seconds 0.3))) + (set-time! (-> self control last-attack-end-time)) + (set-time! (-> self board spin-ground-time)) + (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) + (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) + (set! (-> arg0 vel-turn) 131072.0) + (set! (-> arg0 turnv) 91022.22) + ) + ) + ) + ) + :flags (surface-flag turn-to-pad) + ) + ) + +;; definition for symbol *board-duck-mods*, type surface +(define *board-duck-mods* (new 'static 'surface + :name 'duck + :turnv 21845.334 + :turnvf 30.0 + :turnvv 131072.0 + :turnvvf 30.0 + :tiltv 131072.0 + :tiltvf 15.0 + :tiltvv 2621440.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :transv-max 151552.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 0.5 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 0.75 + :flags (surface-flag no-turn-around turn-to-pad duck) + ) + ) + +;; failed to figure out what this is: +(set! (-> *board-duck-mods* mult-hook) (-> *board-walk-mods* mult-hook)) + +;; definition for symbol *board-air-mods*, type surface +(define *board-air-mods* + (new 'static 'surface + :name 'air + :turnv 49152.0 + :turnvf 30.0 + :turnvv 131072.0 + :turnvvf 30.0 + :tiltv 16384.0 + :tiltvf 150.0 + :tiltvv 131072.0 + :tiltvvf 60.0 + :vel-turn 65536.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.8 + :seek90 0.8 + :seek180 0.8 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (when (and (logtest? (game-secrets board-fast) (-> self game secrets)) + (-> self current-level) + (logtest? (level-flags desert) (-> self current-level info level-flags)) + ) + (set! (-> arg0 transv-max) + (fmin (fmin 245760.0 (-> *setting-control* user-current board-max-speed)) (* 2.5 (-> arg0 transv-max))) + ) + (set! (-> arg0 target-speed) (* 3.5 (-> arg0 target-speed))) + ) + ) + ) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +;; definition for symbol *board-jump-mods*, type surface +(define *board-jump-mods* (new 'static 'surface + :name 'jump + :turnv 49152.0 + :turnvf 30.0 + :turnvv 524288.0 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 30.0 + :tiltvv 131072.0 + :tiltvvf 18.0 + :vel-turn 10922.667 + :transv-max 143360.0 + :target-speed 102400.0 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +;; failed to figure out what this is: +(set! (-> *board-jump-mods* mult-hook) (-> *board-air-mods* mult-hook)) + +;; definition for symbol *board-ride-jump-mods*, type surface +(define *board-ride-jump-mods* + (new 'static 'surface + :name 'jump + :turnv 49152.0 + :turnvf 30.0 + :turnvv 32768.0 + :turnvvf 300.0 + :tiltv 32768.0 + :tiltvf 30.0 + :tiltvv 131072.0 + :tiltvvf 18.0 + :transv-max 143360.0 + :target-speed 102400.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (when (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (if (< (-> *setting-control* user-current board-max-speed) (-> self control ctrl-xz-vel)) + (set! (-> arg0 transv-max) + (lerp (-> self control ctrl-xz-vel) (-> *setting-control* user-current board-max-speed) 0.2) + ) + (set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> *setting-control* user-current board-max-speed))) + ) + (let* ((f30-0 (* (+ -20480.0 (-> arg0 transv-max)) (seconds-per-frame) (-> self control turn-to-magnitude))) + (a2-2 (-> self board ride-dir)) + (v1-19 (vector-flatten! (new 'stack-no-clear 'vector) (-> self control to-target-pt-xz) a2-2)) + ) + (vector+float*! (-> self control transv) (-> self control transv) v1-19 f30-0) + ) + ) + ) + ) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +;; definition for symbol *board-duck-jump-mods*, type surface +(define *board-duck-jump-mods* *board-jump-mods*) + +;; definition for symbol *board-spin-mods*, type surface +(define *board-spin-mods* (copy *board-jump-mods* 'global)) + +;; failed to figure out what this is: +(let ((v1-12 *board-spin-mods*)) + (set! (-> v1-12 name) 'spin) + (set! (-> v1-12 flags) (surface-flag no-turn-around check-edge air)) + (set! (-> v1-12 seek0) 0.0) + (set! (-> v1-12 seek90) 0.0) + (set! (-> v1-12 seek180) 0.0) + (set! (-> v1-12 vel-turn) 0.0) + (set! (-> v1-12 turnv) 0.0) + (set! (-> v1-12 turnvv) 0.0) + (set! (-> v1-12 tiltv) 0.0) + (set! (-> v1-12 tiltvf) 0.0) + ) + +;; failed to figure out what this is: +(let ((v1-14 (copy *board-jump-mods* 'global))) + (set! (-> v1-14 seek0) 0.0) + (set! (-> v1-14 seek90) 0.0) + (set! (-> v1-14 seek180) 0.0) + (set! (-> v1-14 vel-turn) 0.0) + (set! *board-spin-post-mods* v1-14) + ) + +;; failed to figure out what this is: +(let ((v1-16 (copy *board-duck-jump-mods* 'global))) + (set! (-> v1-16 flags) (surface-flag no-turn-around turn-to-vel air)) + (set! (-> v1-16 seek0) 0.0) + (set! (-> v1-16 seek90) 0.0) + (set! (-> v1-16 seek180) 0.0) + (set! (-> v1-16 vel-turn) 0.0) + (set! (-> v1-16 turnv) 49152.0) + (set! (-> v1-16 turnvf) 30.0) + (set! (-> v1-16 turnvv) 0.0) + (set! (-> v1-16 turnvvf) 0.0) + (set! *board-flip-mods* v1-16) + ) + +;; definition for symbol *board-wall-kick-mods*, type surface +(define *board-wall-kick-mods* (new 'static 'surface + :name 'jump + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 60.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek180 0.8 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 0.8 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (when (not (time-elapsed? (-> self state-time) (seconds 0.05))) + (set! (-> arg0 turnv) 0.0) + (set! (-> arg0 turnvf) 0.0) + ) + ) + ) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-vel air) + ) + ) + +;; definition for symbol *board-halfpipe-mods*, type surface +(define *board-halfpipe-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvf 30.0 + :turnvv 524288.0 + :turnvvf 30.0 + :tiltv 16384.0 + :tiltvf 150.0 + :tiltvv 131072.0 + :tiltvvf 60.0 + :transv-max 143360.0 + :target-speed 102400.0 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flag no-turn-around turn-to-vel air turn-when-centered) + ) + ) + +;; definition for symbol *board-turn-to-mods*, type surface +(define *board-turn-to-mods* (new 'static 'surface + :name 'run + :turnv 524288.0 + :turnvf 30.0 + :tiltv 131072.0 + :tiltvf 15.0 + :tiltvv 2621440.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 0.5 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :flags (surface-flag no-turn-around turn-to-vel turn-when-centered) + ) + ) + +;; failed to figure out what this is: +(set! (-> *board-turn-to-mods* mult-hook) (-> *board-walk-mods* mult-hook)) + +;; definition for symbol *board-ride-mods*, type surface +(define *board-ride-mods* + (new 'static 'surface + :name 'run + :turnv 218453.33 + :turnvf 30.0 + :turnvv 131072.0 + :turnvvf 30.0 + :tiltv 131072.0 + :tiltvf 60.0 + :tiltvv 262144.0 + :tiltvvf 30.0 + :transv-max 143360.0 + :target-speed 40960.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.1 + :nonlin-fric-dist 1.0 + :slip-factor 0.6 + :slide-factor 1.0 + :slope-up-factor 24576.0 + :slope-down-factor 49152.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (set! (-> arg0 slope-up-factor) (-> arg1 slope-up-factor)) + (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) + (if (< (-> *setting-control* user-current board-max-speed) (-> self control ctrl-xz-vel)) + (set! (-> arg0 transv-max) + (lerp (-> self control ctrl-xz-vel) (-> *setting-control* user-current board-max-speed) 0.2) + ) + (set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> *setting-control* user-current board-max-speed))) + ) + ) + ) + ) + :mode 'ride + :flags (surface-flag no-turn-around turn-to-pad check-edge turn-when-centered) + ) + ) + +;; definition for symbol *collide-edge-board-halfpipe-spec*, type collide-edge-spec +(define *collide-edge-board-halfpipe-spec* (new 'static 'collide-edge-spec + :split-dists (new 'static 'array float 2 1024.0 1433.6) + :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) + :flags (collide-edge-spec-flags send-event) + :max-dist-sqrd-to-outward-pt 150994940.0 + :max-dir-cosa-delta -1.0 + :max-dir-cosa-player -2.0 + :touching-segment #f + :local-cache-fill-box (new 'static 'bounding-box + :min (new 'static 'vector :x -8192.0 :y -16384.0 :z -8192.0 :w 1.0) + :max (new 'static 'vector :x 8192.0 :y 16384.0 :z 8192.0 :w 1.0) + ) + :local-within-reach-box (new 'static 'bounding-box + :min (new 'static 'vector :x -7987.2 :y -16179.2 :z -7987.2 :w 1.0) + :max (new 'static 'vector :x 7987.2 :y 16179.2 :z 7987.2 :w 1.0) + ) + :local-player-spheres (new 'static 'inline-array sphere 12 + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x -737.28 :y 4096.0 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 6553.6 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 9420.8 :r 3072.0) + (new 'static 'sphere :x 1720.32 :y 3686.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 5734.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 8601.6 :r 2949.12) + ) + ) + ) + +;; definition for function target-board-green-eco-attack +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior target-board-green-eco-attack target ((arg0 symbol)) + (local-vars (v1-14 float) (v1-25 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'bounding-box))) + (cond + (arg0 + (set! (-> gp-0 min quad) (-> self control trans quad)) + (set! (-> gp-0 min w) 49152.0) + ) + (else + (vector-normalize! (vector-z-quaternion! (the-as vector gp-0) (-> self control quat)) -12288.0) + (vector+! (the-as vector gp-0) (the-as vector gp-0) (-> self control trans)) + (set! (-> gp-0 min w) 24576.0) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-1 384)) + (let* ((s3-0 (-> s5-1 s4-0)) + (v1-10 (if (type? s3-0 collide-shape) + s3-0 + ) + ) + ) + (when v1-10 + (let* ((s3-1 (-> v1-10 process)) + (a0-11 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (when a0-11 + (when (!= *target* a0-11) + (let ((v1-13 (vector-! (new 'stack-no-clear 'vector) (-> a0-11 root trans) (the-as vector gp-0)))) + 0.0 + (.lvf vf1 (&-> v1-13 quad)) + ) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-14 vf1) + (let ((f0-3 v1-14) + (f1-0 (-> gp-0 min w)) + ) + (if (>= (* f1-0 f1-0) f0-3) + (send-event a0-11 'green-eco-attack) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let* ((s4-1 *target*) + (s5-2 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (when (and s5-2 (< (vector-vector-distance (get-trans s5-2 0) (the-as vector gp-0)) (-> gp-0 min w))) + (when (!= *target* s5-2) + (let ((v1-24 (vector-! (new 'stack-no-clear 'vector) (-> s5-2 control trans) (the-as vector gp-0)))) + 0.0 + (.lvf vf1 (&-> v1-24 quad)) + ) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-25 vf1) + (let ((f0-6 v1-25) + (f1-4 (-> gp-0 min w)) + ) + (if (>= (* f1-4 f1-4) f0-6) + (send-event s5-2 'green-eco-attack) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for function target-board-green-eco-use +;; WARN: Return type mismatch float vs none. +(defbehavior target-board-green-eco-use target ((arg0 float)) + (set! (-> self fact eco-green) (- (-> self fact eco-green) arg0)) + (if (< (-> self fact eco-green) 0.0) + (set! (-> self fact eco-green) 0.0) + ) + (none) + ) + +;; definition for function target-board-handler +(defbehavior target-board-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object) (a0-11 uint)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'board + ) + (else + (case arg2 + (('end-mode) + (case (-> arg3 param 0) + (('board) + (go target-board-get-off (process->handle arg0) #f) + ) + ) + ) + (('change-mode) + (let ((v1-8 (-> arg3 param 0))) + (b! (!= v1-8 'grab) cfg-21 :delay (set! a0-11 (the-as uint #f))) + (b! (focus-test? self dead) cfg-20 :delay (set! v0-0 #f)) + (set! v0-0 (if (not (-> arg3 param 1)) + #t + (go target-board-grab (the-as symbol a0-11)) + ) + ) + (label cfg-20) + (b! #t cfg-32 :delay (nop!)) + (label cfg-21) + (set! v0-0 (cond + ((= v1-8 'normal) + (go target-board-get-off (process->handle arg0) #f) + ) + ((= v1-8 'falling) + enter-state + (go target-board-falling) + ) + ((= v1-8 'pilot) + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + (label cfg-32) + v0-0 + ) + (('swim 'wade 'slide 'pole-grab) + #f + ) + (('clone-anim) + (go target-board-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('edge-grab) + (let ((gp-1 *edge-grab-info*) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (-> gp-1 world-vertex 1) + (the-as vector (-> gp-1 world-vertex)) + ) + 1.0 + ) + (vector+float*! s5-1 (-> self control trans) (-> self control c-R-w fvec) (* 40960.0 (seconds-per-frame))) + (let ((f0-2 (vector-segment-overlap s5-1 (the-as vector (-> gp-1 world-vertex)) (-> gp-1 world-vertex 1)))) + (if (and (time-elapsed? (-> self board ride-time) (seconds 0.4)) + (>= f0-2 0.0) + (>= 1.0 f0-2) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-duck-stance))) + ) + (go target-board-ride-edge (logtest? (-> self control mod-surface flags) (surface-flag air))) + ) + ) + ) + ) + (('touched) + (cond + ((and (-> self control danger-mode) ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + ) + (when (target-send-attack + arg0 + (-> self control danger-mode) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + (case (-> self control danger-mode) + (('board-spin) + (cond + ((logtest? (-> *part-group-id-table* 184 flags) (sp-group-flag sp13)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-2 + (let ((t9-12 (method-of-type part-tracker-subsampler activate))) + (t9-12 (the-as part-tracker-subsampler gp-2) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-13 run-function-in-process) + (a0-53 gp-2) + (a1-12 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 184)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 37) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-13) a0-53 a1-12 *part-tracker-subsampler-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + (else + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-3 + (let ((t9-15 (method-of-type part-tracker activate))) + (t9-15 (the-as part-tracker gp-3) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-16 run-function-in-process) + (a0-56 gp-3) + (a1-15 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 184)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 37) + ((the-as (function object object object none) t9-16) a0-56 a1-15 *part-tracker-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + ) + ) + ) + (target-timed-invulnerable (seconds 0.5) self 2) + ) + ) + (else + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) (process->ppointer self)) + (set! (-> a1-17 num-params) 2) + (set! (-> a1-17 message) 'attack) + (set! (-> a1-17 param 0) (-> arg3 param 0)) + (set! (-> a1-17 param 1) + (the-as + uint + (static-attack-info :mask (vehicle-impulse-factor) ((id (-> self board attack-id)) + (damage 2.0) + (vehicle-damage-factor 0.0) + (vehicle-impulse-factor 0.0) + (mode 'board) + (penetrate-using (-> self control penetrate-using)) + ) + ) + ) + ) + (set! v0-0 (send-event-function arg0 a1-17)) + ) + (when v0-0 + (let* ((v1-85 (-> self game)) + (a0-67 (+ (-> v1-85 attack-id) 1)) + ) + (set! (-> v1-85 attack-id) a0-67) + (set! (-> self board attack-id) a0-67) + ) + ) + v0-0 + ) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-board-hit + ) + ) + (('shove) + (when (not (focus-test? self hit)) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 168) + (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) + (set! (-> self attack-info-rec attacker) (process->handle arg0)) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) + ) + (go target-board-hit 'shove (-> self attack-info-rec)) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +;; definition for function board-turn-around? +;; INFO: Used lq/sq +(defbehavior board-turn-around? target () + (let* ((gp-0 (vector<-pad-in-surface! (new-stack-vector0) #f)) + (s5-0 (vector-normalize! gp-0 1.0)) + (t9-2 vector-normalize!) + (a0-2 (new-stack-vector0)) + ) + (set! (-> a0-2 quad) (-> self control transv quad)) + (let ((f30-0 (vector-dot s5-0 (t9-2 a0-2 1.0))) + (s5-1 (-> self control transv-history)) + (f26-0 -1000.0) + (f28-0 0.0) + (s2-0 -1) + (s3-0 (new 'static 'array time-frame 2 (seconds 0) (seconds 0))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (countdown (v1-7 15) + (let ((a0-5 (-> s5-1 v1-7 quad))) + (set! (-> s5-1 (+ v1-7 1) quad) a0-5) + ) + ) + (cond + ((>= (-> self control pad-magnitude) 0.2) + (set! (-> s5-1 0 quad) (-> gp-0 quad)) + (set! (-> s5-1 0 w) (-> self control pad-magnitude)) + ) + (else + (vector-normalize-copy! (-> s5-1 0) (-> self control transv) 1.0) + (set! (-> s5-1 0 w) 0.2) + ) + ) + (dotimes (v1-18 16) + (+! f28-0 (-> s5-1 v1-18 w)) + (vector+float*! s4-0 s4-0 (-> s5-1 v1-18) (-> s5-1 v1-18 w)) + (when (< f26-0 (-> s5-1 v1-18 w)) + (set! s2-0 v1-18) + (set! f26-0 (-> s5-1 v1-18 w)) + ) + ) + (let ((f28-1 (* 0.0625 f28-0))) + (vector-normalize! s4-0 1.0) + (set! (-> self control idx-of-fastest-xz-vel) s2-0) + (set! (-> self control average-xz-vel) f28-1) + ) + (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) + (set-time! (-> s3-0 0)) + ) + (and (>= (the-as uint (- (current-time) (-> s3-0 0))) (the-as uint 300)) + (< f30-0 0.0) + (< (vector-dot s4-0 gp-0) -0.5) + (< 0.5 (vector-dot gp-0 (-> s5-1 1))) + (< 0.5 (vector-dot gp-0 (-> s5-1 2))) + (< 0.5 (vector-dot gp-0 (-> s5-1 3))) + (= (-> self ext-anim) (target-anim board)) + (< 0.7 (-> self control pad-magnitude)) + (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.3)) + (time-elapsed? (-> self control time-of-last-lc) (seconds 0.3)) + (logtest? (-> self control status) (collide-status on-surface)) + (and (< 0.7 (-> self control surface-angle)) #t) + ) + ) + ) + ) + +;; definition for function target-board-setup +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-setup target ((arg0 symbol)) + (when (zero? (-> self board)) + (set! (-> self board) (new 'process 'board-info)) + (set! (-> self board process) (the-as (pointer target) (process->ppointer self))) + (set! (-> self board latch?) #f) + (set! (-> self board engine-sound-id) (new-sound-id)) + (set! (-> self board ride-sound-id) (new-sound-id)) + (set! (-> self board spin-sound-id) (new 'static 'sound-id)) + (set! (-> self board wind-sound-id) (new-sound-id)) + (set! (-> self board bank-sound-id) (new-sound-id)) + (set! (-> self board eco-sound-id) (new-sound-id)) + (set! (-> self board charge-sound-id) (new-sound-id)) + (let* ((v1-12 (-> self game)) + (a0-5 (+ (-> v1-12 attack-id) 1)) + ) + (set! (-> v1-12 attack-id) a0-5) + (set! (-> self board attack-id) a0-5) + ) + (set! (-> self board board) (the-as (pointer board) #f)) + (set! (-> self board mode-sound-bank) #f) + ) + (cond + (arg0 + (if (not (-> self board board)) + (set! (-> self board board) + (process-spawn board :init board-init :name "board" :from *8k-dead-pool* :to self) + ) + ) + ) + (else + (when (-> self board board) + (deactivate (-> self board board 0)) + (set! (-> self board board) (the-as (pointer board) #f)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-board-init +(defbehavior target-board-init target () + (target-lightjak-end-mode #t) + (target-darkjak-end-mode #t) + (target-gun-end-mode #f) + (target-exit) + (target-board-setup #t) + (set! (-> self pending-ext-anim) (target-anim board)) + (set! (-> self board latch?) #f) + (if (zero? (-> self board main)) + (set! (-> self board main) (new 'process 'joint-mod (joint-mod-mode flex-blend) self 3)) + ) + (if (zero? (-> self board upper-body)) + (set! (-> self board upper-body) (new 'process 'joint-mod (joint-mod-mode flex-blend) self 5)) + ) + (if (zero? (-> self board effect-part)) + (set! (-> self board effect-part) (create-launch-control (-> *part-group-id-table* 185) self)) + ) + (if (zero? (-> self board charge-part)) + (set! (-> self board charge-part) (create-launch-control (-> *part-group-id-table* 186) self)) + ) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + (set! (-> self board engine-sound-pitch) 0.0) + (set! (-> self board engine-sound-volume) 1.0) + (set! (-> self board bank-sound-pitch) 0.0) + (set! (-> self board bank-sound-volume) 0.0) + (set! (-> self board wind-sound-pitch) 0.0) + (set! (-> self board wind-sound-volume) 1.0) + (set! (-> self board spin-sound-volume) 0.0) + (set! (-> self board eco-sound-volume) 0.0) + (set! (-> self board sound-air-knob) 0.0) + (set! (-> self board sound-bank-knob) 0.0) + (set! (-> self board turn-sound-id) (new 'static 'sound-id)) + (set! (-> self board mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modebord 0.0 0))) + (set-time! (-> self board board-get-on-time)) + (set! (-> self board stick-lock) #f) + (set! (-> self board stick-off) #f) + (set-time! (-> self board unstuck-time)) + (set! (-> self board stuck-count) 0) + (set! (-> self board slip-factor) 1.0) + (set! (-> self board probe) #f) + (set! (-> self board halfpipe-side-time) 0) + (set! (-> self board spin-control) 0.0) + (set! (-> self board rotyv) 0.0) + (set! (-> self board roty) 0.0) + (set! (-> self board roty-cum) 0.0) + (set! (-> self board unk-deg00) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board flip-count) 0) + (set! (-> self board unk-float005) 0.0) + (set! (-> self board unk-float006) 0.0) + (set! (-> self board unk-float007) 0.0) + (set! (-> self board trick-count) 0) + (countdown (v1-69 16) + (set! (-> self board trick-list 0) (board-tricks none)) + ) + (set! (-> self board charge-progress) 0.0) + (set! (-> self board upper-body-rotyv) 0.0) + (set! (-> self board upper-body-roty) 0.0) + (set! (-> self board upper-body-rotyv-max) 91022.22) + (set! (-> self board ride-lock) #f) + (set! (-> self board ride-lock-on) #f) + (set! (-> self board ride-rot-old) -1.0) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1)) + (logior! (-> self focus-status) (focus-status board)) + (logclear! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control bend-target) 1.0) + (let ((v1-90 (-> self node-list data))) + (set! (-> v1-90 0 param0) (the-as (function cspace transformq none) cspace<-transformq+world-trans!)) + (set! (-> v1-90 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-90 0 param2) (the-as basic (-> self control cspace-offset))) + ) + (target-collide-set! 'board 0.0) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (set! (-> self board thrust-scale) 1.0) + (set! (-> self board turn-anim-targ) 0.0) + (set! (-> self board turn-anim-frame) 0.0) + (set! (-> self board turn-anim-vel) 0.0) + (set! (-> self board turn-anim-duck) 0.0) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self board cushion-base) 0.0) + (set! (-> self board cushion-offset) 0.0) + (set! (-> self board shock-offset) 0.0) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self board shock-rotx) 0.0) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (set-setting! 'string-spline-max-move 'abs (meters 2) 0) + (set-setting! 'string-spline-accel 'abs (meters 0.045) 0) + (set-setting! 'string-spline-max-move-player 'abs (meters 1.5) 0) + (set-setting! 'string-spline-accel-player 'abs (meters 0.035) 0) + (none) + ) + +;; definition for function target-board-exit +;; INFO: Used lq/sq +(defbehavior target-board-exit target () + (when (not (and (-> self next-state) + (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-stance) + (= v1-3 'target-board-jump) + (= v1-3 'target-board-hit-ground) + (= v1-3 'target-board-jump-kick) + (= v1-3 'target-board-wall-kick) + (= v1-3 'target-board-ride-edge) + (= v1-3 'target-board-duck-stance) + (= v1-3 'target-board-falling) + (= v1-3 'target-board-flip) + (= v1-3 'target-board-trickx) + (= v1-3 'target-board-tricky) + (= v1-3 'target-board-hold) + (= v1-3 'target-board-halfpipe) + (= v1-3 'target-board-grenade) + (= v1-3 'target-board-turn-to) + (= v1-3 'target-board-turn-around) + (= v1-3 'target-board-hit) + (= v1-3 'target-board-get-off) + (= v1-3 'target-board-grab) + (= v1-3 'target-board-clone-anim) + ) + ) + ) + ) + (set! (-> self board latch?) #f) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + (if (-> self board board) + (mode-set! (-> self board board 0 main) (joint-mod-mode flex-blend)) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (logclear! (-> self focus-status) (focus-status board)) + (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape no-normal-reset)) + (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control mod-surface) *walk-mods*) + (logclear! (-> self target-flags) (target-flags tf6)) + (remove-setting! 'string-spline-max-move) + (remove-setting! 'string-spline-accel) + (remove-setting! 'string-spline-max-move-player) + (remove-setting! 'string-spline-accel-player) + (let ((v1-51 (-> self node-list data))) + (set! (-> v1-51 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-51 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-51 0 param2) (the-as basic (-> self control cspace-offset))) + ) + (target-collide-set! 'normal 0.0) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :board #x1) + ) + (sound-stop (-> self board wind-sound-id)) + (sound-stop (-> self board engine-sound-id)) + (sound-stop (-> self board bank-sound-id)) + (sound-stop (-> self board ride-sound-id)) + (sound-stop (-> self board spin-sound-id)) + (sound-stop (-> self board eco-sound-id)) + (sound-stop (-> self board charge-sound-id)) + (set! (-> self board spin-sound-id) (new 'static 'sound-id)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (set! (-> self control cspace-offset quad) (the-as uint128 0)) + (remove-setting! 'sound-flava) + (setting-control-method-14 *setting-control* (-> self board mode-sound-bank)) + (set! (-> self board mode-sound-bank) #f) + (set! (-> self pending-ext-anim) (target-anim default)) + (joint-control-cleanup + (-> self skel) + (-> self ext-anim-control heap) + (the-as art-joint-anim jakb-stance-loop-ja) + ) + (send-event (ppointer->process (-> self sidekick)) 'cleanup) + (if (and (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> self game features) + ) + (-> *setting-control* user-current board-trail) + ) + (set! (-> self fact eco-green) 0.0) + ) + (target-exit) + ) + (none) + ) + +;; definition for function target-board-falling-anim-trans +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-falling-anim-trans target () + (let ((v1-2 (ja-group))) + (cond + ((not (and v1-2 (= v1-2 jakb-board-jump-loop-ja))) + (ja-channel-push! 1 (seconds 0.33)) + (ja :group! jakb-board-jump-loop-ja) + ) + ((let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 jakb-board-jump-loop-ja)) + ) + (ja :num! (loop!)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function board-on-ground? +(defbehavior board-on-ground? target () + (logtest? (-> self control status) (collide-status on-surface)) + ) + +;; definition for function target-board-smack-surface? +;; INFO: Used lq/sq +(defbehavior target-board-smack-surface? target () + (when (and (logtest? (-> self control status) (collide-status touch-wall)) + (< (+ (current-time) (seconds -0.05)) (-> self control last-time-touching-actor)) + (< 0.7 (-> self control touch-angle)) + (< 73728.0 (-> self control ctrl-xz-vel)) + (and (< (vector-dot (-> self control wall-contact-normal) (-> self control dynam gravity-normal)) 0.3) + (not (logtest? (-> self control status) (collide-status touch-actor))) + ) + ) + (set-time! (-> self board smack-surface-time)) + (set! (-> self board smack-speed) (-> self control ctrl-xz-vel)) + (set! (-> self board smack-normal quad) (-> self control wall-contact-normal quad)) + #t + ) + ) + +;; definition for function board-add-thrust +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior board-add-thrust target () + (let ((gp-0 (-> self control transv-ctrl))) + (let* ((v1-1 gp-0) + (f0-7 (cond + ((= (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 0.0) + 0.0 + ) + (else + (let ((f0-5 (-> gp-0 z)) + (v1-4 gp-0) + ) + (/ f0-5 (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z))))) + ) + ) + ) + ) + (f30-0 + (if (>= f0-7 0.0) + (+ (* f0-7 (-> self control current-surface seek0)) (* (- 1.0 f0-7) (-> self control current-surface seek90))) + (+ (* (fabs f0-7) (-> self control current-surface seek180)) + (* (+ 1.0 f0-7) (-> self control current-surface seek90)) + ) + ) + ) + (f28-0 (cond + ((-> self board stick-off) + 0.0 + ) + ((= (-> self control ground-pat mode) (pat-mode halfpipe)) + 1.0 + ) + (*target-rc-board-controls* + 1.0 + ) + ((< (-> gp-0 z) 0.0) + (fmax 0.75 (-> self control turn-to-magnitude)) + ) + (else + (-> self control turn-to-magnitude) + ) + ) + ) + ) + (when (not (or (= (-> self control current-surface vel-turn) 0.0) (< (-> gp-0 z) 0.0))) + (let ((f0-22 (atan (-> gp-0 x) (-> gp-0 z)))) + (vector-rotate-y! gp-0 gp-0 (fmin + (* 0.03 (-> self clock time-adjust-ratio) (- f0-22)) + (* (-> self control current-surface vel-turn) (seconds-per-frame)) + ) + ) + ) + ) + (let* ((f0-28 (* f30-0 (-> self board thrust-scale) (lerp-scale 0.4 1.0 f28-0 0.3 1.0))) + (f1-22 (-> self control current-surface target-speed)) + (f1-23 + (if (< (-> self control local-slope-z) 0.0) + (+ f1-22 (* (- (-> self control local-slope-z)) (-> self control current-surface slope-down-factor))) + (+ f1-22 (* (- (-> self control local-slope-z)) (-> self control current-surface slope-up-factor))) + ) + ) + ) + (when (-> self board stick-off) + (set! f0-28 0.0) + (set! f1-23 0.0) + ) + (when (and (not (time-elapsed? (-> self control last-time-touching-actor) (seconds 1))) + (>= f28-0 0.5) + (< (vector-dot (-> self control wall-contact-normal) (-> self control to-target-pt-xz)) -0.7) + (logtest? (-> self control mod-surface flags) (surface-flag air)) + (< 0.0 (-> gp-0 y)) + ) + (cond + ((and (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.1)) + (< 0.3 (-> self control blocked-factor)) + ) + (set! f0-28 f1-23) + ) + ((< (-> gp-0 z) 0.0) + (set! (-> gp-0 z) 0.0) + ) + ) + ) + (+! (-> gp-0 z) (* f0-28 (seconds-per-frame))) + (when (!= f1-23 0.0) + (let ((f0-33 (- 1.0 (/ (* f30-0 (seconds-per-frame)) f1-23)))) + (set! (-> gp-0 x) (* (-> gp-0 x) f0-33)) + (set! (-> gp-0 z) (* (-> gp-0 z) f0-33)) + ) + ) + (set! (-> self board transv-max) f1-23) + ) + ) + (let ((f0-35 (-> self control current-surface transv-max)) + (v1-87 gp-0) + ) + (if (>= (sqrtf (+ (* (-> v1-87 x) (-> v1-87 x)) (* (-> v1-87 z) (-> v1-87 z)))) f0-35) + (vector-xz-normalize! gp-0 f0-35) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-matrix*! s5-0 gp-0 (-> self control c-R-w)) + (vector-float*! s5-0 s5-0 0.5) + (vector+! s5-0 s5-0 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + s5-0 + (meters 0.2) + "ltransv" + (the-as rgba (new 'static 'rgba :g #xff :a #x80)) + ) + (set! (-> s5-0 quad) (-> self control btransv quad)) + (vector-float*! s5-0 s5-0 0.5) + (vector+! s5-0 s5-0 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + s5-0 + (meters 0.2) + "btransv" + (the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function segment-array-vector->index +(defun segment-array-vector->index ((arg0 (inline-array vector)) (arg1 int) (arg2 float) (arg3 float)) + (let ((gp-0 -1) + (f30-0 0.0) + (f0-0 0.0) + ) + (while (< (+ gp-0 1) arg1) + (+! gp-0 1) + (set! f30-0 (vector-segment-overlap (the-as vector arg2) (-> arg0 gp-0) (-> arg0 (+ gp-0 1)))) + (set! f0-0 (/ arg3 (vector-vector-distance (-> arg0 gp-0) (-> arg0 (+ gp-0 1))))) + (if (>= 1.0 (+ f30-0 f0-0)) + (return (+ (the float gp-0) f30-0 f0-0)) + ) + ) + (+ (the float gp-0) f30-0 f0-0) + ) + ) + +;; definition for function segment-array-index->vector +(defun segment-array-index->vector ((arg0 (inline-array vector)) (arg1 int) (arg2 float) (arg3 vector)) + (let ((v0-0 (the int arg2))) + (let* ((f0-2 arg2) + (f0-4 (- f0-2 (the float (the int f0-2)))) + ) + (when (>= v0-0 arg1) + (set! v0-0 (+ arg1 -1)) + (set! f0-4 (- arg2 (the float v0-0))) + ) + (let ((v1-5 (-> arg0 v0-0)) + (a1-3 (-> arg0 (+ v0-0 1))) + ) + (vector+float*! arg3 v1-5 (vector-! (new 'stack-no-clear 'vector) a1-3 v1-5) f0-4) + ) + ) + v0-0 + ) + ) + +;; definition for function target-board-exit-check +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-exit-check target () + (if (and (or (and (cpad-pressed? (-> self control cpad number) r2) + (or (!= *cheat-mode* 'debug) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) + ) + (not *pause-lock*) + (!= (-> *setting-control* user-current board) 'force) + ) + (or (logtest? (target-flags prevent-board) (-> self target-flags)) + (not (logtest? (logand (game-feature board) (-> *setting-control* user-current features)) (-> self game features)) + ) + ) + ) + (and (not (focus-test? self dead grabbed)) + (time-elapsed? (-> self board board-get-on-time) (seconds 1)) + (< (-> self board board-get-on-time) + (max (-> self control list-time-on-ground) (-> self control last-time-of-stuck)) + ) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-grab))) + ) + ) + (go target-board-get-off (process->handle self) #f) + ) + 0 + (none) + ) + +;; definition for function target-board-trail +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-trail target () + (when (and (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> self game features) + ) + (-> *setting-control* user-current board-trail) + (focus-test? self board) + (< 0.0 (-> self fact eco-green)) + ) + (target-board-green-eco-attack #f) + (target-board-green-eco-use 0.075) + ) + 0 + (none) + ) + +;; definition for function target-board-effect +(defbehavior target-board-effect target () + (let ((gp-0 0)) + (cond + ((focus-test? self rail) + (set! gp-0 10) + ) + ((= (-> self control mod-surface name) 'spin) + (set! gp-0 3) + ) + ((and (-> self next-state) (= (-> self next-state name) 'target-board-flip)) + (set! gp-0 4) + ) + ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (set! gp-0 1) + ) + ((not (logtest? (-> self control status) (collide-status on-surface))) + (set! gp-0 2) + ) + ) + (if (board-on-ground?) + (seek! (-> self board sound-air-knob) 0.0 (* 16.0 (seconds-per-frame))) + (seek! + (-> self board sound-air-knob) + (lerp-scale 0.0 1.0 (target-height-above-ground) 409.6 28672.0) + (* 2.0 (seconds-per-frame)) + ) + ) + (let ((f30-0 (fabs (/ (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames))))) + (seek! (-> self board sound-bank-knob) f30-0 (if (< (-> self board sound-bank-knob) f30-0) + (* 0.5 (seconds-per-frame)) + (seconds-per-frame) + ) + ) + (set! (-> self board engine-sound-volume) (lerp-scale 0.8 1.0 f30-0 0.0 1.0)) + ) + (set! (-> self board engine-sound-pitch) + (+ (lerp-scale 0.0 -0.1 (-> self board sound-bank-knob) 0.0 1.0) + (lerp-scale -0.15 0.0 (-> self board shock-offset) -3072.0 52.0192) + ) + ) + (set! (-> self board bank-sound-volume) (lerp-scale 0.0 1.0 (-> self board sound-bank-knob) 0.0 1.0)) + (set! (-> self board bank-sound-pitch) (lerp-scale 0.0 -0.2 (-> self board sound-bank-knob) 0.0 1.0)) + 0 + (let ((f0-25 (-> self board sound-air-knob))) + (if (< 0.0 f0-25) + (set! (-> self board engine-sound-volume) (lerp-scale (-> self board engine-sound-volume) 0.3 f0-25 0.0 1.0)) + ) + ) + (let ((t9-12 sound-play-by-spec) + (a0-18 (static-sound-spec "board-steady" :group 1 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-18 volume) (the int (* 1024.0 (-> self board engine-sound-volume)))) + (set! (-> a0-18 pitch-mod) (the int (* 1524.0 (-> self board engine-sound-pitch)))) + (set! (-> a0-18 reg 0) (the-as uint gp-0)) + (t9-12 a0-18 (-> self board engine-sound-id) (the-as vector #t)) + ) + (if (< (-> self board bank-sound-volume) 0.1) + (sound-stop (-> self board bank-sound-id)) + (sound-play-by-name + (static-sound-name "board-bank") + (-> self board bank-sound-id) + (the int (* 1024.0 (-> self board bank-sound-volume))) + (the int (* 1524.0 (-> self board bank-sound-pitch))) + 0 + (sound-group) + #t + ) + ) + (let ((t9-15 sound-play-by-spec) + (a0-23 (static-sound-spec "board-wind" :group 1 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-23 volume) (the int (-> self board wind-sound-volume))) + (set! (-> a0-23 pitch-mod) (the int (-> self board wind-sound-pitch))) + (set! (-> a0-23 reg 0) (the-as uint gp-0)) + (t9-15 a0-23 (-> self board wind-sound-id) (the-as vector #t)) + ) + ) + (cond + ((= (-> self control mod-surface name) 'spin) + (seek! + (-> self board spin-sound-volume) + (lerp-scale 0.0 1.0 (fabs (-> self board rotyv)) 0.0 91022.22) + (* 8.0 (seconds-per-frame)) + ) + (seek! + (-> self board spin-sound-pitch) + (lerp-scale 0.0 0.3 (fabs (-> self board rotyv)) 36408.89 91022.22) + (seconds-per-frame) + ) + (when *sound-player-enable* + (let ((v1-89 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-89 command) (sound-command set-param)) + (set! (-> v1-89 id) (-> self board spin-sound-id)) + (set! (-> v1-89 params volume) (the int (* 1024.0 (-> self board spin-sound-volume)))) + (set! (-> v1-89 params mask) (the-as uint 1)) + (-> v1-89 id) + ) + ) + ) + (else + (set! (-> self board spin-sound-volume) 0.0) + ) + ) + (when (and (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> self game features) + ) + (and (-> *setting-control* user-current board-trail) + (focus-test? self board) + (< 0.0 (-> self fact eco-green)) + ) + ) + (seek! (-> self board eco-sound-volume) 1.0 (seconds-per-frame)) + (let ((t9-22 sound-play-by-spec) + (a0-43 (static-sound-spec "eco-loop" :group 1 :volume 0.0)) + ) + (set! (-> a0-43 volume) (the int (* 1024.0 (-> self board eco-sound-volume)))) + (t9-22 a0-43 (-> self board eco-sound-id) (the-as vector #t)) + ) + ) + (when (and (< (* (-> self board turn-anim-frame) (-> self board unk-float001)) 0.0) + (time-elapsed? (-> self board adjust-time) (seconds 0.5)) + ) + (set-time! (-> self board adjust-time)) + (sound-play "board-adjust") + ) + (if (!= (-> self board upper-body-rotyv) 0.0) + (mode-set! (-> self board upper-body) (joint-mod-mode rotate)) + ) + (when (= (-> self board upper-body mode) (joint-mod-mode rotate)) + (set! (-> self board upper-body-rotyv) + (* 0.95 (fmax + (fmin (-> self board upper-body-rotyv) (-> self board upper-body-rotyv-max)) + (- (-> self board upper-body-rotyv-max)) + ) + ) + ) + (+! (-> self board upper-body-rotyv) (* -10.0 (seconds-per-frame) (-> self board upper-body-roty))) + (let ((f1-25 (* (-> self board upper-body-rotyv) (seconds-per-frame))) + (f0-74 (-> self board upper-body-roty)) + ) + (+! (-> self board upper-body-roty) f1-25) + (when (< (* f0-74 (-> self board upper-body-roty)) 0.0) + (set! (-> self board upper-body-roty) 0.0) + (set! (-> self board upper-body-rotyv) 0.0) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + ) + ) + (twist-set! (-> self board upper-body) (the-as float #f) (-> self board upper-body-roty) (the-as float #f)) + ) + (when (and (board-on-ground?) + (not (or (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2)) + (zero? (-> self skel active-channels)) + ) + ) + ) + (spawn (-> self board effect-part) (-> self control trans)) + (do-effect (-> self skel effect) (the-as symbol "effect-board-poof") 0.0 -1) + (if (< (-> self board shock-offset) -2048.0) + (do-effect (-> self skel effect) (the-as symbol "effect-board-poof") 0.0 -1) + ) + ) + (vector-lerp! (-> self board slow-transv) (-> self board slow-transv) (-> self control transv) 0.2) + (if (< (-> self board slow-transv y) 0.0) + (set! (-> self board slow-transv y) 0.0) + ) + (if (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> self game features) + ) + (target-board-trail) + ) + (none) + ) + +;; definition for function target-board-physics +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-physics target ((arg0 vector)) + (let ((f30-0 0.5)) + (if (time-elapsed? (-> self board unk-time-frame01) (seconds 0.3)) + (+! (-> self board shock-offsetv) (* (- (-> arg0 y) (-> self control transv y)) f30-0)) + (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + ) + (+! (-> self board shock-offsetv) + (+ (* -10.0 (seconds-per-frame) (-> self board shock-offset)) + (if (board-on-ground?) + (* (-> self control dynam gravity-length) (seconds-per-frame) f30-0) + 0.0 + ) + ) + ) + ) + (cond + ((= (-> self control mod-surface mode) 'ride) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self board shock-offset) (* 0.96 (-> self board shock-offset))) + ) + ((and (or (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.2))) + (< (-> self board shock-offset) 0.0) + ) + (!= (-> self control mod-surface mode) 'air) + ) + (+! (-> self board shock-offset) (* (-> self board shock-offsetv) (seconds-per-frame))) + ) + ) + (set! (-> self board shock-offset) + (* (-> self board shock-offset) (lerp-scale 0.99 0.98 (-> self control ctrl-xz-vel) 0.0 28672.0)) + ) + (cond + ((< 40960.0 (-> self board shock-offset)) + (set! (-> self board shock-offset) 40960.0) + (set! (-> self board shock-offsetv) 0.0) + ) + ((< (-> self board shock-offset) -3072.0) + (when (< (-> self board shock-offsetv) -12288.0) + (case (-> self control ground-pat material) + (((pat-material waterbottom)) + (let ((gp-1 (sound-play "swim-enter" :pitch -0.5)) + (v1-62 (the-as sound-rpc-set-param (get-sound-buffer-entry))) + ) + (set! (-> v1-62 command) (sound-command set-param)) + (set! (-> v1-62 id) gp-1) + (set! (-> v1-62 params volume) -4) + (set! (-> v1-62 params fo-curve) 1) + (set! (-> v1-62 auto-time) 480) + (set! (-> v1-62 auto-from) 2) + (set! (-> v1-62 params mask) (the-as uint 273)) + (-> v1-62 id) + ) + ) + (else + (sound-play-by-name + (static-sound-name "board-bounce") + (new-sound-id) + (the int (* 1024.0 (lerp-scale 1.0 0.3 (-> self board shock-offsetv) -40960.0 -12288.0))) + 0 + 0 + (sound-group) + #t + ) + ) + ) + ) + (set! (-> self board shock-offset) -3072.0) + (set! (-> self board shock-offsetv) 0.0) + (cond + ((logtest? (-> *part-group-id-table* 23 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-3 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-3 + (let ((t9-9 (method-of-type part-tracker-subsampler activate))) + (t9-9 (the-as part-tracker-subsampler gp-3) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-10 run-function-in-process) + (a0-31 gp-3) + (a1-8 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 23)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-10) a0-31 a1-8 *part-tracker-subsampler-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-4 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-4 + (let ((t9-12 (method-of-type part-tracker activate))) + (t9-12 (the-as part-tracker gp-4) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-13 run-function-in-process) + (a0-37 gp-4) + (a1-11 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 23)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-13) a0-37 a1-11 *part-tracker-params-default*) + ) + (-> gp-4 ppointer) + ) + ) + ) + ) + ) + ) + (set! (-> self control draw-offset y) + (+ (-> self board cushion-base) (-> self board cushion-offset) (-> self board shock-offset)) + ) + (if (< (-> self control draw-offset y) 0.0) + (set! (-> self control draw-offset y) 0.0) + ) + 0 + (none) + ) + +;; definition for function target-board-collision +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-collision target () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control transv quad)) + (when (focus-test? self halfpipe) + (when (-> self control unknown-spool-anim00) + *edge-grab-info* + (let ((v1-9 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control edge-grab-across-edge-dir) (-> self control transv))) + ) + 0.0 + (vector-! + v1-9 + (-> self control transv) + (vector-float*! v1-9 (-> self control edge-grab-across-edge-dir) f0-1) + ) + (let* ((f1-2 (vector-length v1-9)) + (f2-0 f1-2) + ) + (if (< 0.0 f0-1) + (set! f0-1 -2048.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control edge-grab-across-edge-dir) f0-1) + (vector-float*! v1-9 v1-9 (/ f1-2 f2-0)) + ) + ) + ) + ) + ) + (let ((a2-6 (new 'stack-no-clear 'collide-query)) + (v1-10 (-> self control)) + ) + (set! (-> a2-6 collide-with) (-> v1-10 root-prim prim-core collide-with)) + (set! (-> a2-6 ignore-process0) self) + (set! (-> a2-6 ignore-process1) #f) + (set! (-> a2-6 ignore-pat) (-> v1-10 pat-ignore-mask)) + (set! (-> a2-6 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-10 (-> v1-10 transv) a2-6 (meters 1)) + ) + (when (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (= (-> self ext-anim) (target-anim board)) + ) + (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one)) + (set! (-> *collide-edge-board-spec* touching-segment) #f) + (target-method-28 *target* *collide-cache* *collide-edge-board-spec*) + ) + (target-board-physics gp-0) + (deg-diff (vector-y-angle gp-0) (vector-y-angle (-> self control transv))) + (let* ((v1-25 gp-0) + (f30-0 (sqrtf (+ (* (-> v1-25 x) (-> v1-25 x)) (* (-> v1-25 z) (-> v1-25 z))))) + ) + (when (and (logtest? (-> self control status) (collide-status touch-wall)) + (and (< 16384.0 f30-0) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-smack))) + (not (focus-test? self halfpipe)) + (!= (-> self control ground-pat mode) 3) + (time-elapsed? (-> self board halfpipe-time) (seconds 0.1)) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> self control wall-contact-normal quad)) + (vector-normalize! s5-1 1.0) + (let ((s3-0 (vector-reflect! (new 'stack-no-clear 'vector) gp-0 s5-1)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-1 quad) (-> self control c-R-w fvec quad)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (set! (-> s4-1 y) 0.0) + (vector-normalize! s4-1 1.0) + (let ((f0-11 (y-angle (-> self control)))) + (deg-diff f0-11 (vector-y-angle s3-0)) + ) + (let ((s2-1 (vector-matrix*! (new 'stack-no-clear 'vector) (-> self control transv) (-> self control w-R-c))) + (s3-1 (vector-matrix*! (new 'stack-no-clear 'vector) s3-0 (-> self control w-R-c))) + ) + (logior! (-> self control status) (collide-status glance)) + (set-time! (-> self board glance-time)) + (let ((v1-64 s2-1)) + (set! (-> self board glance-speed) (sqrtf (+ (* (-> v1-64 x) (-> v1-64 x)) (* (-> v1-64 z) (-> v1-64 z))))) + ) + (set! (-> self board glance-normal quad) (-> s5-1 quad)) + (set! (-> self board glance-in-transv quad) (-> gp-0 quad)) + (set! (-> s3-1 y) (-> s2-1 y)) + (vector-xz-normalize! s3-1 (-> self board glance-speed)) + (vector-matrix*! (-> self control transv) s3-1 (-> self control c-R-w)) + ) + (set! (-> self board glance-out-transv quad) (-> self control transv quad)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (when (and (< (vector-dot s4-1 s5-1) -0.77) (not (logtest? (-> self focus-status) (focus-status dead hit)))) + (cond + ((not (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + ) + (if (< 32768.0 f30-0) + (sound-play "board-glance") + ) + (go target-board-turn-to (-> self control transv) (seconds 0.2)) + ) + (else + (set! (-> self control turn-lockout-end-time) + (the-as time-frame (max (+ (current-time) (seconds 0.1)) (-> self control turn-lockout-end-time))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'collide-query))) + (let ((v1-103 gp-3)) + (set! (-> v1-103 radius) 1638.4) + (set! (-> v1-103 collide-with) + (logclear (-> self control root-prim prim-core collide-with) (collide-spec crate)) + ) + (set! (-> v1-103 ignore-process0) self) + (set! (-> v1-103 ignore-process1) #f) + (set! (-> v1-103 ignore-pat) (-> self control pat-ignore-mask)) + (set! (-> v1-103 action-mask) (collide-action solid)) + ) + (vector+float*! (-> gp-3 start-pos) (-> self control trans) (-> self control c-R-w fvec) 10240.0) + (vector+float*! (-> gp-3 start-pos) (-> gp-3 start-pos) (-> self control dynam gravity-normal) 8192.0) + (vector-float*! (-> gp-3 move-dist) (-> self control dynam gravity-normal) -49152.0) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-3) 0.0) + (set! (-> self board probe-intersect quad) (-> gp-3 best-other-tri intersect quad)) + (set! (-> self board probe-normal quad) (-> gp-3 best-other-tri normal quad)) + (set! (-> self board probe-pat) (-> gp-3 best-other-tri pat)) + (set! (-> self board probe) #t) + ) + (else + (set! (-> self board probe) #f) + ) + ) + ) + (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) + ) + (set-time! (-> self control last-time-of-stuck)) + ) + 0 + (none) + ) + +;; definition for function target-board-joint-points +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-joint-points target () + (when (-> self board board) + (let ((a1-0 (-> self node-list data 37 bone transform))) + (matrix->transformq (the-as transformq (-> self board board-trans)) a1-0) + ) + (set! (-> self board board-scale quad) (-> self control scale quad)) + (let ((a0-4 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *board-shadow-control* settings shadow-dir quad) a0-4) + ) + ) + 0 + (none) + ) + +;; definition for function target-board-pre-move +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-pre-move target () + (cond + ((and (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (begin + (set-time! (-> self board in-air-time)) + (and (not (and (-> self next-state) + (let ((v1-12 (-> self next-state name))) + (or (= v1-12 'target-board-stance) (= v1-12 'target-board-duck-stance) (= v1-12 'target-board-turn-to)) + ) + ) + ) + (and (or (and (or (< 20480.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + ) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (< (-> self control gspot-slope-z) 0.0) + ) + (or (not (or (= (-> self control gspot-pat-surfce mode) (pat-mode ground)) + (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + ) + ) + (or (= (-> self control gspot-pat-surfce event) (pat-event rail)) + (and (logtest? (-> self water flags) (water-flag active)) + (< (-> self control gspot-pos y) (-> self water surface-height)) + ) + (and (and (-> self next-state) + (let ((v1-53 (-> self next-state name))) + (or (= v1-53 'target-board-hold) (= v1-53 'target-board-trickx) (= v1-53 'target-board-tricky)) + ) + ) + (not (logtest? (focus-status halfpipe) (-> self focus-status))) + ) + (and (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + (and (< (fabs (vector-dot (-> self control gspot-normal) (-> self control dynam gravity-normal))) 0.7) + (not (logtest? (focus-status halfpipe) (-> self focus-status))) + ) + ) + ) + ) + ) + (time-elapsed? (-> self board last-jump-time) (seconds 0.2)) + ) + ) + ) + ) + (set! (-> self control bend-speed) 0.0) + (set! (-> self control bend-target) 0.0) + ) + (else + (set! (-> self control bend-speed) 1024.0) + (set! (-> self control bend-target) 1.0) + (when (not (time-elapsed? (-> self board last-jump-time) (seconds 0.1))) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + (-> self control gspot-normal) + ) + (quaternion-slerp! + (-> self control quat-for-control) + (-> self control quat-for-control) + (-> self control dir-targ) + 0.1 + ) + ) + ) + ) + (if (and (cpad-hold? (-> self control cpad number) square) (not (-> self board ride-lock))) + (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) + (logclear! (-> self control root-prim prim-core action) (collide-action check-edge)) + ) + (if (not (cpad-hold? (-> self control cpad number) square)) + (set! (-> self board ride-lock) #f) + ) + (cond + ((and (-> self next-state) (let ((v1-121 (-> self next-state name))) + (or (= v1-121 'target-board-get-on) (= v1-121 'target-board-get-off)) + ) + ) + ) + ((and (-> self next-state) + (let ((v1-126 (-> self next-state name))) + (or (= v1-126 'target-board-trickx) (= v1-126 'target-board-tricky) (= v1-126 'target-board-hold)) + ) + ) + (seek! (-> self control dynam gravity-length) 245760.0 (* 30.0 (seconds-per-frame))) + ) + ((= (-> self control mod-surface name) 'spin) + (set! (-> self control dynam gravity-length) + (lerp-scale 245760.0 204800.0 (fabs (-> self board rotyv)) 0.0 145635.56) + ) + ) + ((and (-> self next-state) (= (-> self next-state name) 'target-board-halfpipe)) + (if (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self control dynam gravity-length) 163840.0) + ) + ) + ((and (-> self next-state) + (let ((v1-159 (-> self next-state name))) + (or (= v1-159 'target-board-stance) (= v1-159 'target-board-duck-stance) (= v1-159 'target-board-turn-to)) + ) + ) + (cond + (#f + (set! (-> self control dynam gravity-length) 245760.0) + ) + ((time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) + (seek! (-> self control dynam gravity-length) 245760.0 (* 245760.0 (seconds-per-frame))) + ) + (else + (set! (-> self control dynam gravity-length) 81920.0) + ) + ) + ) + (else + (set! (-> self control dynam gravity-length) 245760.0) + ) + ) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (if (< (-> self control force-turn-to-strength) 0.0) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> self control cpad stick0-speed))) + ) + (when (and (-> self board probe) (not (logtest? (focus-status halfpipe) (-> self focus-status)))) + (let ((f30-0 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self board probe-intersect) (-> self control trans)) + ) + ) + (f26-0 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self board probe-intersect) (-> self control gspot-pos)) + ) + ) + (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (let ((f0-36 + (* (-> self control local-slope-z) + (vector-length + (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self board probe-intersect)) + (-> self control standard-dynamics gravity-normal) + ) + ) + ) + ) + ) + (when (and (= (-> self board probe-pat mode) (pat-mode ground)) + (!= (-> self board probe-pat event) 13) + (time-elapsed? (-> self board unk-time-frame01) (seconds 0.2)) + (< 819.2 (- f30-0 f0-36)) + (or (< (-> self board jump-end-time) (-> self control last-time-on-surface)) + (not (time-elapsed? (-> self board jump-end-time) (seconds 0.2))) + ) + (< 0.98 (vector-dot (-> self board probe-normal) (-> self control standard-dynamics gravity-normal))) + (< f26-0 8192.0) + (< f30-0 8192.0) + (or (< (* 0.2 f28-0) f30-0) (not (time-elapsed? (-> self board last-jump-time) (seconds 0.1)))) + ) + (vector+float*! + (-> self control transv) + (-> self control transv) + (-> self control dynam gravity-normal) + (* 7.0 (fmin 4096.0 f30-0)) + ) + (if (time-elapsed? (-> self board last-jump-time) (seconds 0.1)) + (set-time! (-> self board jump-end-time)) + ) + (set-time! (-> self board last-jump-time)) + ) + ) + (when (and (not (logtest? (-> self control status) (collide-status on-surface))) + (< 0.0 f28-0) + (or (and (or (< (target-height-above-ground) 4096.0) + (not (time-elapsed? (-> self board last-jump-time) (seconds 0.1))) + ) + (< 8192.0 (- f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self board slow-transv)))) + ) + (not (time-elapsed? (-> self board unk-time-frame01) (seconds 0.1))) + ) + (>= 204.8 f30-0) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-jump))) + ) + (set-time! (-> self board unk-time-frame01)) + (vector-length (-> self control transv)) + (let ((v1-303 (new-stack-vector0)) + (f0-51 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-303 + (-> self control transv) + (vector-float*! v1-303 (-> self control dynam gravity-normal) f0-51) + ) + (let* ((f1-24 (vector-length v1-303)) + (f2-0 f1-24) + (f0-52 (* 0.9 f0-51)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-52) + (vector-float*! v1-303 v1-303 (/ f1-24 f2-0)) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-board-real-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-real-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (target-board-pre-move) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (when (-> self board stick-off) + (let ((f0-5 0.0)) + (set! (-> self control cpad stick0-speed) f0-5) + (set! (-> self control pad-magnitude) f0-5) + ) + ) + (when *target-rc-board-controls* + (vector-rotate-y! + s5-0 + (-> self control c-R-w fvec) + (* -42.666668 (+ -128.0 (the float (-> self control cpad leftx)))) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> self control trans) + s5-0 + (meters 2) + (the-as rgba (new 'static 'rgba :g #xff :a #x80)) + ) + ) + (turn-to-vector s5-0 (-> self control pad-magnitude)) + ) + (if (and (= (-> self control pad-magnitude) 0.0) + (>= (current-time) (-> self control turn-lockout-end-time)) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) + (time-elapsed? (-> self board last-jump-time) (seconds 0.1)) + ) + (rot->dir-targ! (-> self control)) + ) + (when (and (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1))) + (>= (current-time) (-> self control turn-lockout-end-time)) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) + (time-elapsed? (-> self board last-jump-time) (seconds 0.1)) + ) + (let* ((s3-0 + (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal)) + (-> self control local-normal) + ) + ) + (a2-4 + (forward-up-nopitch->quaternion + (new 'stack-no-clear 'quaternion) + s3-0 + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + ) + ) + (quaternion-slerp! + (-> self control dir-targ) + (-> self control dir-targ) + a2-4 + (* 0.05 (fabs (-> self control ctrl-slope-heading))) + ) + ) + ) + (if (cpad-pressed? (-> self control cpad number) l1) + (set-time! (-> self board duck-start-time)) + ) + (if (cpad-pressed? (-> self control cpad number) l2) + (set-time! (-> self board l2-start-time)) + ) + (board-add-thrust) + (add-gravity) + (cond + ((= (-> self control mod-surface name) 'spin) + (set! (-> self board rotyv) + (* 0.95 (fmax (fmin (-> self board rotyv) (-> self board rotyv-max)) (- (-> self board rotyv-max)))) + ) + (let ((f0-15 (* (-> self board rotyv) (seconds-per-frame)))) + (set! (-> self board roty) (the float (sar (shl (the int (+ (-> self board roty) f0-15)) 48) 48))) + (set! (-> self board unk-deg00) (-> self board roty-cum)) + (+! (-> self board roty-cum) f0-15) + ) + (seek! (-> self board rotyv-max) 91022.22 (* 91022.22 (seconds-per-frame))) + (mode-set! (-> self board main) (joint-mod-mode rotate)) + (twist-set! (-> self board main) (the-as float #f) (-> self board roty) (the-as float #f)) + (mode-set! (-> self board board 0 main) (joint-mod-mode rotate)) + (twist-set! (-> self board board 0 main) (the-as float #f) (-> self board roty) (the-as float #f)) + ) + (else + (cond + ((!= (-> self board main mode) (joint-mod-mode flex-blend)) + (let ((f0-24 (fabs (-> self board roty-cum)))) + (cond + ((>= f0-24 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-spin) 4000.0) + ) + ((>= f0-24 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-spin) 2000.0) + ) + ((>= f0-24 49152.0) + (add-to-trick-list (-> self board) (board-tricks board-spin) 500.0) + ) + ) + ) + (let ((v1-142 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-142 command) (sound-command set-param)) + (set! (-> v1-142 id) (-> self board spin-sound-id)) + (set! (-> v1-142 params volume) -4) + (set! (-> v1-142 auto-time) 120) + (set! (-> v1-142 auto-from) 2) + (set! (-> v1-142 params mask) (the-as uint 17)) + (-> v1-142 id) + ) + (set! (-> self board spin-sound-id) (new 'static 'sound-id)) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board board 0 main) (joint-mod-mode flex-blend)) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (set! (-> s5-3 quad) (-> self node-list data 3 bone transform fvec quad)) + (vector-rotate-y! s5-3 s5-3 15109.688) + (if (not (and (-> self next-state) + (let ((v1-160 (-> self next-state name))) + (or (= v1-160 'target-board-flip) + (= v1-160 'target-board-hold) + (= v1-160 'target-board-trickx) + (= v1-160 'target-board-tricky) + ) + ) + ) + ) + (forward-up-nopitch->quaternion + (-> self control quat-for-control) + s5-3 + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + ) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self board upper-body-rotyv) (-> self board rotyv)) + (set! (-> self board roty) 0.0) + (set! (-> self board rotyv) 0.0) + ) + ((and (= (-> self control danger-mode) 'board-spin) + (or (board-on-ground?) (time-elapsed? (-> self board spin-time) (seconds 0.5))) + ) + (target-danger-set! 'harmless #f) + ) + ) + (when (board-on-ground?) + (set! (-> self board spin-control) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board unk-float005) 0.0) + (set! (-> self board unk-float006) 0.0) + (set! (-> self board unk-float007) 0.0) + (set! (-> self board ride-rot-old) -1.0) + ) + ) + ) + (cond + ((and (cpad-pressed? (-> self control cpad number) l1) + (logtest? (game-feature board-launch) (-> self game features)) + ) + (set-time! (-> self board charge-start-time)) + ) + ((and (cpad-hold? (-> self control cpad number) l1) + (logtest? (game-feature board-launch) (-> self game features)) + ) + (when (board-on-ground?) + (set-time! (-> self board charge-time)) + (seek! + (-> self board charge-progress) + 1.0 + (* (/ 300.0 (the float (-> *TARGET_BOARD-bank* charge-jump-time))) (seconds-per-frame)) + ) + ) + (sound-play-by-name + (static-sound-name "board-charge") + (-> self board charge-sound-id) + (the int (* 1024.0 (-> self board charge-progress))) + 0 + 0 + (sound-group) + (-> self control trans) + ) + ) + ((!= (-> self board charge-progress) 0.0) + (seek! + (-> self board charge-progress) + 0.0 + (* (/ 300.0 (the float (-> *TARGET_BOARD-bank* charge-jump-fade-time))) (seconds-per-frame)) + ) + (if (= (-> self board charge-progress) 0.0) + (sound-stop (-> self board charge-sound-id)) + ) + ) + ) + (if (and (!= (-> self board charge-progress) 0.0) + (not (or (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2)) + (zero? (-> self skel active-channels)) + ) + ) + ) + (spawn + (-> self board charge-part) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg board)) + ) + ) + (cond + ((and (cpad-pressed? (-> self control cpad number) circle) + (time-elapsed? + (-> self board zap-start-time) + (+ (-> *TARGET_BOARD-bank* zap-duration) (-> *TARGET_BOARD-bank* zap-reset-time)) + ) + (not (-> self control danger-mode)) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (and (-> self next-state) (let ((v1-275 (-> self next-state name))) + (or (= v1-275 'target-board-get-on) (= v1-275 'target-board-get-off)) + ) + ) + ) + (not (logtest? (-> self focus-status) (focus-status dead hit grabbed))) + ) + (let ((s5-6 (matrix-identity! (new 'stack-no-clear 'matrix)))) + (sound-play "board-zap") + (target-start-attack) + (target-danger-set! 'board-zap #f) + (set-time! (-> self board zap-start-time)) + (matrix-identity! s5-6) + (vector<-cspace! (-> s5-6 trans) (joint-node jakb-lod0-jg board)) + ) + (cond + ((and (logtest? (the-as game-feature (logand (game-feature board-trail) (-> *setting-control* user-current features))) + (-> self game features) + ) + (-> *setting-control* user-current board-trail) + (focus-test? self board) + (< 0.0 (-> self fact eco-green)) + ) + (cond + ((logtest? (-> *part-group-id-table* 187 flags) (sp-group-flag sp13)) + (let ((s5-7 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-7 + (let ((t9-52 (method-of-type part-tracker-subsampler activate))) + (t9-52 (the-as part-tracker-subsampler s5-7) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-53 run-function-in-process) + (a0-113 s5-7) + (a1-46 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 187)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 37) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-53) a0-113 a1-46 *part-tracker-subsampler-params-default*) + ) + (-> s5-7 ppointer) + ) + ) + ) + (else + (let ((s5-8 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-8 + (let ((t9-55 (method-of-type part-tracker activate))) + (t9-55 (the-as part-tracker s5-8) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-56 run-function-in-process) + (a0-116 s5-8) + (a1-49 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 187)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 37) + ((the-as (function object object object none) t9-56) a0-116 a1-49 *part-tracker-params-default*) + ) + (-> s5-8 ppointer) + ) + ) + ) + ) + (target-board-green-eco-attack #t) + (target-board-green-eco-use 5.0) + ) + ((logtest? (-> *part-group-id-table* 188 flags) (sp-group-flag sp13)) + (let ((s5-9 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-9 + (let ((t9-60 (method-of-type part-tracker-subsampler activate))) + (t9-60 (the-as part-tracker-subsampler s5-9) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-61 run-function-in-process) + (a0-121 s5-9) + (a1-52 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 188)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 37) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-61) a0-121 a1-52 *part-tracker-subsampler-params-default*) + ) + (-> s5-9 ppointer) + ) + ) + ) + (else + (let ((s5-10 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-10 + (let ((t9-63 (method-of-type part-tracker activate))) + (t9-63 (the-as part-tracker s5-10) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-64 run-function-in-process) + (a0-124 s5-10) + (a1-55 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 188)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 37) + ((the-as (function object object object none) t9-64) a0-124 a1-55 *part-tracker-params-default*) + ) + (-> s5-10 ppointer) + ) + ) + ) + ) + (target-timed-invulnerable (-> *TARGET_BOARD-bank* zap-duration) self 2) + ) + ((and (-> self control danger-mode) + (time-elapsed? (-> self board zap-start-time) (-> *TARGET_BOARD-bank* zap-duration)) + ) + (target-danger-set! 'harmless #f) + ) + ) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (cond + ((and (-> self next-state) (= (-> self next-state name) 'target-board-get-off)) + (seek! (-> self board cushion-offset) 0.0 (* 20480.0 (seconds-per-frame))) + ) + ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (seek! + (-> self board cushion-offset) + (lerp-scale (-> *TARGET_BOARD-bank* cushion) 0.0 (target-height-above-ground) 0.0 12288.0) + (* 20480.0 (seconds-per-frame)) + ) + ) + ((focus-test? self on-water) + (seek! + (-> self board cushion-offset) + (+ 2048.0 (-> *TARGET_BOARD-bank* cushion)) + (* 20480.0 (seconds-per-frame)) + ) + ) + (else + (seek! (-> self board cushion-offset) (-> *TARGET_BOARD-bank* cushion) (* 8192.0 (seconds-per-frame))) + ) + ) + (target-board-collision) + (if (!= (-> self control bend-speed) 0.0) + (bend-gravity) + ) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (set-time! (-> self board board-time)) + (target-board-exit-check) + (target-board-effect) + (when (board-on-ground?) + (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + (set! (-> self board up-vector 0 quad) (-> self control local-normal quad)) + (if (= (-> self board roty-cum) 0.0) + (set! (-> self board ground-on-dir quad) (-> self node-list data 3 bone transform fvec quad)) + ) + ) + 0 + (none) + ) + +;; definition for function probe-test +;; INFO: Used lq/sq +(defun probe-test ((arg0 control-info) (arg1 vector) (arg2 pat-surface)) + (dotimes (s3-0 3) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-2 (-> arg0 collision-spheres s3-0))) + (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) + (set! (-> s2-0 move-dist quad) (-> arg1 quad)) + (let ((a0-3 s2-0)) + (set! (-> a0-3 radius) (* 0.5 (-> v1-2 prim-core world-sphere w))) + (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) + (set! (-> a0-3 ignore-process0) (-> arg0 process)) + (set! (-> a0-3 ignore-process1) #f) + (set! (-> a0-3 ignore-pat) arg2) + (set! (-> a0-3 action-mask) (collide-action solid)) + ) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) + (return (if (= (-> s2-0 best-other-tri pat event) (pat-event rail)) + 'rail + #t + ) + ) + ) + ) + ) + #f + ) + +;; definition for function target-board-compute-edge +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +;; INFO: Used lq/sq +(defbehavior target-board-compute-edge target () + (local-vars (sv-752 int)) + (let ((s4-0 *edge-grab-info*) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self control transv quad)) + (when (not (edge-grab-info-method-9 s4-0)) + (format #t "exit update~%") + (send-event self 'end-mode 'ride #f) + (return (the-as time-frame #f)) + ) + (vector-normalize-copy! (-> self board ride-dir) (-> self board ride-segment) 1.0) + (when (time-elapsed? (-> self board ride-time) (seconds 0.2)) + (set! (-> self board ride-lock-on) #f) + (set-time! (-> self board ride-start-time)) + (vector-normalize-copy! (-> self board ride-dir) (-> self control transv) 1.0) + (dotimes (v1-26 3) + (vector-reset! (-> self board ride-vertex-old v1-26)) + ) + ) + (set! (-> self board ride-rot-abs 1) (-> self board ride-rot-abs 0)) + (let* ((f30-0 (deg- (vector-y-angle (-> self board ride-dir)) (-> self board ride-rot-abs 0))) + (f30-1 (* f30-0 (lerp-scale 10.0 100.0 (fabs f30-0) 1820.4445 3640.889))) + ) + (+! (-> self board ride-rotv-abs) (* f30-1 (seconds-per-frame))) + (set! (-> self board ride-rotv-abs) (* 0.9 (-> self board ride-rotv-abs))) + (+! (-> self board ride-rot-abs 0) (* (-> self board ride-rotv-abs) (seconds-per-frame))) + (when (>= 0.0 (* f30-1 (deg- (vector-y-angle (-> self board ride-dir)) (-> self board ride-rot-abs 0)))) + (set! (-> self board ride-rotv-abs) 0.0) + (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-dir))) + ) + ) + (set! (-> self control ground-pat) (-> s4-0 edge-tri-pat)) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (-> s4-0 world-vertex 1) + (the-as vector (-> s4-0 world-vertex)) + ) + 1.0 + ) + (set! (-> self control edge-grab-across-edge-dir quad) (-> s4-0 hanging-matrix rvec quad)) + (when (< (vector-dot (-> self control edge-grab-edge-dir) (-> self board ride-dir)) 0.0) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> s4-0 world-vertex 0 quad)) + (set! (-> s4-0 world-vertex 0 quad) (-> s4-0 world-vertex 1 quad)) + (set! (-> s4-0 world-vertex 1 quad) (-> s3-2 quad)) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (-> s4-0 world-vertex 1) + (the-as vector (-> s4-0 world-vertex)) + ) + 1.0 + ) + (set! (-> s3-2 quad) (-> s4-0 adjacent-edge-left-vertex quad)) + (set! (-> s4-0 adjacent-edge-left-vertex quad) (-> s4-0 adjacent-edge-right-vertex quad)) + (set! (-> s4-0 adjacent-edge-right-vertex quad) (-> s3-2 quad)) + ) + (let ((v1-70 (logtest? (-> s4-0 status) 2))) + (if (logtest? (-> s4-0 status) 1) + (logior! (-> s4-0 status) 2) + (logand! (-> s4-0 status) -3) + ) + (if v1-70 + (logior! (-> s4-0 status) 1) + (logand! (-> s4-0 status) -2) + ) + ) + ) + (dotimes (v1-75 3) + (set! (-> self board ride-vertex-old v1-75 quad) (-> self board ride-vertex v1-75 quad)) + ) + (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) + (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) + (set! (-> self board ride-vertex-length-old) (-> self board ride-vertex-length)) + (set! (-> self board ride-vertex 0 quad) (-> s4-0 world-vertex 0 quad)) + (set! (-> self board ride-vertex 1 quad) (-> s4-0 world-vertex 1 quad)) + (set! (-> self board ride-vertex 2 quad) (the-as uint128 0)) + (set! (-> self board ride-vertex-length) 1) + (cond + ((logtest? (-> s4-0 status) 2) + (vector-normalize! + (vector-! (-> self control unknown-vector35) (-> s4-0 adjacent-edge-right-vertex) (-> s4-0 world-vertex 1)) + 1.0 + ) + (set! (-> self board ride-vertex 2 quad) (-> s4-0 adjacent-edge-right-vertex quad)) + (+! (-> self board ride-vertex-length) 1) + 0 + ) + (else + (set! (-> self control unknown-vector35 quad) (the-as uint128 0)) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (let ((s3-3 0)) + (label cfg-26) + (set! (-> self board ride-vertex-index) + (segment-array-vector->index + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (the-as float (-> self control trans)) + 0.0 + ) + ) + (when (and (< (-> self board ride-vertex-index) 0.0) + (not (time-elapsed? (-> self board ride-time) (seconds 0.2))) + (zero? s3-3) + ) + (+! s3-3 1) + (dotimes (v1-114 3) + (set! (-> self board ride-vertex v1-114 quad) (-> self board ride-vertex-old v1-114 quad)) + ) + (set! (-> self board ride-vertex-length) (-> self board ride-vertex-length-old)) + (goto cfg-26) + ) + ) + (set! (-> self board ride-vertex-index) (fmax 0.0 (-> self board ride-vertex-index))) + (set! (-> self board ride-vertex-base) + (segment-array-index->vector + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (-> self board ride-vertex-index) + s4-1 + ) + ) + (vector-! + (-> self board ride-segment) + (-> self board ride-vertex (+ (-> self board ride-vertex-base) 1)) + (-> self board ride-vertex (-> self board ride-vertex-base)) + ) + (dotimes (v1-128 3) + (set! (-> self board ride-vertex v1-128 w) 1.0) + ) + (when (time-elapsed? (-> self board ride-time) (seconds 0.2)) + (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-segment))) + (set! (-> self board ride-rotv-abs) 0.0) + ) + (let ((f0-25 (vector-vector-distance (-> self control trans) s4-1))) + (when #t + (let ((s3-5 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> self control trans)))) + (let ((f1-9 (* 12288.0 (seconds-per-frame)))) + (if (and (not (-> self board ride-lock-on)) (< f1-9 f0-25)) + (vector-normalize! s3-5 f1-9) + (set! (-> self board ride-lock-on) #t) + ) + ) + (if (probe-test (-> self control) s3-5 (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1)) + (logior! (-> self control status) (collide-status probe-hit)) + (move-by-vector! (-> self control) s3-5) + ) + ) + ) + ) + ) + (let ((f30-2 (-> self board ride-speed))) + (vector-normalize-copy! (-> self control to-target-pt-xz) (-> self board ride-segment) 1.0) + (vector-normalize-copy! (-> self control transv) (-> self board ride-segment) f30-2) + (vector-rotate-y! + (-> self board ride-dir-lean) + (-> self control to-target-pt-xz) + (* -4551.1113 (-> self board ride-lean)) + ) + (when (< (-> self board ride-vertex-base) (+ (-> self board ride-vertex-length) -1)) + (let ((a0-100 (-> self board ride-vertex (+ (-> self board ride-vertex-base) 1))) + (s4-2 0) + ) + (let ((s3-7 (vector-! (new 'stack-no-clear 'vector) (&+ a0-100 16) a0-100))) + (if (< 14563.556 (fabs (deg-diff (vector-y-angle s3-7) (vector-y-angle (-> self control to-target-pt-xz))))) + (set! s4-2 (logior s4-2 2)) + ) + (if (< (vector-length s3-7) (fmin 1024.0 (* 0.25 (vector-length (-> self board ride-segment))))) + (set! s4-2 (logior s4-2 32)) + ) + ) + (if (nonzero? s4-2) + (+! (-> self board ride-vertex-length) -1) + ) + ) + ) + (let ((s4-3 0)) + (if (if (time-elapsed? (-> self board ride-start-time) (seconds 0.1)) + (< (fabs f30-2) 2048.0) + (< (fabs f30-2) 16384.0) + ) + (set! s4-3 (logior s4-3 1)) + ) + (let* ((v1-198 (min (the int (-> self board ride-vertex-index)) (+ (-> self board ride-vertex-length) -1))) + (f28-2 + (vector-length + (vector-! + (new 'stack-no-clear 'vector) + (-> self board ride-vertex (+ v1-198 1)) + (-> self board ride-vertex v1-198) + ) + ) + ) + (s3-8 (new 'stack-no-clear 'collide-query)) + (f26-0 81920.0) + ) + (set! sv-752 8) + (let ((v1-205 s3-8)) + (set! (-> v1-205 radius) 1228.8) + (set! (-> v1-205 collide-with) + (logclear (-> self control root-prim prim-core collide-with) (collide-spec crate)) + ) + (set! (-> v1-205 ignore-process0) self) + (set! (-> v1-205 ignore-process1) #f) + (set! (-> v1-205 ignore-pat) (-> self control pat-ignore-mask)) + (set! (-> v1-205 action-mask) (collide-action solid)) + ) + (vector+float*! (-> s3-8 start-pos) (-> self control trans) (-> self board ride-dir) 3276.8) + (vector+float*! (-> s3-8 start-pos) (-> s3-8 start-pos) (-> self control dynam gravity-normal) 5324.8) + (vector-float*! (-> s3-8 move-dist) (-> self control dynam gravity-normal) -49152.0) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* s3-8) 0.0) + (set! f26-0 (- (-> self control trans y) (-> s3-8 best-other-tri intersect y))) + (set! sv-752 (the-as int (-> s3-8 best-other-tri pat))) + ) + (when (and (< (+ (the float (-> self board ride-vertex-length)) (/ 0.0 f28-2)) + (+ (-> self board ride-vertex-index) (/ (* (-> self board ride-speed) (seconds-per-frame)) f28-2)) + ) + (or (>= (-> self board ride-vertex-index) 3.0) + (and (>= f28-2 3686.4) + (and (or (>= f26-0 4096.0) (and (>= f26-0 2048.0) (zero? (shr (shl sv-752 54) 61)))) + (logtest? (shr (shl sv-752 57) 57) 8) + ) + ) + ) + ) + (format + #t + "end with length ~M sp:~M ang:~M b:~X ~f/~f~%" + f28-2 + (-> self board ride-speed) + f26-0 + sv-752 + (+ (-> self board ride-vertex-index) + (/ (* (-> self board ride-speed) (seconds-per-frame)) (vector-length (-> self board ride-segment))) + ) + (+ (the float (-> self board ride-vertex-length)) (/ 0.0 f28-2)) + ) + (set! s4-3 (logior s4-3 4)) + ) + ) + (let ((s3-9 (-> self board ride-vertex (-> self board ride-vertex-base)))) + (if (not (or (vector= s3-9 (the-as vector (-> self board ride-vertex-old))) + (vector= s3-9 (-> self board ride-vertex-old 1)) + (vector= s3-9 (-> self board ride-vertex-old 2)) + (vector= (&+ s3-9 16) (the-as vector (-> self board ride-vertex-old))) + (vector= (&+ s3-9 16) (-> self board ride-vertex-old 1)) + (vector= (&+ s3-9 16) (-> self board ride-vertex-old 2)) + ) + ) + (set! s4-3 (logior s4-3 8)) + ) + ) + (if (time-elapsed? (-> self board ride-button-time) (seconds 0.05)) + (set! s4-3 (logior s4-3 16)) + ) + (if (< (vector-length (-> self board ride-segment)) + (fmin 1024.0 (* 0.25 (vector-length (-> self board ride-segment-old)))) + ) + (set! s4-3 (logior s4-3 32)) + ) + (if (logtest? (collide-status probe-hit) (-> self control status)) + (set! s4-3 (logior s4-3 64)) + ) + (logclear! (-> self control status) (collide-status probe-hit)) + (when (and (not (time-elapsed? (-> self board ride-time) (seconds 0.2))) (nonzero? s4-3)) + (if (logtest? s4-3 1) + (format #t "exit speed ~M~%" f30-2) + ) + (if (logtest? s4-3 2) + (format + #t + "exit angle ~F~%" + (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self board ride-segment-old) 1.0) + (-> self control to-target-pt-xz) + ) + ) + ) + (if (logtest? s4-3 4) + (format + #t + "exit end ~F/~F~%" + (-> self board ride-vertex-index) + (the float (-> self board ride-vertex-length)) + ) + ) + (if (logtest? s4-3 8) + (format #t "exit match~%") + ) + (if (logtest? s4-3 16) + (format #t "exit button~%") + ) + (if (logtest? s4-3 32) + (format #t "exit length~%") + ) + (when (logtest? s4-3 64) + (set! (-> self board ride-lock-on) #f) + (format #t "exit probe~%") + ) + (if (logtest? s4-3 128) + (format #t "exit probe2~%") + ) + (cond + ((or (logtest? s4-3 1) (and (logtest? s4-3 2) (< (fabs f30-2) 32768.0))) + (let ((gp-1 (-> self control edge-grab-across-edge-dir))) + (let* ((a0-162 (vector-rotate-y! (new 'stack-no-clear 'vector) (-> self board ride-dir) -16384.0)) + (f28-3 (* (-> self board ride-lean) (vector-dot a0-162 gp-1))) + ) + (format #t "throw side ~f ~A speed ~m~%" f28-3 (>= f28-3 0.0) f30-2) + (vector-normalize-copy! + (-> self control transv) + gp-1 + (* (lerp-scale 8192.0 32768.0 (fabs (-> self board ride-lean)) 0.0 1.0) (if (>= f28-3 0.0) + 1.0 + -1.0 + ) + ) + ) + ) + (set! (-> self control to-target-pt-xz quad) (-> gp-1 quad)) + ) + ) + ((logtest? s4-3 42) + (move-to-point! (-> self control) gp-0) + (set! (-> self control transv quad) (-> s5-0 quad)) + ) + ) + (when (not (logtest? s4-3 64)) + (let ((a1-78 (vector-float*! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal) 819.2))) + (move-by-vector! (-> self control) a1-78) + ) + ) + (send-event self 'end-mode 'ride (not (logtest? s4-3 75))) + ) + ) + (vector-rotate-y! + (-> self control to-target-pt-xz) + (-> self control to-target-pt-xz) + (+ (-> self board ride-rot) (* -2730.6667 (-> self board ride-lean))) + ) + (set-time! (-> self board ride-time)) + (set! (-> self board ride-speed) f30-2) + ) + ) + ) + (let ((v0-3 (current-time))) + (set! (-> self control last-time-on-surface) v0-3) + v0-3 + ) + ) + +;; definition for function board-ride-add-thrust +;; WARN: Return type mismatch int vs none. +(defbehavior board-ride-add-thrust target ((arg0 vector) (arg1 float)) + (let* ((f30-0 (-> self board ride-speed)) + (f0-4 (lerp-scale + (-> self control current-surface fric) + (* 0.2 (-> self control current-surface fric)) + f30-0 + 0.0 + (-> self control current-surface transv-max) + ) + ) + (f30-1 (seek f30-0 0.0 (* f0-4 (seconds-per-frame)))) + (f28-0 (vector-dot (-> self board ride-dir) arg0)) + (f0-19 (+ f30-1 (* (if (< 0.0 f28-0) + (* f28-0 + (lerp-scale + (-> self control current-surface target-speed) + 0.0 + (-> self board ride-speed) + 0.0 + (-> self control current-surface transv-max) + ) + arg1 + ) + (* 40960.0 arg1 f28-0) + ) + (seconds-per-frame) + ) + ) + ) + (v1-21 (-> self control to-target-pt-xz)) + (f1-6 (vector-dot (-> self control dynam gravity-normal) v1-21)) + (f0-20 (if (< f1-6 0.0) + (+ f0-19 (* (- f1-6) (-> self control current-surface slope-down-factor) (seconds-per-frame))) + (+ f0-19 (* (- f1-6) (-> self control current-surface slope-up-factor) (seconds-per-frame))) + ) + ) + ) + (set! (-> self board ride-speed) (fmax 0.0 (fmin f0-20 (-> self control current-surface transv-max)))) + ) + 0 + (none) + ) + +;; definition for function target-board-ride-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-ride-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (set! (-> self control bend-speed) 32.0) + (set! (-> self control bend-target) 1.0) + (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) + (if (< (-> self control force-turn-to-strength) 0.0) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> self control cpad stick0-speed))) + ) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (turn-to-vector s5-0 (-> self control pad-magnitude)) + (if (< 0.0 (-> self control turn-to-magnitude)) + (set! (-> self board ride-pad-vector 0 quad) (-> self control to-target-pt-xz quad)) + ) + (board-ride-add-thrust s5-0 (-> self control turn-to-magnitude)) + (let ((s5-1 (vector-rotate-y! (new 'stack-no-clear 'vector) s5-0 16384.0))) + (set! (-> s5-1 y) 0.0) + (vector-xz-normalize! s5-1 (-> self control turn-to-magnitude)) + (let ((f0-16 (vector-dot s5-1 (-> self board ride-dir)))) + (if (>= 0.0 (-> self control turn-to-magnitude)) + (set! f0-16 0.0) + ) + (set! (-> self board ride-lean-targ) f0-16) + (+! (-> self board ride-leanv) (* 100.0 (seconds-per-frame) (- f0-16 (-> self board ride-lean)))) + ) + ) + ) + (set! (-> self board ride-leanv) (* 0.95 (-> self board ride-leanv))) + (seek! + (-> self board ride-lean-mag) + (fabs (analog-input (the-as int (-> self control cpad leftx)) 128.0 32.0 110.0 1.0)) + (* 2.0 (seconds-per-frame)) + ) + (+! (-> self board ride-lean) (* (-> self board ride-leanv) (seconds-per-frame))) + (cond + ((< (-> self board ride-lean) -1.0) + (set! (-> self board ride-lean) -1.0) + (set! (-> self board ride-leanv) (* 0.0 (-> self board ride-leanv))) + ) + ((< 1.0 (-> self board ride-lean)) + (set! (-> self board ride-lean) 1.0) + (set! (-> self board ride-leanv) (* 0.0 (-> self board ride-leanv))) + ) + ) + 0 + (add-gravity) + (reverse-conversions (-> self control transv)) + (target-board-compute-edge) + (do-rotations2) + (pre-collide-setup) + (seek! (-> self board cushion-offset) 1638.4 (* 16384.0 (seconds-per-frame))) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (set! (-> s5-3 quad) (-> self control transv quad)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> self control trans quad)) + (let ((a2-4 (new 'stack-no-clear 'collide-query)) + (v1-83 (-> self control)) + ) + (set! (-> a2-4 collide-with) (-> v1-83 root-prim prim-core collide-with)) + (set! (-> a2-4 ignore-process0) self) + (set! (-> a2-4 ignore-process1) #f) + (set! (-> a2-4 ignore-pat) (-> v1-83 pat-ignore-mask)) + (set! (-> a2-4 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-83 (-> v1-83 transv) a2-4 (meters 1)) + ) + (when (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags two)) + (cond + ((time-elapsed? (-> self board ride-time) (seconds 0.2)) + (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one)) + (set! (-> *collide-edge-board-spec* touching-segment) #f) + ) + (else + (logior! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one)) + (dotimes (v1-102 2) + (set! (-> self board ride-touch-segment v1-102 quad) + (-> self board ride-vertex (+ (-> self board ride-vertex-base) v1-102) quad) + ) + ) + (set! (-> *collide-edge-board-spec* touching-segment) (the-as symbol (-> self board ride-touch-segment))) + ) + ) + (target-method-28 *target* *collide-cache* *collide-edge-board-spec*) + ) + (when (focus-test? self rail) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((f28-1 + (fmax + 0.0 + (segment-array-vector->index + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (the-as float s4-1) + (* (-> self board ride-speed) (seconds-per-frame)) + ) + ) + ) + ) + (set! (-> self board ride-vertex-base2) + (segment-array-index->vector (-> self board ride-vertex) (-> self board ride-vertex-length) f28-1 s3-0) + ) + (set! (-> self board ride-vertex-index2) f28-1) + ) + (if (probe-test + (-> self control) + (vector-! (new 'stack-no-clear 'vector) s3-0 (-> self control trans)) + (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1) + ) + (logior! (-> self control status) (collide-status probe-hit)) + ) + (if (and (-> self board ride-lock-on) (not (logtest? (collide-status probe-hit) (-> self control status)))) + (move-to-point! (-> self control) s3-0) + ) + ) + (set! (-> self control transv quad) (-> s5-3 quad)) + ) + ) + (target-board-physics s5-3) + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (vector-cross! + (-> self control local-normal) + (-> self control edge-grab-across-edge-dir) + (-> self control edge-grab-edge-dir) + ) + (if (< (vector-dot (-> self control local-normal) (-> self control dynam gravity-normal)) 0.0) + (vector-negate! (-> self control local-normal) (-> self control local-normal)) + ) + (set! (-> self control gspot-normal quad) (-> self control local-normal quad)) + (target-powerup-process) + (target-board-exit-check) + (target-board-effect) + (set-time! (-> self board board-time)) + (+! (-> *game-info* board-time) + (- (-> *display* game-clock frame-counter) (-> *display* game-clock old-frame-counter)) + ) + 0 + (none) + ) + +;; definition for function target-board-post +(defbehavior target-board-post target () + (target-board-real-post) + (none) + ) + +;; definition for function target-board-center-anim +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-center-anim target () + (set! (-> self board turn-anim-frame) 0.0) + 0 + (none) + ) + +;; definition for function target-board-turn-anim +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-turn-anim target ((arg0 int)) + (let ((f30-0 (-> self clock clock-ratio))) + (let ((s5-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float s5-1))) + (while (nonzero? s5-1) + (+! s5-1 -1) + (set! (-> self control remaining-ctrl-iterations) s5-1) + (set! (-> self board turn-anim-targ) (fmax -10.0 (fmin 10.0 (-> self board turn-anim-targ)))) + (or (not (>= (* (-> self board turn-anim-targ) (-> self board turn-anim-frame)) 0.0)) + (< (fabs (-> self board turn-anim-frame)) (fabs (-> self board turn-anim-targ))) + ) + (+! (-> self board turn-anim-vel) + (* (- (-> self board turn-anim-targ) (-> self board turn-anim-frame)) + (lerp-scale + 20.0 + (if (< (fabs (-> self board turn-anim-frame)) (fabs (-> self board turn-anim-targ))) + 30.0 + 60.0 + ) + (-> self control ctrl-xz-vel) + 0.0 + (* 0.3 (-> self board transv-max)) + ) + (seconds-per-frame) + ) + ) + (set! (-> self board turn-anim-vel) + (fmax + -100.0 + (fmin + 100.0 + (* (-> self board turn-anim-vel) + (lerp-scale 0.96 0.9 (-> self control ctrl-xz-vel) 0.0 (* 0.3 (-> self board transv-max))) + ) + ) + ) + ) + (set! (-> self board unk-float000) (-> self board turn-anim-frame)) + (+! (-> self board turn-anim-frame) (* (-> self board turn-anim-vel) (seconds-per-frame))) + (set! (-> self board turn-anim-frame) + (fmax + (fmin (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames)) + (- (-> *TARGET_BOARD-bank* turn-frames)) + ) + ) + (if (>= 1.0 (fabs (- (-> self board turn-anim-frame) (-> self board turn-anim-targ)))) + (set! (-> self board unk-float001) (-> self board turn-anim-frame)) + ) + (cond + ((and (>= (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames)) + (>= (-> self board turn-anim-vel) 0.0) + ) + (set! (-> self board turn-anim-vel) 0.0) + ) + ((and (>= (- (-> *TARGET_BOARD-bank* turn-frames)) (-> self board turn-anim-frame)) + (>= 0.0 (-> self board turn-anim-vel)) + ) + (set! (-> self board turn-anim-vel) 0.0) + ) + ) + (ja :chan arg0 + :num-func num-func-identity + :frame-num (ja-aframe + (fmax + (fmin + (+ (fmax + (fmin (-> self board turn-anim-frame) (+ -1.0 (-> *TARGET_BOARD-bank* turn-frames))) + (- (+ -1.0 (-> *TARGET_BOARD-bank* turn-frames))) + ) + (* (sin (* 145.63556 (the float (- (current-time) (-> self state-time))))) + (lerp-scale 1.0 2.0 (fabs (-> self board turn-anim-frame)) 0.0 (-> *TARGET_BOARD-bank* turn-frames)) + ) + ) + (-> *TARGET_BOARD-bank* turn-frames) + ) + (- (-> *TARGET_BOARD-bank* turn-frames)) + ) + arg0 + ) + ) + (let ((f0-62 + (fmin + (if (logtest? (-> self control status) (collide-status on-surface)) + (seek (-> self board turn-anim-duck) 0.0 (seconds-per-frame)) + (-> self board turn-anim-duck) + ) + (lerp-scale 0.0 -1.0 (the float (- (current-time) (-> self control last-time-on-surface))) 30.0 120.0) + ) + ) + ) + (+! (-> self board turn-anim-duck) (* (-> self board turn-anim-duck-vel) (seconds-per-frame))) + (cond + ((< (-> self board turn-anim-duck) f0-62) + (set! (-> self board turn-anim-duck) f0-62) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ((< 1.0 (-> self board turn-anim-duck)) + (set! (-> self board turn-anim-duck) 1.0) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ) + ) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + 0 + (none) + ) + +;; definition for method 9 of type board-info +;; WARN: Return type mismatch int vs none. +(defmethod add-to-trick-list ((this board-info) (arg0 board-tricks) (arg1 float)) + (send-event (handle->process (-> this process 0 notify)) 'notify 'trick-point arg0) + (when (and (< (-> this trick-count) 16) (and (< 0.0 arg1) (nonzero? (-> this process 0 fact trick-point-duration)))) + (let ((s4-0 0)) + (when (>= (- (-> *display* game-clock frame-counter) (-> this process 0 fact trick-point-pickup-time)) (seconds 30)) + (countdown (v1-20 16) + (set! (-> this trick-list 0) (board-tricks none)) + ) + ) + (countdown (v1-23 15) + (if (= (-> this trick-list v1-23) arg0) + (+! s4-0 1) + ) + (set! (-> this trick-list (+ v1-23 1)) (-> this trick-list v1-23)) + ) + (set! (-> this trick-list 0) arg0) + (let* ((a0-24 (* arg1 (lerp-scale 1.0 0.1 (the float s4-0) 2.0 6.0))) + (s3-1 (the float (* 25 (/ (+ (the int a0-24) 24) 25)))) + ) + (sound-play "do-trick") + (let ((t9-4 format) + (a0-29 #t) + (a1-8 "trick: ~S (~D) ~,,0f") + (v1-30 arg0) + ) + (t9-4 + a0-29 + a1-8 + (cond + ((= v1-30 (board-tricks darkjak-tracking)) + "darkjak-tracking" + ) + ((= v1-30 (board-tricks board-rail-jump)) + "board-rail-jump" + ) + ((= v1-30 (board-tricks lightjak-swoop)) + "lightjak-swoop" + ) + ((= v1-30 (board-tricks board-nosegrab)) + "board-nosegrab" + ) + ((= v1-30 (board-tricks board-board-spin)) + "board-board-spin" + ) + ((= v1-30 (board-tricks board-kickflip)) + "board-kickflip" + ) + ((= v1-30 (board-tricks lightjak-regen)) + "lightjak-regen" + ) + ((= v1-30 (board-tricks board-method)) + "board-method" + ) + ((= v1-30 (board-tricks board-spin)) + "board-spin" + ) + ((= v1-30 (board-tricks board-kickspin)) + "board-kickspin" + ) + ((= v1-30 (board-tricks board-boost)) + "board-boost" + ) + ((= v1-30 (board-tricks darkjak)) + "darkjak" + ) + ((= v1-30 (board-tricks lightjak)) + "lightjak" + ) + ((= v1-30 (board-tricks board-method-cross)) + "board-method-cross" + ) + ((= v1-30 (board-tricks board-duck-jump)) + "board-duck-jump" + ) + ((= v1-30 (board-tricks board-airwalk)) + "board-airwalk" + ) + ((= v1-30 (board-tricks lightjak-shield)) + "lightjak-shield" + ) + ((= v1-30 (board-tricks board-backgrab)) + "board-backgrab" + ) + ((= v1-30 (board-tricks board-board-flip)) + "board-board-flip" + ) + ((= v1-30 (board-tricks board-rail)) + "board-rail" + ) + ((= v1-30 (board-tricks none)) + "none" + ) + ((= v1-30 (board-tricks lightjak-freeze)) + "lightjak-freeze" + ) + ((= v1-30 (board-tricks darkjak-bomb0)) + "darkjak-bomb0" + ) + ((= v1-30 (board-tricks board-quick-jump)) + "board-quick-jump" + ) + ((= v1-30 (board-tricks darkjak-smack)) + "darkjak-smack" + ) + ((= v1-30 (board-tricks board-noseflip)) + "board-noseflip" + ) + ((= v1-30 (board-tricks darkjak-bomb1)) + "darkjak-bomb1" + ) + ((= v1-30 (board-tricks board-jump)) + "board-jump" + ) + ((= v1-30 (board-tricks board-flip)) + "board-flip" + ) + (else + "*unknown*" + ) + ) + s4-0 + s3-1 + ) + ) + (when (nonzero? (-> this trick-count)) + (format #t " + combo ~,,0f" (-> this trick-points-array (+ (-> this trick-count) -1))) + (+! (-> this trick-points-array (+ (-> this trick-count) -1)) + (-> this trick-points-array (+ (-> this trick-count) -1)) + ) + ) + (format #t "~%") + (set! (-> this trick-array (-> this trick-count)) arg0) + (set! (-> this trick-points-array (-> this trick-count)) s3-1) + ) + ) + (+! (-> this trick-count) 1) + ) + 0 + (none) + ) + +;; definition for method 10 of type board-info +;; WARN: Return type mismatch int vs none. +(defmethod flush-trick-list ((this board-info)) + (let ((f30-0 0.0)) + (dotimes (v1-0 (-> this trick-count)) + (+! f30-0 (-> this trick-points-array v1-0)) + ) + (when (< 0.0 f30-0) + (send-event + (handle->process (-> this process 0 notify)) + 'notify + 'trick-flush + f30-0 + (-> this trick-list) + (-> this trick-count) + ) + (send-event (ppointer->process (-> this process)) 'get-pickup (pickup-type trick-point) f30-0) + (sound-play "trick-score") + ) + ) + (set! (-> this trick-count) 0) + 0 + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc b/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc new file mode 100644 index 00000000000..c8cbb92559f --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc @@ -0,0 +1,620 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function poly-find-nearest-edge +;; INFO: Used lq/sq +(defun poly-find-nearest-edge ((arg0 nav-poly) (arg1 (inline-array vector)) (arg2 vector) (arg3 vector)) + (local-vars (sv-32 vector) (sv-36 number) (sv-40 int) (sv-48 number) (sv-80 vector)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 4095996000.0) + (set! sv-40 -1) + (set! sv-48 0.0) + (dotimes (s2-0 3) + (let ((s0-0 (-> arg1 s2-0))) + (set! sv-80 (-> arg1 (mod (+ s2-0 1) 3))) + (let ((f30-0 (vector-line-distance-point! arg2 s0-0 sv-80 sv-32)) + (s1-1 (vector-! (new 'stack-no-clear 'vector) sv-80 s0-0)) + ) + 0.0 + (vector-normalize! s1-1 1.0) + (let ((f0-5 (fabs (vector-dot arg3 s1-1)))) + (when (or (< f30-0 (the-as float sv-36)) (and (= f30-0 (the-as float sv-36)) (< (the-as float sv-48) f0-5))) + (set! sv-36 f30-0) + (set! sv-40 s2-0) + (set! sv-48 f0-5) + ) + ) + ) + ) + ) + (set! (-> arg0 vertex 0 quad) (-> arg1 sv-40 quad)) + (set! (-> arg0 vertex1 quad) (-> arg1 (mod (+ sv-40 1) 3) quad)) + arg0 + ) + +;; definition for function target-collision-low-coverage +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun target-collision-low-coverage ((arg0 control-info) + (arg1 collide-query) + (arg2 vector) + (arg3 (pointer cshape-reaction-flags)) + (arg4 (pointer collide-status)) + (arg5 (pointer symbol)) + ) + (local-vars + (sv-16 vector) + (sv-20 (pointer cshape-reaction-flags)) + (sv-24 (pointer collide-status)) + (sv-28 (pointer symbol)) + (sv-32 cshape-reaction-flags) + (sv-40 collide-status) + (sv-48 symbol) + (sv-52 vector) + (sv-56 vector) + ) + (set! sv-16 arg2) + (set! sv-20 arg3) + (set! sv-24 arg4) + (set! sv-28 arg5) + (set! sv-32 (-> arg3 0)) + (set! sv-40 (-> arg4 0)) + (set! sv-48 (-> arg5 0)) + (set! sv-52 (-> arg0 low-coverage-tangent)) + (set! sv-56 (vector-cross! (-> arg0 low-coverage-overhang-plane-normal) (-> arg0 poly-normal) sv-16)) + (vector-normalize! sv-56 1.0) + (if (>= (fabs (vector-dot (-> arg0 dynam gravity-normal) sv-56)) 0.866) + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf09))) + ) + (vector-cross! sv-52 sv-16 sv-56) + (if (< 0.0 (vector-dot (-> arg0 dynam gravity-normal) sv-52)) + (vector-negate! sv-52 sv-52) + ) + (vector-normalize! sv-52 1.0) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) + (let ((s3-0 (vector-flatten! (-> arg0 low-coverage-tangent-xz) sv-52 (-> arg0 dynam gravity-normal)))) + (let ((v1-19 s4-0)) + (set! (-> v1-19 radius) 409.6) + (set! (-> v1-19 collide-with) (-> arg1 best-my-prim prim-core collide-with)) + (set! (-> v1-19 ignore-process0) #f) + (set! (-> v1-19 ignore-process1) #f) + (set! (-> v1-19 ignore-pat) (-> arg0 pat-ignore-mask)) + (set! (-> v1-19 action-mask) (collide-action solid)) + ) + (vector-normalize! s3-0 1.0) + (if (< (vector-dot s3-0 sv-16) 0.0) + (vector-negate! s3-0 s3-0) + ) + (set! (-> arg0 low-coverage-slope-to-next1) 4095996000.0) + (set! (-> arg0 low-coverage-dist-to-next2) 4095996000.0) + (vector+float*! (-> s4-0 start-pos) (-> arg1 best-other-tri intersect) s3-0 2867.2) + (vector-normalize-copy! (-> s4-0 move-dist) (-> arg0 dynam gravity-normal) -20480.0) + (vector+float*! (-> s4-0 move-dist) (-> s4-0 move-dist) s3-0 4096.0) + (when (>= (probe-using-line-sphere *collide-cache* s4-0) 0.0) + (set! (-> arg0 low-coverage-slope-to-next1) + (vector-dot + (-> arg0 dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-other-tri intersect) (-> s4-0 best-other-tri intersect)) + ) + ) + (set! (-> arg0 low-coverage-pat-next1) (-> s4-0 best-other-tri pat)) + (set! (-> arg0 low-coverage-norm-of-next1 quad) (-> s4-0 best-other-tri normal quad)) + 0 + ) + (vector+float*! (-> s4-0 start-pos) (-> arg1 best-other-tri intersect) (-> arg0 dynam gravity-normal) 819.2) + (vector-normalize-copy! (-> s4-0 move-dist) (-> arg0 dynam gravity-normal) -20480.0) + (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) s3-0 -819.2) + (vector+float*! (-> s4-0 move-dist) (-> s4-0 move-dist) s3-0 -4096.0) + ) + (when (>= (probe-using-line-sphere *collide-cache* s4-0) 0.0) + (set! (-> arg0 low-coverage-dist-to-next2) + (vector-vector-distance (-> s4-0 start-pos) (-> s4-0 best-other-tri intersect)) + ) + (set! (-> arg0 low-coverage-pat-next2) (-> s4-0 best-other-tri pat)) + (set! (-> arg0 low-coverage-norm-of-next2 quad) (-> s4-0 best-other-tri normal quad)) + 0 + ) + ) + (when (and (not (logtest? sv-32 (cshape-reaction-flags csrf09))) + (and (or (< (* 1.25 (-> arg1 best-my-prim local-sphere w)) (-> arg0 low-coverage-slope-to-next1)) + (= (-> arg0 low-coverage-pat-next1 mode) (pat-mode wall)) + ) + (and (< (-> arg0 low-coverage-dist-to-next2) (* 2.0 (-> arg1 best-my-prim local-sphere w))) + (or (= (-> arg0 low-coverage-pat-next2 mode) (pat-mode ground)) + (= (-> arg0 low-coverage-pat-next2 mode) (pat-mode halfpipe)) + ) + ) + ) + ) + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf07))) + (set-time! (-> arg0 time-of-last-lc-touch-edge)) + (set! sv-40 (logior sv-40 (collide-status touch-edge))) + (set-time! (-> arg0 time-of-last-lc)) + (let ((f30-0 (vector-dot sv-52 (-> arg0 turn-to-target))) + (f0-27 (if (logtest? sv-32 (cshape-reaction-flags csrf01)) + (cos (- 16384.0 (acos (-> arg0 coverage)))) + (-> arg0 coverage) + ) + ) + (f1-11 (vector-dot + (-> arg0 dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg0 trans) (-> arg1 best-other-tri intersect)) + ) + ) + ) + (if (or (not (logtest? sv-32 (cshape-reaction-flags csrf05))) (< 0.5 f0-27)) + (set! sv-48 (the-as symbol #f)) + ) + (when (and (or (and (< f0-27 0.95) (>= f30-0 0.0)) + (and (logtest? sv-32 (cshape-reaction-flags csrf05)) (< f0-27 0.3)) + (< f1-11 (* -0.25 (-> arg1 best-my-prim local-sphere w))) + ) + (>= (vector-dot sv-52 sv-16) -0.000001) + ) + (set! (-> arg0 surf) *edge-surface*) + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf10))) + (set! sv-48 (the-as symbol #f)) + (when (logtest? sv-32 (cshape-reaction-flags csrf05)) + (set! sv-48 #t) + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf12))) + ) + ) + ) + ) + (if (< (-> arg0 surface-angle) 0.0) + (set! sv-48 #t) + ) + (when sv-48 + (cond + ((and (or (or (= (-> arg0 poly-pat mode) (pat-mode ground)) (= (-> arg0 poly-pat mode) (pat-mode halfpipe))) + (and (logtest? sv-32 (cshape-reaction-flags csrf03)) + (>= (* 1.25 (-> arg1 best-my-prim local-sphere w)) (-> arg0 low-coverage-slope-to-next1)) + (or (= (-> arg0 low-coverage-pat-next1 mode) (pat-mode ground)) + (= (-> arg0 low-coverage-pat-next1 mode) (pat-mode halfpipe)) + ) + (< 0.3 (fabs (-> arg0 surface-angle))) + ) + ) + (not (logtest? sv-32 (cshape-reaction-flags csrf07))) + ) + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf06))) + (set! sv-40 (logior sv-40 (collide-status touch-edge))) + (set-time! (-> arg0 time-of-last-lc)) + (set! sv-48 (the-as symbol #f)) + ) + (#t + (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf06))) + (set! sv-40 (logior sv-40 (collide-status touch-edge))) + (set-time! (-> arg0 time-of-last-lc)) + ) + ) + ) + (set! (-> sv-24 0) sv-40) + (set! (-> sv-20 0) sv-32) + (set! (-> sv-28 0) sv-48) + 0 + (none) + ) + +;; definition for function target-collision-reaction +;; INFO: Used lq/sq +(defbehavior target-collision-reaction target ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (local-vars + (sv-80 vector) + (sv-84 vector) + (sv-88 matrix) + (sv-96 collide-status) + (sv-104 cshape-reaction-flags) + (sv-240 symbol) + ) + (set! sv-80 (new-stack-vector0)) + (set! sv-84 (new-stack-vector0)) + (let ((v1-2 (new 'stack-no-clear 'matrix))) + (dotimes (a0-1 2) + (set! (-> v1-2 quad a0-1) (the-as uint128 0)) + ) + (set! sv-88 v1-2) + ) + (set! sv-96 (collide-status)) + (set! sv-104 (cshape-reaction-flags)) + (set! (-> sv-88 rvec quad) (-> arg3 quad)) + (set! (-> sv-88 uvec quad) (-> arg3 quad)) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (vector-float*! a1-3 (-> arg1 move-dist) (the-as float (-> arg1 spheres))) + (move-by-vector! arg0 a1-3) + ) + (set! sv-104 (logior sv-104 (react-to-pat! arg0 (-> arg1 best-other-tri pat)))) + (if (= (-> arg0 poly-pat mode) (pat-mode wall)) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf00))) + ) + (if (logtest? (-> arg0 mod-surface flags) (surface-flag air)) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf05))) + ) + (let ((v1-24 (new 'stack-no-clear 'vector))) + (set! (-> v1-24 quad) (-> arg1 best-my-prim prim-core world-sphere quad)) + (vector-! sv-80 v1-24 (-> arg1 best-other-tri intersect)) + ) + (vector-normalize! sv-80 1.0) + (set! (-> arg0 coverage) (vector-dot sv-80 (-> arg1 best-other-tri normal))) + (when (< (-> arg0 coverage) 0.0) + (set! (-> arg0 coverage) 0.0) + (vector-flatten! sv-80 sv-80 (-> arg1 best-other-tri normal)) + (vector-normalize! sv-80 1.0) + ) + (if (< (-> arg0 coverage) 0.9999) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf03 csrf04))) + ) + (let ((v1-35 (-> sv-80 quad))) + (set! (-> sv-84 quad) v1-35) + ) + (if (= (the-as float (-> arg1 spheres)) 0.0) + (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-84 3.0)) + ) + (set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad)) + (collide-shape-moving-angle-set! arg0 sv-84 (-> sv-88 rvec)) + (if (< (-> arg0 poly-angle) -0.2) + (set! sv-96 (logior sv-96 (collide-status touch-ceiling))) + ) + (if (< (-> arg0 poly-angle) 0.0) + (set! sv-96 (logior sv-96 (collide-status touch-ceiling-sticky))) + ) + (if (!= (-> arg1 best-my-prim prim-id) 6) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf15))) + ) + (if (and (= (-> arg0 cur-pat mode) (pat-mode halfpipe)) (< (-> arg0 poly-angle) 0.75)) + (send-event (-> arg0 process) 'slide) + ) + (set! sv-240 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))) + (if (and sv-240 (and (= (-> arg0 mod-surface mode) 'dive) (< 0.4 (fabs (-> arg0 surface-angle))))) + (set! sv-240 (the-as symbol #f)) + ) + (if (and (logtest? sv-104 (cshape-reaction-flags csrf15)) + (logtest? sv-104 (cshape-reaction-flags csrf05)) + (>= (-> arg0 poly-angle) 0.0) + (not sv-240) + ) + (set! sv-240 #t) + ) + (if sv-240 + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf01))) + ) + (if (logtest? sv-104 (cshape-reaction-flags csrf03)) + (target-collision-low-coverage arg0 arg1 sv-84 (& sv-104) (& sv-96) (& sv-240)) + ) + (when (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) + (set! (-> arg0 transv-on-last-impact quad) (-> arg0 transv quad)) + (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) + (set! (-> arg0 normal-impact-vel) (- (vector-dot (-> arg0 transv) sv-84))) + (set! sv-96 (logior sv-96 (collide-status impact-surface))) + (if (nonzero? (-> arg0 current-surface impact-hook)) + ((-> arg0 current-surface impact-hook) arg0 (the-as (pointer float) (-> sv-88 rvec)) sv-84) + ) + (when (not sv-240) + (let ((f0-21 (- 1.0 (-> arg0 current-surface impact-fric)))) + (when (< f0-21 1.0) + (let ((v1-113 (new-stack-vector0)) + (f1-13 (vector-dot (-> arg0 dynam gravity-normal) (-> sv-88 rvec))) + ) + 0.0 + (vector-! v1-113 (-> sv-88 rvec) (vector-float*! v1-113 (-> arg0 dynam gravity-normal) f1-13)) + (let* ((f2-2 (vector-length v1-113)) + (f3-0 f2-2) + ) + (if (< f1-13 0.0) + (set! f1-13 (* f1-13 f0-21)) + ) + (vector+! + (-> sv-88 rvec) + (vector-float*! (-> sv-88 rvec) (-> arg0 dynam gravity-normal) f1-13) + (vector-float*! v1-113 v1-113 (/ f2-2 f3-0)) + ) + ) + ) + ) + ) + ) + ) + (set! sv-96 (logior sv-96 (collide-status touch-surface))) + (cond + ((-> arg1 best-other-prim) + (set! sv-96 (logior sv-96 (collide-status touch-actor))) + (set! (-> arg0 actor-contact-pt quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> arg0 actor-contact-normal quad) (-> arg0 poly-normal quad)) + (set! (-> arg0 actor-contact-handle) (process->handle (-> arg1 best-other-prim cshape process))) + ) + ((= (-> arg0 poly-pat material) (pat-material waterbottom)) + ) + (else + (set! sv-96 (logior sv-96 (collide-status touch-background))) + ) + ) + (cond + (sv-240 + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf02))) + (set! sv-96 (logior sv-96 (collide-status touch-wall))) + (set! (-> arg0 cur-pat mode) 1) + (set! (-> arg0 wall-contact-pt quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> arg0 wall-contact-poly-normal quad) (-> arg0 poly-normal quad)) + (set! (-> arg0 wall-contact-normal quad) (-> sv-84 quad)) + (set! (-> arg0 wall-contact-pat) (-> arg1 best-other-tri pat)) + (cond + ((and (focus-test? (the-as process-focusable (-> arg0 process)) mech) + (logtest? sv-104 (cshape-reaction-flags csrf15)) + (logtest? sv-104 (cshape-reaction-flags csrf05)) + (< 0.0 (vector-dot sv-84 (-> arg0 dynam gravity-normal))) + (< 0.0 (vector-dot (-> sv-88 rvec) (-> arg0 dynam gravity-normal))) + ) + (set! (-> arg0 surf) *edge-surface*) + (set! sv-104 (logior (cshape-reaction-flags csrf16) sv-104)) + (vector-flatten! arg2 (vector-negate! (new 'stack-no-clear 'vector) (-> arg0 dynam gravity-normal)) sv-84) + (vector-normalize! arg2 (vector-dot arg2 (-> sv-88 rvec))) + ) + (else + (vector-reflect-flat! arg2 (-> sv-88 rvec) sv-84) + ) + ) + (cond + ((and (or (and (>= (-> arg1 best-my-prim local-sphere w) + (vector-dot + (-> arg0 ground-poly-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-other-tri intersect) (-> arg0 ground-touch-point)) + ) + ) + (not (time-elapsed? (-> arg0 list-time-on-ground) (seconds 0.3))) + ) + (logtest? sv-104 (cshape-reaction-flags csrf15)) + ) + (>= (vector-dot + (-> arg0 dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-other-tri intersect) (-> arg0 ground-touch-point)) + ) + 0.0 + ) + (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) + (not (logtest? sv-104 (cshape-reaction-flags csrf05))) + (not (logtest? (state-flags sf26) (-> arg0 process state-flags))) + ) + ) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf08))) + (set! sv-104 (logclear sv-104 (cshape-reaction-flags csrf06))) + (let ((s3-4 (vector-cross! (new 'stack-no-clear 'vector) (-> arg0 poly-normal) (-> arg0 ground-poly-normal)))) + (vector-normalize! s3-4 1.0) + (vector-float*! arg2 s3-4 (vector-dot (-> sv-88 rvec) s3-4)) + ) + (vector+! arg2 arg2 (-> arg0 poly-normal)) + ) + (else + ) + ) + ) + (else + (set! sv-96 (logior sv-96 (collide-status on-surface))) + (set! (-> arg0 cur-pat mode) 0) + (if (= (-> arg1 best-my-prim prim-id) 6) + (set! (-> arg0 local-normal quad) (-> sv-84 quad)) + ) + (cond + ((and (focus-test? (the-as process-focusable (-> arg0 process)) board) + (not (focus-test? (the-as process-focusable (-> arg0 process)) halfpipe)) + (!= (-> arg0 cur-pat mode) 3) + (!= (-> arg0 ground-pat mode) 3) + ) + (vector-reflect-flat-gravity! arg2 (-> sv-88 rvec) sv-84 (-> arg0 dynam gravity-normal)) + (vector+! arg2 arg2 sv-84) + ) + ((and (or (>= (fabs (-> arg0 trans x)) 16777216.0) (>= (fabs (-> arg0 trans z)) 16777216.0)) + (and (not (focus-test? (the-as process-focusable (-> arg0 process)) board)) (< 0.7 (-> arg0 surface-angle))) + ) + (vector-reflect-flat-above! arg2 (-> sv-88 rvec) sv-84) + ) + (else + (vector-reflect-flat! arg2 (-> sv-88 rvec) sv-84) + (vector+! arg2 arg2 sv-84) + ) + ) + (let ((f0-37 (-> arg0 current-surface slope-change-preserve))) + (when (< 0.0 f0-37) + (let ((v1-234 (new-stack-vector0))) + (let ((f1-28 (vector-dot (-> arg0 pre-collide-local-normal) (-> sv-88 rvec)))) + 0.0 + (vector-! v1-234 (-> sv-88 rvec) (vector-float*! v1-234 (-> arg0 pre-collide-local-normal) f1-28)) + ) + (let ((f1-29 (vector-length v1-234))) + f1-29 + (let ((f1-30 f1-29) + (f2-5 (vector-length arg2)) + ) + (if (and (< 409.6 (fabs (- f2-5 f1-30))) (< f2-5 f1-30)) + (vector-normalize! arg2 (lerp-scale f2-5 f1-30 f0-37 0.0 1.0)) + ) + ) + ) + ) + ) + ) + (set! (-> arg0 ground-touch-point w) 0.0) + (when (not (logtest? sv-104 (cshape-reaction-flags csrf00 csrf01 csrf02 csrf03 csrf14))) + (set! sv-96 (logior sv-96 (collide-status on-ground))) + (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) + (set! (-> arg0 ground-contact-normal quad) (-> sv-84 quad)) + (set! (-> arg0 ground-local-norm-dot-grav) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) + (set-time! (-> arg0 list-time-on-ground)) + (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) + (set! (-> arg0 ground-touch-point quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> arg0 ground-contact-sphere-center quad) (-> arg1 best-my-prim prim-core world-sphere quad)) + (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf11))) + (if (= (-> arg0 poly-pat material) (pat-material waterbottom)) + (set! sv-96 (logior sv-96 (collide-status on-water))) + ) + ) + ) + ) + (logior! (-> arg0 status) sv-96) + (set! (-> arg0 reaction-flag) sv-104) + (when *debug-segment* + (+! (-> arg0 history-idx) 1) + (let ((v1-271 (clear-record-tags! *history* (history-channel surface-normal) (-> arg0 history-idx) (the-as uint 2))) + ) + (set! (-> v1-271 origin quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> v1-271 vector quad) (-> arg0 surface-normal quad)) + ) + (let ((v1-274 (clear-record-tags! *history* (history-channel local-normal) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-274 origin quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> v1-274 vector quad) (-> arg0 local-normal quad)) + ) + (set! (-> (clear-record-tags! *history* (history-channel intersect) (-> arg0 history-idx) (the-as uint 2)) + vector + quad + ) + (-> arg1 best-other-tri intersect quad) + ) + (let ((v1-280 (clear-record-tags! *history* (history-channel transv-out) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-280 origin quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> v1-280 vector quad) (-> arg2 quad)) + ) + (let ((v1-283 (clear-record-tags! *history* (history-channel transv-in) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-283 origin quad) (-> arg1 best-other-tri intersect quad)) + (set! (-> v1-283 vector quad) (-> sv-88 uvec quad)) + ) + (let ((v1-286 (clear-record-tags! *history* (history-channel transv) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-286 origin quad) (-> arg0 trans quad)) + (set! (-> v1-286 vector quad) (-> arg0 transv quad)) + ) + (set! (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector quad) + (-> arg0 trans quad) + ) + (let ((v1-292 (clear-record-tags! *history* (history-channel pat) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-292 vector x) (the-as float (-> arg0 cur-pat))) + ) + (let ((v1-294 (clear-record-tags! *history* (history-channel collide-status) (-> arg0 history-idx) (the-as uint 2))) + ) + (set! (-> v1-294 collide-status) (-> arg0 status)) + (set! (-> v1-294 vector z) (the-as float (-> arg0 reaction-flag))) + ) + ) + sv-96 + ) + +;; definition for function target-collision-no-reaction +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun target-collision-no-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (if (= (-> arg0 mod-surface mode) 'air) + (logior! (-> arg0 reaction-flag) (cshape-reaction-flags csrf05)) + ) + (when *debug-segment* + (+! (-> arg0 history-idx) 1) + (let ((v1-9 (clear-record-tags! *history* (history-channel transv-out) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-9 origin quad) (-> arg0 trans quad)) + (set! (-> v1-9 vector quad) (-> arg2 quad)) + ) + (let ((v1-12 (clear-record-tags! *history* (history-channel transv-in) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-12 origin quad) (-> arg0 trans quad)) + (set! (-> v1-12 vector quad) (-> arg3 quad)) + ) + (let ((v1-15 (clear-record-tags! *history* (history-channel transv) (-> arg0 history-idx) (the-as uint 2)))) + (set! (-> v1-15 origin quad) (-> arg0 trans quad)) + (set! (-> v1-15 vector quad) (-> arg0 transv quad)) + ) + (set! (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector quad) + (-> arg0 trans quad) + ) + (let ((v1-21 (clear-record-tags! *history* (history-channel collide-status) (-> arg0 history-idx) (the-as uint 2))) + ) + (set! (-> v1-21 collide-status) (logior (-> arg0 status) (collide-status no-touch))) + (set! (-> v1-21 vector z) (the-as float (-> arg0 reaction-flag))) + ) + ) + 0 + (none) + ) + +;; definition for symbol *collide-edge-board-spec*, type collide-edge-spec +(define *collide-edge-board-spec* (new 'static 'collide-edge-spec + :split-dists (new 'static 'array float 2 1024.0 1433.6) + :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) + :flags (collide-edge-spec-flags find-adjacent-edge send-event) + :ignore-pat (new 'static 'pat-surface :noentity #x1 :nogrind #x1 :probe #x1) + :max-dist-sqrd-to-outward-pt 67108864.0 + :max-dir-cosa-delta -1.0 + :max-dir-cosa-player -2.0 + :touching-segment #f + :local-cache-fill-box (new 'static 'bounding-box + :min (new 'static 'vector :x -12288.0 :y -11059.2 :z -12288.0 :w 1.0) + :max (new 'static 'vector :x 12288.0 :y 16384.0 :z 12288.0 :w 1.0) + ) + :local-within-reach-box (new 'static 'bounding-box + :min (new 'static 'vector :x -11878.4 :y -2867.2 :z -11878.4 :w 1.0) + :max (new 'static 'vector :x 11878.4 :y 2867.2 :z 11878.4 :w 1.0) + ) + :local-player-spheres (new 'static 'inline-array sphere 12 + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2539.52 :y -819.2 :r 1433.6) + (new 'static 'sphere :x -737.28 :y 4096.0 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 6553.6 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 9420.8 :r 3072.0) + (new 'static 'sphere :x 1720.32 :y 3686.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 5734.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 8601.6 :r 2949.12) + ) + ) + ) + +;; definition for function rail-surface-touch +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior rail-surface-touch target () + (when (time-elapsed? (-> self control time-of-last-surface-change) (seconds 0.2)) + (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one send-event)) + (set! (-> *collide-edge-board-spec* touching-segment) #f) + (target-method-28 *target* *collide-cache* *collide-edge-board-spec*) + (logior! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags send-event)) + (let ((gp-0 *edge-grab-info*)) + (when (-> gp-0 found-edge?) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (the-as vector (-> gp-0 world-vertex)) + (-> gp-0 world-vertex 1) + ) + 1.0 + ) + (set! (-> self control edge-grab-across-edge-dir quad) (-> gp-0 hanging-matrix rvec quad)) + (send-event + self + 'push-transv + (vector-float*! + (new 'stack-no-clear 'vector) + (-> self control edge-grab-across-edge-dir) + (seek (vector-length (-> self control additional-decaying-velocity)) 40960.0 (* 81920.0 (seconds-per-frame))) + ) + (seconds 0.3) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function gravel-surface-touch +;; WARN: Return type mismatch int vs none. +(defbehavior gravel-surface-touch target () + 0 + (none) + ) + +;; definition for function mushroom-surface-touch +;; WARN: Return type mismatch float vs none. +(defbehavior mushroom-surface-touch target () + (lerp-scale 0.0 1.0 (-> self control surface-angle) 0.8 0.0) + (if (< (-> self control surface-angle) 0.8) + (seek! (-> *mushroom-surface* slip-factor) 0.0 (* 0.5 (seconds-per-frame))) + (seek! (-> *mushroom-surface* slip-factor) 1.0 (* 2.5 (seconds-per-frame))) + ) + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/target/darkjak-h_REF.gc b/test/decompiler/reference/jak3/engine/target/darkjak-h_REF.gc new file mode 100644 index 00000000000..3cccdba0182 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/darkjak-h_REF.gc @@ -0,0 +1,62 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type darkjak-info +(deftype darkjak-info (basic) + ((process (pointer target)) + (latch-out-time time-frame) + (attack-id uint32) + (start-time time-frame) + (attack-time time-frame) + (attack-count uint64) + (lightning-count int32) + (charge-effect handle) + (stage darkjak-stage) + (want-stage darkjak-stage) + (clock-pos float) + (clock-vel float) + (clock-on symbol) + (hud handle 1) + (tone sound-id) + (bomb uint32) + (mode-sound-bank connection) + ) + (:methods + (darkjak-info-method-9 () none) + ) + ) + +;; definition for method 3 of type darkjak-info +(defmethod inspect ((this darkjak-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tlatch-out-time: ~D~%" (-> this latch-out-time)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~1Tattack-count: ~D~%" (-> this attack-count)) + (format #t "~1Tlightning-count: ~D~%" (-> this lightning-count)) + (format #t "~1Tcharge-effect: ~D~%" (-> this charge-effect)) + (format #t "~1Tstage: ~D~%" (-> this stage)) + (format #t "~1Twant-stage: ~D~%" (-> this want-stage)) + (format #t "~1Tclock-pos: ~f~%" (-> this clock-pos)) + (format #t "~1Tclock-vel: ~f~%" (-> this clock-vel)) + (format #t "~1Tclock-on: ~A~%" (-> this clock-on)) + (format #t "~1Thud[1] @ #x~X~%" (-> this hud)) + (format #t "~1Ttone: ~D~%" (-> this tone)) + (format #t "~1Tbomb: ~D~%" (-> this bomb)) + (format #t "~1Tmode-sound-bank: #~%" (-> this mode-sound-bank)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc new file mode 100644 index 00000000000..65c0c03068f --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc @@ -0,0 +1,114 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type flut-info +(deftype flut-info (basic) + ((entity entity-actor) + (flut-trans vector :inline) + (flut-quat vector :inline) + (flut-scale vector :inline) + (prev-quat quaternion :inline) + (stick-lock symbol) + (flap-sound-id uint32) + (mode-sound-bank connection) + (mode basic) + (color-index int32) + (as-daxter? symbol) + (art-group-backup art-group) + (flut-start-time time-frame) + (wild-turn-time time-frame) + (wild-turn-rate degrees) + (attack-id uint32) + ) + ) + +;; definition for method 3 of type flut-info +(defmethod inspect ((this flut-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tflut-trans: ~`vector`P~%" (-> this flut-trans)) + (format #t "~1Tflut-quat: ~`vector`P~%" (-> this flut-quat)) + (format #t "~1Tflut-scale: ~`vector`P~%" (-> this flut-scale)) + (format #t "~1Tprev-quat: #~%" (-> this prev-quat)) + (format #t "~1Tstick-lock: ~A~%" (-> this stick-lock)) + (format #t "~1Tflap-sound-id: ~D~%" (-> this flap-sound-id)) + (format #t "~1Tmode-sound-bank: #~%" (-> this mode-sound-bank)) + (format #t "~1Tmode: ~A~%" (-> this mode)) + (format #t "~1Tcolor-index: ~D~%" (-> this color-index)) + (format #t "~1Tas-daxter?: ~A~%" (-> this as-daxter?)) + (format #t "~1Tart-group-backup: ~A~%" (-> this art-group-backup)) + (format #t "~1Tflut-start-time: ~D~%" (-> this flut-start-time)) + (format #t "~1Twild-turn-time: ~D~%" (-> this wild-turn-time)) + (format #t "~1Twild-turn-rate: (deg ~r)~%" (-> this wild-turn-rate)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (label cfg-4) + this + ) + +;; definition of type flut +(deftype flut (process-focusable) + ((extra-trans vector :inline) + (condition int32) + (shadow-backup shadow-geo) + (rider handle) + (nav-sphere-handle handle) + (probe-time time-frame) + (count-lock basic) + (flags flut-flag) + (mode basic) + (color-index int32) + (minimap connection-minimap) + ) + (:methods + (flut-method-28 () none) + (flut-method-29 () none) + (flut-method-30 () none) + (flut-method-31 () none) + (flut-method-32 () none) + (flut-method-33 () none) + (flut-method-34 () none) + ) + ) + +;; definition for method 3 of type flut +(defmethod inspect ((this flut)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Textra-trans: ~`vector`P~%" (-> this extra-trans)) + (format #t "~2Tcondition: ~D~%" (-> this condition)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Trider: ~D~%" (-> this rider)) + (format #t "~2Tnav-sphere-handle: ~D~%" (-> this nav-sphere-handle)) + (format #t "~2Tprobe-time: ~D~%" (-> this probe-time)) + (format #t "~2Tcount-lock: ~A~%" (-> this count-lock)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tmode: ~A~%" (-> this mode)) + (format #t "~2Tcolor-index: ~D~%" (-> this color-index)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-flut flut-saddle flut-saddle-lod0-jg -1 + ((flut-saddle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :shadow flut-saddle-shadow-mg + :light-index 1 + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-h_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-h_REF.gc new file mode 100644 index 00000000000..0b9e67e6012 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-h_REF.gc @@ -0,0 +1,430 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type gun +(deftype gun (process-drawable) + ((parent (pointer target) :override) + (control control-info :overlay-at root) + (shadow-backup shadow-geo :offset 208) + (read-scale symbol) + (gun-type pickup-type) + (barrel joint-mod 2) + (mag joint-mod 4) + (mag-scale float 4) + (extra handle) + ) + (:state-methods + idle + (use symbol) + hidden + die + ) + ) + +;; definition for method 3 of type gun +(defmethod inspect ((this gun)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tcontrol: ~A~%" (-> this root)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Tread-scale: ~A~%" (-> this read-scale)) + (format #t "~2Tgun-type: ~D~%" (-> this gun-type)) + (format #t "~2Tbarrel[2] @ #x~X~%" (-> this barrel)) + (format #t "~2Tmag[4] @ #x~X~%" (-> this mag)) + (format #t "~2Tmag-scale[4] @ #x~X~%" (-> this mag-scale)) + (format #t "~2Textra: ~D~%" (-> this extra)) + (label cfg-4) + this + ) + +;; definition of type gun-info +(deftype gun-info (basic) + ((process (pointer target)) + (gun (pointer gun)) + (gun-pos transformq :inline) + (gun-trans vector :inline :overlay-at (-> gun-pos trans)) + (gun-quat quaternion :inline :overlay-at (-> gun-pos rot data 0)) + (gun-scale vector :inline :overlay-at (-> gun-pos scale)) + (gun-type pickup-type) + (using-gun-type pickup-type) + (active? symbol) + (latch? symbol) + (put-away? symbol) + (surpress-time time-frame) + (fire-time time-frame) + (gun-delay-fire float) + (gun-time time-frame) + (gun-get-on-time time-frame) + (active-time time-frame) + (fire-delay uint32) + (gun-control uint32) + (gun-target (pointer process-focusable)) + (gun-daxter float) + (gun-select-time time-frame 4) + (gun-roty-rel degrees) + (gun-roty degrees) + (gun-roty-targ degrees) + (hips joint-mod) + (upper-body joint-mod) + (chest joint-mod) + (strip prim-strip) + (uv-slide float) + (fire-dir-rot degrees) + (fire-dir vector :inline) + (unk-vec vector :inline) + (fire-point vector :inline :offset 256) + (fire-dir-backup vector :inline) + (fire-dir-out vector :inline) + (fire-pending int32) + (fire-pending-time time-frame) + (fire-start-time time-frame) + (fire-charge float) + (fire-spin degrees) + (fire-spinv degrees) + (fire-chamber int32) + (fire-range meters) + (laser-active? symbol) + (laser-point vector :inline) + (laser-dir vector :inline) + (unk-vec00 vector :inline) + (laser-hit-point vector :inline :offset 400) + (track? gun-track-flags) + (track-tilt degrees) + (track-turn degrees) + (track-find-range meters) + (track-turnv-range meters) + (track-tilt-range meters) + (track-turn-range meters) + (track-tilt-max degrees) + (track-turn-max degrees) + (track-angle-mult float) + (track-beam-size float) + (track-auto-fire symbol) + (track-require uint32) + (track-target-hold-time time-frame) + (track-start-time time-frame) + (track-press-start-time time-frame) + (track-target focus 2 :inline) + (track-trans vector :inline) + (track-dir vector :inline) + (turn-fast-hold-time time-frame) + (blue-whine-sound-id sound-id) + (blue-whine-volume float) + (mode-sound-bank connection) + (top-anim-twist vector :inline) + (top-anim-twist-targ vector :inline) + (top-anim-look-at vector :inline) + (top-anim-twist-reset uint64) + (top-anim-gun-height meters) + (top-anim-blue-cycle float) + (top-anim-low-high float) + (top-anim-extra-twistv degrees) + (top-anim-tilt-up degrees) + (attack-combo combo-tracker :inline) + (combo-window-start time-frame) + (combo-window-state symbol) + (combo-fire-delay uint32) + (charge-ammo float) + (charge-start-time time-frame) + (charge-inc-time time-frame) + (charge-active? handle) + (part sparticle-launch-control) + (ammo-required float) + ) + (:methods + (gun-info-method-9 (_type_) vector) + ) + ) + +;; definition for method 3 of type gun-info +(defmethod inspect ((this gun-info)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tgun: #x~X~%" (-> this gun)) + (format #t "~1Tgun-pos: #~%" (-> this gun-pos)) + (format #t "~1Tgun-trans: ~`vector`P~%" (-> this gun-pos)) + (format #t "~1Tgun-quat: ~`vector`P~%" (-> this gun-pos quat)) + (format #t "~1Tgun-scale: ~`vector`P~%" (-> this gun-pos scale)) + (format #t "~1Tgun-type: #x~X : ~S~%" (-> this gun-type) (pickup-type->string (-> this gun-type))) + (format + #t + "~1Tusing-gun-type: #x~X : ~S~%" + (-> this using-gun-type) + (pickup-type->string (-> this using-gun-type)) + ) + (format #t "~1Tactive?: ~A~%" (-> this active?)) + (format #t "~1Tlatch?: ~A~%" (-> this latch?)) + (format #t "~1Tput-away?: ~A~%" (-> this put-away?)) + (format #t "~1Tsurpress-time: ~D~%" (-> this surpress-time)) + (format #t "~1Tfire-time: ~D~%" (-> this fire-time)) + (format #t "~1Tgun-delay-fire: ~f~%" (-> this gun-delay-fire)) + (format #t "~1Tgun-time: ~D~%" (-> this gun-time)) + (format #t "~1Tgun-get-on-time: ~D~%" (-> this gun-get-on-time)) + (format #t "~1Tactive-time: ~D~%" (-> this active-time)) + (format #t "~1Tfire-delay: ~D~%" (-> this fire-delay)) + (format #t "~1Tgun-control: ~D~%" (-> this gun-control)) + (format #t "~1Tgun-target: ~D~%" (-> this gun-target)) + (format #t "~1Tgun-daxter: ~f~%" (-> this gun-daxter)) + (format #t "~1Tgun-select-time[4] @ #x~X~%" (-> this gun-select-time)) + (format #t "~1Tgun-roty-rel: (deg ~r)~%" (-> this gun-roty-rel)) + (format #t "~1Tgun-roty: (deg ~r)~%" (-> this gun-roty)) + (format #t "~1Tgun-roty-targ: (deg ~r)~%" (-> this gun-roty-targ)) + (format #t "~1Thips: ~A~%" (-> this hips)) + (format #t "~1Tupper-body: ~A~%" (-> this upper-body)) + (format #t "~1Tchest: ~A~%" (-> this chest)) + (format #t "~1Tstrip: ~A~%" (-> this strip)) + (format #t "~1Tuv-slide: ~f~%" (-> this uv-slide)) + (format #t "~1Tfire-dir-rot: (deg ~r)~%" (-> this fire-dir-rot)) + (format #t "~1Tfire-dir: ~`vector`P~%" (-> this fire-dir)) + (format #t "~1Tfire-point: ~`vector`P~%" (-> this fire-point)) + (format #t "~1Tfire-dir-backup: ~`vector`P~%" (-> this fire-dir-backup)) + (format #t "~1Tfire-dir-out: ~`vector`P~%" (-> this fire-dir-out)) + (format #t "~1Tfire-pending: ~D~%" (-> this fire-pending)) + (format #t "~1Tfire-pending-time: ~D~%" (-> this fire-pending-time)) + (format #t "~1Tfire-start-time: ~D~%" (-> this fire-start-time)) + (format #t "~1Tfire-charge: ~f~%" (-> this fire-charge)) + (format #t "~1Tfire-spin: (deg ~r)~%" (-> this fire-spin)) + (format #t "~1Tfire-spinv: (deg ~r)~%" (-> this fire-spinv)) + (format #t "~1Tfire-chamber: ~D~%" (-> this fire-chamber)) + (format #t "~1Tfire-range: (meters ~m)~%" (-> this fire-range)) + (format #t "~1Tlaser-active?: ~A~%" (-> this laser-active?)) + (format #t "~1Tlaser-point: ~`vector`P~%" (-> this laser-point)) + (format #t "~1Tlaser-dir: ~`vector`P~%" (-> this laser-dir)) + (format #t "~1Tlaser-hit-point: ~`vector`P~%" (-> this laser-hit-point)) + (format #t "~1Ttrack?: ~D~%" (-> this track?)) + (format #t "~1Ttrack-tilt: (deg ~r)~%" (-> this track-tilt)) + (format #t "~1Ttrack-turn: (deg ~r)~%" (-> this track-turn)) + (format #t "~1Ttrack-find-range: (meters ~m)~%" (-> this track-find-range)) + (format #t "~1Ttrack-turnv-range: (meters ~m)~%" (-> this track-turnv-range)) + (format #t "~1Ttrack-tilt-range: (meters ~m)~%" (-> this track-tilt-range)) + (format #t "~1Ttrack-turn-range: (meters ~m)~%" (-> this track-turn-range)) + (format #t "~1Ttrack-tilt-max: (deg ~r)~%" (-> this track-tilt-max)) + (format #t "~1Ttrack-turn-max: (deg ~r)~%" (-> this track-turn-max)) + (format #t "~1Ttrack-angle-mult: ~f~%" (-> this track-angle-mult)) + (format #t "~1Ttrack-beam-size: ~f~%" (-> this track-beam-size)) + (format #t "~1Ttrack-auto-fire: ~A~%" (-> this track-auto-fire)) + (format #t "~1Ttrack-require: ~D~%" (-> this track-require)) + (format #t "~1Ttrack-target-hold-time: ~D~%" (-> this track-target-hold-time)) + (format #t "~1Ttrack-start-time: ~D~%" (-> this track-start-time)) + (format #t "~1Ttrack-press-start-time: ~D~%" (-> this track-press-start-time)) + (format #t "~1Ttrack-target[2] @ #x~X~%" (-> this track-target)) + (dotimes (s5-2 2) + (format #t "~T [~D]~1Ttrack-target: ~`focus`P~%" s5-2 (-> this track-target s5-2)) + ) + (format #t "~1Ttrack-trans: ~`vector`P~%" (-> this track-trans)) + (format #t "~1Ttrack-dir: ~`vector`P~%" (-> this track-dir)) + (format #t "~1Tturn-fast-hold-time: ~D~%" (-> this turn-fast-hold-time)) + (format #t "~1Tblue-whine-sound-id: ~D~%" (-> this blue-whine-sound-id)) + (format #t "~1Tblue-whine-volume: ~f~%" (-> this blue-whine-volume)) + (format #t "~1Tmode-sound-bank: #~%" (-> this mode-sound-bank)) + (format #t "~1Ttop-anim-twist: ~`vector`P~%" (-> this top-anim-twist)) + (format #t "~1Ttop-anim-twist-targ: ~`vector`P~%" (-> this top-anim-twist-targ)) + (format #t "~1Ttop-anim-look-at: ~`vector`P~%" (-> this top-anim-look-at)) + (format #t "~1Ttop-anim-twist-reset: ~D~%" (-> this top-anim-twist-reset)) + (format #t "~1Ttop-anim-gun-height: (meters ~m)~%" (-> this top-anim-gun-height)) + (format #t "~1Ttop-anim-blue-cycle: ~f~%" (-> this top-anim-blue-cycle)) + (format #t "~1Ttop-anim-low-high: ~f~%" (-> this top-anim-low-high)) + (format #t "~1Ttop-anim-extra-twistv: (deg ~r)~%" (-> this top-anim-extra-twistv)) + (format #t "~1Ttop-anim-tilt-up: (deg ~r)~%" (-> this top-anim-tilt-up)) + (format #t "~1Tattack-combo: #~%" (-> this attack-combo)) + (format #t "~1Tcombo-window-start: ~D~%" (-> this combo-window-start)) + (format #t "~1Tcombo-window-state: ~A~%" (-> this combo-window-state)) + (format #t "~1Tcombo-fire-delay: ~D~%" (-> this combo-fire-delay)) + (format #t "~1Tcharge-ammo: ~f~%" (-> this charge-ammo)) + (format #t "~1Tcharge-start-time: ~D~%" (-> this charge-start-time)) + (format #t "~1Tcharge-inc-time: ~D~%" (-> this charge-inc-time)) + (format #t "~1Tcharge-active?: ~D~%" (-> this charge-active?)) + (format #t "~1Tpart: ~A~%" (-> this part)) + (format #t "~1Tammo-required: ~f~%" (-> this ammo-required)) + (label cfg-7) + this + ) + +;; definition for function using-gun? +(defun using-gun? ((arg0 target)) + (nonzero? (-> arg0 gun gun-type)) + ) + +;; definition for function enabled-gun? +(defun enabled-gun? ((arg0 target)) + (nonzero? (-> arg0 gun using-gun-type)) + ) + +;; definition for function gun->ammo +;; WARN: Return type mismatch int vs pickup-type. +(defun gun->ammo ((arg0 pickup-type)) + (let ((v1-0 arg0)) + (the-as pickup-type (cond + ((or (= v1-0 (pickup-type eco-yellow)) + (= v1-0 (pickup-type gun-yellow-1)) + (= v1-0 (pickup-type gun-yellow-2)) + (= v1-0 (pickup-type gun-yellow-3)) + ) + (the-as pickup-type (pickup-type ammo-yellow)) + ) + ((or (= v1-0 (pickup-type eco-red)) + (= v1-0 (pickup-type gun-red-1)) + (= v1-0 (pickup-type gun-red-2)) + (= v1-0 (pickup-type gun-red-3)) + ) + (the-as pickup-type (pickup-type ammo-red)) + ) + ((or (= v1-0 (pickup-type eco-blue)) + (= v1-0 (pickup-type gun-blue-1)) + (= v1-0 (pickup-type gun-blue-2)) + (= v1-0 (pickup-type gun-blue-3)) + ) + (the-as pickup-type (pickup-type ammo-blue)) + ) + ((or (= v1-0 (pickup-type eco-dark)) + (= v1-0 (pickup-type gun-dark-1)) + (= v1-0 (pickup-type gun-dark-2)) + (= v1-0 (pickup-type gun-dark-3)) + ) + (the-as pickup-type (pickup-type ammo-dark)) + ) + (else + (the-as pickup-type (pickup-type none)) + ) + ) + ) + ) + ) + +;; definition for function gun->eco +;; WARN: Return type mismatch int vs pickup-type. +(defun gun->eco ((arg0 pickup-type)) + (let ((v1-0 arg0)) + (the-as pickup-type (cond + ((or (= v1-0 (pickup-type eco-yellow)) + (= v1-0 (pickup-type gun-yellow-1)) + (= v1-0 (pickup-type gun-yellow-2)) + (= v1-0 (pickup-type gun-yellow-3)) + ) + (the-as pickup-type (pickup-type eco-yellow)) + ) + ((or (= v1-0 (pickup-type eco-red)) + (= v1-0 (pickup-type gun-red-1)) + (= v1-0 (pickup-type gun-red-2)) + (= v1-0 (pickup-type gun-red-3)) + ) + (the-as pickup-type (pickup-type eco-red)) + ) + ((or (= v1-0 (pickup-type eco-blue)) + (= v1-0 (pickup-type gun-blue-1)) + (= v1-0 (pickup-type gun-blue-2)) + (= v1-0 (pickup-type gun-blue-3)) + ) + (the-as pickup-type (pickup-type eco-blue)) + ) + ((or (= v1-0 (pickup-type eco-dark)) + (= v1-0 (pickup-type gun-dark-1)) + (= v1-0 (pickup-type gun-dark-2)) + (= v1-0 (pickup-type gun-dark-3)) + ) + (the-as pickup-type (pickup-type eco-dark)) + ) + (else + (the-as pickup-type (pickup-type none)) + ) + ) + ) + ) + ) + +;; definition for method 12 of type fact-info-target +(defmethod get-gun-ammo ((this fact-info-target)) + (let ((v1-2 (gun->ammo (-> this process gun gun-type)))) + (if (= v1-2 (pickup-type none)) + 0.0 + (-> this process game gun-ammo (+ v1-2 -15)) + ) + ) + ) + +;; definition of type beam-info +(deftype beam-info (structure) + ((y-scale float) + ) + ) + +;; definition for method 3 of type beam-info +(defmethod inspect ((this beam-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'beam-info) + (format #t "~1Ty-scale: ~f~%" (-> this y-scale)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-gun gun gun-lod0-jg -1 + ((gun-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.5) + :shadow gun-shadow-mg + :shadow-joint-index 3 + :light-index 1 + ) + +;; definition for symbol *gun-shadow-control*, type shadow-control +(define *gun-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #xa)) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w 81920.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ammo-yellow gun gun-ammo-yellow-lod0-jg gun-ammo-idle-ja + ((gun-ammo-yellow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + :light-index 1 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ammo-red gun gun-ammo-red-lod0-jg gun-ammo-idle-ja + ((gun-ammo-red-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + :light-index 1 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ammo-blue gun gun-ammo-blue-lod0-jg gun-ammo-idle-ja + ((gun-ammo-blue-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + :light-index 1 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ammo-dark gun gun-ammo-dark-lod0-jg gun-ammo-idle-ja + ((gun-ammo-dark-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + :light-index 1 + ) + +;; failed to figure out what this is: +(defskelgroup skel-gun-red-cone gun gun-red-cone-lod0-jg gun-red-cone-idle-ja + ((gun-red-cone-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :texture-level 10 + ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-util_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-util_REF.gc new file mode 100644 index 00000000000..a7d0dd7e1c5 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-util_REF.gc @@ -0,0 +1,1281 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type gun-eject +(deftype gun-eject (projectile-bounce) + () + ) + +;; definition for method 3 of type gun-eject +(defmethod inspect ((this gun-eject)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile-bounce inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 31 of type gun-eject +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-31 ((this gun-eject)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (let ((v1-5 (-> this skel root-channel 0))) + (set! (-> v1-5 frame-group) (-> this parent 0 skel channel 0 frame-group)) + ) + (let ((t9-3 (method-of-type projectile-bounce projectile-method-31))) + (t9-3 this) + ) + (quaternion-copy! (-> this root quat) (-> this parent 0 root quat)) + (set! (-> this timeout) (seconds 4)) + (set! (-> this root root-prim local-sphere w) 3276.8) + (logclear! (-> this mask) (process-mask projectile)) + 0 + (none) + ) + +;; definition of type gun-mag-yellow +(deftype gun-mag-yellow (projectile-bounce) + () + ) + +;; definition for method 3 of type gun-mag-yellow +(defmethod inspect ((this gun-mag-yellow)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile-bounce inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 31 of type gun-mag-yellow +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-31 ((this gun-mag-yellow)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile-bounce projectile-method-31))) + (t9-2 this) + ) + (set! (-> this timeout) (seconds 4)) + (sound-play "dark-shot-fire") + 0 + (none) + ) + +;; definition of type gun-mag-red +(deftype gun-mag-red (projectile-bounce) + () + ) + +;; definition for method 3 of type gun-mag-red +(defmethod inspect ((this gun-mag-red)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile-bounce inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 31 of type gun-mag-red +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-31 ((this gun-mag-red)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile-bounce projectile-method-31))) + (t9-2 this) + ) + (set! (-> this timeout) (seconds 4)) + (sound-play "dark-shot-fire") + 0 + (none) + ) + +;; definition of type gun-mag-blue +(deftype gun-mag-blue (projectile-bounce) + () + ) + +;; definition for method 3 of type gun-mag-blue +(defmethod inspect ((this gun-mag-blue)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile-bounce inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 31 of type gun-mag-blue +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-31 ((this gun-mag-blue)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile-bounce projectile-method-31))) + (t9-2 this) + ) + (set! (-> this timeout) (seconds 4)) + (sound-play "dark-shot-fire") + 0 + (none) + ) + +;; definition of type gun-mag-dark +(deftype gun-mag-dark (projectile-bounce) + () + ) + +;; definition for method 3 of type gun-mag-dark +(defmethod inspect ((this gun-mag-dark)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile-bounce inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 31 of type gun-mag-dark +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-31 ((this gun-mag-dark)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile-bounce projectile-method-31))) + (t9-2 this) + ) + (set! (-> this timeout) (seconds 4)) + (sound-play "dark-shot-fire") + 0 + (none) + ) + +;; definition for symbol *beam-info*, type beam-info +(define *beam-info* (new 'static 'beam-info)) + +;; definition for function birth-func-setup-beam +;; WARN: Return type mismatch int vs none. +(defun birth-func-setup-beam ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (a0-2 float) (a0-3 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a0-1 arg2) + (v1-0 *particle-quat*) + ) + (cond + ((< (-> v1-0 w) 0.0) + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-2 vf1) + ) + (else + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-3 vf1) + ) + ) + ) + (set! (-> arg2 conerot w) (-> *beam-info* y-scale)) + 0 + (none) + ) + ) + +;; definition for function birth-func-laser-pointer +;; WARN: Return type mismatch int vs none. +(defun birth-func-laser-pointer ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (a0-2 float) (a0-3 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a0-1 arg2) + (v1-0 *particle-quat*) + ) + (cond + ((< (-> v1-0 w) 0.0) + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-2 vf1) + ) + (else + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-3 vf1) + ) + ) + ) + (set! (-> arg2 conerot w) (-> *beam-info* y-scale)) + (set! (-> arg1 user1-int16) (the-as uint (logand (/ (-> *display* base-clock frame-counter) 10) 31))) + 0 + (none) + ) + ) + +;; definition for function draw-beam +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun draw-beam ((arg0 sparticle-launcher) (arg1 vector) (arg2 vector) (arg3 symbol)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) + (set! (-> s5-0 1 quad) (-> arg2 quad)) + (let ((v1-2 (get-field-spec-by-id arg0 (sp-field-id spt-scale-y)))) + (when v1-2 + (let ((f30-0 (-> v1-2 initial-valuef))) + (if arg3 + (set! f30-0 (fmin f30-0 (vector-length arg2))) + ) + (vector-normalize! (-> s5-0 1) f30-0) + (set! (-> *beam-info* y-scale) f30-0) + ) + ) + ) + (vector+! (-> s5-0 0) arg1 (-> s5-0 1)) + (when (line-in-view-frustum? arg1 (-> s5-0 0)) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (vector+float*! s3-1 arg1 (-> s5-0 1) 0.5) + (vector-normalize! (-> s5-0 1) 1.0) + (forward-up->quaternion *particle-quat* (-> s5-0 1) *y-vector*) + (let ((t9-5 sp-launch-particles-var) + (a0-12 *sp-particle-system-3d*) + (a1-9 arg0) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> s3-1 quad)) + (t9-5 a0-12 a1-9 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (dotimes (s5-1 2) + (quaternion-rotate-local-z! *particle-quat* *particle-quat* 10922.667) + (let ((t9-7 sp-launch-particles-var) + (a0-14 *sp-particle-system-3d*) + (a1-11 arg0) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> s3-1 quad)) + (t9-7 a0-14 a1-11 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 7 of type gun +;; WARN: Return type mismatch process-drawable vs gun. +(defmethod relocate ((this gun) (offset int)) + (dotimes (v1-0 2) + (if (nonzero? (-> this barrel v1-0)) + (&+! (-> this barrel v1-0) offset) + ) + ) + (dotimes (v1-3 4) + (if (nonzero? (-> this mag v1-3)) + (&+! (-> this mag v1-3) offset) + ) + ) + (the-as gun ((method-of-type process-drawable relocate) this offset)) + ) + +;; definition for method 7 of type gun-info +;; WARN: Return type mismatch prim-strip vs gun-info. +(defmethod relocate ((this gun-info) (offset int)) + (the-as gun-info (when (nonzero? (-> this strip)) + (let ((v0-0 (&+ (-> this strip) offset))) + (set! (-> this strip) v0-0) + v0-0 + ) + ) + ) + ) + +;; definition for function gun-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior gun-post gun () + (let ((gp-0 (ppointer->process (-> self parent)))) + (let ((s5-0 self)) + (set! self (the-as gun gp-0)) + (target-gun-compute-pos) + (set! self s5-0) + ) + (set! (-> self root trans quad) (-> (the-as target gp-0) gun gun-pos trans quad)) + (let ((v1-6 (-> (the-as target gp-0) gun gun-pos quat quad))) + (set! (-> self root quat quad) v1-6) + ) + (set! (-> self root scale quad) (-> (the-as target gp-0) gun gun-pos scale quad)) + (when (-> self read-scale) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (matrix->scale (-> (the-as target gp-0) node-list data 36 bone transform) s5-1) + (vector-float*! s5-1 s5-1 0.71428573) + (if (< 0.0 (-> (the-as target gp-0) gun gun-daxter)) + (matrix->scale (-> (the-as target gp-0) sidekick 0 node-list data 28 bone transform) s4-0) + ) + (vector-lerp! (-> self root scale) s5-1 s4-0 (-> (the-as target gp-0) gun gun-daxter)) + ) + ) + (set! (-> self draw light-index) (-> (the-as target gp-0) draw light-index)) + (let ((v1-28 (-> (the-as target gp-0) draw color-mult quad))) + (set! (-> self draw color-mult quad) v1-28) + ) + (let ((v1-30 (-> (the-as target gp-0) draw color-emissive quad))) + (set! (-> self draw color-emissive quad) v1-30) + ) + (set! (-> self draw force-fade) (-> (the-as target gp-0) draw force-fade)) + (set! (-> self draw global-effect) (-> (the-as target gp-0) draw global-effect)) + (set! (-> self draw death-vertex-skip) (-> self parent 0 draw death-vertex-skip)) + (set! (-> self draw death-effect) (-> self parent 0 draw death-effect)) + (set! (-> self draw death-timer) (-> self parent 0 draw death-timer)) + (set! (-> self draw death-timer-org) (-> self parent 0 draw death-timer-org)) + (set! (-> self draw death-draw-overlap) (-> self parent 0 draw death-draw-overlap)) + (let ((v1-57 (-> (the-as target gp-0) draw shadow-ctrl settings shadow-dir quad))) + (set! (-> self draw shadow-ctrl settings shadow-dir quad) v1-57) + ) + (cond + ((logtest? (-> (the-as target gp-0) draw shadow-ctrl settings flags) (shadow-flags disable-draw)) + (let ((v1-63 (-> self draw shadow-ctrl))) + (logior! (-> v1-63 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (else + (let ((v1-66 (-> self draw shadow-ctrl))) + (logclear! (-> v1-66 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + (twist-set! (-> self barrel 0) (the-as float #f) (the-as float #f) (-> (the-as target gp-0) gun fire-spin)) + (twist-set! + (-> self barrel 1) + (the-as float #f) + (the-as float #f) + (if (= (-> self gun-type) (pickup-type gun-blue-2)) + (-> (the-as target gp-0) gun fire-spin) + 0.0 + ) + ) + (if (or (logtest? (-> (the-as target gp-0) draw status) + (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2) + ) + (or (logtest? (-> (the-as target gp-0) target-effect) 1) + (zero? (-> (the-as target gp-0) skel active-channels)) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (if (logtest? (-> (the-as target gp-0) draw status) (draw-control-status force-fade)) + (logior! (-> self draw status) (draw-control-status force-fade)) + (logclear! (-> self draw status) (draw-control-status force-fade)) + ) + (if (logtest? (-> (the-as target gp-0) target-effect) 7) + (logior! (-> self draw global-effect) (draw-control-global-effect no-textures)) + (logclear! (-> self draw global-effect) (draw-control-global-effect no-textures)) + ) + (if (logtest? (-> (the-as target gp-0) target-effect) 56) + (logior! (-> self draw global-effect) (draw-control-global-effect rim-lights)) + (logclear! (-> self draw global-effect) (draw-control-global-effect rim-lights)) + ) + ) + (dotimes (gp-1 4) + (cond + ((= (-> self parent 0 game gun-ammo gp-1) 0.0) + (when (!= (-> self mag-scale gp-1) 0.0) + (let ((s5-2 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (vector<-cspace! s3-0 (-> self mag gp-1 joint)) + (vector-normalize-copy! s4-1 (-> self mag gp-1 joint bone transform uvec) 40960.0) + (+! (-> s4-1 y) 81920.0) + (set! (-> s5-2 ent) (-> self entity)) + (set! (-> s5-2 charge) 1.0) + (set! (-> s5-2 options) (projectile-options)) + (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) + (set! (-> s5-2 pos quad) (-> s3-0 quad)) + (set! (-> s5-2 vel quad) (-> s4-1 quad)) + ) + (set! (-> s5-2 notify-handle) (the-as handle #f)) + (set! (-> s5-2 owner-handle) (the-as handle #f)) + (set! (-> s5-2 target-handle) (the-as uint #f)) + (set! (-> s5-2 target-pos quad) (the-as uint128 0)) + (set! (-> s5-2 ignore-handle) (process->handle self)) + (let* ((v1-133 *game-info*) + (a0-59 (+ (-> v1-133 attack-id) 1)) + ) + (set! (-> v1-133 attack-id) a0-59) + (set! (-> s5-2 attack-id) a0-59) + ) + (set! (-> s5-2 timeout) (seconds 4)) + (let ((t9-8 spawn-projectile) + (v1-135 gp-1) + ) + (t9-8 + (cond + ((zero? v1-135) + gun-mag-yellow + ) + ((= v1-135 1) + gun-mag-red + ) + ((= v1-135 2) + gun-mag-blue + ) + (else + gun-mag-dark + ) + ) + s5-2 + self + *default-dead-pool* + ) + ) + ) + ) + (set! (-> self mag-scale gp-1) 0.0) + (trs-set! (-> self mag gp-1) (the-as vector #f) (the-as quaternion #f) *zero-vector*) + ) + (else + (seek! (-> self mag-scale gp-1) 1.0 (* 8.0 (seconds-per-frame))) + (let* ((f30-0 (-> self mag-scale gp-1)) + (s5-3 (-> self mag gp-1)) + (s4-2 (method-of-object s5-3 trs-set!)) + (s3-1 #f) + (s2-0 #f) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s1-0 x) (lerp-scale 0.1 1.0 f30-0 0.4 1.0)) + (set! (-> s1-0 y) (lerp-scale 0.0 1.0 f30-0 0.0 0.4)) + (set! (-> s1-0 z) (lerp-scale 0.1 1.0 f30-0 0.4 1.0)) + (set! (-> s1-0 w) 1.0) + (s4-2 s5-3 (the-as vector s3-1) (the-as quaternion s2-0) s1-0) + ) + ) + ) + ) + (ja-post) + (if *display-sidekick-stats* + (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate hidden (gun) + :virtual #t + :trans (behavior () + (let ((v1-0 (-> self parent))) + (if (not (focus-test? + (the-as process-focusable (if v1-0 + (the-as process-focusable (-> v1-0 0 self)) + ) + ) + in-head + ) + ) + (go-virtual idle) + ) + ) + ) + :code (behavior () + (ja-channel-set! 0) + (ja-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate idle (gun) + :virtual #t + :trans (behavior () + (set! (-> self gun-type) (-> self parent 0 game gun-type)) + (let ((a0-0 (ppointer->process (-> self parent)))) + (cond + ((focus-test? (the-as process-focusable a0-0) in-head) + (go-virtual hidden) + ) + ((nonzero? (-> self parent 0 gun gun-type)) + (go-virtual use (the-as symbol a0-0)) + ) + ) + ) + ) + :code (behavior () + (set! (-> self draw shadow) #f) + (ja-channel-set! 1) + (set! (-> self read-scale) #f) + (until #f + (ja-no-eval :group! gun-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post gun-post + ) + +;; failed to figure out what this is: +(defstate use (gun) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notice) + (case (-> block param 0) + (('die) + (if (-> *setting-control* user-current gun-eject) + (go-virtual die) + ) + ) + ) + ) + (('release) + (send-event (ppointer->process (-> self parent)) 'release) + ) + (('eject-point) + (vector<-cspace! (the-as vector (-> block param 0)) (joint-node gun-lod0-jg backCover)) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set-time! (-> self state-time)) + (set! (-> self draw shadow) (-> self shadow-backup)) + (logior! (-> self skel status) (joint-control-status sync-math)) + ) + :exit (behavior () + (logclear! (-> self skel status) (joint-control-status sync-math)) + ) + :trans (behavior () + (local-vars (a0-14 object)) + (let ((v1-0 (ppointer->process (-> self parent))) + (a0-1 (-> self parent)) + ) + (cond + ((focus-test? + (the-as process-focusable (if a0-1 + (the-as process-focusable (-> a0-1 0 self)) + ) + ) + in-head + ) + (go-virtual hidden) + ) + ((and (= (-> self parent 0 gun gun-type) (pickup-type none)) + (or (not (-> (the-as process-focusable v1-0) skel top-anim frame-group)) + (!= (-> (the-as process-focusable v1-0) skel top-anim interp) 1.0) + ) + ) + (go-virtual idle) + ) + ((begin + (set! a0-14 (!= (-> self parent 0 game gun-type) (-> self gun-type))) + (and (the-as symbol a0-14) (let ((v1-16 (-> self state-time))) + (set! a0-14 (current-time)) + (!= v1-16 (the-as time-frame a0-14)) + ) + ) + ) + (go-virtual use (the-as symbol a0-14)) + ) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.1)) + (gun->eco (-> self gun-type)) + (let ((gp-0 (-> self gun-type))) + (gun->eco (-> self parent 0 game gun-type)) + (let ((v1-8 (-> self parent 0 game gun-type))) + (set! (-> self gun-type) v1-8) + (cond + ((and (= gp-0 (pickup-type gun-red-1)) (= v1-8 (pickup-type gun-red-2))) + (ja-no-eval :group! gun-gun-red1-red2-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((and (= gp-0 (pickup-type gun-yellow-2)) (= v1-8 (pickup-type gun-yellow-3))) + (ja-no-eval :group! gun-gun-yellow2-yellow3-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((and (= gp-0 (pickup-type gun-blue-1)) (= v1-8 (pickup-type gun-blue-2))) + (ja-no-eval :group! gun-gun-blue1-blue2-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((and (= gp-0 (pickup-type gun-dark-1)) (= v1-8 (pickup-type gun-dark-2))) + (ja-no-eval :group! gun-gun-dark1-dark2-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((and (= gp-0 (pickup-type gun-dark-2)) (= v1-8 (pickup-type gun-dark-3))) + (ja-no-eval :group! gun-gun-dark2-dark3-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + (let* ((v1-131 (-> self gun-type)) + (gp-1 (cond + ((= v1-131 (pickup-type gun-yellow-1)) + gun-idle-yellow-ja + ) + ((= v1-131 (pickup-type gun-yellow-2)) + gun-idle-yellow2-ja + ) + ((= v1-131 (pickup-type gun-yellow-3)) + gun-idle-yellow3-ja + ) + ((= v1-131 (pickup-type gun-red-1)) + gun-idle-red-ja + ) + ((= v1-131 (pickup-type gun-red-2)) + gun-idle-red2-ja + ) + ((= v1-131 (pickup-type gun-red-3)) + gun-idle-red3-ja + ) + ((= v1-131 (pickup-type gun-blue-1)) + gun-idle-blue-ja + ) + ((= v1-131 (pickup-type gun-blue-2)) + gun-idle-blue2-ja + ) + ((= v1-131 (pickup-type gun-blue-3)) + gun-idle-blue3-ja + ) + ((= v1-131 (pickup-type gun-dark-2)) + gun-idle-dark2-ja + ) + ((= v1-131 (pickup-type gun-dark-3)) + gun-idle-dark3-ja + ) + (else + gun-idle-dark-ja + ) + ) + ) + (s5-0 '(("jakb-gun-yellow-fire" . "gun-yellow-fire") + ("jakb-gun-yellow-fire-low" . "gun-yellow-fire-low") + ("jakb-pilot-gun-yellow-fire" . "gun-yellow-fire") + ("jakb-gun-red-fire" . "gun-red-fire") + ("jakb-pilot-gun-red-fire" . "gun-red-fire") + ("jakb-gun-blue-fire" . "gun-blue-fire") + ("jakb-pilot-gun-blue-fire" . "gun-blue-fire") + ("jakb-gun-blue-fire-single" . "gun-blue-fire-single") + ("jakb-pilot-gun-blue-fire-single" . "gun-blue-fire-single") + ("jakb-gun-dark-fire" . "gun-dark-fire") + ("jakb-pilot-gun-dark-fire" . "gun-dark-fire") + ("jakb-gun-red-fire-2" . "gun-red-fire-2") + ("jakb-gun-yellow-fire-3" . "gun-yellow-fire-3") + ("jakb-gun-blue-fire-2" . "gun-blue-fire-2") + ) + ) + (v1-156 (-> self parent)) + (s4-0 (if v1-156 + (the-as process-focusable (-> v1-156 0 self)) + ) + ) + ) + (until #f + (let* ((v1-160 (-> s4-0 skel top-anim frame-group)) + (s3-0 (if v1-160 + (-> v1-160 name) + ) + ) + (s2-0 (nassoc s3-0 s5-0)) + (s1-0 (if s2-0 + (-> (the-as pair s2-0) cdr) + ) + ) + ) + (cond + ((string= (the-as string s1-0) "gun-red-fire") + (case (-> self gun-type) + (((pickup-type gun-red-3)) + (set! s1-0 "gun-red-fire-3") + ) + ) + ) + ((or (string= (the-as string s1-0) "gun-yellow-fire") (string= (the-as string s1-0) "gun-yellow-fire-low")) + (case (-> self gun-type) + (((pickup-type gun-yellow-2)) + (set! s1-0 "gun-yellow-fire-2") + ) + (((pickup-type gun-yellow-3)) + (set! s1-0 "gun-yellow-fire-3") + ) + ) + ) + ((string= (the-as string s1-0) "gun-blue-fire") + (case (-> self gun-type) + (((pickup-type gun-blue-3)) + (set! s1-0 "gun-blue-fire-3") + ) + ) + ) + ((string= (the-as string s1-0) "gun-blue-fire-single") + (case (-> self gun-type) + (((pickup-type gun-blue-3)) + (set! s1-0 "gun-blue-fire-3-single") + ) + ) + ) + ((string= (the-as string s1-0) "gun-dark-fire") + (case (-> self gun-type) + (((pickup-type gun-red-2)) + (set! s1-0 "gun-red-fire-2") + ) + (((pickup-type gun-dark-2)) + (set! s1-0 "gun-dark-fire-2") + ) + (((pickup-type gun-dark-3)) + (set! s1-0 "gun-dark-fire-3") + ) + ) + ) + ) + (let ((a1-27 (if s1-0 + (get-art-by-name (-> self draw art-group) (the-as string s1-0) art-joint-anim) + ) + ) + ) + (cond + (s2-0 + (ja :group! a1-27 :num! (identity (-> s4-0 skel top-anim frame-num))) + (set! (-> self read-scale) #f) + ) + ((nmember s3-0 '("jakb-gun-attack-butt" + "jakb-gun-attack-butt-end" + "jakb-gun-attack-butt-blue" + "jakb-gun-attack-butt-blue-end" + "jakb-gun-attack-from-stance" + "jakb-gun-attack-from-stance-end" + "jakb-gun-attack-from-stance-blue" + "jakb-gun-attack-from-stance-blue-end" + "jakb-pilot-gun-red-yellow" + ) + ) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + (set! (-> self read-scale) #t) + ) + ((and (= (-> s4-0 skel top-anim interp) 1.0) + (begin + (set! s2-0 (nassoc s3-0 '(("jakb-gun-yellow-takeout" . "gun-red-yellow") + ("jakb-gun-blue-takeout" . "gun-red-blue") + ("jakb-gun-dark-takeout" . "gun-red-dark") + ("jakb-gun-red-takeout" . "gun-idle-red") + ("jakb-pilot-gun-yellow-takeout" . "gun-red-yellow") + ("jakb-pilot-gun-blue-takeout" . "gun-red-blue") + ("jakb-pilot-gun-dark-takeout" . "gun-red-dark") + ("jakb-pilot-gun-red-takeout" . "gun-idle-red") + ) + ) + ) + s2-0 + ) + ) + (let ((s1-1 + (if s2-0 + (get-art-by-name (-> self draw art-group) (the-as string (-> (the-as pair s2-0) cdr)) art-joint-anim) + ) + ) + ) + (set! (-> self read-scale) #t) + (let* ((v1-208 (-> s4-0 skel top-anim frame-group)) + (f30-0 (+ (* (-> s4-0 skel top-anim frame-num) (-> v1-208 artist-step)) (-> v1-208 artist-base))) + ) + (cond + ((string= s3-0 "jakb-gun-blue-takeout") + (if (>= f30-0 (-> s1-1 artist-base)) + (ja :group! s1-1 :num! (identity (ja-aframe f30-0 0))) + (ja :group! gun-idle-ja) + ) + ) + ((or (string= s3-0 "jakb-gun-dark-takeout") (string= s3-0 "jakb-pilot-gun-dark-takeout")) + (if (>= f30-0 -40.0) + (ja :group! s1-1 :num! (identity (+ 40.0 (ja-aframe f30-0 0)))) + (ja :group! s1-1 :num! min) + ) + ) + ((>= f30-0 -40.0) + (ja :group! s1-1 :num! (identity (ja-aframe f30-0 0))) + ) + (else + (ja :group! gun-idle-ja) + ) + ) + ) + ) + ) + (else + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + (set! (-> self read-scale) #f) + ) + ) + ) + ) + (suspend) + 0 + ) + ) + #f + ) + :post (behavior () + (gun-post) + (let* ((v1-0 (-> self parent)) + (gp-0 (if v1-0 + (the-as process-drawable (-> v1-0 0 self)) + ) + ) + ) + (let ((s5-0 + (and (-> (the-as target gp-0) skel top-anim frame-group) + (not (or (focus-test? (the-as target gp-0) pilot) + (string= (-> (the-as target gp-0) skel top-anim frame-group name) "jakb-gun-attack-from-stance-end") + (string= (-> (the-as target gp-0) skel top-anim frame-group name) "jakb-gun-attack-from-stance") + (string= (-> (the-as target gp-0) skel top-anim frame-group name) "jakb-gun-dark-fire") + (string= (-> (the-as target gp-0) skel top-anim frame-group name) "jakb-gun-stance-dark") + (string= (-> (the-as target gp-0) skel top-anim frame-group name) "jakb-gun-attack-from-stance-blue-end") + ) + ) + ) + ) + ) + (vector<-cspace! (-> (the-as target gp-0) gun fire-point) (joint-node gun-lod0-jg muzzle)) + (set! (-> (the-as target gp-0) gun unk-vec quad) (-> (the-as target gp-0) gun fire-dir quad)) + (cond + ((and (handle->process (-> (the-as target gp-0) gun track-target 0 handle)) + (logtest? (surface-flag gun-direct) (-> (the-as target gp-0) control current-surface flags)) + ) + (vector-! + (-> (the-as target gp-0) gun fire-dir) + (-> (the-as target gp-0) gun track-trans) + (-> (the-as target gp-0) gun fire-point) + ) + (vector-normalize! (-> (the-as target gp-0) gun fire-dir) 1.0) + (set! (-> (the-as target gp-0) gun fire-dir-out quad) (-> (the-as target gp-0) gun fire-dir quad)) + ) + (else + (vector-normalize-copy! + (-> (the-as target gp-0) gun fire-dir) + (-> self node-list data 13 bone transform fvec) + 1.0 + ) + (if s5-0 + (set! (-> (the-as target gp-0) gun fire-dir-out quad) + (-> (the-as target gp-0) node-list data 4 bone transform fvec quad) + ) + ) + (vector-rotate-y! + (-> (the-as target gp-0) gun fire-dir-out) + (-> (the-as target gp-0) gun fire-dir) + (-> (the-as target gp-0) gun fire-dir-rot) + ) + ) + ) + (vector<-cspace! (-> (the-as target gp-0) gun laser-point) (joint-node gun-lod0-jg laser)) + (set! (-> (the-as target gp-0) gun unk-vec00 quad) (-> (the-as target gp-0) gun laser-dir quad)) + (set! (-> (the-as target gp-0) gun laser-dir quad) (-> (the-as target gp-0) gun fire-dir-out quad)) + (if s5-0 + (set! (-> (the-as target gp-0) gun laser-dir quad) + (-> (the-as target gp-0) node-list data 4 bone transform fvec quad) + ) + ) + ) + (let ((s5-1 self)) + (set! self (the-as gun gp-0)) + (target-gun-check) + (set! self s5-1) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (gun) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reset) + (go-virtual idle) + ) + ) + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-float*! + s5-0 + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self parent 0 control quat)) + -20480.0 + ) + (+! (-> s5-0 y) 81920.0) + (set! (-> gp-0 ent) (-> self entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) (-> s4-0 quad)) + (set! (-> gp-0 vel quad) (-> s5-0 quad)) + ) + (set! (-> gp-0 notify-handle) (the-as handle #f)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as uint #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle self)) + (let* ((v1-16 *game-info*) + (a0-13 (+ (-> v1-16 attack-id) 1)) + ) + (set! (-> v1-16 attack-id) a0-13) + (set! (-> gp-0 attack-id) a0-13) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (spawn-projectile gun-eject gp-0 self *default-dead-pool*) + ) + (ja-channel-set! 0) + (ja-post) + (while (logtest? (-> self parent 0 focus-status) (focus-status dead)) + (suspend) + ) + (go-virtual idle) + ) + ) + +;; definition for function gun-init +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior gun-init gun () + (change-to-last-brother self) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-5 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *gun-shadow-control* settings shadow-dir quad) v1-5) + ) + (set! (-> self draw shadow-ctrl) *gun-shadow-control*) + (set! (-> self shadow-backup) (-> self draw shadow)) + (set! (-> self barrel 0) (new 'process 'joint-mod (joint-mod-mode rotate) self 8)) + (set! (-> self barrel 1) (new 'process 'joint-mod (joint-mod-mode rotate) self 10)) + (set! (-> self read-scale) #f) + (set! (-> self extra) (the-as handle #f)) + (set! (-> self mag 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 38)) + (set! (-> self mag 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 36)) + (set! (-> self mag 2) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 37)) + (set! (-> self mag 3) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 39)) + (dotimes (v1-15 4) + (set! (-> self mag-scale v1-15) (if (= (-> self parent 0 game gun-ammo v1-15) 0.0) + 0.0 + 1.0 + ) + ) + ) + (go-virtual idle) + (none) + ) + +;; definition for method 9 of type gun-info +;; INFO: Used lq/sq +(defmethod gun-info-method-9 ((this gun-info)) + (when (and (-> this laser-active?) + (-> this active?) + (not (logtest? (-> this gun 0 draw status) (draw-control-status no-draw))) + #t + ) + (let ((s5-0 (-> this laser-point)) + (s4-0 (new 'stack-no-clear 'collide-query)) + (s3-0 (-> this laser-dir)) + (f30-0 (rotate-y<-vector+vector (-> this laser-dir) (-> this unk-vec00))) + ) + (vector+float*! (-> s4-0 start-pos) s5-0 s3-0 -8192.0) + (vector-float*! (-> s4-0 move-dist) s3-0 163840.0) + (let ((v1-13 s4-0)) + (set! (-> v1-13 radius) (-> this track-beam-size)) + (set! (-> v1-13 collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> v1-13 ignore-process0) (ppointer->process (-> this process))) + (set! (-> v1-13 ignore-process1) #f) + (set! (-> v1-13 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-13 action-mask) (collide-action solid semi-solid)) + ) + (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) + (cond + ((>= f0-3 0.0) + (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) (-> s4-0 move-dist) f0-3) + (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) s3-0 (-> this track-beam-size)) + (let* ((s2-0 (-> s4-0 best-other-tri collide-ptr)) + (s0-0 (if (type? s2-0 collide-shape-prim) + (the-as collide-shape-prim s2-0) + ) + ) + (s1-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 start-pos)) 1638.4)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-1 quad) (-> s4-0 start-pos quad)) + (cond + ((and s0-0 + (or (logtest? (process-mask enemy guard) (-> s0-0 cshape process mask)) + (= (handle->process (-> this track-target 0 handle)) (-> s0-0 cshape process)) + ) + (>= (-> this fire-range) (vector-vector-distance s2-1 s5-0)) + ) + (vector+! s2-1 s2-1 s1-0) + (launch-particles (-> *part-id-table* 211) s2-1) + (launch-particles (-> *part-id-table* 210) s2-1) + ) + (else + (vector+! s2-1 s2-1 s1-0) + (launch-particles (-> *part-id-table* 212) s2-1) + ) + ) + ) + ) + (else + (vector+! (-> s4-0 start-pos) (-> s4-0 start-pos) (-> s4-0 move-dist)) + ) + ) + ) + (set! (-> this laser-hit-point quad) (-> s4-0 start-pos quad)) + (let ((s1-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (camera-pos) s5-0) 1.0)) + (t9-10 vector-normalize!) + (a0-37 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-37 quad) (-> s3-0 quad)) + (let ((s2-3 (t9-10 a0-37 1.0)) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (-> s5-0 quad)) + (let ((v1-47 (vector-normalize-copy! (new 'stack-no-clear 'vector) s2-3 327.68)) + (f28-1 (vector-dot s1-3 s2-3)) + ) + (when (< 0.0 f28-1) + (vector+! s3-1 s3-1 v1-47) + (set! (-> *part-id-table* 209 init-specs 13 initial-valuef) f28-1) + (launch-particles (-> *part-id-table* 209) s3-1) + (set! (-> *part-id-table* 208 init-specs 13 initial-valuef) f28-1) + (launch-particles (-> *part-id-table* 208) s3-1) + ) + ) + ) + ) + (let* ((s3-2 (-> *part-id-table* 207)) + (s2-4 (get-field-spec-by-id s3-2 (sp-field-id spt-timer))) + (s1-5 (vector-! (new 'stack-no-clear 'vector) (-> s4-0 start-pos) s5-0)) + (s4-1 (if (< 182.04445 f30-0) + 3 + 1 + ) + ) + (f30-1 (-> s2-4 initial-valuef)) + (f28-2 (vector-vector-distance (camera-pos) s5-0)) + (s0-2 (get-field-spec-by-id s3-2 (sp-field-id spt-scale-x))) + (f0-13 (cond + ((< f28-2 122.88) + 0.0 + ) + ((< 65536.0 f28-2) + 1.0 + ) + (else + (* 0.000015287453 (+ -122.88 f28-2)) + ) + ) + ) + (f28-3 (-> s0-2 initial-valuef)) + (f26-0 (-> s0-2 random-rangef)) + ) + (set! (-> s0-2 initial-valuef) (* f28-3 f0-13)) + (set! (-> s0-2 random-rangef) (* f26-0 f0-13)) + (set! (-> s2-4 initial-valuef) (the float s4-1)) + (draw-beam s3-2 s5-0 s1-5 #t) + (set! (-> s2-4 initial-valuef) f30-1) + (set! (-> s0-2 initial-valuef) f28-3) + (set! (-> s0-2 random-rangef) f26-0) + ) + ) + ) + (-> this laser-dir) + ) + +;; definition for function do-fire-backcheck +;; INFO: Used lq/sq +(defun do-fire-backcheck ((arg0 vector) (arg1 vector)) + (let* ((v1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) + (a0-3 (vector+float*! (new 'stack-no-clear 'vector) arg0 v1-0 -7372.8)) + (gp-1 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> gp-1 start-pos quad) (-> a0-3 quad)) + (vector-float*! (-> gp-1 move-dist) v1-0 40960.0) + (let ((v1-1 gp-1)) + (set! (-> v1-1 radius) 40.96) + (set! (-> v1-1 collide-with) (collide-spec backgnd hit-by-others-list pusher impenetrable-obj)) + (set! (-> v1-1 ignore-process0) #f) + (set! (-> v1-1 ignore-process1) #f) + (set! (-> v1-1 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-1 action-mask) (collide-action solid)) + ) + (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* gp-1))) + (when (>= f0-3 0.0) + (if (< (* (vector-length (-> gp-1 move-dist)) f0-3) 8192.0) + (return #f) + ) + ) + ) + ) + #t + ) + +;; definition for function get-remaining-player-ammo +(defun get-remaining-player-ammo ((arg0 pickup-type)) + 0.0 + (if (or (logtest? (target-flags tf16) (-> *target* target-flags)) + (logtest? (game-secrets endless-ammo) (-> *target* game secrets)) + ) + 1000.0 + (the-as float (send-event *target* 'query 'pickup arg0)) + ) + ) + +;; definition for function adjust-player-ammo +;; WARN: Return type mismatch object vs float. +(defun adjust-player-ammo ((arg0 int) (arg1 pickup-type)) + (if (and *target* + (and (focus-test? *target* light) (nonzero? (-> *target* lightjak))) + (not (logtest? (-> *target* lightjak stage) (lightjak-stage ls1))) + ) + (pickup-collectable! (-> *target* fact) (pickup-type eco-pill-light) -1.0 (the-as handle #f)) + ) + (the-as float (send-event *target* 'get-pickup arg1 arg0)) + ) + +;; definition for function adjust-player-ammo-over-time +(defun adjust-player-ammo-over-time ((arg0 int) (arg1 float) (arg2 pickup-type) (arg3 float)) + (let* ((f0-2 (* 0.0033333334 (the float arg0) arg1)) + (f30-0 (fmin (fmax 0.0 f0-2) arg3)) + ) + (adjust-player-ammo (the-as int (- f30-0)) arg2) + f30-0 + ) + ) + +;; definition for function truncate-player-ammo +;; WARN: Return type mismatch float vs none. +(defun truncate-player-ammo ((arg0 pickup-type)) + (let* ((f0-0 (get-remaining-player-ammo arg0)) + (f0-1 (- f0-0 (the float (the int f0-0)))) + ) + (adjust-player-ammo (the-as int (- f0-1)) arg0) + ) + (none) + ) + +;; definition of type last-gun-fire-time +(deftype last-gun-fire-time (structure) + ((last-fire-times time-frame 12) + ) + ) + +;; definition for method 3 of type last-gun-fire-time +(defmethod inspect ((this last-gun-fire-time)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'last-gun-fire-time) + (format #t "~1Tlast-fire-times[12] @ #x~X~%" (-> this last-fire-times)) + (label cfg-4) + this + ) + +;; definition for symbol *last-gun-fire-time*, type last-gun-fire-time +(define *last-gun-fire-time* (new 'static 'last-gun-fire-time)) + +;; definition for function compute-gun-fire-time-index +(defun compute-gun-fire-time-index ((arg0 int)) + (max 0 (min 11 (+ arg0 -26))) + ) + +;; definition for function get-last-fire-time +(defun get-last-fire-time ((arg0 int)) + (-> *last-gun-fire-time* last-fire-times (compute-gun-fire-time-index arg0)) + ) + +;; definition for function set-last-fire-time +;; WARN: Return type mismatch int vs none. +(defun set-last-fire-time ((arg0 int)) + (set-time! (-> *last-gun-fire-time* last-fire-times (compute-gun-fire-time-index arg0))) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/target/indax/indax-h_REF.gc b/test/decompiler/reference/jak3/engine/target/indax/indax-h_REF.gc new file mode 100644 index 00000000000..86cbe285799 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/indax/indax-h_REF.gc @@ -0,0 +1,34 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type indax-info +(deftype indax-info (basic) + ((indax-start-time time-frame) + (indax-time time-frame) + (indax-hang-start-time time-frame) + (art-group-backup art-group) + (pad object) + ) + ) + +;; definition for method 3 of type indax-info +(defmethod inspect ((this indax-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tindax-start-time: ~D~%" (-> this indax-start-time)) + (format #t "~1Tindax-time: ~D~%" (-> this indax-time)) + (format #t "~1Tindax-hang-start-time: ~D~%" (-> this indax-hang-start-time)) + (format #t "~1Tart-group-backup: ~A~%" (-> this art-group-backup)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/target/lightjak-h_REF.gc b/test/decompiler/reference/jak3/engine/target/lightjak-h_REF.gc new file mode 100644 index 00000000000..e73910cf181 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/lightjak-h_REF.gc @@ -0,0 +1,131 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type wings +(deftype wings (process-drawable) + ((parent (pointer target) :override) + (shadow-backup shadow-geo :offset 208) + (ragdoll-proc handle) + (lock? symbol) + (wing-part sparticle-launch-control 2) + ) + (:state-methods + (idle symbol) + use + hidden + close + ) + ) + +;; definition for method 3 of type wings +(defmethod inspect ((this wings)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Tragdoll-proc: ~D~%" (-> this ragdoll-proc)) + (format #t "~2Tlock?: ~A~%" (-> this lock?)) + (format #t "~2Twing-part[2] @ #x~X~%" (-> this wing-part)) + (label cfg-4) + this + ) + +;; definition of type lightjak-shield +(deftype lightjak-shield (process-drawable) + ((parent (pointer target) :override) + (fade float) + (tone rgba) + ) + (:state-methods + open + close + hit + ) + ) + +;; definition for method 3 of type lightjak-shield +(defmethod inspect ((this lightjak-shield)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tfade: ~f~%" (-> this fade)) + (format #t "~2Ttone: ~D~%" (-> this tone)) + (label cfg-4) + this + ) + +;; definition of type lightjak-info +(deftype lightjak-info (basic) + ((process (pointer target)) + (wings (pointer wings)) + (get-off-lock symbol) + (latch-out-time time-frame) + (start-time time-frame) + (attack-id uint32) + (lightjak-before-powerjak symbol) + (attack-time time-frame) + (attack-count time-frame) + (stage lightjak-stage) + (want-stage lightjak-stage) + (get-on-latch uint32) + (tone uint32) + (on-off uint32) + (mode-sound-bank connection) + (swoop-count int32) + (freeze-control handle) + (freeze-screen handle) + (freeze-sound sound-id) + (shield (pointer lightjak-shield)) + (shield-start-time time-frame) + (shield-count-time time-frame) + (regen-start-time time-frame) + (regen-time time-frame) + ) + ) + +;; definition for method 3 of type lightjak-info +(defmethod inspect ((this lightjak-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Twings: #x~X~%" (-> this wings)) + (format #t "~1Tget-off-lock: ~A~%" (-> this get-off-lock)) + (format #t "~1Tlatch-out-time: ~D~%" (-> this latch-out-time)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tlightjak-before-powerjak: ~A~%" (-> this lightjak-before-powerjak)) + (format #t "~1Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~1Tattack-count: ~D~%" (-> this attack-count)) + (format #t "~1Tstage: ~D~%" (-> this stage)) + (format #t "~1Twant-stage: ~D~%" (-> this want-stage)) + (format #t "~1Tget-on-latch: ~D~%" (-> this get-on-latch)) + (format #t "~1Ttone: ~D~%" (-> this tone)) + (format #t "~1Ton-off: ~D~%" (-> this on-off)) + (format #t "~1Tmode-sound-bank: #~%" (-> this mode-sound-bank)) + (format #t "~1Tswoop-count: ~D~%" (-> this swoop-count)) + (format #t "~1Tfreeze-control: ~D~%" (-> this freeze-control)) + (format #t "~1Tfreeze-screen: ~D~%" (-> this freeze-screen)) + (format #t "~1Tfreeze-sound: ~D~%" (-> this freeze-sound)) + (format #t "~1Tshield: #x~X~%" (-> this shield)) + (format #t "~1Tshield-start-time: ~D~%" (-> this shield-start-time)) + (format #t "~1Tshield-count-time: ~D~%" (-> this shield-count-time)) + (format #t "~1Tregen-start-time: ~D~%" (-> this regen-start-time)) + (format #t "~1Tregen-time: ~D~%" (-> this regen-time)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/engine/target/lightjak-wings_REF.gc b/test/decompiler/reference/jak3/engine/target/lightjak-wings_REF.gc new file mode 100644 index 00000000000..f756c650516 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/lightjak-wings_REF.gc @@ -0,0 +1,934 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 623 + :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x4)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 80.0) + (:b 255.0) + (:a 16.0) + (:omega (degrees 2261.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 409.6) + ) + ) + +;; definition for symbol *jchar-wings-ragdoll-setup*, type ragdoll-setup +(define *jchar-wings-ragdoll-setup* (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.2654 :y -0.0018 :z -0.9641 :w 6300.3945) + :geo-tform (new 'static 'vector :x -0.0691 :y 0.9889 :z -0.1309 :w 40149.74) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6487 :y -0.1165 :z 0.752 :w 2928.8037) + :geo-tform (new 'static 'vector :x -0.2599 :y 0.9602 :z 0.1019 :w 40284.58) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6739 :y 0.0291 :z 0.7381 :w 5517.9307) + :geo-tform (new 'static 'vector :x 0.6239 :y 0.7439 :z -0.2391 :w 38562.84) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7135 :y -0.0779 :z -0.6962 :w 14612.671) + :geo-tform (new 'static 'vector :x 0.427 :y 0.8201 :z -0.3806 :w 42171.234) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9024 :y 0.17 :z -0.3958 :w 11472.295) + :geo-tform (new 'static 'vector :x -0.2578 :y 0.9589 :z 0.118 :w 41397.145) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.3801 :y 0.004 :z -0.9248 :w 10360.44) + :geo-tform (new 'static 'vector :x 0.029 :y 0.9893 :z -0.1425 :w 38818.555) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9764 :y -0.1821 :z 0.1154 :w 2970.6013) + :geo-tform (new 'static 'vector :x -0.3592 :y 0.9097 :z 0.208 :w 39567.34) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7474 :y 0.077 :z 0.6598 :w 8458.804) + :geo-tform (new 'static 'vector :x 0.7599 :y 0.4936 :z -0.4228 :w 40823.484) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9331 :y -0.0047 :z -0.3594 :w 19540.941) + :geo-tform (new 'static 'vector :x -0.371 :y -0.9276 :z 0.0428 :w 19994.434) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6734 :y 0.0697 :z -0.7359 :w 6495.546) + :geo-tform (new 'static 'vector :x 0.2558 :y -0.9488 :z -0.1848 :w 20230.09) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.4255 :y 0.0067 :z -0.9049 :w 20150.281) + :geo-tform (new 'static 'vector :x -0.2495 :y 0.9088 :z -0.3343 :w 35460.62) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6235 :y -0.2077 :z 0.7536 :w 9110.888) + :geo-tform (new 'static 'vector :x -0.4093 :y 0.7846 :z 0.4655 :w 40835.207) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9382 :y 0.1251 :z 0.3225 :w 12873.182) + :geo-tform (new 'static 'vector :x 0.8171 :y 0.4684 :z -0.336 :w 36737.35) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8007 :y 0.0872 :z 0.5926 :w 43485.977) + :geo-tform (new 'static 'vector :x 0.1755 :y -0.9787 :z -0.106 :w 21626.426) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8735 :y -0.2713 :z 0.404 :w 3852.2788) + :geo-tform (new 'static 'vector :x 0.2542 :y -0.9517 :z -0.1717 :w 20847.074) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.3727 :y -0.0018 :z 0.9279 :w 39237.88) + :geo-tform (new 'static 'vector :x -0.3279 :y 0.8812 :z -0.3403 :w 32193.342) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6138 :y -0.2619 :z 0.7446 :w 10673.011) + :geo-tform (new 'static 'vector :x -0.2349 :y 0.9716 :z 0.027 :w 35094.527) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2056 :y 0.0894 :z 0.9745 :w 4970.159) + :geo-tform (new 'static 'vector :x 0.4984 :y 0.8656 :z -0.0465 :w 34449.273) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2011 :y -0.0286 :z -0.9791 :w 10903.315) + :geo-tform (new 'static 'vector :x -0.3811 :y 0.9235 :z 0.0419 :w 34879.68) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2655 :y -0.1245 :z 0.956 :w 8234.635) + :geo-tform (new 'static 'vector :x -0.176 :y 0.9839 :z 0.0286 :w 36081.355) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.2278 :y -0.0045 :z 0.9736 :w 7255.163) + :geo-tform (new 'static 'vector :x 0.1231 :y 0.9802 :z -0.1548 :w 25669.123) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.505 :y 0.1057 :z -0.8565 :w 3937.3848) + :geo-tform (new 'static 'vector :x 0.26 :y 0.9604 :z 0.0998 :w 25394.436) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6633 :y -0.0291 :z -0.7477 :w 5518.568) + :geo-tform (new 'static 'vector :x -0.6247 :y 0.7448 :z -0.2343 :w 27084.008) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7035 :y 0.0779 :z 0.7063 :w 14612.635) + :geo-tform (new 'static 'vector :x -0.4285 :y 0.8213 :z -0.3765 :w 23488.012) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8966 :y -0.17 :z 0.4087 :w 11471.3125) + :geo-tform (new 'static 'vector :x 0.2579 :y 0.9591 :z 0.1158 :w 24282.729) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.3141 :y -0.0019 :z 0.9493 :w 10925.16) + :geo-tform (new 'static 'vector :x 0.012 :y 0.9857 :z -0.1675 :w 27199.225) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9195 :y 0.1659 :z -0.3562 :w 3444.5723) + :geo-tform (new 'static 'vector :x 0.3612 :y 0.9109 :z 0.1992 :w 26365.314) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7192 :y -0.0769 :z -0.6904 :w 8459.351) + :geo-tform (new 'static 'vector :x 0.7654 :y -0.4999 :z 0.4051 :w 40607.035) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9174 :y 0.0049 :z 0.3978 :w 19540.723) + :geo-tform (new 'static 'vector :x -0.3669 :y 0.9295 :z -0.0346 :w 20393.875) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6425 :y -0.0696 :z 0.763 :w 6494.891) + :geo-tform (new 'static 'vector :x 0.2562 :y 0.9502 :z 0.1772 :w 20638.305) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.3625 :y -0.0048 :z 0.9319 :w 19612.213) + :geo-tform (new 'static 'vector :x 0.219 :y 0.8996 :z -0.3777 :w 30652.809) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7243 :y 0.2029 :z -0.6588 :w 9590.757) + :geo-tform (new 'static 'vector :x 0.4178 :y 0.7885 :z 0.4511 :w 25124.445) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9203 :y -0.1251 :z -0.3705 :w 12873.563) + :geo-tform (new 'static 'vector :x 0.8236 :y -0.4721 :z 0.3141 :w 36484.418) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7691 :y -0.0872 :z -0.6331 :w 43486.32) + :geo-tform (new 'static 'vector :x 0.1757 :y 0.9793 :z 0.1 :w 22153.406) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8514 :y 0.2725 :z -0.4481 :w 3853.9175) + :geo-tform (new 'static 'vector :x 0.2546 :y 0.9532 :z 0.1627 :w 21354.834) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.3106 :y -0.0029 :z 0.9505 :w 25369.969) + :geo-tform (new 'static 'vector :x 0.2772 :y 0.8778 :z -0.3905 :w 33952.89) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7403 :y 0.2573 :z -0.621 :w 10801.298) + :geo-tform (new 'static 'vector :x 0.2349 :y 0.9718 :z 0.019 :w 31129.637) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 41 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1393 :y -0.0881 :z -0.9863 :w 4969.959) + :geo-tform (new 'static 'vector :x -0.4987 :y 0.8662 :z -0.0296 :w 31694.191) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 42 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.136 :y 0.0307 :z 0.9902 :w 10903.225) + :geo-tform (new 'static 'vector :x 0.3813 :y 0.9239 :z 0.0294 :w 31281.717) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 43 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.196 :y 0.1065 :z -0.9747 :w 8216.977) + :geo-tform (new 'static 'vector :x 0.176 :y 0.9841 :z 0.0214 :w 30276.574) + :axial-slop 1689.773 + :max-angle 5461.3335 + :coll-rad 614.4 + ) + ) + ) + ) + +;; definition for function wings-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior wings-post wings () + (let* ((a0-0 (-> self parent)) + (v1-0 (if a0-0 + (the-as process-drawable (-> a0-0 0 self)) + ) + ) + ) + (set! (-> self draw light-index) (-> (the-as process-focusable v1-0) draw light-index)) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 0.0) + (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) + (set! (-> self draw death-vertex-skip) (-> self parent 0 draw death-vertex-skip)) + (set! (-> self draw death-effect) (-> self parent 0 draw death-effect)) + (set! (-> self draw death-timer) (-> self parent 0 draw death-timer)) + (set! (-> self draw death-timer-org) (-> self parent 0 draw death-timer-org)) + (set! (-> self draw death-draw-overlap) (-> self parent 0 draw death-draw-overlap)) + (let ((a0-29 (-> v1-0 draw shadow-ctrl settings shadow-dir quad))) + (set! (-> self draw shadow-ctrl settings shadow-dir quad) a0-29) + ) + (if (or (logtest? (-> v1-0 draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2)) + (zero? (-> v1-0 skel active-channels)) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (when (and (not (focus-test? (the-as process-focusable v1-0) in-head)) + (and (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp))) + (not (movie?)) + (< (-> *setting-control* user-current slow-time) 1.0) + ) + ) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f30-0 (fmin 1.0 (-> self clock clock-ratio))) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 623) (sp-field-id spt-a)) initial-valuef) + (* 16.0 (- 1.0 (-> *setting-control* user-current slow-time))) + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg upper_body)) + :rate f30-0 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg chest)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg neckA)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg neckB)) :rate f30-0) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg MhairB)) + :rate f30-0 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Lshould)) + :rate f30-0 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Lforarm)) + :rate f30-0 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg lindA)) :rate f30-0) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg lringA)) + :rate f30-0 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Rshould)) + :rate f30-0 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Rarm)) :rate f30-0) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Rforarm)) + :rate f30-0 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg sk_rhand)) + :rate f30-0 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg rindA)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg gun)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (joint-node jakb-lod0-jg hips)) :rate f30-0) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg Lankle)) + :rate f30-0 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg LbigToe)) + :rate f30-0 + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate hidden (wings) + :virtual #t + :trans (behavior () + (let ((v1-0 (-> self parent))) + (if (not (focus-test? + (the-as process-focusable (if v1-0 + (the-as process-focusable (-> v1-0 0 self)) + ) + ) + in-head + ) + ) + (go-virtual idle #f) + ) + ) + ) + :code (behavior () + (ja-channel-set! 0) + (ja-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate idle (wings) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (go-virtual use) + ) + (('end-mode) + (go-virtual close) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self lock?) arg0) + ) + :exit (behavior () + (let ((a0-1 (handle->process (-> self ragdoll-proc)))) + (if a0-1 + (ragdoll-proc-method-16 (the-as ragdoll-proc a0-1) 60) + ) + ) + ) + :trans (behavior () + (let ((v1-0 (-> self parent))) + (b! + (not (focus-test? + (the-as process-focusable (if v1-0 + (the-as process-focusable (-> v1-0 0 self)) + ) + ) + in-head + ) + ) + cfg-4 + :delay (empty-form) + ) + ) + (go-virtual hidden) + (b! #t cfg-27 :delay (nop!)) + (label cfg-4) + (if (and (not (-> self lock?)) (let* ((a0-1 (-> self parent)) + (v1-10 (if a0-1 + (the-as process-drawable (-> a0-1 0 self)) + ) + ) + (a0-4 (if (> (-> v1-10 skel active-channels) 0) + (-> v1-10 skel root-channel 0 frame-group) + ) + ) + ) + (and a0-4 (or (= a0-4 (-> v1-10 draw art-group data 493)) + (= a0-4 (-> v1-10 draw art-group data 494)) + (= a0-4 (-> v1-10 draw art-group data 495)) + (= a0-4 (-> v1-10 draw art-group data 496)) + (= a0-4 (-> v1-10 draw art-group data 482)) + (= a0-4 (-> v1-10 draw art-group data 485)) + (= a0-4 (-> v1-10 draw art-group data 483)) + ) + ) + ) + ) + (go-virtual use) + ) + (label cfg-27) + (let ((v1-20 (handle->process (-> self ragdoll-proc)))) + (when v1-20 + (let ((v1-22 (-> (the-as ragdoll-proc v1-20) ragdoll))) + (if v1-22 + (logclear! (-> v1-22 ragdoll-flags) (ragdoll-flag rf2)) + ) + ) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (case arg0 + (('open) + (ja-channel-set! 1) + (ja-no-eval :group! jakb-wings-lightjak-get-on-land-ja :num! (seek! (ja-aframe 45.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 45.0 0))) + ) + (sound-play "ltjak-wings-out") + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + (('force) + (ja-channel-set! 1) + (ja :group! jakb-wings-lightjak-stance-ja :num! max) + (suspend) + 0 + ) + ) + (set! (-> self lock?) #f) + (let ((a0-17 (handle->process (-> self ragdoll-proc)))) + (when (not a0-17) + (set! (-> self ragdoll-proc) (ppointer->handle (process-spawn + ragdoll-proc + :init wings-ragdoll-proc-init-by-other + *jchar-wings-ragdoll-setup* + :name "ragdoll-proc" + :to self + :stack-size #x5000 + ) + ) + ) + (set! a0-17 (handle->process (-> self ragdoll-proc))) + ) + (if (and a0-17 (-> (the-as process-drawable a0-17) root)) + (logior! (-> (the-as ragdoll-proc a0-17) ragdoll ragdoll-flags) (ragdoll-flag rf3 rf4 rf10)) + ) + (ragdoll-proc-method-15 (the-as ragdoll-proc a0-17) #f (the-as vector #f) #t) + ) + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! jakb-wings-lightjak-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (wings-post) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate close (wings) + :virtual #t + :code (behavior () + (sound-play "ltjak-wings-in") + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-wings-lightjak-get-off-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-set! 0) + (sleep-code) + ) + :post (-> (method-of-type wings idle) post) + ) + +;; failed to figure out what this is: +(defstate use (wings) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (go-virtual idle #f) + ) + (('end-mode) + (go-virtual close) + ) + ) + ) + :trans (behavior () + (let ((v1-0 (ppointer->process (-> self parent))) + (a0-1 (-> self parent)) + ) + (cond + ((focus-test? + (the-as process-focusable (if a0-1 + (the-as process-focusable (-> a0-1 0 self)) + ) + ) + in-head + ) + (go-virtual hidden) + ) + ((let ((a0-8 (if (> (-> (the-as process-focusable v1-0) skel active-channels) 0) + (-> (the-as process-focusable v1-0) skel root-channel 0 frame-group) + ) + ) + ) + (not (and a0-8 (or (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 493)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 494)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 495)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 496)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 482)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 485)) + (= a0-8 (-> (the-as process-focusable v1-0) draw art-group data 483)) + ) + ) + ) + ) + (go-virtual idle #f) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! jakb-wings-lightjak-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (wings-post) + (clone-anim-once (ppointer->handle (-> self parent)) #f "wings-") + (ja-post) + ) + ) + +;; definition for function wings-init +;; WARN: Return type mismatch object vs none. +(defbehavior wings-init wings ((arg0 symbol)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar-wings" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self shadow-backup) #f) + (let* ((s5-1 (ppointer->process (-> self parent))) + (v1-6 (if (type? s5-1 process-focusable) + s5-1 + ) + ) + (a0-6 (-> self node-list data)) + ) + (set! (-> a0-6 0 param0) (the-as (function cspace transformq none) cspace<-cspace-normalized!)) + (set! (-> a0-6 0 param1) (the-as basic (-> (the-as process-drawable v1-6) node-list data 6))) + (set! (-> a0-6 0 param2) #f) + ) + (set! (-> self ragdoll-proc) (the-as handle #f)) + (set! (-> self draw shadow-ctrl) *target-shadow-control*) + (cond + ((= arg0 'open) + (go-virtual idle 'open) + ) + ((= arg0 'move) + (go-virtual idle #f) + ) + ((= arg0 'force) + (go-virtual idle 'force) + ) + (else + (go-virtual use) + ) + ) + (none) + ) + +;; definition of type wings-ragdoll +(deftype wings-ragdoll (ragdoll) + ((which-chain int8) + (chain-pos int8) + ) + ) + +;; definition for method 3 of type wings-ragdoll +(defmethod inspect ((this wings-ragdoll)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tragdoll-joints[60] @ #x~X~%" (-> this ragdoll-joints)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Tmirror: #~%" (-> this mirror)) + (format #t "~1Tgravity: #~%" (-> this gravity)) + (format #t "~1Tgravity-target: #~%" (-> this gravity-target)) + (format #t "~1Torient-tform: #~%" (-> this orient-tform)) + (format #t "~1Tscale: #~%" (-> this scale)) + (format #t "~1Tstretch-vel: ~f~%" (-> this stretch-vel)) + (format #t "~1Tstretch-vel-parallel: ~f~%" (-> this stretch-vel-parallel)) + (format #t "~1Tcompress-vel: ~f~%" (-> this compress-vel)) + (format #t "~1Tcompress-vel-parallel: ~f~%" (-> this compress-vel-parallel)) + (format #t "~1Tmomentum: ~f~%" (-> this momentum)) + (format #t "~1Tmaximum-stretch: ~f~%" (-> this maximum-stretch)) + (format #t "~1Tturn-off-start: ~D~%" (-> this turn-off-start)) + (format #t "~1Tturn-off-duration: ~D~%" (-> this turn-off-duration)) + (format #t "~1Tcopy-velocity-start: ~D~%" (-> this copy-velocity-start)) + (format #t "~1Troot-offset: #~%" (-> this root-offset)) + (format #t "~1Trotate-vel: #~%" (-> this rotate-vel)) + (format #t "~1Trotate-adj: #~%" (-> this rotate-adj)) + (format #t "~1Trotate-adj-count: ~D~%" (-> this rotate-adj-count)) + (format #t "~1Tragdoll-flags: ~D~%" (-> this ragdoll-flags)) + (format #t "~1Tflex-blend: ~f~%" (-> this flex-blend)) + (format #t "~1Tstable-joints: ~D~%" (-> this stable-joints)) + (format #t "~1Tragdoll-joint-remap[100] @ #x~X~%" (-> this ragdoll-joint-remap)) + (format #t "~1Tallow-destabilize: ~D~%" (-> this allow-destabilize)) + (format #t "~1Tbg-collide-with: ~D~%" (-> this bg-collide-with)) + (format #t "~1Twater-info: #~%" (-> this water-info)) + (format #t "~1Twhich-chain: ~D~%" (-> this which-chain)) + (format #t "~1Tchain-pos: ~D~%" (-> this chain-pos)) + (label cfg-4) + this + ) + +;; definition for method 19 of type wings-ragdoll +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod ragdoll-method-19 ((this wings-ragdoll) (arg0 vector) (arg1 int) (arg2 object) (arg3 vector)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> this gravity quad)) + (let ((s1-0 (-> this ragdoll-joints arg1)) + (f30-0 1.0) + ) + (cond + ((= (-> s1-0 parent-joint) -1) + (+! (-> this chain-pos) 1) + ) + (else + (+! (-> this which-chain) 1) + (set! (-> this chain-pos) 0) + 0 + ) + ) + (let ((v1-12 (-> this which-chain))) + (cond + ((or (zero? v1-12) (= v1-12 4)) + (set! f30-0 100.0) + ) + ((or (= v1-12 1) (= v1-12 5)) + (set! f30-0 50.0) + ) + ((or (= v1-12 2) (= v1-12 6)) + (set! f30-0 10.0) + ) + ) + ) + (vector-float*! (-> this gravity) (&+ arg3 16) f30-0) + (let ((t9-0 (method-of-type ragdoll ragdoll-method-19))) + (t9-0 this arg0 arg1 arg2 arg3) + ) + (when (= (-> s1-0 parent-joint) -1) + (let* ((f0-4 + (+ (* 54.613335 (the float (current-time))) + (* 10922.667 (the float (-> this chain-pos))) + (* 29127.111 (the float (-> this which-chain))) + ) + ) + (f0-5 (- f0-4 (* (the float (the int (/ f0-4 65536.0))) 65536.0))) + ) + (vector+float*! + arg0 + arg0 + (the-as vector (&-> arg3 x)) + (* 5.0 (cos f0-5) f30-0 (the float (-> this chain-pos))) + ) + ) + ) + ) + (set! (-> this gravity quad) (-> s3-0 quad)) + ) + (if (and (= (-> this ragdoll-joints arg1 parent-joint) -1) + (= (-> this ragdoll-joints (+ arg1 -1) parent-joint) -1) + ) + (vector+float*! + arg0 + arg0 + (the-as vector (+ (the-as uint (-> this ragdoll-joints 0 velocity)) (* 192 (+ arg1 -1)))) + 0.25 + ) + ) + (none) + ) + +;; definition for method 18 of type wings-ragdoll +;; WARN: Return type mismatch int vs none. +(defmethod ragdoll-method-18 ((this wings-ragdoll)) + (let ((t9-0 (method-of-type ragdoll ragdoll-method-18))) + (t9-0 this) + ) + (set! (-> this which-chain) -1) + (set! (-> this chain-pos) -1) + (none) + ) + +;; definition for method 16 of type wings-ragdoll +;; WARN: Return type mismatch float vs none. +(defmethod ragdoll-setup! ((this wings-ragdoll) (arg0 process-drawable) (arg1 ragdoll-setup)) + "Set up this ragdoll with the given [[ragdoll-setup]]." + (let ((t9-0 (method-of-type ragdoll ragdoll-setup!))) + (t9-0 this arg0 arg1) + ) + (set! (-> this stretch-vel) 0.7) + (set! (-> this stretch-vel-parallel) 0.8) + (set! (-> this compress-vel) 0.85) + (set! (-> this compress-vel-parallel) 0.75) + (set! (-> this momentum) 0.4) + (set! (-> this maximum-stretch) 1.5) + (none) + ) + +;; definition for function wings-ragdoll-proc-init-by-other +(defbehavior wings-ragdoll-proc-init-by-other wings-ragdoll-proc ((arg0 ragdoll-proc)) + (set! (-> self last-attack-id) (the-as uint 0)) + (set! (-> self ragdoll) (new 'process 'wings-ragdoll)) + (if (nonzero? (-> self ragdoll)) + (ragdoll-setup! + (-> self ragdoll) + (the-as process-drawable (ppointer->process (-> self parent))) + (the-as ragdoll-setup arg0) + ) + (format 0 "ERROR: didn't have enough memory to allocate wings-ragdoll for wings-ragdoll-proc~%") + ) + (go-virtual idle) + ) diff --git a/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc new file mode 100644 index 00000000000..fe8fe19d72a --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc @@ -0,0 +1,3362 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function build-conversions +;; INFO: Used lq/sq +(defbehavior build-conversions target ((arg0 vector)) + (when (!= (-> self control prev-surf) (-> self control surf)) + (set! (-> self control prev-surf) (-> self control surf)) + (set-time! (-> self control time-of-last-surface-change)) + ) + (surface-mult! (-> self control current-surface) (-> self control mod-surface) (-> self control surf)) + (when (and (and (= (-> self fact eco-type) 3) (>= (-> self fact eco-level) 1.0)) + (or (= (-> self control mod-surface name) 'run) (= (-> self control mod-surface name) 'jump)) + ) + (+! (-> self control current-surface target-speed) 20480.0) + (+! (-> self control current-surface transv-max) 20480.0) + ) + (when (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (or (= (-> self control mod-surface name) 'run) + (= (-> self control mod-surface name) 'jump) + (= (-> self control mod-surface name) 'attack) + ) + ) + (set! (-> self control current-surface target-speed) + (* 1.2 (-> self darkjak-giant-interp) (-> self control current-surface target-speed)) + ) + (set! (-> self control current-surface transv-max) + (* 1.2 (-> self darkjak-giant-interp) (-> self control current-surface transv-max)) + ) + ) + (let ((f0-11 (-> *setting-control* user-current speed-mult))) + (set! (-> self control current-surface target-speed) (* (-> self control current-surface target-speed) f0-11)) + (set! (-> self control current-surface transv-max) (* (-> self control current-surface transv-max) f0-11)) + ) + (let ((s5-0 (new-stack-vector0))) + (vector-z-quaternion! s5-0 (-> self control quat-for-control)) + (when (logtest? (-> self control mod-surface flags) (surface-flag xz-local)) + (vector-flatten! s5-0 s5-0 (-> self control dynam gravity-normal)) + (vector-normalize! s5-0 1.0) + ) + (forward-up-nopitch->inv-matrix (-> self control c-R-w) s5-0 (-> self control local-normal)) + ) + (matrix-transpose! (-> self control w-R-c) (-> self control c-R-w)) + (vector-matrix*! (-> self control transv-ctrl) arg0 (-> self control w-R-c)) + (set! (-> self control last-gravity-normal quad) (-> self control gravity-normal quad)) + (let ((v0-7 (-> self control gravity-normal))) + (set! (-> v0-7 quad) (-> self control dynam gravity-normal quad)) + v0-7 + ) + ) + +;; definition for function vector-turn-to +;; INFO: Used lq/sq +(defbehavior vector-turn-to target ((arg0 vector)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (build-conversions (-> self control transv)) + ) + +;; definition for function reverse-conversions +;; WARN: Return type mismatch collide-status vs none. +(defbehavior reverse-conversions target ((arg0 vector)) + (let ((v1-1 (-> self control transv-ctrl))) + (set! (-> self control ctrl-xz-vel) (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) + ) + (vector-matrix*! arg0 (-> self control transv-ctrl) (-> self control c-R-w)) + (set! (-> self control old-status) (-> self control status)) + (none) + ) + +;; definition (debug) for function draw-history +(defun-debug draw-history ((arg0 control-info)) + (when (nonzero? *display-collide-history*) + (when (cpad-pressed? 0 l3) + (set! (-> arg0 history-length) (logand (+ (-> arg0 history-length) 1) 3)) + (if (cpad-hold? 0 l2) + (set! (-> arg0 history-length) (the-as uint 1000)) + ) + ) + (let* ((v1-15 (-> arg0 history-length)) + (gp-0 (cond + ((zero? v1-15) + 465 + ) + ((= v1-15 1) + 469 + ) + ((= v1-15 2) + 473 + ) + ((= v1-15 3) + 913 + ) + (else + 384 + ) + ) + ) + (a0-5 (new 'stack 'history-iterator (the-as uint 1800))) + ) + (set! (-> a0-5 out) #t) + (set! (-> a0-5 owner) (the-as uint 2)) + (set! (-> a0-5 channel-mask) (the-as uint gp-0)) + (history-draw a0-5) + ) + ) + (none) + ) + +;; definition (debug) for function target-history-print +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition (debug) for function target-print-stats +;; INFO: Used lq/sq +(defun-debug target-print-stats ((arg0 target) (arg1 symbol)) + (local-vars + (sv-64 int) + (sv-72 int) + (sv-80 art-joint-anim-manager) + (sv-96 string) + (sv-112 string) + (sv-128 string) + (sv-144 string) + (sv-160 string) + (sv-176 string) + (sv-192 string) + (sv-208 string) + (sv-224 string) + (sv-240 string) + (sv-256 string) + (sv-272 string) + (sv-288 string) + (sv-304 string) + ) + (with-pp + (let ((s5-0 pp)) + (set! pp arg0) + (when (and *display-ground-stats* arg0) + (let ((s3-0 format) + (s2-0 arg1) + (s1-0 "~0kpoly:~6X mode:~-8S material:~-10S event:~S~%") + (s0-0 (-> arg0 control poly-pat)) + ) + (set! sv-96 (pat-mode->string (-> arg0 control poly-pat))) + (set! sv-112 (pat-material->string (-> arg0 control poly-pat))) + (let ((t1-0 (pat-event->string (-> arg0 control poly-pat)))) + (s3-0 s2-0 s1-0 s0-0 sv-96 sv-112 t1-0) + ) + ) + (let ((s3-1 format) + (s2-1 arg1) + (s1-1 "~0kgrnd:~6X mode:~-8S material:~-10S event:~S~%") + (s0-1 (-> arg0 control ground-pat)) + ) + (set! sv-128 (pat-mode->string (-> arg0 control ground-pat))) + (set! sv-144 (pat-material->string (-> arg0 control ground-pat))) + (let ((t1-1 (pat-event->string (-> arg0 control ground-pat)))) + (s3-1 s2-1 s1-1 s0-1 sv-128 sv-144 t1-1) + ) + ) + (let ((s3-2 format) + (s2-2 arg1) + (s1-2 "~0kwall:~6X mode:~-8S material:~-10S event:~S~%") + (s0-2 (-> arg0 control wall-contact-pat)) + ) + (set! sv-160 (pat-mode->string (-> arg0 control wall-contact-pat))) + (set! sv-176 (pat-material->string (-> arg0 control wall-contact-pat))) + (let ((t1-2 (pat-event->string (-> arg0 control wall-contact-pat)))) + (s3-2 s2-2 s1-2 s0-2 sv-160 sv-176 t1-2) + ) + ) + (let ((s3-3 format) + (s2-3 arg1) + (s1-3 "~0kgspt:~6X mode:~-8S material:~-10S event:~S~%") + (s0-3 (-> arg0 control gspot-pat-surfce)) + ) + (set! sv-192 (pat-mode->string (-> arg0 control gspot-pat-surfce))) + (set! sv-208 (pat-material->string (-> arg0 control gspot-pat-surfce))) + (let ((t1-3 (pat-event->string (-> arg0 control gspot-pat-surfce)))) + (s3-3 s2-3 s1-3 s0-3 sv-192 sv-208 t1-3) + ) + ) + ) + (when (and *stats-target* arg0) + (format + arg1 + "~0ks: ~M ~X/~X ~A ~A ~A~%" + (-> arg0 control ctrl-xz-vel) + (-> arg0 control status) + (-> arg0 control prev-status) + (if (-> arg0 state) + (-> arg0 state name) + ) + (-> arg0 control surf name) + (-> arg0 control mod-surface name) + ) + (let ((s3-4 (-> arg0 focus-status))) + (if (= (logand s3-4 (focus-status pole)) (focus-status pole)) + (format arg1 "pole ") + ) + (if (= (logand s3-4 (focus-status dead)) (focus-status dead)) + (format arg1 "dead ") + ) + (if (= (logand (focus-status gun) s3-4) (focus-status gun)) + (format arg1 "gun ") + ) + (if (= (logand (focus-status pilot) s3-4) (focus-status pilot)) + (format arg1 "racer ") + ) + (if (= (logand (focus-status mech) s3-4) (focus-status mech)) + (format arg1 "mech ") + ) + (if (= (logand (focus-status shooting) s3-4) (focus-status shooting)) + (format arg1 "shooting ") + ) + (if (= (logand (focus-status halfpipe) s3-4) (focus-status halfpipe)) + (format arg1 "halfpipe ") + ) + (if (= (logand (focus-status light) s3-4) (focus-status light)) + (format arg1 "light ") + ) + (if (= (logand s3-4 (focus-status in-head)) (focus-status in-head)) + (format arg1 "in-head ") + ) + (if (= (logand s3-4 (focus-status grabbed)) (focus-status grabbed)) + (format arg1 "grabbed ") + ) + (if (= (logand s3-4 (focus-status ignore)) (focus-status ignore)) + (format arg1 "ignore ") + ) + (if (= (logand s3-4 (focus-status under-water)) (focus-status under-water)) + (format arg1 "under-water ") + ) + (if (= (logand s3-4 (focus-status disable)) (focus-status disable)) + (format arg1 "disable ") + ) + (if (= (logand s3-4 (focus-status hit)) (focus-status hit)) + (format arg1 "hit ") + ) + (if (= (logand s3-4 (focus-status inactive)) (focus-status inactive)) + (format arg1 "inactive ") + ) + (if (= (logand (focus-status invulnerable) s3-4) (shl #x8000 16)) + (format arg1 "invulnerable ") + ) + (if (= (logand s3-4 (focus-status dangerous)) (focus-status dangerous)) + (format arg1 "dangerous ") + ) + (if (= (logand (focus-status gun-no-target) s3-4) (shl 4 32)) + (format arg1 "gun-no-target ") + ) + (if (= (logand (focus-status teleporting) s3-4) (focus-status teleporting)) + (format arg1 "teleporting ") + ) + (if (= (logand (focus-status indax) s3-4) (focus-status indax)) + (format arg1 "indax ") + ) + (if (= (logand (focus-status turret) s3-4) (shl 1 32)) + (format arg1 "turret ") + ) + (if (= (logand (focus-status tube) s3-4) (focus-status tube)) + (format arg1 "tube ") + ) + (if (= (logand (focus-status pilot) s3-4) (focus-status pilot)) + (format arg1 "pilot ") + ) + (if (= (logand s3-4 (focus-status edge-grab)) (focus-status edge-grab)) + (format arg1 "edge-grab ") + ) + (if (= (logand (focus-status dark) s3-4) (focus-status dark)) + (format arg1 "dark ") + ) + (if (= (logand (focus-status arrestable) s3-4) (focus-status arrestable)) + (format arg1 "arrestable ") + ) + (if (= (logand (focus-status rail) s3-4) (focus-status rail)) + (format arg1 "rail ") + ) + (if (= (logand s3-4 (focus-status pilot-riding)) (focus-status pilot-riding)) + (format arg1 "pilot-riding ") + ) + (if (= (logand (focus-status board) s3-4) (focus-status board)) + (format arg1 "board ") + ) + (if (= (logand s3-4 (focus-status on-water)) (focus-status on-water)) + (format arg1 "on-water ") + ) + (if (= (logand s3-4 (focus-status in-air)) (focus-status in-air)) + (format arg1 "in-air ") + ) + (if (= (logand (focus-status no-gravity) s3-4) (shl 2 32)) + (format arg1 "no-gravity ") + ) + (if (= (logand (focus-status carry) s3-4) (focus-status carry)) + (format arg1 "carry ") + ) + (if (= (logand s3-4 (focus-status flut)) (focus-status flut)) + (format arg1 "flut ") + ) + (if (= (logand s3-4 (focus-status touch-water)) (focus-status touch-water)) + (format arg1 "touch-water ") + ) + (if (= (logand (focus-status super) s3-4) (focus-status super)) + (format arg1 "super ") + ) + ) + (if (logtest? (-> arg0 target-flags) (target-flags tinvuln1)) + (format arg1 "tinvul1 ") + ) + (if (logtest? (target-flags tinvuln2) (-> arg0 target-flags)) + (format arg1 "tinvul2 ") + ) + (if (logtest? (target-flags disable-attacks) (-> arg0 target-flags)) + (format arg1 "disable-attacks ") + ) + (if (logtest? (target-flags invisible) (-> arg0 target-flags)) + (format arg1 "invisible ") + ) + (if (logtest? (target-flags lleg-still) (-> arg0 target-flags)) + (format arg1 "lleg-still ") + ) + (if (logtest? (target-flags rleg-still) (-> arg0 target-flags)) + (format arg1 "rleg-still ") + ) + (if (logtest? (target-flags lleg-no-ik) (-> arg0 target-flags)) + (format arg1 "lleg-no-ik ") + ) + (if (logtest? (target-flags rleg-no-ik) (-> arg0 target-flags)) + (format arg1 "rleg-no-ik ") + ) + (format arg1 "~%") + (format + arg1 + "~0k~9S ~9S ~9S ~9S ~9S ~9S~%" + (if (logtest? (-> arg0 control status) (collide-status on-surface)) + "on-surface" + "" + ) + (if (logtest? (-> arg0 control status) (collide-status on-ground)) + "on-ground" + "" + ) + (if (logtest? (-> arg0 control status) (collide-status touch-surface)) + "t-surface" + "" + ) + (if (logtest? (-> arg0 control status) (collide-status touch-wall)) + "t-wall" + "" + ) + (if (logtest? (-> arg0 control status) (collide-status touch-actor)) + "t-act" + "" + ) + (cond + ((logtest? (-> arg0 control status) (collide-status touch-ceiling)) + "t-ceil" + ) + ((logtest? (-> arg0 control status) (collide-status on-water)) + "on-water" + ) + (else + "" + ) + ) + ) + (when (logtest? (-> arg0 water flags) (water-flag active)) + (format + arg1 + "water at ~M ~5S ~5S ~5S ~5S " + (-> arg0 water height) + (if (logtest? (water-flag touch-water) (-> arg0 water flags)) + "water" + "" + ) + (if (logtest? (water-flag wading) (-> arg0 water flags)) + "wade" + "" + ) + (if (logtest? (water-flag swimming) (-> arg0 water flags)) + "swim" + "" + ) + (if (logtest? (-> arg0 water flags) (water-flag under-water)) + "under" + "" + ) + ) + (format arg1 "~2S~%" (if (logtest? (-> arg0 water flags) (water-flag swim-ground)) + "sg" + "" + ) + ) + ) + (format + arg1 + "~0kan:~,,3f su:~,,3f ti:~,,3f to:~,,3f pa:~,,3f~%" + (-> arg0 control surface-angle) + (-> arg0 control local-slope-z) + (-> arg0 control local-slope-x) + (-> arg0 control touch-angle) + (-> arg0 control poly-angle) + ) + (let ((v1-175 (-> arg0 control trans))) + (format arg1 "pos: ~6,,2m ~6,,2m ~6,,2m " (-> v1-175 x) (-> v1-175 y) (-> v1-175 z)) + ) + (let ((s3-5 format) + (s2-4 arg1) + (s1-4 "~0kpol:~X/~S/~S/~S~%") + (s0-4 (-> arg0 control poly-pat)) + ) + (set! sv-224 (pat-mode->string (-> arg0 control poly-pat))) + (set! sv-240 (pat-material->string (-> arg0 control poly-pat))) + (let ((t1-10 (pat-event->string (-> arg0 control poly-pat)))) + (s3-5 s2-4 s1-4 s0-4 sv-224 sv-240 t1-10) + ) + ) + (let ((s3-6 format) + (s2-5 arg1) + (s1-5 "~0kcur:~X/~S/~S/~S ") + (s0-5 (-> arg0 control cur-pat)) + ) + (set! sv-256 (pat-mode->string (-> arg0 control cur-pat))) + (set! sv-272 (pat-material->string (-> arg0 control cur-pat))) + (let ((t1-11 (pat-event->string (-> arg0 control cur-pat)))) + (s3-6 s2-5 s1-5 s0-5 sv-256 sv-272 t1-11) + ) + ) + (let ((s3-7 format) + (s2-6 arg1) + (s1-6 "~0kgnd:~X/~S/~S/~S~%") + (s0-6 (-> arg0 control ground-pat)) + ) + (set! sv-288 (pat-mode->string (-> arg0 control ground-pat))) + (set! sv-304 (pat-material->string (-> arg0 control ground-pat))) + (let ((t1-12 (pat-event->string (-> arg0 control ground-pat)))) + (s3-7 s2-6 s1-6 s0-6 sv-288 sv-304 t1-12) + ) + ) + (let ((t9-79 format) + (a0-147 arg1) + (a1-59 "~0kvel: x:~M y:~M z:~M yv:~M xzv:~M~%") + (a2-13 (-> arg0 control transv x)) + (a3-14 (-> arg0 control transv y)) + (t0-14 (-> arg0 control transv z)) + (t1-14 (vector-dot (-> arg0 control dynam gravity-normal) (-> arg0 control transv))) + (v1-195 (new-stack-vector0)) + ) + (let ((f0-15 (vector-dot (-> arg0 control dynam gravity-normal) (-> arg0 control transv)))) + 0.0 + (vector-! + v1-195 + (-> arg0 control transv) + (vector-float*! v1-195 (-> arg0 control dynam gravity-normal) f0-15) + ) + ) + (let ((f0-16 (vector-length v1-195))) + f0-16 + (t9-79 a0-147 a1-59 a2-13 a3-14 t0-14 t1-14 f0-16) + ) + ) + (format + arg1 + "~0ky:~,,2M t:~d cy: ~,,2M my: ~,,2M impv:~,,2M " + (-> arg0 control last-trans-any-surf y) + (- (current-time) (-> arg0 control last-time-on-surface)) + (- (-> arg0 control trans y) (-> arg0 control last-trans-any-surf y)) + (- (-> arg0 control highest-jump-mark y) (-> arg0 control last-trans-leaving-surf y)) + (-> arg0 control ground-impact-vel) + ) + (let* ((t9-81 format) + (a0-149 arg1) + (a1-61 "~0k~Tcd: ~,,2M md:~,,2M~%") + (v1-206 (vector-! (new-stack-vector0) (-> arg0 control trans) (-> arg0 control last-trans-any-surf))) + (a2-17 (sqrtf (+ (* (-> v1-206 x) (-> v1-206 x)) (* (-> v1-206 z) (-> v1-206 z))))) + (v1-208 + (vector-! (new-stack-vector0) (-> arg0 control highest-jump-mark) (-> arg0 control last-trans-leaving-surf)) + ) + ) + (t9-81 a0-149 a1-61 a2-17 (sqrtf (+ (* (-> v1-208 x) (-> v1-208 x)) (* (-> v1-208 z) (-> v1-208 z))))) + ) + (format + arg1 + "~0kbend b:~F t:~F s:~F~%" + (-> arg0 control bend-amount) + (-> arg0 control bend-target) + (-> arg0 control bend-speed) + ) + (set! sv-64 0) + (set! sv-72 0) + (set! sv-80 *anim-manager*) + (countdown (s3-8 (-> sv-80 free-index)) + (when (= (-> sv-80 slot s3-8 time-stamp) (-> *display* base-clock frame-counter)) + (set! sv-72 (+ sv-72 1)) + (set! sv-64 (+ sv-64 (used-bytes-for-slot sv-80 s3-8))) + ) + ) + (format + arg1 + "anim cache ~d anims ~dK total, ~d ~dK active~%" + (-> sv-80 free-index) + (sar (&- (-> sv-80 heap current) (the-as uint (-> sv-80 heap base))) 10) + sv-72 + (sar sv-64 10) + ) + (debug-print-channels (-> arg0 skel) arg1) + ) + (draw-history (-> arg0 control)) + (set! pp s5-0) + ) + #f + ) + ) + +;; definition for function read-pad +;; INFO: Used lq/sq +(defbehavior read-pad target ((arg0 vector)) + (when (!= (-> self control time-of-last-pad-read) (-> *display* real-clock frame-counter)) + (set! (-> self control last-pad-xz-dir quad) (-> self control pad-xz-dir quad)) + (set! (-> self control last-pad-magnitude) (-> self control pad-magnitude)) + (set! (-> self control time-of-last-pad-read) (-> *display* real-clock frame-counter)) + ) + (set! (-> arg0 x) (sin (-> self control cpad stick0-dir))) + (set! (-> arg0 y) 0.0) + (set! (-> arg0 z) (cos (-> self control cpad stick0-dir))) + (set! (-> arg0 w) 0.0) + (set! (-> self control pad-xz-dir quad) (-> arg0 quad)) + (set! (-> self control pad-magnitude) (-> self control cpad stick0-speed)) + (when (< (-> self control update-cam-R-w-start-time) (current-time)) + (let* ((s5-0 (-> self control cam-R-w)) + (a2-0 (matrix-local->world #t #f)) + (v1-24 (-> a2-0 rvec quad)) + (a0-14 (-> a2-0 uvec quad)) + (a1-1 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 rvec quad) v1-24) + (set! (-> s5-0 uvec quad) a0-14) + (set! (-> s5-0 fvec quad) a1-1) + (set! (-> s5-0 trans quad) a2-1) + ) + ) + (vector-matrix*! arg0 arg0 (-> self control cam-R-w)) + ) + +;; definition for function set-pad +(defbehavior set-pad target ((arg0 vector)) + (set! (-> self control pad-magnitude) (vector-length arg0)) + (vector-matrix*! (-> self control pad-xz-dir) arg0 (matrix-world->local #t #f)) + arg0 + ) + +;; definition for function warp-vector-into-surface! +;; INFO: Used lq/sq +(defun warp-vector-into-surface! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 matrix)) + (let ((t9-0 matrix-from-two-vectors!) + (a0-1 (new 'stack-no-clear 'matrix)) + ) + (set! (-> a0-1 rvec quad) (the-as uint128 0)) + (set! (-> a0-1 uvec quad) (the-as uint128 0)) + (set! (-> a0-1 fvec quad) (the-as uint128 0)) + (set! (-> a0-1 trans quad) (the-as uint128 0)) + (let ((a2-1 (t9-0 a0-1 (-> arg3 uvec) arg2))) + (vector-matrix*! arg0 arg1 a2-1) + ) + ) + ) + +;; definition for function vector<-pad-in-surface! +;; INFO: Used lq/sq +(defbehavior vector<-pad-in-surface! target ((arg0 vector) (arg1 symbol)) + (let ((a1-1 (read-pad (new-stack-vector0)))) + (warp-vector-into-surface! arg0 a1-1 (-> self control local-normal) (-> self control cam-R-w)) + ) + (if arg1 + (vector-float*! arg0 arg0 (-> self control pad-magnitude)) + ) + arg0 + ) + +;; definition for function vector<-pad-in-matrix! +;; WARN: Return type mismatch vector vs none. +(defun vector<-pad-in-matrix! ((arg0 vector) (arg1 cpad-info) (arg2 matrix)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (matrix-local->world #t #f)) + ) + (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> arg1 leftx))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> arg1 lefty))))) + (set! (-> gp-0 w) 0.0) + (let ((f30-0 (vector-length gp-0))) + (vector-matrix*! gp-0 gp-0 s5-0) + (warp-vector-into-surface! arg0 gp-0 (-> arg2 uvec) s5-0) + (vector-matrix*! arg0 arg0 arg2) + (vector-normalize! arg0 f30-0) + ) + ) + (none) + ) + +;; definition for function local-pad-angle +;; INFO: Used lq/sq +(defbehavior local-pad-angle target () + (let ((a0-1 (vector<-pad-in-surface! (new-stack-vector0) #f))) + (vector-dot + (vector-normalize! a0-1 1.0) + (vector-z-quaternion! (new-stack-vector0) (-> self control quat-for-control)) + ) + ) + ) + +;; definition for function turn-around? +;; INFO: Used lq/sq +;; WARN: disable def twice: 93. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defbehavior turn-around? target () + (let* ((a0-1 (vector<-pad-in-surface! (new-stack-vector0) #f)) + (gp-0 (vector-normalize! a0-1 1.0)) + (t9-2 vector-normalize!) + (a0-2 (new-stack-vector0)) + ) + (set! (-> a0-2 quad) (-> self control transv quad)) + (let ((f0-1 (vector-dot gp-0 (t9-2 a0-2 1.0))) + (a1-3 (-> self control transv-history)) + (f2-0 -1000.0) + (f1-0 0.0) + (a0-3 -1) + (v1-7 (new 'static 'array time-frame 1 (seconds 0))) + ) + (countdown (a2-0 15) + (let ((a3-2 (-> a1-3 a2-0 quad))) + (set! (-> a1-3 (+ a2-0 1) quad) a3-2) + ) + ) + (set! (-> a1-3 0 quad) (-> self control transv quad)) + (set! (-> a1-3 0 w) (-> self control ctrl-xz-vel)) + (dotimes (a2-6 16) + (+! f1-0 (-> a1-3 a2-6 w)) + (when (< f2-0 (-> a1-3 a2-6 w)) + (set! a0-3 a2-6) + (set! f2-0 (-> a1-3 a2-6 w)) + ) + ) + (let ((f1-1 (* 0.0625 f1-0))) + (set! (-> self control idx-of-fastest-xz-vel) a0-3) + (set! (-> self control average-xz-vel) f1-1) + (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) + (set-time! (-> v1-7 0)) + ) + (if (logtest? (target-flags tf26) (-> self target-flags)) + (and (>= (the-as uint (- (current-time) (-> v1-7 0))) (the-as uint 300)) + (< f0-1 0.0) + (< (* 0.8 (-> self control current-surface target-speed)) f1-1) + (and (< 0.7 (-> self control pad-magnitude)) (time-elapsed? (-> self control time-of-last-lc) (seconds 0.3))) + ) + (and (>= (the-as uint (- (current-time) (-> v1-7 0))) (the-as uint 300)) + (= (-> self ext-anim) (target-anim default)) + (< f0-1 0.0) + (< (* 0.8 (-> self control current-surface target-speed)) f1-1) + (< 0.7 (-> self control pad-magnitude)) + (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.3)) + (time-elapsed? (-> self control time-of-last-lc) (seconds 0.3)) + (logtest? (-> self control status) (collide-status on-surface)) + (and (< 0.7 (-> self control surface-angle)) #t) + ) + ) + ) + ) + ) + ) + +;; definition for function wall-hide? +;; INFO: Used lq/sq +(defbehavior wall-hide? target () + (when (and (= (-> self ext-anim) (target-anim default)) + (< 0.7 (-> self control pad-magnitude)) + (< 0.7 (-> self control blocked-factor)) + (and (< (-> self control ctrl-xz-vel) 8192.0) + (logtest? (-> self control status) (collide-status touch-wall)) + (not (logtest? (-> self control status) (collide-status touch-actor))) + (or (= (-> self control wall-contact-pat event) (pat-event hide)) + (let ((a0-2 (level-get-target-inside *level*))) + (and a0-2 (logtest? (-> a0-2 info level-flags) (level-flags lf0))) + ) + ) + ) + ) + (if (time-elapsed? (-> self control time-of-last-wall-hide-first-check-pass) (seconds 0.1)) + (set-time! (-> self control time-of-first-wall-hide-first-check-pass)) + ) + (set-time! (-> self control time-of-last-wall-hide-first-check-pass)) + (when (time-elapsed? (-> self control time-of-first-wall-hide-first-check-pass) (seconds 0.5)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-35 (-> gp-0 bbox)) + (a0-13 (-> self control trans)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 x) 8192.0) + (set! (-> a1-0 y) 10240.0) + (set! (-> a1-0 z) 8192.0) + (set! (-> a1-0 w) 1.0) + (vector-! (the-as vector v1-35) a0-13 a1-0) + ) + (let ((v1-37 (-> gp-0 bbox max)) + (a0-15 (-> self control trans)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) 8192.0) + (set! (-> a1-1 y) 10240.0) + (set! (-> a1-1 z) 8192.0) + (set! (-> a1-1 w) 1.0) + (vector+! v1-37 a0-15 a1-1) + ) + (set! (-> gp-0 collide-with) (-> self control root-prim prim-core collide-with)) + (set! (-> gp-0 ignore-process0) self) + (set! (-> gp-0 ignore-process1) #f) + (set! (-> gp-0 ignore-pat) (-> self control pat-ignore-mask)) + ((method-of-object *collide-cache* collide-cache-method-12)) + (dotimes (s5-0 3) + (set! (-> gp-0 start-pos quad) (-> self control collision-spheres s5-0 prim-core world-sphere quad)) + (vector-float*! (-> gp-0 move-dist) (-> self control wall-contact-normal) -8192.0) + (let ((v1-49 gp-0)) + (set! (-> v1-49 radius) 4.096) + (set! (-> v1-49 collide-with) (-> gp-0 collide-with)) + (set! (-> v1-49 ignore-process0) #f) + (set! (-> v1-49 ignore-process1) #f) + (set! (-> v1-49 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-49 action-mask) (collide-action solid)) + ) + (cond + ((and (>= (probe-using-line-sphere *collide-cache* gp-0) 0.0) + (< 0.8 (vector-dot (-> gp-0 best-other-tri normal) (-> self control wall-contact-normal))) + ) + ) + (else + (return #f) + ) + ) + ) + ) + #t + ) + ) + ) + +;; definition for function target-log-trans +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-log-trans target () + (let ((v1-1 (-> self control trans-log-idx))) + (set-time! (-> self control trans-log-times v1-1)) + (set! (-> self control trans-log-trans v1-1 quad) (-> self control trans quad)) + (set! (-> self control trans-log-idx) (logand (+ v1-1 1) 127)) + ) + 0 + (none) + ) + +;; definition for function target-move-dist +;; INFO: Used lq/sq +(defbehavior target-move-dist target ((arg0 time-frame)) + (let ((s5-0 (new-stack-vector0)) + (f30-0 0.0) + (gp-0 0) + ) + (let ((s4-0 (-> self control))) + (let* ((v1-0 127) + (a1-2 (logand (+ (-> s4-0 trans-log-idx) v1-0) 127)) + ) + (while (and (not (time-elapsed? (-> s4-0 trans-log-times a1-2) arg0)) (> v1-0 0)) + (vector+! s5-0 s5-0 (-> s4-0 trans-log-trans a1-2)) + (+! gp-0 1) + (+! v1-0 -1) + (set! a1-2 (logand (+ a1-2 v1-0) 127)) + ) + ) + (vector-float/! s5-0 s5-0 (the float gp-0)) + (let ((s3-0 (- 128 gp-0))) + (while (< s3-0 128) + (let ((v1-5 (logand (+ (-> s4-0 trans-log-idx) s3-0) 127))) + (+! f30-0 (vector-vector-distance s5-0 (-> s4-0 trans-log-trans v1-5))) + ) + (+! s3-0 1) + ) + ) + ) + (/ f30-0 (the float gp-0)) + ) + ) + +;; definition for function turn-to-vector +;; INFO: Used lq/sq +(defbehavior turn-to-vector target ((arg0 vector) (arg1 float)) + (let ((gp-0 (new-stack-vector0))) + (warp-vector-into-surface! gp-0 arg0 (-> self control local-normal) (-> self control cam-R-w)) + (set! (-> self control last-turn-to-magnitude) (-> self control turn-to-magnitude)) + (set! (-> self control last-turn-to-angle) (-> self control turn-to-angle)) + (set! (-> self control last-to-target-pt-xz quad) (-> self control to-target-pt-xz quad)) + (set! (-> self control last-turn-to-target quad) (-> self control turn-to-target quad)) + (vector-float*! (-> self control turn-to-target) gp-0 arg1) + (if (< 0.0 arg1) + (warp-vector-into-surface! (-> self control to-target-pt-xz) arg0 *up-vector* (-> self control cam-R-w)) + ) + (dotimes (v1-17 7) + (set! (-> self control turn-history-ctrl (+ v1-17 1) quad) (-> self control turn-history-ctrl v1-17 quad)) + ) + (set! (-> self control turn-history-ctrl 0 quad) + (-> (vector-matrix*! gp-0 gp-0 (-> self control w-R-c)) quad) + ) + (let ((f0-6 (atan (-> gp-0 x) (-> gp-0 z)))) + (set! (-> self control turn-to-magnitude) arg1) + (set! (-> self control turn-to-angle) f0-6) + ) + (let ((f0-8 (* arg1 (-> self control current-surface target-speed)))) + (set! (-> self control target-transv quad) (-> (vector-normalize! gp-0 f0-8) quad)) + ) + ) + (let ((gp-1 (new-stack-vector0))) + (vector-matrix*! gp-1 (-> self control target-transv) (-> self control c-R-w)) + (vector-float*! gp-1 gp-1 0.5) + (vector+! gp-1 gp-1 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + gp-1 + (meters 0.2) + "target" + (the-as rgba (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + ) + ) + +;; definition for function target-bend-vel-turn +(defbehavior target-bend-vel-turn target ((arg0 vector)) + (cond + ((= (-> self control current-surface vel-turn) 0.0) + ) + ((< (-> self control current-surface vel-turn) 0.0) + (let* ((v1-5 arg0) + (f0-6 (sqrtf (+ (* (-> v1-5 x) (-> v1-5 x)) (* (-> v1-5 z) (-> v1-5 z))))) + ) + (set-vector! arg0 0.0 (-> arg0 y) f0-6 1.0) + ) + ) + (else + (let ((f0-10 (atan (-> arg0 x) (-> arg0 z)))) + (vector-rotate-y! arg0 arg0 (fmin + (* 0.03 (-> self clock time-adjust-ratio) (- f0-10)) + (* (-> self control current-surface vel-turn) (seconds-per-frame)) + ) + ) + ) + ) + ) + arg0 + ) + +;; definition for function target-add-slide-factor +;; INFO: Used lq/sq +(defbehavior target-add-slide-factor target ((arg0 vector)) + (let* ((a1-2 (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-negate! (new-stack-vector0) (-> self control dynam gravity-normal)) + (-> self control local-normal) + ) + ) + (s4-1 (vector-matrix*! (new 'stack-no-clear 'vector) a1-2 (-> self control w-R-c))) + (s5-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 1.0)) + ) + (vector+float*! arg0 arg0 s4-1 (-> self control current-surface slide-factor)) + (let ((a1-5 (-> self control low-coverage-tangent))) + (when (not (or (= (- 1.0 (-> self control current-surface slope-up-traction)) 0.0) (< (vector-length s4-1) 0.1))) + (let* ((a0-7 (vector-matrix*! (new 'stack-no-clear 'vector) a1-5 (-> self control w-R-c))) + (v1-15 (new-stack-vector0)) + (f0-5 (vector-dot a0-7 arg0)) + ) + 0.0 + (vector-! v1-15 arg0 (vector-float*! v1-15 a0-7 f0-5)) + (let* ((f1-5 (vector-length v1-15)) + (f2-0 f1-5) + ) + (if (< f0-5 0.0) + (set! f0-5 (* f0-5 (-> self control current-surface slope-up-traction))) + ) + (let ((f0-6 (+ f0-5 (-> self control current-surface slope-down-factor)))) + (vector+! arg0 (vector-float*! arg0 a0-7 f0-6) (vector-float*! v1-15 v1-15 (/ f1-5 f2-0))) + ) + ) + ) + ) + ) + (let ((t9-5 vector-xz-normalize!) + (a0-10 (new-stack-vector0)) + ) + (set! (-> a0-10 quad) (-> arg0 quad)) + (let ((v1-18 (t9-5 a0-10 1.0))) + (set! (-> v1-18 y) 0.0) + (let* ((f0-10 (vector-dot s5-1 v1-18)) + (v1-20 arg0) + (f1-10 (sqrtf (+ (* (-> v1-20 x) (-> v1-20 x)) (* (-> v1-20 z) (-> v1-20 z))))) + ) + (if (>= f0-10 0.0) + (vector-xz-normalize! arg0 (fmax 0.0 (+ f1-10 (* f0-10 (-> self control current-surface slope-down-factor))))) + (vector-xz-normalize! + arg0 + (fmax 0.0 (- f1-10 (* (- f0-10) (-> self control current-surface slope-up-factor)))) + ) + ) + ) + ) + ) + ) + arg0 + ) + +;; definition for function add-thrust +;; INFO: Used lq/sq +(defbehavior add-thrust target () + (let ((s5-0 (-> self control target-transv)) + (gp-0 (-> self control transv-ctrl)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> self control target-transv quad)) + (target-bend-vel-turn gp-0) + (target-add-slide-factor s5-0) + (let ((t9-2 vector-xz-normalize!) + (a0-2 (new-stack-vector0)) + ) + (set! (-> a0-2 quad) (-> s5-0 quad)) + (let ((s3-0 (t9-2 a0-2 1.0))) + (let ((t9-3 vector-xz-normalize!) + (a0-3 (new-stack-vector0)) + ) + (set! (-> a0-3 quad) (-> gp-0 quad)) + (let ((v1-9 (t9-3 a0-3 1.0))) + (set! (-> s3-0 y) 0.0) + (set! (-> v1-9 y) 0.0) + ) + ) + (let* ((f0-2 (-> s3-0 z)) + (v1-10 gp-0) + (f1-4 (sqrtf (+ (* (-> v1-10 x) (-> v1-10 x)) (* (-> v1-10 z) (-> v1-10 z))))) + (v1-12 s5-0) + (f30-0 + (cond + ((>= f1-4 (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z))))) + (let ((f0-3 (-> self control current-surface fric)) + (f1-5 1.0) + (v1-17 gp-0) + ) + (* f0-3 (fmax f1-5 (/ (sqrtf (+ (* (-> v1-17 x) (-> v1-17 x)) (* (-> v1-17 z) (-> v1-17 z)))) + (-> self control current-surface nonlin-fric-dist) + ) + ) + ) + ) + ) + ((>= f0-2 0.0) + (+ (* f0-2 (-> self control current-surface seek0)) (* (- 1.0 f0-2) (-> self control current-surface seek90))) + ) + (else + (+ (* (fabs f0-2) (-> self control current-surface seek180)) + (* (+ 1.0 f0-2) (-> self control current-surface seek90)) + ) + ) + ) + ) + ) + (let* ((s2-0 (-> self control btransv)) + (s3-1 (vector-matrix*! (new 'stack-no-clear 'vector) s2-0 (-> self control w-R-c))) + ) + (if (< (-> s4-0 x) 0.0) + (set! (-> s3-1 x) (fmax (fmin 0.0 (-> s3-1 x)) (-> s4-0 x))) + (set! (-> s3-1 x) (fmax 0.0 (fmin (-> s3-1 x) (-> s4-0 x)))) + ) + (if (< (-> s4-0 y) 0.0) + (set! (-> s3-1 y) (fmax (fmin 0.0 (-> s3-1 y)) (-> s4-0 y))) + (set! (-> s3-1 y) (fmax 0.0 (fmin (-> s3-1 y) (-> s4-0 y)))) + ) + (if (< (-> s4-0 z) 0.0) + (set! (-> s3-1 z) (fmax (fmin 0.0 (-> s3-1 z)) (-> s4-0 z))) + (set! (-> s3-1 z) (fmax 0.0 (fmin (-> s3-1 z) (-> s4-0 z)))) + ) + (if (< 0.2 (-> self control blocked-factor)) + (vector-seek! s3-1 s4-0 (* 122880.0 (seconds-per-frame))) + ) + (vector-matrix*! s2-0 s3-1 (-> self control c-R-w)) + (let ((f28-0 (vector-vector-xz-distance s3-1 s4-0))) + (when (and (not (logtest? (-> self control status) (collide-status touch-surface))) + (let ((v1-51 gp-0)) + (< (sqrtf (+ (* (-> v1-51 x) (-> v1-51 x)) (* (-> v1-51 z) (-> v1-51 z)))) + (sqrtf (+ (* (-> s3-1 x) (-> s3-1 x)) (* (-> s3-1 z) (-> s3-1 z)))) + ) + ) + ) + (let ((f0-37 (lerp-scale 163840.0 0.0 f28-0 0.0 20480.0))) + (if (and (< f28-0 20480.0) (< (-> s4-0 z) 0.0)) + (set! f0-37 (* 2.0 f0-37)) + ) + (+! f30-0 f0-37) + ) + ) + ) + ) + (if (and (not (logtest? (-> self control status) (collide-status touch-wall))) + (logtest? (-> self control old-status) (collide-status touch-wall)) + (logtest? (-> self control mod-surface flags) (surface-flag air)) + (< 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 collision-spheres 1 prim-core)) + (-> self control wall-contact-pt) + ) + ) + ) + ) + (set-time! (-> self control time-of-last-clear-wall-in-jump)) + ) + (if (not (time-elapsed? (-> self control time-of-last-clear-wall-in-jump) (seconds 0.2))) + (set! f30-0 (+ 204800.0 f30-0)) + ) + (if (and (not (logtest? (-> self control status) (collide-status touch-wall))) + (and (logtest? (-> self control old-status) (collide-status touch-wall)) + (logtest? (-> self control mod-surface flags) (surface-flag air)) + (< 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))) + (let ((f0-45 (* f30-0 (seconds-per-frame)))) + (set! (-> s4-2 y) 0.0) + (let ((v1-104 s4-2)) + (if (< f0-45 (sqrtf (+ (* (-> v1-104 x) (-> v1-104 x)) (* (-> v1-104 z) (-> v1-104 z))))) + (vector-xz-normalize! s4-2 f0-45) + ) + ) + ) + (vector+! gp-0 gp-0 s4-2) + ) + ) + ) + ) + ) + (set! (-> self control velocity-after-thrust) (vector-length gp-0)) + ) + (let ((gp-1 (new-stack-vector0))) + (vector-matrix*! gp-1 (-> self control transv-ctrl) (-> self control c-R-w)) + (vector-float*! gp-1 gp-1 0.5) + (vector+! gp-1 gp-1 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + gp-1 + (meters 0.2) + "ltransv" + (the-as rgba (new 'static 'rgba :g #xff :a #x80)) + ) + (set! (-> gp-1 quad) (-> self control btransv quad)) + (vector-float*! gp-1 gp-1 0.5) + (vector+! gp-1 gp-1 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + gp-1 + (meters 0.2) + "btransv" + (the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + ) + ) + ) + +;; definition for function add-gravity +;; INFO: Used lq/sq +(defbehavior add-gravity target () + (let ((s5-0 (new-stack-vector0)) + (gp-0 (new-stack-vector0)) + ) + (compute-acc-due-to-gravity (-> self control) s5-0 (-> self control current-surface slip-factor)) + (vector-matrix*! gp-0 s5-0 (-> self control w-R-c)) + (vector-v++! (-> self control transv-ctrl) gp-0) + ) + (let* ((a0-4 + (vector-matrix*! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal) (-> self control w-R-c)) + ) + (v1-9 (new-stack-vector0)) + (f0-2 (vector-dot a0-4 (-> self control transv-ctrl))) + ) + 0.0 + (vector-! v1-9 (-> self control transv-ctrl) (vector-float*! v1-9 a0-4 f0-2)) + (let* ((f1-2 (vector-length v1-9)) + (f2-0 f1-2) + ) + (if (< f1-2 0.00004096) + (set! f1-2 0.0) + ) + (if (< f0-2 (- (-> self control dynam gravity-max))) + (set! f0-2 (- (-> self control dynam gravity-max))) + ) + (vector+! + (-> self control transv-ctrl) + (vector-float*! (-> self control transv-ctrl) a0-4 f0-2) + (vector-float*! v1-9 v1-9 (/ f1-2 f2-0)) + ) + ) + ) + ) + +;; definition for function target-compute-slopes +(defbehavior target-compute-slopes target ((arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s4-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control))) + (s3-0 (new 'stack-no-clear 'matrix)) + (s5-0 (vector-flatten! + (new 'stack-no-clear 'vector) + (-> self control dynam gravity-normal) + (-> self control local-normal) + ) + ) + ) + (forward-up-nopitch->inv-matrix s3-0 (-> self control c-R-w fvec) arg0) + (set-vector! gp-0 0.0 0.0 1.0 1.0) + (vector-matrix*! gp-0 gp-0 s3-0) + (set! (-> self control surface-slope-z) (- (vector-dot (-> self control surface-normal) gp-0))) + (set! (-> self control local-slope-z) (- (vector-dot (-> self control local-normal) gp-0))) + (set! (-> self control gspot-slope-z) (- (vector-dot (-> self control gspot-normal) gp-0))) + (set! (-> self control ctrl-slope-z) (- (vector-dot s4-0 gp-0))) + (set-vector! gp-0 1.0 0.0 0.0 1.0) + (vector-matrix*! gp-0 gp-0 s3-0) + (set! (-> self control surface-slope-x) (- (vector-dot (-> self control surface-normal) gp-0))) + (set! (-> self control local-slope-x) (- (vector-dot (-> self control local-normal) gp-0))) + (set! (-> self control gspot-slope-x) (- (vector-dot (-> self control gspot-normal) gp-0))) + (set! (-> self control ctrl-slope-x) (- (vector-dot s4-0 gp-0))) + (set-vector! gp-0 1.0 0.0 0.0 1.0) + (vector-matrix*! gp-0 gp-0 (-> self control c-R-w)) + (set! (-> self control ctrl-slope-heading) (vector-dot gp-0 s5-0)) + ) + 0 + ) + +;; definition for function do-rotations1 +(defbehavior do-rotations1 target () + (rotate-toward-orientation! + (-> self control) + (-> self control dir-targ) + 0.0 + (-> self control current-surface tiltv) + 150 + (the int (-> self control current-surface tiltvf)) + 0.0 + ) + ) + +;; definition for symbol *strafe-mode*, type symbol +(define *strafe-mode* #f) + +;; definition for function do-rotations2 +;; INFO: Used lq/sq +(defbehavior do-rotations2 target () + (if *strafe-mode* + (return 0) + ) + (let ((gp-0 (vector-z-quaternion! (new-stack-vector0) (-> self control dir-targ))) + (s5-0 + (cond + ((logtest? (surface-flag turn-to-alt) (-> self control current-surface flags)) + (-> self control turn-to-alt-heading) + ) + ((and (or (not (logtest? (logior (-> self control status) (-> self control old-status)) + (collide-status on-surface touch-surface) + ) + ) + (not (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.5))) + (not (and (-> self next-state) (let ((v1-18 (-> self next-state name))) + (or (= v1-18 'target-walk) (= v1-18 'target-gun-walk)) + ) + ) + ) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) + (not (time-elapsed? (-> self control time-of-last-lc) (seconds 0.5))) + (logtest? (-> self control current-surface flags) (surface-flag turn-to-pad)) + (!= (-> self control force-turn-to-strength) 0.0) + ) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) + ) + (-> self control to-target-pt-xz) + ) + (else + (-> self control transv) + ) + ) + ) + ) + (let* ((s3-0 (-> self control bent-gravity-normal)) + (s4-0 (forward-up-nopitch->quaternion (new-stack-quaternion0) gp-0 s3-0)) + (s3-1 (forward-up-nopitch->quaternion (new-stack-quaternion0) s5-0 s3-0)) + (f0-2 (acos (vector-dot gp-0 s5-0))) + (f1-2 (* (-> self control current-surface turnvv) (seconds-per-frame))) + ) + (quaternion-slerp! + (-> self control dir-targ) + s4-0 + s3-1 + (cond + ((and (or (>= 0.0 (-> self control turn-to-magnitude)) (< (current-time) (-> self control turn-lockout-end-time))) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-when-centered))) + ) + 0.0 + ) + ((< f0-2 f1-2) + 1.0 + ) + (else + (/ f1-2 f0-2) + ) + ) + ) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + gp-0 + (meters 2) + (the-as rgba (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + s5-0 + (meters 2) + (the-as rgba (new 'static 'rgba :r #xff :g #x80 :a #x80)) + ) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (-> self control c-R-w fvec) + (meters 2) + (the-as rgba (new 'static 'rgba :r #xff :b #xff :a #x80)) + ) + (rotate-toward-orientation! + (-> self control) + (-> self control dir-targ) + (-> self control current-surface turnv) + 0.0 + (the int (-> self control current-surface turnvf)) + 150 + (-> self control turn-go-the-long-way) + ) + (if (and (!= (-> self control turn-go-the-long-way) 0.0) + (< (fabs + (deg-diff + (quaternion-y-angle (-> self control quat-for-control)) + (quaternion-y-angle (-> self control dir-targ)) + ) + ) + 182.04445 + ) + ) + (set! (-> self control turn-go-the-long-way) 0.0) + ) + (quaternion-slerp! + (-> self control quat) + (-> self control quat-for-control) + (-> self control override-quat) + (-> self control override-quat-alpha) + ) + (target-compute-slopes (-> self control dynam gravity-normal)) + ) + +;; definition for function leg-ik-callback +;; INFO: Used lq/sq +(defun leg-ik-callback ((arg0 joint-mod-ik) (arg1 object) (arg2 object) (arg3 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg3 quad)) + (let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y)))) + (if (< 1228.8 f0-1) + (set! f0-1 1228.8) + ) + (if (< f0-1 409.6) + (set! f0-1 409.6) + ) + (+! (-> arg0 user-position y) f0-1) + ) + (let* ((f0-4 + (vector-dot (-> arg0 user-normal) (vector-! (new 'stack-no-clear 'vector) arg3 (-> arg0 user-position))) + ) + (f30-1 (lerp-scale 1.0 0.0 f0-4 0.0 2048.0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-13 s5-0)) + (let ((a0-4 (-> arg0 user-normal))) + (let ((a1-4 4096.0)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-4 quad)) + ) + (.lvf vf4 (&-> v1-13 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s3-0 quad) vf6) + (vector-float*! (new 'stack-no-clear 'vector) (-> arg0 user-normal) -8192.0) + (let ((s4-1 (new 'stack-no-clear 'vector))) + 0.0 + (let ((f0-8 (intersect-ray-plane s3-0 (-> arg0 user-normal) (-> arg0 user-position) (-> arg0 user-normal))) + (a0-7 s4-1) + ) + (let ((v1-16 (-> arg0 user-normal))) + (let ((a1-7 f0-8)) + (.mov vf7 a1-7) + ) + (.lvf vf5 (&-> v1-16 quad)) + ) + (.lvf vf4 (&-> s3-0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-7 quad) vf6) + ) + (let ((a1-8 s4-1)) + (let ((v1-17 s4-1)) + (let ((a0-8 (-> arg0 user-normal))) + (let ((a2-6 + (- (vector-dot (-> arg0 user-normal) (vector-! (new 'stack-no-clear 'vector) s4-1 (-> arg0 user-position)))) + ) + ) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a0-8 quad)) + ) + (.lvf vf4 (&-> v1-17 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-8 quad) vf6) + ) + (let ((a1-9 s5-0)) + (let ((v1-18 s5-0)) + (let ((a0-10 (vector-! (new 'stack-no-clear 'vector) s4-1 s5-0))) + (let ((a2-9 (fmin 1.0 (* (-> arg0 user-blend) f30-1)))) + (.mov vf7 a2-9) + ) + (.lvf vf5 (&-> a0-10 quad)) + ) + (.lvf vf4 (&-> v1-18 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-9 quad) vf6) + ) + ) + ) + (set-ik-target! arg0 s5-0) + ) + (none) + ) + ) + +;; definition for function target-update-ik +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-update-ik target () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-0 (-> gp-0 bbox)) + (a0-1 (-> self control trans)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 x) 8192.0) + (set! (-> a1-0 y) 6144.0) + (set! (-> a1-0 z) 8192.0) + (set! (-> a1-0 w) 1.0) + (vector-! (the-as vector v1-0) a0-1 a1-0) + ) + (let ((v1-2 (-> gp-0 bbox max)) + (a0-3 (-> self control trans)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) 8192.0) + (set! (-> a1-1 y) 6144.0) + (set! (-> a1-1 z) 8192.0) + (set! (-> a1-1 w) 1.0) + (vector+! v1-2 a0-3 a1-1) + ) + (set! (-> gp-0 collide-with) (-> self control root-prim prim-core collide-with)) + (set! (-> gp-0 ignore-process0) self) + (set! (-> gp-0 ignore-process1) #f) + (set! (-> gp-0 ignore-pat) (-> self control pat-ignore-mask)) + ((method-of-object *collide-cache* collide-cache-method-12)) + (dotimes (s5-0 2) + (let ((a1-4 (not (or (logtest? (target-flags lleg-no-ik rleg-no-ik) (-> self target-flags)) + (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (focus-test? self edge-grab pole flut pilot mech) + ) + ) + ) + ) + (enable-set! (-> self leg-ik s5-0) a1-4) + ) + (set! (-> self foot s5-0 twist-max quad) (-> self control ground-contact-normal quad)) + (set! (-> self foot s5-0 trans quad) (-> self control gspot-pos quad)) + (vector-y-quaternion! (-> self foot s5-0 target) (-> self control quat-for-control)) + (set! (-> self foot s5-0 flex-blend) (if (if (zero? s5-0) + (logtest? (target-flags lleg-no-ik) (-> self target-flags)) + (logtest? (target-flags rleg-no-ik) (-> self target-flags)) + ) + 0.0 + 1.0 + ) + ) + (-> self leg-ik s5-0 shoulder-matrix-no-ik) + (let ((v1-51 (-> self leg-ik s5-0 elbow-matrix-no-ik)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s1-0 quad) (-> *y-vector* quad)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((a2-8 s2-0)) + (let ((a0-27 (-> v1-51 trans))) + (let ((a1-8 (-> v1-51 uvec))) + (let ((a3-3 (-> self leg-ik s5-0 hand-dist))) + (.mov vf7 a3-3) + ) + (.lvf vf5 (&-> a1-8 quad)) + ) + (.lvf vf4 (&-> a0-27 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a2-8 quad) vf6) + ) + (let ((a1-9 s2-0)) + (let ((a0-28 (-> v1-51 trans))) + (let ((v1-52 (-> v1-51 uvec))) + (let ((a2-12 (-> self leg-ik s5-0 hand-dist))) + (.mov vf7 a2-12) + ) + (.lvf vf5 (&-> v1-52 quad)) + ) + (.lvf vf4 (&-> a0-28 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-9 quad) vf6) + ) + (let ((f0-13 (lerp-scale 1.0 0.0 (- (-> s2-0 y) (-> self control gspot-pos y)) 819.2 2048.0))) + (seek! (-> self leg-ik s5-0 user-blend) f0-13 (* 4.0 (seconds-per-frame))) + ) + (let ((a1-12 (-> gp-0 start-pos))) + (let ((v1-63 s2-0)) + (let ((a0-31 s1-0)) + (let ((a2-16 4096.0)) + (.mov vf7 a2-16) + ) + (.lvf vf5 (&-> a0-31 quad)) + ) + (.lvf vf4 (&-> v1-63 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-12 quad) vf6) + ) + (vector-float*! (-> gp-0 move-dist) s1-0 -8192.0) + (let ((v1-66 gp-0)) + (set! (-> v1-66 radius) 4.096) + (set! (-> v1-66 collide-with) (-> gp-0 collide-with)) + (set! (-> v1-66 ignore-process0) #f) + (set! (-> v1-66 ignore-process1) #f) + (set! (-> v1-66 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-66 action-mask) (collide-action solid)) + ) + (let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0))) + (cond + ((and (>= f30-0 0.0) (< 0.5 (-> gp-0 best-other-tri normal y))) + (set! (-> s4-0 quad) (-> gp-0 best-other-tri normal quad)) + (when (< 8192.0 (vector-vector-angle-safe *y-vector* s4-0)) + (let* ((a1-17 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s4-0) 1.0)) + (a2-18 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-17 8192.0)) + ) + (vector-orient-by-quat! s4-0 *y-vector* a2-18) + ) + ) + (let ((a1-19 s3-0)) + (let ((v1-77 (-> gp-0 start-pos))) + (let ((a0-45 (-> gp-0 move-dist))) + (let ((a2-19 f30-0)) + (.mov vf7 a2-19) + ) + (.lvf vf5 (&-> a0-45 quad)) + ) + (.lvf vf4 (&-> v1-77 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-19 quad) vf6) + ) + (set! (-> self leg-ik s5-0 user-position quad) (-> s3-0 quad)) + (set! (-> self leg-ik s5-0 user-normal quad) (-> s4-0 quad)) + (set! (-> self foot s5-0 twist-max quad) (-> s4-0 quad)) + ) + (else + (set! (-> self leg-ik s5-0 user-position quad) (-> s2-0 quad)) + (set! (-> self leg-ik s5-0 user-normal quad) (-> *y-vector* quad)) + (set! (-> self foot s5-0 twist-max quad) (-> *y-vector* quad)) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function pre-collide-setup +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior pre-collide-setup target () + (if (>= (current-time) (-> self control additional-decaying-velocity-decay-start-time)) + (vector-normalize! + (-> self control additional-decaying-velocity) + (seek (vector-length (-> self control additional-decaying-velocity)) 0.0 (* 40960.0 (seconds-per-frame))) + ) + ) + (cond + ((logtest? (-> self control old-status) (collide-status on-surface)) + (if (>= (+ (current-time) (seconds -0.035)) (-> self control additional-decaying-velocity-end-time)) + (vector-reset! (-> self control additional-decaying-velocity)) + ) + ) + (else + (let ((f30-0 (vector-length (-> self control additional-decaying-velocity)))) + (let* ((v1-22 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control additional-decaying-velocity) 1.0) + ) + (f0-3 (vector-dot (-> self control transv) v1-22)) + ) + (if (< f0-3 0.0) + (set! f30-0 (seek f30-0 0.0 (* -1.0 (seconds-per-frame) f0-3))) + ) + ) + (let ((f0-7 (seek f30-0 0.0 (* 28672.0 (seconds-per-frame))))) + (vector-normalize! (-> self control additional-decaying-velocity) f0-7) + ) + ) + ) + ) + (set! (-> self control collide-extra-velocity quad) (-> self control additional-decaying-velocity quad)) + (set! (-> self control pre-collide-local-normal quad) (-> self control local-normal quad)) + 0 + (none) + ) + +;; definition for function level-setup +;; WARN: Return type mismatch int vs none. +(defbehavior level-setup target () + (let ((gp-0 (-> self current-level))) + (set! (-> self current-level) (level-get-target-inside *level*)) + (if (-> self current-level) + (+! (-> self game task-in-times (-> self current-level info task-level)) + (- (current-time) (-> self clock old-frame-counter)) + ) + ) + (if (and (-> self current-level) (or (not gp-0) (!= (-> gp-0 name) (-> self current-level name)))) + (send-event self 'level-enter (-> self current-level name)) + ) + ) + 0 + (none) + ) + +;; definition for function flag-setup +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior flag-setup target () + (cond + ((= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (if (zero? (-> self control time-between-zero-inputs)) + (set! (-> self control time-between-zero-inputs) (- (current-time) (-> self control time-of-last-zero-input))) + ) + (set-time! (-> self control time-of-last-zero-input)) + (quaternion-copy! (-> self control last-nonzero-input-dir-targ) (-> self control dir-targ)) + ) + (else + (set-time! (-> self control time-of-last-nonzero-input)) + (set! (-> self control time-between-zero-inputs) 0) + 0 + ) + ) + (level-setup) + (set! (-> self control last-transv quad) (-> self control transv quad)) + (quaternion-copy! (-> self control last-quat-for-control) (-> self control quat-for-control)) + ((-> self control current-surface active-hook)) + (cond + ((logtest? (-> self control status) (collide-status on-surface)) + (set-time! (-> self control last-time-on-surface)) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (if (and (>= (-> self control coverage) 1.0) + (not (logtest? (-> self control status) (collide-status touch-actor on-water))) + (logtest? (-> self control status) (collide-status on-ground)) + ) + (set! (-> self control last-trans-on-ground quad) (-> self control trans quad)) + ) + ((-> self control current-surface touch-hook)) + ) + (else + (let ((v1-49 (-> self control trans))) + (when (logtest? (-> self control old-status) (collide-status on-surface)) + (set! (-> self control last-trans-leaving-surf quad) (-> self control last-trans-any-surf quad)) + (set! (-> self control highest-jump-mark quad) (-> self control last-trans-any-surf quad)) + ) + (set! (-> self control highest-jump-mark x) (-> v1-49 x)) + (set! (-> self control highest-jump-mark z) (-> v1-49 z)) + (if (< (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control highest-jump-mark) v1-49) + ) + 0.0 + ) + (set! (-> self control highest-jump-mark y) (-> v1-49 y)) + ) + ) + ) + ) + (when (and (cpad-pressed? (-> self control cpad number) r3) + (zero? (-> self control remaining-ctrl-iterations)) + (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask movie))) + (not *pause-lock*) + ) + (if (and (= (-> self cam-user-mode) 'normal) + (logtest? (-> self control mod-surface flags) (surface-flag look-around)) + (not (focus-test? self edge-grab pole flut tube light board pilot dark)) + (-> *setting-control* user-current allow-look-around) + (time-elapsed? (the-as int (-> self no-look-around-wait)) (seconds 0.05)) + (not (and (= (-> self control ground-pat material) (pat-material ice)) (< 4096.0 (-> self control ctrl-xz-vel))) + ) + ) + (send-event self 'change-mode 'look-around) + ) + ) + (if (!= (not (logtest? (logand (game-feature sidekick) (-> *setting-control* user-current features)) + (-> self game features) + ) + ) + (not (-> self sidekick)) + ) + (target-sidekick-setup + (logtest? (logand (game-feature sidekick) (-> *setting-control* user-current features)) + (-> self game features) + ) + ) + ) + (if (and (!= (not (logtest? (game-feature board) (-> self game features))) (not (-> self board board))) + (not (logtest? (focus-status board) (-> self focus-status))) + ) + (target-board-setup (logtest? (game-feature board) (-> self game features))) + ) + (if (want-to-board?) + (send-event self 'change-mode 'board #f) + ) + (when (!= (not (-> *setting-control* user-current mirror)) (not (-> self mirror))) + (cond + ((-> self mirror) + (deactivate (-> self mirror 0)) + (set! (-> self mirror) (the-as (pointer process-drawable) #f)) + ) + (else + (let ((gp-1 (process-spawn + manipy + :init manipy-init + (-> self control trans) + (-> self entity) + (target-skel-group) + #f + 2 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (send-event (ppointer->process gp-1) 'anim-mode 'mirror) + (send-event (ppointer->process gp-1) 'mirror #t) + (set! (-> self mirror) (the-as (pointer process-drawable) gp-1)) + ) + ) + ) + ) + (when (and (= *cheat-mode* 'debug) + (cpad-hold? (-> self control cpad number) r2) + (cpad-hold? (-> self control cpad number) l2) + (not *pause-lock*) + (not (focus-test? self grabbed in-head pilot teleporting)) + (not (and (-> self next-state) + (let ((v1-163 (-> self next-state name))) + (or (= v1-163 'target-darkjak-get-on) (= v1-163 'target-lightjak-get-on) (= v1-163 'target-float)) + ) + ) + ) + (= (-> self pending-ext-geo) (-> self ext-geo)) + ) + (send-event *camera* 'reset-follow) + (set-time! (-> self control time-of-last-debug-float)) + (cond + ((focus-test? self mech indax) + (if (not (and (-> self next-state) (let ((v1-176 (-> self next-state name))) + (or (= v1-176 'target-falling) + (= v1-176 'target-board-falling) + (= v1-176 'target-gun-falling) + (= v1-176 'target-mech-falling) + (= v1-176 'target-mech-carry-falling) + (= v1-176 'target-carry-falling) + (= v1-176 'target-indax-falling) + ) + ) + ) + ) + (send-event self 'change-mode 'falling) + ) + (set! (-> self control additional-decaying-velocity-end-time) 0) + (vector-reset! (-> self control additional-decaying-velocity)) + (let ((v1-186 (new-stack-vector0))) + (let ((f0-9 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-186 (-> self control transv) (vector-float*! v1-186 (-> self control dynam gravity-normal) f0-9)) + ) + (let* ((f0-10 (vector-length v1-186)) + (f1-5 f0-10) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-186 v1-186 (/ f0-10 f1-5)) + ) + ) + ) + (let ((a1-44 (new 'stack-no-clear 'vector))) + (set! (-> a1-44 quad) (-> self control trans quad)) + (let ((v1-190 (new-stack-vector0)) + (f0-13 (vector-dot (-> self control dynam gravity-normal) a1-44)) + ) + 0.0 + (vector-! v1-190 a1-44 (vector-float*! v1-190 (-> self control dynam gravity-normal) f0-13)) + (let* ((f1-8 (vector-length v1-190)) + (f2-1 f1-8) + (f0-14 (+ 512.0 f0-13)) + ) + (vector+! + a1-44 + (vector-float*! a1-44 (-> self control dynam gravity-normal) f0-14) + (vector-float*! v1-190 v1-190 (/ f1-8 f2-1)) + ) + ) + ) + (move-to-point! (-> self control) a1-44) + ) + (set! (-> self control surf) *standard-ground-surface*) + ) + (else + (go target-float) + ) + ) + ) + (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (if (and (or (logtest? (-> self control current-surface flags) (surface-flag check-edge)) + (and (and (-> self next-state) (let ((v1-208 (-> self next-state name))) + (or (= v1-208 'target-walk) (= v1-208 'target-gun-walk)) + ) + ) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + ) + (and (< f0-17 0.0) + (and (or (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) *pause-lock*) + (not (focus-test? self flut pilot mech indax)) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + #t + ) + ) + ) + (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) + (logclear! (-> self control root-prim prim-core action) (collide-action check-edge)) + ) + ) + (let ((v1-226 (-> self current-level))) + (if (and (or (time-elapsed? (-> self control last-time-on-surface) (seconds 2)) (focus-test? self pilot)) + (and v1-226 + (< (-> self control trans y) (-> v1-226 info bottom-height)) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) + ) + ) + (send-event + self + 'attack-invinc + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'endlessfall) + ) + ) + ) + ) + ) + (set! (-> self control bend-speed) (if (logtest? (-> self control status) (collide-status on-surface)) + 32.0 + 2.0 + ) + ) + (let ((v1-245 (-> *setting-control* user-current beard))) + (when (!= (-> self beard?) v1-245) + (cond + (v1-245 + (setup-masks (-> self draw) 4 0) + (set! (-> self beard?) #t) + ) + (else + (setup-masks (-> self draw) 0 4) + (set! (-> self beard?) #f) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function post-flag-setup +;; WARN: Return type mismatch int vs none. +(defbehavior post-flag-setup target () + (if (logtest? (-> self control status) (collide-status touch-wall touch-actor)) + (set-time! (-> self control last-time-touching-actor)) + ) + (when (logtest? (-> self target-flags) (target-flags tinvuln1)) + (if (< (logand (-> *display* frame-clock integral-frame-counter) 3) 1) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + ) + (if (time-elapsed? (-> self control invul1-on-time) (-> self control invul1-off-time)) + (target-timed-invulnerable-off self 1) + ) + ) + (when (logtest? (target-flags tinvuln2) (-> self target-flags)) + (if (time-elapsed? (-> self control invul2-on-time) (-> self control invul2-off-time)) + (target-timed-invulnerable-off self 2) + ) + ) + (set! (-> self control jump-kind) #f) + (target-gun-joint-pre) + ((-> self pre-joint-hook)) + (target-log-trans) + (seek! + (-> self hair 0 twist-max z) + (lerp-scale 0.0 1820.4445 (vector-length (-> self control transv)) 0.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! + (-> self hair 0 twist-speed-x) + (lerp-scale 0.5 4.0 (vector-length (-> self control transv)) 0.0 122880.0) + (* 10.0 (seconds-per-frame)) + ) + (let ((f0-9 (+ (-> self hair 0 twist z) (* (-> self hair 0 twist-speed-x) (seconds-per-frame))))) + (set! (-> self hair 0 twist z) (- f0-9 (* (the float (the int (/ f0-9 1.0))) 1.0))) + ) + (if (and (focus-test? self pilot) (nonzero? (-> self pilot)) (= (-> self pilot stance) 1)) + (seek! + (-> self hair 0 twist-max w) + (lerp-scale 0.0 9102.223 (vector-length (-> self control transv)) 0.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! (-> self hair 0 twist-max w) 0.0 (* 65536.0 (seconds-per-frame))) + ) + (trs-set! + (-> self hair 0) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (+ (-> self hair 0 twist-max w) (* (sin (* 32768.0 (-> self hair 0 twist z))) (-> self hair 0 twist-max z))) + ) + (the-as vector #f) + ) + (seek! + (-> self hair 1 twist-max z) + (lerp-scale 0.0 5461.3335 (vector-length (-> self control transv)) 4096.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! + (-> self hair 1 twist-speed-x) + (lerp-scale 1.0 8.0 (vector-length (-> self control transv)) 4096.0 122880.0) + (* 10.0 (seconds-per-frame)) + ) + (let ((f0-33 (+ (-> self hair 1 twist z) (* (-> self hair 1 twist-speed-x) (seconds-per-frame))))) + (set! (-> self hair 1 twist z) (- f0-33 (* (the float (the int (/ f0-33 1.0))) 1.0))) + ) + (trs-set! + (-> self hair 1) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (* (sin (* 32768.0 (-> self hair 1 twist z))) (-> self hair 1 twist-max z)) + ) + (the-as vector #f) + ) + (target-update-ik) + 0 + (none) + ) + +;; definition for function bend-gravity +;; INFO: Used lq/sq +(defbehavior bend-gravity target () + (if (and (logtest? (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (return #f) + ) + (let ((f0-1 + (if (and (logtest? (-> self control status) (collide-status touch-wall)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + 0.0 + (-> self control bend-target) + ) + ) + ) + (seek! (-> self control bend-amount) f0-1 (* (-> self control bend-speed) (seconds-per-frame))) + ) + (set! (-> self control dynam gravity-normal quad) (-> self control standard-dynamics gravity-normal quad)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((f30-0 (-> self control current-surface tiltvv)) + (gp-0 (-> self control gspot-normal)) + ) + (vector-deg-slerp s5-0 (-> self control standard-dynamics gravity-normal) gp-0 (-> self control bend-amount)) + (let ((a2-3 + (matrix-from-two-vectors-smooth! + (new 'stack-no-clear 'matrix) + (-> self control bent-gravity-normal) + s5-0 + f30-0 + (the int (-> self control current-surface tiltvvf)) + ) + ) + ) + (vector-matrix*! (-> self control bent-gravity-normal) (-> self control bent-gravity-normal) a2-3) + ) + (vector-normalize! (-> self control bent-gravity-normal) 1.0) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + gp-0 + (meters 2) + (new 'static 'rgba :b #xff :a #x80) + ) + ) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (-> self control local-normal) + (meters 2) + (the-as rgba (new 'static 'rgba :r #xff :a #x80)) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (-> self control standard-dynamics gravity-normal) + (meters 2.5) + (the-as rgba (new 'static 'rgba :r #xff :a #x80)) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (-> self control dynam gravity-normal) + (meters 3) + (the-as rgba (new 'static 'rgba :r #xff :b #xff :a #x80)) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (-> self control bent-gravity-normal) + (meters 3) + (the-as rgba (new 'static 'rgba :r #xff :b #xff :a #x80)) + ) + (add-debug-vector + *display-target-marks* + (bucket-id debug-no-zbuf1) + (-> self control trans) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + (meters 3) + (the-as rgba (new 'static 'rgba :r #xff :a #x80)) + ) + ) + +;; definition for function target-compute-edge +;; INFO: Used lq/sq +(defbehavior target-compute-edge target () + (let ((s5-0 *edge-grab-info*)) + (cond + ((-> s5-0 pilot-edge-grab?) + (set! (-> self control ground-pat) (new 'static 'pat-surface :material (pat-material metal))) + (cond + ((send-event (handle->process (-> s5-0 pilot-edge-grab handle)) 'pilot-edge-grab s5-0) + (let ((a0-7 (handle->process (-> s5-0 pilot-edge-grab handle)))) + (set! (-> s5-0 center-hold-old quad) (-> s5-0 center-hold quad)) + (let ((gp-0 (new 'stack-no-clear 'bone))) + (let* ((v1-13 (-> gp-0 transform)) + (a3-0 (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) + (a0-12 (-> a3-0 rvec quad)) + (a1-4 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-13 rvec quad) a0-12) + (set! (-> v1-13 uvec quad) a1-4) + (set! (-> v1-13 fvec quad) a2-1) + (set! (-> v1-13 trans quad) a3-1) + ) + (vector-matrix*! (-> gp-0 scale) (the-as vector (-> s5-0 pilot-edge-grab)) (-> gp-0 transform)) + (vector-rotate*! (the-as vector (&+ gp-0 80)) (-> s5-0 pilot-edge-grab local-dir) (-> gp-0 transform)) + (set! (-> s5-0 center-hold quad) (-> gp-0 scale quad)) + (set! (-> self control edge-grab-edge-dir quad) (-> (&+ gp-0 80) transform rvec quad)) + ) + ) + ) + (else + (send-event self 'end-mode 'edge-grab) + ) + ) + ) + (else + (if (not (edge-grab-info-method-9 s5-0)) + (send-event self 'end-mode 'edge-grab) + ) + (if *display-edge-collision-marks* + ((method-of-type edge-grab-info edge-grab-info-method-10)) + ) + (set! (-> self control ground-pat) (-> s5-0 edge-tri-pat)) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (the-as vector (-> s5-0 world-vertex)) + (-> s5-0 world-vertex 1) + ) + 1.0 + ) + ) + ) + (let ((gp-2 (vector-cross! + (-> self control edge-grab-across-edge-dir) + (-> self control edge-grab-edge-dir) + (-> self control dynam gravity-normal) + ) + ) + ) + (let ((s4-1 (vector-! (new-stack-vector0) (-> s5-0 center-hold) (-> self control midpoint-of-hands)))) + (set! (-> self control hand-to-edge-dist) (vector-length s4-1)) + (cond + ((and (< 1228.8 (-> self control hand-to-edge-dist)) + (time-elapsed? (-> self control last-successful-compute-edge-time) (seconds 0.2)) + ) + (cond + ((-> s5-0 pilot-edge-grab?) + (case (-> s5-0 pilot-edge-grab?) + (('target-jump) + (seek! (-> s5-0 pilot-grab-interp) 1.0 (* 2.0 (seconds-per-frame))) + ) + (else + (seek! (-> s5-0 pilot-grab-interp) 1.0 (* 1.5 (seconds-per-frame))) + ) + ) + (let* ((f0-11 (fmin 1.0 (* 1.5 (-> s5-0 pilot-grab-interp)))) + (s3-1 (vector-lerp! + (new 'stack-no-clear 'vector) + (-> s5-0 pilot-start-grab-pos) + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 center-hold) (-> self control ctrl-to-hands-offset)) + (smooth-step f0-11) + ) + ) + ) + (set! (-> s3-1 y) (+ (lerp + (-> s5-0 pilot-start-grab-pos y) + (- (-> s5-0 center-hold y) (-> self control ctrl-to-hands-offset y)) + (smooth-step (-> s5-0 pilot-grab-interp)) + ) + (cond + ((= (-> s5-0 pilot-edge-grab?) 'target-jump) + (let ((f1-6 (-> s5-0 pilot-grab-interp))) + (* 8192.0 (- 1.0 f1-6) f1-6) + ) + ) + ((>= (-> s5-0 pilot-grab-interp) 0.5) + (let ((f1-10 (* 2.0 (+ -0.5 (-> s5-0 pilot-grab-interp))))) + (* 8192.0 (- 1.0 f1-10) f1-10) + ) + ) + (else + (let ((f1-13 (* 2.0 (-> s5-0 pilot-grab-interp)))) + (* 32768.0 (- 1.0 f1-13) f1-13) + ) + ) + ) + ) + ) + (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) + (set-time! (-> self control rider-time)) + (vector+! s3-1 s3-1 (-> self control cspace-offset)) + (move-to-point! (-> self control) s3-1) + ) + (set! (-> self control hand-to-edge-dist) 0.0) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + ) + (else + (vector-normalize! s4-1 1638.4) + (let ((a1-20 (vector+! (new 'stack-no-clear 'vector) s4-1 (-> self control cspace-offset)))) + (move-by-vector! (-> self control) a1-20) + ) + (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) + (set-time! (-> self control rider-time)) + (if (and (time-elapsed? (-> self control edge-grab-start-time) (seconds 0.5)) + (time-elapsed? (-> self control last-successful-compute-edge-time) (seconds 0.5)) + ) + (send-event self 'end-mode 'edge-grab) + ) + ) + ) + ) + (else + (let ((a1-23 (new 'stack-no-clear 'vector))) + (vector-! a1-23 (-> s5-0 center-hold) (-> self control ctrl-to-hands-offset)) + (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) + (set-time! (-> self control rider-time)) + (vector+! a1-23 a1-23 (-> self control cspace-offset)) + (move-to-point! (-> self control) a1-23) + ) + (set! (-> self control hand-to-edge-dist) 0.0) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (set-time! (-> self control last-successful-compute-edge-time)) + ) + ) + ) + (forward-up-nopitch->quaternion (-> self control dir-targ) gp-2 (-> self control dynam gravity-normal)) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + (none) + ) + +;; definition for function target-compute-edge-rider +;; INFO: Used lq/sq +(defbehavior target-compute-edge-rider target () + (let ((gp-0 *edge-grab-info*)) + (cond + ((-> gp-0 pilot-edge-grab?) + (set! (-> self control ground-pat) (new 'static 'pat-surface :material (pat-material metal))) + (cond + ((send-event (handle->process (-> gp-0 pilot-edge-grab handle)) 'pilot-edge-grab gp-0) + (let ((a0-7 (handle->process (-> gp-0 pilot-edge-grab handle)))) + (set! (-> gp-0 center-hold-old quad) (-> gp-0 center-hold quad)) + (let ((s5-0 (new 'stack-no-clear 'bone))) + (let* ((v1-13 (-> s5-0 transform)) + (a3-0 (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) + (a0-12 (-> a3-0 rvec quad)) + (a1-4 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-13 rvec quad) a0-12) + (set! (-> v1-13 uvec quad) a1-4) + (set! (-> v1-13 fvec quad) a2-1) + (set! (-> v1-13 trans quad) a3-1) + ) + (vector-matrix*! (-> s5-0 scale) (the-as vector (-> gp-0 pilot-edge-grab)) (-> s5-0 transform)) + (vector-rotate*! (the-as vector (&+ s5-0 80)) (-> gp-0 pilot-edge-grab local-dir) (-> s5-0 transform)) + (set! (-> gp-0 center-hold quad) (-> s5-0 scale quad)) + (set! (-> self control edge-grab-edge-dir quad) (-> (&+ s5-0 80) transform rvec quad)) + ) + ) + ) + (else + (send-event self 'end-mode 'edge-grab) + ) + ) + ) + (else + (if (not (edge-grab-info-method-9 gp-0)) + (send-event self 'end-mode 'edge-grab) + ) + (if *display-edge-collision-marks* + ((method-of-type edge-grab-info edge-grab-info-method-10)) + ) + (vector-normalize! + (vector-! + (-> self control edge-grab-edge-dir) + (the-as vector (-> gp-0 world-vertex)) + (-> gp-0 world-vertex 1) + ) + 1.0 + ) + ) + ) + (vector-cross! + (-> self control edge-grab-across-edge-dir) + (-> self control edge-grab-edge-dir) + (-> self control dynam gravity-normal) + ) + (let ((a1-15 (vector-! (new-stack-vector0) (-> gp-0 center-hold) (-> gp-0 center-hold-old)))) + (vector-float*! (-> self control rider-last-move) a1-15 (-> self clock frames-per-second)) + (set-time! (-> self control rider-time)) + (move-by-vector! (-> self control) a1-15) + ) + ) + (set! (-> self control hand-to-edge-dist) 0.0) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + (none) + ) + +;; definition for function target-compute-pole +;; INFO: Used lq/sq +(defbehavior target-compute-pole target () + (let* ((s2-0 (the-as swingpole (handle->process (-> self control anim-handle)))) + (gp-0 (-> s2-0 dir)) + ) + (set! (-> self control edge-grab-edge-dir quad) (-> gp-0 quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let* ((s1-0 (get-trans s2-0)) + (s4-1 (vector+float*! (new 'stack-no-clear 'vector) s1-0 gp-0 (the-as float (-> s2-0 edge-length)))) + (s3-1 (vector+float*! (new 'stack-no-clear 'vector) s1-0 gp-0 (- (-> s2-0 edge-length)))) + ) + (let ((v1-9 (new 'stack-no-clear 'vector))) + (vector+! v1-9 s4-1 s3-1) + (vector-float*! v1-9 v1-9 0.5) + (+! (-> v1-9 y) -6144.0) + (send-event *camera* 'ease-in 0.5 v1-9) + ) + (vector-segment-distance-point! (-> self control midpoint-of-hands) s4-1 s3-1 s5-0) + (if (not (time-elapsed? (-> self state-time) (seconds 0.05))) + (set! (-> self control hand-to-edge-dist) + (fmax 0.0 (fmin 1.0 (/ (vector-vector-distance s4-1 s5-0) (* 2.0 (-> s2-0 edge-length))))) + ) + (vector-lerp! s5-0 s4-1 s3-1 (-> self control hand-to-edge-dist)) + ) + (when *display-edge-collision-marks* + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + s1-0 + (-> s2-0 dir) + (meters 3) + (the-as rgba (new 'static 'rgba :r #xff :b #xff :a #x80)) + ) + (add-debug-sphere + #t + (bucket-id bucket583) + (-> self control midpoint-of-hands) + (meters 0.2) + (the-as rgba (new 'static 'rgba :r #xff :a #x80)) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + s4-1 + (meters 0.2) + (the-as rgba (new 'static 'rgba :g #xff :a #x80)) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + s3-1 + (meters 0.2) + (the-as rgba (new 'static 'rgba :g #xff :b #x40 :a #x80)) + ) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) s5-0 (meters 0.2) (new 'static 'rgba :b #xff :a #x80)) + ) + ) + (let ((a0-27 (vector-! (new-stack-vector0) s5-0 (-> self control midpoint-of-hands)))) + (cond + ((and (< 2457.6 (vector-length a0-27)) (not (-> self control did-move-to-pole-or-max-jump-height))) + (move-by-vector! (-> self control) (vector-normalize! a0-27 2457.6)) + ) + (else + (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float #t)) + (move-to-point! + (-> self control) + (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self control ctrl-to-hands-offset)) + ) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + ) + ) + ) + ) + (let ((s5-3 (vector-cross! (-> self control edge-grab-across-edge-dir) gp-0 (-> self control dynam gravity-normal))) + ) + (if (>= 0.0 + (vector-dot s5-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control))) + ) + (vector-negate! s5-3 s5-3) + ) + (forward-up-nopitch->quaternion (-> self control dir-targ) s5-3 (-> self control dynam gravity-normal)) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + (update-transforms (-> self control)) + (none) + ) + +;; definition for function target-calc-camera-pos +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-calc-camera-pos target () + (let ((s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((and (and (-> self next-state) (= (-> self next-state name) 'target-clone-anim)) + (and (not (logtest? (-> self draw status) (draw-control-status no-draw))) + (begin + (vector<-cspace! s5-0 (joint-node jakb-lod0-jg main)) + (+! (-> s5-0 y) -5896.192) + (< (fabs (- (-> s5-0 y) (-> self control trans y))) 8192.0) + ) + ) + ) + (set! (-> self control camera-pos quad) (-> s5-0 quad)) + ) + ((logtest? (target-flags tf26) (-> self target-flags)) + (vector+! (-> self control camera-pos) (-> self control trans) (new 'static 'vector :y -8192.0 :w 1.0)) + ) + ((focus-test? self board pilot mech indax) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + ) + ((or (logtest? (-> self control status) (collide-status on-water)) + (let ((v1-28 (-> self water flags))) + (and (logtest? (water-flag touch-water) v1-28) + (logtest? (water-flag under-water swimming) v1-28) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + ) + ) + (vector<-cspace! s5-0 (the-as cspace (-> self node-list data))) + (if (not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (set! (-> s5-0 y) (- (-> self water surface-height) (-> self water swim-height))) + ) + (vector<-cspace! gp-0 (joint-node jakb-lod0-jg chest)) + (cond + ((>= (+ (current-time) (seconds -2)) (-> self control unknown-time-frame26)) + (set! (-> self control camera-pos quad) (-> s5-0 quad)) + ) + ((not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (vector-lerp! + (-> self control camera-pos) + gp-0 + s5-0 + (* 0.0016666667 (the float (- (current-time) (-> self control unknown-time-frame26)))) + ) + ) + (else + (vector-lerp! + (-> self control camera-pos) + s5-0 + gp-0 + (fmax 0.0 (fmin 1.0 (* 0.0011111111 (the float (- (current-time) (-> self control unknown-time-frame27)))))) + ) + ) + ) + (-> self control camera-pos) + ) + ((and (or (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self control status) (collide-status on-water)) + ) + (logtest? (-> self water flags) (water-flag mud)) + ) + (vector<-cspace! (-> self control camera-pos) (the-as cspace (-> self node-list data))) + (set! (-> self control camera-pos y) (-> self water base-height)) + ) + ((focus-test? self tube) + (set! (-> self control camera-pos quad) (-> self control gspot-pos quad)) + ) + ((logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp)) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + ) + (else + (vector<-cspace! (-> self control camera-pos) (the-as cspace (-> self node-list data))) + ) + ) + ) + 0 + (none) + ) + +;; definition for function joint-points +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior joint-points target () + (let ((f0-1 (* 0.00078125 (the float (-> self neck look-at-count))))) + (if (!= f0-1 0.0) + (set! f0-1 (+ 0.12 f0-1)) + ) + (cond + ((>= f0-1 (-> self excitement)) + (seek! (-> self excitement) f0-1 (* 6.0 (seconds-per-frame))) + ) + ((focus-test? self dead ignore hit) + ) + (else + (seek! (-> self excitement) f0-1 (* 0.25 (seconds-per-frame))) + ) + ) + ) + (set-setting! 'sound-excitement 'add (-> self excitement) 0) + (let ((v1-17 (-> self neck))) + (set! (-> v1-17 blend) 0.0) + ) + (set! (-> self neck look-at-count) (the-as uint 0)) + (if (and (logtest? (-> self control current-surface flags) (surface-flag duck)) + (< 0.5 (-> self control duck-gun-tube-transision)) + (not (using-gun? self)) + ) + (set! (-> self neck base-nose) (the-as uint 1)) + (set! (-> self neck base-nose) (the-as uint 2)) + ) + (let ((v1-29 (-> self upper-body))) + (set! (-> v1-29 blend) 0.0) + ) + (cond + ((focus-test? self tube pilot indax) + ) + ((logtest? (water-flag wading) (-> self water flags)) + (let ((f30-0 (- (- (-> self control trans y) (- (-> self water height) (-> self water wade-height)))))) + (set! (-> *wade-surface* alignv) + (lerp-scale 1.0 0.5 f30-0 0.0 (- (-> self water swim-height) (-> self water wade-height))) + ) + (set! (-> *wade-surface* align-speed) (-> *wade-surface* alignv)) + (let ((f0-20 (lerp-scale 0.8 0.6 f30-0 0.0 (- (-> self water swim-height) (-> self water wade-height))))) + (set! (-> *wade-surface* target-speed) f0-20) + (set! (-> *wade-surface* transv-max) f0-20) + ) + ) + (set! (-> self control surf) *wade-surface*) + ) + ((logtest? (water-flag swimming) (-> self water flags)) + (set! (-> self control surf) *swim-surface*) + ) + ((and (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self water flags) (water-flag mud)) + ) + (set! (-> self control surf) *quicksand-surface*) + ) + ) + (let ((a2-5 + (matrix<-no-trans-transformq! (-> self control ctrl-orientation) (the-as transformq (-> self control trans))) + ) + ) + (vector-matrix*! (-> self control ctrl-to-head-offset) (-> *TARGET-bank* head-offset) a2-5) + ) + (vector<-cspace! + (the-as vector (&-> (-> self control) sidekick-root bone)) + (-> self control sidekick-root parent) + ) + (let ((gp-0 (new-stack-vector0)) + (s5-0 (new-stack-vector0)) + ) + (vector<-cspace! gp-0 (-> self control lhand-cspace)) + (vector<-cspace! s5-0 (-> self control rhand-cspace)) + (vector-average! (-> self control midpoint-of-hands) gp-0 s5-0) + ) + (vector-! (-> self control ctrl-to-hands-offset) (-> self control midpoint-of-hands) (-> self control trans)) + (-> self control impact-ctrl) + ((method-of-type impact-control impact-control-method-10)) + (cond + ((focus-test? self edge-grab) + (target-compute-edge) + ) + ((focus-test? self pole) + (target-compute-pole) + ) + ) + (target-calc-camera-pos) + (set! (-> self control tongue-counter) 0) + (cond + ((focus-test? self indax) + ) + (else + (target-gun-joint-points) + (target-board-joint-points) + ) + ) + 0 + (none) + ) + +;; definition for function do-target-gspot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior do-target-gspot target () + (cond + ((and (logtest? (-> self control status) (collide-status on-surface)) + (!= (-> self control mod-surface mode) 'swim) + (!= (-> self control mod-surface mode) 'dive) + (not (and (-> self next-state) (= (-> self next-state name) 'target-flop))) + (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds))) + ) + (set! (-> self control gspot-pos quad) (-> self control trans quad)) + (set! (-> self control gspot-normal quad) (-> self control ground-poly-normal quad)) + (set! (-> self control gspot-pat-surfce) (-> self control ground-pat)) + ) + (else + (let* ((gp-0 (new 'stack-no-clear 'collide-query)) + (a0-15 (-> self control)) + (t9-0 (method-of-object a0-15 find-ground)) + (a1-0 gp-0) + (a2-1 (if (focus-test? self pilot) + #x64383f7d + (the-as int (logclear (-> self control root-prim prim-core collide-with) (collide-spec water))) + ) + ) + (a3-0 8192.0) + (t0-0 81920.0) + (t1-0 1024.0) + ) + (cond + ((nonzero? (-> self pilot)) + (handle->process (-> self pilot vehicle)) + ) + (else + ) + ) + (if (t9-0 a0-15 a1-0 (the-as collide-spec a2-1) a3-0 t0-0 t1-0) + (set! (-> self control gspot-pat-surfce) (-> gp-0 best-other-tri pat)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-real-post +;; INFO: Used lq/sq +(defbehavior target-real-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (if (< (-> self control force-turn-to-strength) 0.0) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> self control cpad stick0-speed))) + ) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (let ((f28-0 (debounce-speed + (-> self control pad-magnitude) + (-> self control last-pad-magnitude) + (-> self control pad-xz-dir) + (-> self control last-pad-xz-dir) + ) + ) + ) + (when (!= (-> self control force-turn-to-strength) 0.0) + (let ((f0-12 (fmin 1.0 (-> self control force-turn-to-strength)))) + (set! (-> self control force-turn-to-strength) f0-12) + (let ((a1-3 (vector-float*! + (new 'stack-no-clear 'vector) + (if (= f28-0 0.0) + *zero-vector* + s5-0 + ) + f28-0 + ) + ) + (a2-2 (vector-float*! + (new 'stack-no-clear 'vector) + (-> self control force-turn-to-direction) + (-> self control force-turn-to-speed) + ) + ) + ) + (vector-lerp! s5-0 a1-3 a2-2 f0-12) + ) + ) + (set! f28-0 (vector-length s5-0)) + (vector-normalize! s5-0 1.0) + ) + (turn-to-vector s5-0 f28-0) + ) + ) + (add-thrust) + (add-gravity) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (set! (-> self control reaction) target-collision-reaction) + (let ((a2-3 (new 'stack-no-clear 'collide-query))) + (let ((v1-32 (-> self control))) + (set! (-> a2-3 collide-with) (-> v1-32 root-prim prim-core collide-with)) + (set! (-> a2-3 ignore-process0) self) + (set! (-> a2-3 ignore-process1) #f) + (set! (-> a2-3 ignore-pat) (-> v1-32 pat-ignore-mask)) + ) + (set! (-> a2-3 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide (-> self control) (-> self control transv) a2-3 (meters 1)) + ) + (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (>= (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + (-> *TARGET-bank* edge-grab-height-off-ground) + ) + ) + (target-method-28 *target* *collide-cache* *collide-edge-spec*) + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +;; definition for function target-post +(defbehavior target-post target () + (target-real-post) + (none) + ) + +;; definition for function target-swim-post +;; INFO: Used lq/sq +(defbehavior target-swim-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (turn-to-vector s5-0 (-> self control pad-magnitude)) + ) + (add-thrust) + (add-gravity) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (let ((a2-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-10 (-> self control))) + (set! (-> a2-0 collide-with) (-> v1-10 root-prim prim-core collide-with)) + (set! (-> a2-0 ignore-process0) self) + (set! (-> a2-0 ignore-process1) #f) + (set! (-> a2-0 ignore-pat) (-> v1-10 pat-ignore-mask)) + ) + (set! (-> a2-0 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide (-> self control) (-> self control transv) a2-0 (meters 1)) + ) + (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (>= (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + (-> *TARGET-bank* edge-grab-height-off-ground) + ) + ) + (target-method-28 *target* *collide-cache* *collide-edge-spec*) + ) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +;; definition for function target-no-stick-post +;; INFO: Used lq/sq +(defbehavior target-no-stick-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (turn-to-vector s5-0 0.0) + ) + (add-thrust) + (add-gravity) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (let ((a2-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-9 (-> self control))) + (set! (-> a2-0 collide-with) (-> v1-9 root-prim prim-core collide-with)) + (set! (-> a2-0 ignore-process0) self) + (set! (-> a2-0 ignore-process1) #f) + (set! (-> a2-0 ignore-pat) (-> v1-9 pat-ignore-mask)) + ) + (set! (-> a2-0 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide (-> self control) (-> self control transv) a2-0 (meters 1)) + ) + (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (>= (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + (-> *TARGET-bank* edge-grab-height-off-ground) + ) + ) + (target-method-28 *target* *collide-cache* *collide-edge-spec*) + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +;; definition for function target-no-move-post +;; INFO: Used lq/sq +(defbehavior target-no-move-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (build-conversions (-> self control transv)) + (do-rotations1) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (vector-! + (-> self control cspace-offset) + (-> self control draw-offset) + (-> self control anim-collide-offset-world) + ) + (let ((a1-3 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-3 options) (overlaps-others-options oo0)) + (set! (-> a1-3 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-3 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-3) + ) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (when *debug-segment* + (let ((gp-2 (-> self control))) + (+! (-> gp-2 history-idx) 1) + (let ((v1-25 (clear-record-tags! *history* (history-channel transv) (-> gp-2 history-idx) (the-as uint 2)))) + (set! (-> v1-25 origin quad) (-> gp-2 trans quad)) + (set! (-> v1-25 vector quad) (-> gp-2 transv quad)) + ) + (set! (-> (clear-record-tags! *history* (history-channel trans) (-> gp-2 history-idx) (the-as uint 2)) vector quad) + (-> gp-2 trans quad) + ) + (let ((v1-31 (clear-record-tags! *history* (history-channel collide-status) (-> gp-2 history-idx) (the-as uint 2))) + ) + (set! (-> v1-31 collide-status) (logior (-> gp-2 status) (collide-status no-touch))) + (set! (-> v1-31 vector z) (the-as float (-> gp-2 reaction-flag))) + ) + ) + ) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +;; definition for function target-no-ja-move-post +(defbehavior target-no-ja-move-post target () + (vector-! + (-> self control cspace-offset) + (-> self control draw-offset) + (-> self control anim-collide-offset-world) + ) + (let ((a1-2 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-2 options) (overlaps-others-options oo0)) + (set! (-> a1-2 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-2 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-2) + ) + (target-calc-camera-pos) + (do-target-gspot) + (target-powerup-process) + (target-board-joint-points) + (none) + ) + +;; definition for function reset-target-state +;; INFO: Used lq/sq +(defbehavior reset-target-state target ((arg0 symbol)) + (when arg0 + (vector-identity! (-> self control scale)) + (quaternion-identity! (-> self control quat)) + (quaternion-identity! (-> self control quat-for-control)) + (quaternion-identity! (-> self control dir-targ)) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + ) + (target-exit) + (target-timed-invulnerable-off self 0) + (target-timed-invulnerable-off self 2) + (set! (-> self control status) (collide-status)) + (set! (-> self control standard-dynamics) *standard-dynamics*) + (set! (-> self control surf) *standard-ground-surface*) + (set! (-> self control bent-gravity-normal quad) (-> self control standard-dynamics gravity-normal quad)) + (quaternion-identity! (-> self control override-quat)) + (set! (-> self control override-quat-alpha) 0.0) + (set-time! (-> self control last-time-on-surface)) + (set! (-> self control bend-amount) 0.0) + (set! (-> self control bend-speed) 32.0) + (set! (-> self cam-user-mode) 'normal) + (set! (-> self control anim-handle) (the-as handle #f)) + (set! (-> self control actor-contact-handle) (the-as handle #f)) + (set! (-> self control yellow-eco-last-use-time) 0) + (buzz-stop! 0) + self + ) + +;; definition for method 29 of type target +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; INFO: Process stack size was changed from 1024 to 2048 +(defmethod target-init! ((this target) (arg0 continue-point) (arg1 symbol)) + (local-vars (s1-0 int) (s2-0 int) (s3-0 int) (s4-0 int) (sv-16 collide-shape-prim-group)) + (set! (-> *setting-control* user-default kg-primary-target) (process->handle this)) + (set! (-> *setting-control* user-default ff-primary-target) (process->handle this)) + (set! (-> *setting-control* user-default mh-primary-target) (process->handle this)) + (set! (-> *setting-control* user-default sound-ear) (process->handle this)) + (set! (-> this tobot?) arg1) + (set! (-> this tobot-recorder) #f) + (set! (-> this mode-cache) #f) + (set! (-> this color-effect) #f) + (set! (-> this major-mode-exit-hook) #f) + (set! (-> this major-mode-event-hook) #f) + (set! (-> this sub-mode-exit-hook) #f) + (set! (-> this cloth) #t) + (set! (-> this game) *game-info*) + (set! (-> this ext-geo-control) *target-geo-control*) + (set! (-> this pending-ext-geo) + (if (and (logtest? (game-feature feature56) (-> this game features)) + (not (logtest? (game-secrets commentary) (-> *game-info* secrets))) + ) + (target-geo jakc) + (target-geo jakb) + ) + ) + (set! (-> this ext-geo) (target-geo uninitialized)) + (set! (-> this ext-anim-control) *target-anim-control*) + (set! (-> this pending-ext-anim) (target-anim default)) + (set! (-> this ext-anim) (target-anim uninitialized)) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set! (-> *setting-control* cam-default mode-name) 'cam-string) + (apply-settings *setting-control*) + (if (not arg0) + (set! arg0 (get-current-continue-forced *game-info*)) + ) + (set-continue! *game-info* arg0 #f) + (stack-size-set! (-> this main-thread) 2048) + (logior! (-> this mask) (process-mask target)) + (set! (-> this state-hook) (the-as (function none :behavior target) nothing)) + (set! (-> this scarf-interp-old) -1.0) + (set! (-> this goggles-interp-old) -1.0) + (set! (-> this darkjak-interp-old) -1.0) + (cond + ((= (-> this tobot?) 'tobot) + (set! s4-0 #x80000) + (set! s3-0 #x64303f7f) + (set! s2-0 #x80000) + (set! s1-0 #x6430377e) + ) + (else + (set! s4-0 2) + (set! s3-0 #x64383f7d) + (set! s2-0 2) + (set! s1-0 #x6438377c) + ) + ) + (let ((s0-0 (new 'process 'control-info this (collide-list-enum hit-by-others)))) + (set! (-> s0-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s0-0 reaction) target-collision-reaction) + (set! (-> s0-0 no-reaction) target-collision-no-reaction) + (set! sv-16 (new 'process 'collide-shape-prim-group s0-0 (the-as uint 9) 1)) + (set! (-> s0-0 total-prims) (the-as uint 10)) + (set! (-> sv-16 prim-core action) (collide-action solid can-ride)) + (set-vector! (-> sv-16 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 root-prim) sv-16) + (set! (-> sv-16 prim-core collide-as) (the-as collide-spec s4-0)) + (set! (-> sv-16 prim-core collide-with) (the-as collide-spec s3-0)) + (let ((v0-9 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 6)))) + (set! (-> v0-9 prim-core action) (collide-action solid can-ride)) + (set-vector! (-> v0-9 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 0) v0-9) + (set! (-> v0-9 prim-core collide-as) (the-as collide-spec s4-0)) + (set! (-> v0-9 prim-core collide-with) (the-as collide-spec s3-0)) + ) + (let ((v0-10 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 10)))) + (set! (-> v0-10 prim-core action) (collide-action solid)) + (set-vector! (-> v0-10 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 1) v0-10) + (set! (-> v0-10 prim-core collide-as) (the-as collide-spec s4-0)) + (set! (-> v0-10 prim-core collide-with) (the-as collide-spec s3-0)) + ) + (let ((v0-11 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 18)))) + (set! (-> v0-11 prim-core action) (collide-action solid)) + (set-vector! (-> v0-11 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 2) v0-11) + (set! (-> v0-11 prim-core collide-as) (the-as collide-spec s4-0)) + (set! (-> v0-11 prim-core collide-with) (the-as collide-spec s3-0)) + ) + (let ((v0-12 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 34)))) + (set! (-> v0-12 prim-core action) (collide-action solid)) + (set-vector! (-> v0-12 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 3) v0-12) + (set! (-> v0-12 prim-core collide-as) (collide-spec)) + (set! (-> v0-12 prim-core collide-with) (collide-spec)) + ) + (let ((v0-13 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 0)))) + (set! (-> v0-13 prim-core action) (collide-action semi-solid)) + (set! (-> v0-13 transform-index) 6) + (set-vector! (-> v0-13 local-sphere) 0.0 0.0 0.0 2048.0) + (set! (-> s0-0 collision-spheres 4) v0-13) + (set! (-> v0-13 prim-core collide-as) (the-as collide-spec s4-0)) + (set! (-> v0-13 prim-core collide-with) (the-as collide-spec s3-0)) + ) + (let ((v0-14 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 128)))) + (set! (-> v0-14 prim-core action) (collide-action deadly)) + (set-vector! (-> v0-14 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 6) v0-14) + ) + (let ((v0-15 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 256)))) + (set! (-> v0-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v0-15 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 7) v0-15) + ) + (let ((v0-16 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 512)))) + (set! (-> v0-16 prim-core action) (collide-action deadly)) + (set-vector! (-> v0-16 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 8) v0-16) + ) + (let ((v0-17 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 1024)))) + (set! (-> v0-17 prim-core action) (collide-action deadly)) + (set-vector! (-> v0-17 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s0-0 collision-spheres 9) v0-17) + ) + (set! (-> s0-0 nav-radius) (* 0.75 (-> s0-0 root-prim local-sphere w))) + (let ((v1-93 (-> s0-0 root-prim))) + (set! (-> s0-0 backup-collide-as) (-> v1-93 prim-core collide-as)) + (set! (-> s0-0 backup-collide-with) (-> v1-93 prim-core collide-with)) + ) + (set! (-> s0-0 event-priority) (the-as uint 9)) + (set! (-> this control) s0-0) + ) + (let ((v1-96 (-> this control))) + (set! (-> v1-96 default-collide-as-all) (the-as collide-spec s4-0)) + (set! (-> v1-96 default-collide-with-all) (the-as collide-spec s3-0)) + (set! (-> v1-96 default-collide-as-fgnd) (the-as collide-spec s2-0)) + (set! (-> v1-96 default-collide-with-fgnd) (the-as collide-spec s1-0)) + (set! (-> v1-96 max-iteration-count) (the-as uint 8)) + (set! (-> v1-96 event-self) 'touched) + ) + (move-to-point! (-> this control) (-> arg0 trans)) + (set! (-> this control camera-pos quad) (-> arg0 trans quad)) + (set! (-> this focus-search) (new 'process 'boxed-array collide-shape 128)) + (set! (-> this focus-search length) 0) + (set! (-> this handle-search) (new 'process 'boxed-array handle 128)) + (set! (-> this handle-search length) 0) + (set! (-> this control cpad) (-> *cpad-list* cpads 0)) + (set! (-> this control current-surface) (new 'process 'surface)) + (set! (-> this control current-surface name) 'current) + (set! (-> this control current-surface active-hook) nothing) + (set! (-> this control current-surface touch-hook) nothing) + (set! (-> this control send-attack-dest) (the-as handle #f)) + (dotimes (v1-112 8) + (set! (-> this attack-info-old v1-112 attacker) (the-as handle #f)) + ) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this mirror) (the-as (pointer process-drawable) #f)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this skel effect flags) (effect-control-flag ecf0 ecf1)) + (let ((v1-122 (-> this node-list data))) + (set! (-> v1-122 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-122 0 param1) (the-as basic (-> this control trans))) + (set! (-> v1-122 0 param2) (the-as basic (-> this control cspace-offset))) + ) + (set! (-> this skel override) (new 'process 'boxed-array float 54)) + (set! (-> this draw light-index) (the-as uint 30)) + (set! (-> this beard?) #t) + (set! (-> this draw lod-set max-lod) 0) + (logior! (-> this skel status) (joint-control-status sync-math blend-shape eye-anim)) + (set! (-> this draw shadow-ctrl) *target-shadow-control*) + (set! (-> this shadow-backup) (-> this draw shadow)) + (set! (-> this carry) + (new 'process 'carry-info this 52 (new 'static 'vector :w 1.0) (new 'static 'vector :z 1.0 :w 1.0) 12743.111) + ) + (set! (-> this control lhand-cspace) (-> this node-list data 21)) + (set! (-> this control rhand-cspace) (-> this node-list data 30)) + (set! (-> this control rhand-cspace) (-> this node-list data 30)) + (set! (-> this control sidekick-root parent) (-> this node-list data 34)) + (set! (-> this neck) (new 'process 'joint-mod (joint-mod-mode look-at) this 8)) + (set! (-> this neck parented-scale?) #t) + (set! (-> this neck base-joint) (the-as uint 6)) + (set! (-> this neck ignore-angle) 16384.0) + (set! (-> this head) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 7)) + (set! (-> this head parented-scale?) #t) + (set! (-> this upper-body) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 4)) + (set! (-> this upper-body parented-scale?) #t) + (set! (-> this horns) (new 'process 'joint-mod (joint-mod-mode joint-set) this 15)) + (set! (-> this horns parented-scale?) #t) + (set! (-> this horns track-mode) (track-mode no-trans no-rotate)) + (set! (-> this hair 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 9)) + (set! (-> this hair 0 parented-scale?) #t) + (set! (-> this hair 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 10)) + (set! (-> this hair 1 parented-scale?) #t) + (set! (-> this arm-ik 0) (new 'process 'joint-mod-ik this 18 1228.8)) + (set! (-> this arm-ik 1) (new 'process 'joint-mod-ik this 27 -1228.8)) + (set! (-> this arm-ik 1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this arm-ik 1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this leg-ik 0) (new 'process 'joint-mod-ik this 40 1687.552)) + (set! (-> this leg-ik 0 callback) + (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback) + ) + (set! (-> this leg-ik 0 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this leg-ik 0 elbow-rotation-axis) (the-as uint 0)) + (logior! (-> this leg-ik 0 flags) (joint-mod-ik-flags elbow-trans-neg)) + (set! (-> this leg-ik 1) (new 'process 'joint-mod-ik this 46 -1687.552)) + (set! (-> this leg-ik 1 callback) + (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback) + ) + (set! (-> this leg-ik 1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this leg-ik 1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this foot 0) (new 'process 'joint-mod (joint-mod-mode gun-look-at) this 41)) + (set! (-> this foot 1) (new 'process 'joint-mod (joint-mod-mode gun-look-at) this 47)) + (set! (-> this fact) (new + 'process + 'fact-info-target + this + (pickup-type eco-pill-random) + (-> *FACT-bank* default-eco-pill-green-inc) + ) + ) + (target-gun-setup (logtest? (-> this game features) (game-feature gun))) + (target-board-setup (logtest? (game-feature board) (-> this game features))) + (target-sidekick-setup (logtest? (game-feature sidekick) (-> this game features))) + (target-darkjak-setup (logtest? (game-feature darkjak) (-> this game features))) + (target-lightjak-setup (logtest? (game-feature lightjak) (-> this game features))) + (target-collide-set! 'normal 0.0) + (let ((v1-192 (-> this control root-prim))) + (set! (-> this control backup-collide-as) (-> v1-192 prim-core collide-as)) + (set! (-> this control backup-collide-with) (-> v1-192 prim-core collide-with)) + ) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this control trans) 0.0)) + (set! (-> this control unknown-sound-id04) (new-sound-id)) + (set! (-> this control bubbles-sound) (new-sound-id)) + (set! (-> this control board-jump-and-swim-sound) (new-sound-id)) + (if (and *debug-segment* (!= (-> this tobot?) 'tobot)) + (add-connection *debug-engine* this target-print-stats this *stdcon0* #f) + ) + (activate-hud this) + (set! (-> this fp-hud) (the-as handle #f)) + (set! (-> this burn-proc) (the-as handle #f)) + (set! (-> this water) (new 'process 'water-control this 10 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flag swim-ground part-splash part-drip part-rings part-water find-water)) + (reset-target-state #t) + (set! (-> this control last-trans-any-surf quad) (-> this control trans quad)) + (+! (-> this control last-trans-any-surf y) -819200.0) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this manipy) (the-as (pointer manipy) #f)) + (set! (-> this event-hook) target-generic-event-handler) + (set! (-> this current-level) #f) + (level-setup) + (set! (-> this pre-joint-hook) (the-as (function none :behavior target) nothing)) + (set-time! (-> this init-time)) + (set! (-> this spool-anim) (the-as spool-anim #t)) + (set-time! (-> this ambient-time)) + (let ((v1-220 *edge-grab-info*)) + (set! (-> v1-220 pilot-edge-grab?) #f) + (set! (-> v1-220 pilot-edge-grab handle) (the-as handle #f)) + (set! (-> v1-220 actor-handle) (the-as handle #f)) + ) + (set! (-> this control unknown-handle000) (the-as handle #f)) + 0 + (none) + ) + +;; definition for function target-init +;; WARN: Return type mismatch object vs none. +(defbehavior target-init target ((arg0 continue-point)) + (target-init! self arg0 #f) + (set! (-> self event-hook) (-> target-continue event)) + (logior! (-> self focus-status) (focus-status teleporting)) + (go target-continue arg0) + (none) + ) + +;; definition for function tobot-init +;; WARN: Return type mismatch object vs none. +(defbehavior tobot-init target ((arg0 symbol)) + (target-init! self (the-as continue-point #f) 'tobot) + (set! (-> self name) "tobot") + (set! (-> self tobot-recorder) (the-as basic arg0)) + (send-event *target* 'tobot 'tobot) + (go tobot-stance) + (none) + ) + +;; definition for method 10 of type target +(defmethod deactivate ((this target)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) + (if (nonzero? (-> this darkjak)) + (sound-stop (-> this darkjak tone)) + ) + (if (nonzero? (-> this lightjak)) + (sound-stop (the-as sound-id (-> this lightjak tone))) + ) + (if (nonzero? (-> this gun)) + (sound-stop (-> this gun blue-whine-sound-id)) + ) + (when (nonzero? (-> this board)) + (sound-stop (-> this board wind-sound-id)) + (sound-stop (-> this board engine-sound-id)) + (sound-stop (-> this board bank-sound-id)) + (sound-stop (-> this board ride-sound-id)) + (sound-stop (-> this board spin-sound-id)) + ) + (set! (-> *setting-control* cam-default mode-name) #f) + (set-zero! *camera-smush-control*) + (set! (-> *setting-control* user-default kg-primary-target) (the-as handle #f)) + (set! (-> *setting-control* user-default ff-primary-target) (the-as handle #f)) + (set! (-> *setting-control* user-default mh-primary-target) (the-as handle #f)) + (set! (-> *setting-control* user-default sound-ear) (the-as handle #f)) + (call-parent-method this) + (none) + ) + +;; definition for function stop +(defun stop ((arg0 symbol)) + (when *target* + (kill-by-name "target" *active-pool*) + (set! *target* #f) + ) + (set! (-> *game-info* mode) arg0) + 0 + ) + +;; definition for function start +(defun start ((arg0 symbol) (arg1 continue-point)) + (let ((v1-0 arg0)) + (set! (-> *level* play?) (if (= v1-0 'play) + #t + (-> *setting-control* user-default border-mode) + ) + ) + ) + (set! (-> *setting-control* user-default border-mode) #f) + (set! (-> *setting-control* user-default region-mode) #f) + (apply-settings *setting-control*) + (stop arg0) + (let ((v1-8 (process-spawn + target + :init target-init + arg1 + :name "target" + :from *target-dead-pool* + :to *target-pool* + :stack *kernel-dram-stack* + ) + ) + ) + (if v1-8 + (set! *target* (the-as target (-> v1-8 0 self))) + (set! *target* #f) + ) + ) + *target* + ) + +;; definition for function tobot-start +;; WARN: Return type mismatch (pointer process) vs target. +(defun tobot-start ((arg0 symbol)) + (the-as target (process-spawn + target + :init tobot-init + arg0 + :name "target" + :from *target-dead-pool* + :to *target-pool* + :stack *kernel-dram-stack* + ) + ) + ) + +;; definition for function tobot-stop +(defun tobot-stop () + (kill-by-name "tobot" *active-pool*) + 0 + ) + +;; failed to figure out what this is: +(kmemopen global "target-geo") + +;; definition for symbol *target-geo-control*, type external-art-buffer +(define *target-geo-control* (new + 'global + 'external-art-buffer + 0 + (lambda ((arg0 external-art-buffer)) + (let ((gp-0 (-> arg0 heap))) + (set! (-> gp-0 base) (kmalloc global #x26000 (kmalloc-flags) "heap")) + (set! (-> gp-0 current) (-> gp-0 base)) + (set! (-> gp-0 top-base) (&+ (-> gp-0 base) #x26000)) + (set! (-> gp-0 top) (-> gp-0 top-base)) + ) + 0 + (none) + ) + #t + ) + ) + +;; failed to figure out what this is: +(let ((gp-0 *target-geo-control*)) + ((-> gp-0 init-heap) gp-0) + (set! (-> gp-0 status) 'inactive) + ) + +;; failed to figure out what this is: +(kmemclose) + +;; failed to figure out what this is: +(kmemopen global "target-anim") + +;; definition for symbol *target-anim-control*, type external-art-buffer +(define *target-anim-control* (new + 'global + 'external-art-buffer + 0 + (lambda ((arg0 external-art-buffer)) + (let ((gp-0 (-> arg0 heap))) + (set! (-> gp-0 base) (kmalloc global #x4d000 (kmalloc-flags) "heap")) + (set! (-> gp-0 current) (-> gp-0 base)) + (set! (-> gp-0 top-base) (&+ (-> gp-0 base) #x4d000)) + (set! (-> gp-0 top) (-> gp-0 top-base)) + ) + 0 + (none) + ) + #t + ) + ) + +;; failed to figure out what this is: +(let ((gp-1 *target-anim-control*)) + ((-> gp-1 init-heap) gp-1) + (set! (-> gp-1 status) 'inactive) + ) + +;; failed to figure out what this is: +(kmemclose) diff --git a/test/decompiler/reference/jak3/engine/target/mech/carry-h_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/carry-h_REF.gc new file mode 100644 index 00000000000..bfa54970a60 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/mech/carry-h_REF.gc @@ -0,0 +1,583 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type carry-info +(deftype carry-info (basic) + ((process (pointer target)) + (pickup-time time-frame) + (other-value float) + (other handle) + (point vector :inline) + (normal vector :inline) + (max-angle degrees) + (max-distance meters) + (max-pull meters) + (min-pull meters) + (grab-trans-blend float) + (carry-radius meters) + (backup-radius meters) + (joint int8) + (mode carry-mode) + (face-dir int8) + (local-point vector :inline) + (local-normal vector :inline) + (grab-quat quaternion :inline) + (grab-trans vector :inline) + (hold-trans vector :inline) + ) + (:methods + (new (symbol type process-drawable int vector vector float) _type_) + (carry-info-method-9 (_type_) none) + (distance-from-destination (_type_ carry-info) float) + (drag! (_type_ carry-info) none) + (drop-impl! (_type_ carry-info) none) + (carry-info-method-13 (_type_) symbol) + (carry! (_type_ carry-info vector vector) none) + (drop! (_type_ carry-info) none) + (translate! (_type_) symbol) + ) + ) + +;; definition for method 3 of type carry-info +(defmethod inspect ((this carry-info)) + (when (not this) + (set! this this) + (goto cfg-10) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tpickup-time: ~D~%" (-> this pickup-time)) + (format #t "~1Tother-value: ~f~%" (-> this other-value)) + (format #t "~1Tother: ~D~%" (-> this other)) + (format #t "~1Tpoint: ~`vector`P~%" (-> this point)) + (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~1Tmax-angle: (deg ~r)~%" (-> this max-angle)) + (format #t "~1Tmax-distance: (meters ~m)~%" (-> this max-distance)) + (format #t "~1Tmax-pull: (meters ~m)~%" (-> this max-pull)) + (format #t "~1Tmin-pull: (meters ~m)~%" (-> this min-pull)) + (format #t "~1Tgrab-trans-blend: ~f~%" (-> this grab-trans-blend)) + (format #t "~1Tcarry-radius: (meters ~m)~%" (-> this carry-radius)) + (format #t "~1Tbackup-radius: (meters ~m)~%" (-> this backup-radius)) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (format #t "~1Tmode: #x~X : (carry-mode " (-> this mode)) + (let ((s5-0 (-> this mode))) + (if (= (logand s5-0 (carry-mode mech-carry)) (carry-mode mech-carry)) + (format #t "mech-carry ") + ) + (if (= (logand s5-0 (carry-mode mech-drag)) (carry-mode mech-drag)) + (format #t "mech-drag ") + ) + (if (= (logand s5-0 (carry-mode carry)) (carry-mode carry)) + (format #t "carry ") + ) + ) + (format #t ")~%") + (format #t "~1Tface-dir: ~D~%" (-> this face-dir)) + (format #t "~1Tlocal-point: ~`vector`P~%" (-> this local-point)) + (format #t "~1Tlocal-normal: ~`vector`P~%" (-> this local-normal)) + (format #t "~1Tgrab-quat: ~`vector`P~%" (-> this grab-quat)) + (format #t "~1Tgrab-trans: ~`vector`P~%" (-> this grab-trans)) + (format #t "~1Thold-trans: ~`vector`P~%" (-> this hold-trans)) + (label cfg-10) + this + ) + +;; definition for method 0 of type carry-info +;; INFO: Used lq/sq +(defmethod new carry-info ((allocation symbol) + (type-to-make type) + (arg0 process-drawable) + (arg1 int) + (arg2 vector) + (arg3 vector) + (arg4 float) + ) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 mode) (carry-mode carry)) + (set! (-> gp-0 process) (the-as (pointer target) (process->ppointer arg0))) + (set! (-> gp-0 other) (the-as handle #f)) + (set! (-> gp-0 joint) arg1) + (set! arg4 (cond + ((= arg4 0.0) + 131072.0 + ) + (else + (empty) + arg4 + ) + ) + ) + (set! (-> gp-0 max-angle) arg4) + (set! (-> gp-0 max-distance) 8192.0) + (set! (-> gp-0 local-point quad) (-> arg2 quad)) + (set! (-> gp-0 local-normal quad) (-> arg3 quad)) + (let* ((s5-1 (-> arg0 root)) + (v1-7 (if (type? s5-1 collide-shape) + (the-as collide-shape s5-1) + ) + ) + ) + (when v1-7 + (set! (-> gp-0 backup-radius) (-> v1-7 root-prim local-sphere w)) + (set! (-> gp-0 carry-radius) (-> v1-7 root-prim local-sphere w)) + ) + ) + gp-0 + ) + ) + +;; definition for method 9 of type carry-info +;; WARN: Return type mismatch int vs none. +(defmethod carry-info-method-9 ((this carry-info)) + (let ((s5-0 (-> this process 0 node-list data (-> this joint) bone transform))) + (vector-rotate*! (-> this normal) (-> this local-normal) s5-0) + (vector-matrix*! (-> this point) (-> this local-point) s5-0) + ) + 0 + (none) + ) + +;; definition for method 10 of type carry-info +(defmethod distance-from-destination ((this carry-info) (arg0 carry-info)) + (let* ((f28-0 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> arg0 point) (-> this point)))) + (f30-0 (fabs (deg-diff f28-0 (vector-y-angle (-> this normal))))) + (f28-1 (fabs (deg-diff (+ 32768.0 f28-0) (vector-y-angle (-> arg0 normal))))) + (f26-0 (vector-vector-distance (-> this point) (-> arg0 point))) + ) + (cond + ((or (< (-> this max-distance) f26-0) + (< (-> arg0 max-distance) f26-0) + (< (-> this max-angle) f30-0) + (or (< (-> arg0 max-angle) f28-1) (not (logtest? (-> this mode) (-> arg0 mode)))) + ) + (if (< (-> this max-distance) f26-0) + (format + #t + " ~A ~A failed for this distance ~M ~M~%" + (-> this process 0 name) + (-> arg0 process 0 name) + f26-0 + (-> this max-distance) + ) + ) + (if (< (-> arg0 max-distance) f26-0) + (format + #t + " ~A ~A failed for other distance ~M ~M~%" + (-> this process 0 name) + (-> arg0 process 0 name) + f26-0 + (-> arg0 max-distance) + ) + ) + (if (< (-> this max-angle) f30-0) + (format + #t + " ~A ~A failed for this angle ~R ~R~%" + (-> this process 0 name) + (-> arg0 process 0 name) + f30-0 + (-> this max-angle) + ) + ) + (if (< (-> arg0 max-angle) f28-1) + (format + #t + " ~A ~A failed for other angle ~R ~R~%" + (-> this process 0 name) + (-> arg0 process 0 name) + f28-1 + (-> arg0 max-angle) + ) + ) + (if (not (logtest? (-> this mode) (-> arg0 mode))) + (format + #t + " ~A ~A failed for mode ~X ~X~%" + (-> this process 0 name) + (-> arg0 process 0 name) + (-> this mode) + (-> arg0 mode) + ) + ) + -1.0 + ) + (else + (+ f26-0 (* 409.6 (- 32768.0 f30-0))) + ) + ) + ) + ) + +;; definition for method 11 of type carry-info +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod drag! ((this carry-info) (arg0 carry-info)) + (set! (-> this other) (ppointer->handle (-> arg0 process))) + (set! (-> arg0 other) (ppointer->handle (-> this process))) + (set! (-> this pickup-time) (-> this process 0 clock frame-counter)) + (set! (-> arg0 pickup-time) (-> arg0 process 0 clock frame-counter)) + (set! (-> arg0 grab-trans-blend) 1.0) + (let* ((s4-0 (-> arg0 process 0 control)) + (v1-17 (if (type? s4-0 collide-shape) + s4-0 + ) + ) + ) + (if v1-17 + (set! (-> v1-17 root-prim local-sphere w) (-> arg0 carry-radius)) + ) + ) + (quaternion-copy! (-> arg0 grab-quat) (-> arg0 process 0 control quat)) + (quaternion-rotate-y! (-> arg0 grab-quat) (-> arg0 grab-quat) (- (vector-y-angle (-> this normal)))) + (let* ((f30-0 (quaternion-y-angle (-> arg0 grab-quat))) + (f0-8 (the float (the int (* 0.000061035156 (+ 73728.0 (the float (sar (shl (the int f30-0) 48) 48))))))) + (f28-0 (the float (sar (shl (the int (* 16384.0 f0-8)) 48) 48))) + ) + (quaternion-rotate-y! (-> arg0 grab-quat) (-> arg0 grab-quat) (deg-diff f30-0 f28-0)) + (let ((s3-2 + (matrix-4x4-inverse! + (new 'stack-no-clear 'matrix) + (-> arg0 process 0 node-list data (-> arg0 joint) bone transform) + ) + ) + (s4-3 (vector-negate! (new 'stack-no-clear 'vector) (-> this normal))) + ) + (set! (-> s4-3 y) 0.0) + (vector-xz-normalize! s4-3 (-> arg0 max-pull)) + (vector+! s4-3 s4-3 (-> arg0 point)) + (vector-! s4-3 s4-3 (-> arg0 process 0 control trans)) + (vector-rotate-y! s4-3 s4-3 (- (deg-diff f30-0 f28-0))) + (vector+! s4-3 s4-3 (-> arg0 process 0 control trans)) + (vector-matrix*! s4-3 s4-3 s3-2) + (set! (-> arg0 grab-trans quad) (-> s4-3 quad)) + ) + ) + (set! (-> arg0 hold-trans x) + (+ (fmax (fmin (- (-> arg0 grab-trans x) (-> arg0 local-point x)) (-> arg0 min-pull)) (- (-> arg0 min-pull))) + (-> arg0 local-point x) + ) + ) + (set! (-> arg0 hold-trans z) + (+ (fmax (fmin (- (-> arg0 grab-trans z) (-> arg0 local-point z)) (-> arg0 min-pull)) (- (-> arg0 min-pull))) + (-> arg0 local-point z) + ) + ) + (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> this process))) + (let* ((v1-46 (-> arg0 process)) + (v1-49 + (-> (the-as collide-shape (-> (the-as process-drawable (if v1-46 + (the-as process-drawable (-> v1-46 0 self)) + ) + ) + root + ) + ) + root-prim + ) + ) + ) + (let ((a0-30 (-> v1-49 prim-core collide-as)) + (a1-25 (-> arg0 process)) + ) + (set! (-> (the-as collide-shape (-> (the-as process-drawable (if a1-25 + (the-as process-drawable (-> a1-25 0 self)) + ) + ) + root + ) + ) + backup-collide-as + ) + a0-30 + ) + ) + (let ((v1-50 (-> v1-49 prim-core collide-with)) + (a0-31 (-> arg0 process)) + ) + (set! (-> (the-as collide-shape (-> (the-as process-drawable (if a0-31 + (the-as process-drawable (-> a0-31 0 self)) + ) + ) + root + ) + ) + backup-collide-with + ) + v1-50 + ) + ) + ) + (let* ((v1-51 (-> arg0 process)) + (v1-54 + (-> (the-as collide-shape (-> (the-as process-drawable (if v1-51 + (the-as process-drawable (-> v1-51 0 self)) + ) + ) + root + ) + ) + root-prim + ) + ) + ) + (set! (-> v1-54 prim-core collide-as) (collide-spec)) + (set! (-> v1-54 prim-core collide-with) (collide-spec)) + ) + 0 + 0 + (none) + ) + +;; definition for method 12 of type carry-info +;; WARN: Return type mismatch int vs none. +(defmethod drop-impl! ((this carry-info) (arg0 carry-info)) + (let ((a1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 process 0 control quat)))) + (set! (-> a1-2 y) 0.0) + (set-heading-vec-clear-roll-pitch! (-> arg0 process 0 control) a1-2) + ) + (let* ((s4-0 (-> arg0 process 0 control)) + (v1-9 (if (type? s4-0 collide-shape) + s4-0 + ) + ) + ) + (if v1-9 + (set! (-> v1-9 root-prim local-sphere w) (-> arg0 backup-radius)) + ) + ) + (set! (-> this other) (the-as handle #f)) + (set! (-> arg0 other) (the-as handle #f)) + (change-parent (ppointer->process (-> arg0 process)) *entity-pool*) + (let* ((v1-13 (-> arg0 process)) + (v1-16 + (-> (the-as collide-shape (-> (the-as process-drawable (if v1-13 + (the-as process-drawable (-> v1-13 0 self)) + ) + ) + root + ) + ) + root-prim + ) + ) + ) + (let ((a0-8 (-> arg0 process))) + (set! (-> v1-16 prim-core collide-as) + (-> (the-as process-focusable (if a0-8 + (the-as process-focusable (-> a0-8 0 self)) + ) + ) + root + backup-collide-as + ) + ) + ) + (let ((a0-12 (-> arg0 process))) + (set! (-> v1-16 prim-core collide-with) + (-> (the-as process-focusable (if a0-12 + (the-as process-focusable (-> a0-12 0 self)) + ) + ) + root + backup-collide-with + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 13 of type carry-info +;; INFO: Used lq/sq +(defmethod carry-info-method-13 ((this carry-info)) + (with-pp + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'carry-info) + (let* ((s4-0 (the-as carry-info (send-event-function (handle->process (-> this other)) a1-0))) + (s2-0 (-> this process 0 node-list data (-> this joint) bone transform)) + (v1-10 (vector-matrix*! + (new 'stack-no-clear 'vector) + (vector-lerp! + (new 'stack-no-clear 'vector) + (-> this hold-trans) + (-> this grab-trans) + (-> this grab-trans-blend) + ) + s2-0 + ) + ) + (s3-2 (vector-! (new 'stack-no-clear 'vector) v1-10 (-> this process 0 control trans))) + ) + (when s4-0 + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (let* ((a2-3 (-> s4-0 process 0 node-list data (-> s4-0 joint) bone transform)) + (v1-16 (-> a2-3 rvec quad)) + (a0-16 (-> a2-3 uvec quad)) + (a1-3 (-> a2-3 fvec quad)) + (a2-4 (-> a2-3 trans quad)) + ) + (set! (-> s5-1 rvec quad) v1-16) + (set! (-> s5-1 uvec quad) a0-16) + (set! (-> s5-1 fvec quad) a1-3) + (set! (-> s5-1 trans quad) a2-4) + ) + (vector-normalize! (-> s5-1 rvec) 1.0) + (vector-normalize! (-> s5-1 uvec) 1.0) + (vector-normalize! (-> s5-1 fvec) 1.0) + (vector-reset! (-> s5-1 trans)) + (let* ((a1-8 (quaternion-normalize! (matrix->quaternion (new 'stack-no-clear 'quaternion) s5-1))) + (s5-3 (quaternion-normalize! (quaternion*! a1-8 a1-8 (-> this grab-quat)))) + (v1-19 (vector-! (new 'stack-no-clear 'vector) (-> s4-0 point) s3-2)) + (f30-0 (* 0.033333335 (the float (- (current-time) (-> this pickup-time))))) + ) + (cond + ((time-elapsed? (-> this pickup-time) (seconds 1)) + (set! (-> this process 0 control trans quad) (-> v1-19 quad)) + (quaternion-copy! (-> this process 0 control quat) s5-3) + ) + (else + (vector-lerp! + (-> this process 0 control trans) + (-> this process 0 control trans) + v1-19 + (fmin 1.0 (* f30-0 (-> pp clock time-adjust-ratio))) + ) + (quaternion-slerp! + (-> this process 0 control quat) + (-> this process 0 control quat) + s5-3 + (fmin 1.0 (* f30-0 (-> pp clock time-adjust-ratio))) + ) + ) + ) + ) + ) + #t + ) + ) + ) + ) + ) + +;; definition for method 14 of type carry-info +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod carry! ((this carry-info) (arg0 carry-info) (arg1 vector) (arg2 vector)) + (set! (-> this other) (ppointer->handle (-> arg0 process))) + (set! (-> arg0 other) (ppointer->handle (-> this process))) + (set! (-> this pickup-time) (-> this process 0 clock frame-counter)) + (set! (-> arg0 pickup-time) (-> arg0 process 0 clock frame-counter)) + (set! (-> arg0 grab-trans-blend) 1.0) + (let* ((s2-0 (-> arg0 process 0 control)) + (v1-17 (if (type? s2-0 collide-shape) + s2-0 + ) + ) + ) + (if v1-17 + (set! (-> v1-17 root-prim local-sphere w) (-> arg0 carry-radius)) + ) + ) + (quaternion-copy! (-> arg0 grab-quat) (-> arg0 process 0 control quat)) + (set! (-> arg0 grab-trans quad) (-> arg0 process 0 control trans quad)) + (set! (-> arg0 hold-trans quad) (-> this process 0 control trans quad)) + (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (-> this point) (-> arg0 point)))) + (vector-xz-normalize! s2-2 (-> arg0 max-pull)) + (vector+! s2-2 s2-2 (-> arg0 point)) + (let ((f30-0 (y-angle (-> arg0 process 0 control)))) + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-2 (-> this process 0 control trans))) + (let* ((f0-5 (the float (-> this face-dir))) + (f28-0 (the float (sar (shl (the int (* 16384.0 f0-5)) 48) 48))) + ) + (set-vector! arg2 (sin (+ f30-0 f28-0)) 0.0 (cos (+ f30-0 f28-0)) 1.0) + ) + ) + ) + (vector+float*! arg1 (-> arg0 point) arg2 (- (-> arg0 carry-radius))) + (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> this process))) + (let* ((v1-46 (-> arg0 process)) + (v1-49 (-> (the-as process-focusable (if v1-46 + (the-as process-focusable (-> v1-46 0 self)) + ) + ) + root + root-prim + ) + ) + ) + (let ((a0-32 (-> v1-49 prim-core collide-as)) + (a1-7 (-> arg0 process)) + ) + (set! (-> (the-as process-focusable (if a1-7 + (the-as process-focusable (-> a1-7 0 self)) + ) + ) + root + backup-collide-as + ) + a0-32 + ) + ) + (let ((v1-50 (-> v1-49 prim-core collide-with)) + (a0-33 (-> arg0 process)) + ) + (set! (-> (the-as process-focusable (if a0-33 + (the-as process-focusable (-> a0-33 0 self)) + ) + ) + root + backup-collide-with + ) + v1-50 + ) + ) + ) + (let* ((v1-51 (-> arg0 process)) + (v1-54 (-> (the-as process-focusable (if v1-51 + (the-as process-focusable (-> v1-51 0 self)) + ) + ) + root + root-prim + ) + ) + ) + (set! (-> v1-54 prim-core collide-as) (collide-spec)) + (set! (-> v1-54 prim-core collide-with) (collide-spec)) + ) + 0 + (none) + ) + +;; definition for method 16 of type carry-info +(defmethod translate! ((this carry-info)) + (with-pp + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'carry-info) + (let ((a0-6 (the-as carry-info (send-event-function (handle->process (-> this other)) a1-0)))) + (when a0-6 + (let ((v1-6 (vector-! (new 'stack-no-clear 'vector) (-> this grab-trans) (-> this hold-trans)))) + (vector+! (-> this process 0 control trans) (-> a0-6 process 0 control trans) v1-6) + ) + #t + ) + ) + ) + ) + ) + +;; definition for method 15 of type carry-info +(defmethod drop! ((this carry-info) (arg0 carry-info)) + (drop-impl! this arg0) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc new file mode 100644 index 00000000000..789a1229aa1 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc @@ -0,0 +1,145 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mech-info +(deftype mech-info (basic) + ((entity entity-actor) + (hud handle 1) + (mech-trans vector :inline) + (mech-quat vector :inline) + (mech-scale vector :inline) + (engine-sound-id sound-id) + (engine-sound-volume float) + (engine-sound-pitch float) + (thrust-sound-id sound-id) + (drag-sound-id sound-id) + (whine-sound-id sound-id) + (shield-sound-id sound-id) + (mech-start-time time-frame) + (mech-time time-frame) + (no-get-off-time time-frame) + (stick-lock basic) + (stick-off basic) + (forward-vel meters) + (jump-thrust meters) + (jump-thrust-fuel float) + (unstuck-time time-frame) + (stuck-count int32) + (back-touch-point vector :inline) + (back-touch-trans vector :inline) + (back-touch-time time-frame) + (attack-id uint32) + (shield-value float) + (shield-max float) + (shield-handle handle) + (walk-anim-leg int32) + (state-impact? symbol 1) + (state-impact impact-control 1 :inline) + (thruster-flame-width meters) + (thruster-flame-length meters) + (thruster-local-pos vector 2 :inline) + (exhaust-local-pos vector 2 :inline) + (exhaust-local-dir vector 2 :inline) + (smoke-local-pos vector 2 :inline) + (smoke-local-vel vector 2 :inline) + (particle-system-2d basic) + (particle-system-3d basic) + (part-thruster sparticle-launch-control) + (part-thruster-scale-x sp-field-init-spec) + (part-thruster-scale-y sp-field-init-spec) + (part-quat quaternion) + (part-vel vector) + ) + ) + +;; definition for method 3 of type mech-info +(defmethod inspect ((this mech-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Thud[1] @ #x~X~%" (-> this hud)) + (format #t "~1Tmech-trans: ~`vector`P~%" (-> this mech-trans)) + (format #t "~1Tmech-quat: ~`vector`P~%" (-> this mech-quat)) + (format #t "~1Tmech-scale: ~`vector`P~%" (-> this mech-scale)) + (format #t "~1Tengine-sound-id: ~D~%" (-> this engine-sound-id)) + (format #t "~1Tengine-sound-volume: ~f~%" (-> this engine-sound-volume)) + (format #t "~1Tengine-sound-pitch: ~f~%" (-> this engine-sound-pitch)) + (format #t "~1Tthrust-sound-id: ~D~%" (-> this thrust-sound-id)) + (format #t "~1Tdrag-sound-id: ~D~%" (-> this drag-sound-id)) + (format #t "~1Twhine-sound-id: ~D~%" (-> this whine-sound-id)) + (format #t "~1Tshield-sound-id: ~D~%" (-> this shield-sound-id)) + (format #t "~1Tmech-start-time: ~D~%" (-> this mech-start-time)) + (format #t "~1Tmech-time: ~D~%" (-> this mech-time)) + (format #t "~1Tno-get-off-time: ~D~%" (-> this no-get-off-time)) + (format #t "~1Tstick-lock: ~A~%" (-> this stick-lock)) + (format #t "~1Tstick-off: ~A~%" (-> this stick-off)) + (format #t "~1Tforward-vel: (meters ~m)~%" (-> this forward-vel)) + (format #t "~1Tjump-thrust: (meters ~m)~%" (-> this jump-thrust)) + (format #t "~1Tjump-thrust-fuel: ~f~%" (-> this jump-thrust-fuel)) + (format #t "~1Tunstuck-time: ~D~%" (-> this unstuck-time)) + (format #t "~1Tstuck-count: ~D~%" (-> this stuck-count)) + (format #t "~1Tback-touch-point: ~`vector`P~%" (-> this back-touch-point)) + (format #t "~1Tback-touch-trans: ~`vector`P~%" (-> this back-touch-trans)) + (format #t "~1Tback-touch-time: ~D~%" (-> this back-touch-time)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tshield-value: ~f~%" (-> this shield-value)) + (format #t "~1Tshield-max: ~f~%" (-> this shield-max)) + (format #t "~1Tshield-handle: ~D~%" (-> this shield-handle)) + (format #t "~1Twalk-anim-leg: ~D~%" (-> this walk-anim-leg)) + (format #t "~1Tstate-impact?[1] @ #x~X~%" (-> this state-impact?)) + (format #t "~1Tstate-impact[1] @ #x~X~%" (-> this state-impact)) + (format #t "~1Tthruster-flame-width: (meters ~m)~%" (-> this thruster-flame-width)) + (format #t "~1Tthruster-flame-length: (meters ~m)~%" (-> this thruster-flame-length)) + (format #t "~1Tthruster-local-pos[2] @ #x~X~%" (-> this thruster-local-pos)) + (format #t "~1Texhaust-local-pos[2] @ #x~X~%" (-> this exhaust-local-pos)) + (format #t "~1Texhaust-local-dir[2] @ #x~X~%" (-> this exhaust-local-dir)) + (format #t "~1Tsmoke-local-pos[2] @ #x~X~%" (-> this smoke-local-pos)) + (format #t "~1Tsmoke-local-vel[2] @ #x~X~%" (-> this smoke-local-vel)) + (format #t "~1Tparticle-system-2d: ~A~%" (-> this particle-system-2d)) + (format #t "~1Tparticle-system-3d: ~A~%" (-> this particle-system-3d)) + (format #t "~1Tpart-thruster: ~A~%" (-> this part-thruster)) + (format #t "~1Tpart-thruster-scale-x: #~%" (-> this part-thruster-scale-x)) + (format #t "~1Tpart-thruster-scale-y: #~%" (-> this part-thruster-scale-y)) + (format #t "~1Tpart-quat: #~%" (-> this part-quat)) + (format #t "~1Tpart-vel: #~%" (-> this part-vel)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-mech mech mech-lod0-jg mech-mech-idle-ja + ((mech-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.5) + :shadow mech-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + :global-effects 32 + ) + +;; definition for symbol *mech-shadow-control*, type shadow-control +(define *mech-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #xa)) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w 81920.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-mech-explode mech mech-explode-lod0-jg mech-explode-idle-ja + ((mech-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.5) + :shadow-joint-index 3 + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/target/sidekick_REF.gc b/test/decompiler/reference/jak3/engine/target/sidekick_REF.gc new file mode 100644 index 00000000000..bac12041831 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/sidekick_REF.gc @@ -0,0 +1,634 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-sidekick daxter daxter-lod0-jg -1 + ((daxter-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :longest-edge (meters 1) + :shadow daxter-shadow-mg + :texture-level 10 + :origin-joint-index 6 + :shadow-joint-index 6 + :light-index 1 + ) + +;; failed to figure out what this is: +(defskelgroup skel-sidekick-highres daxter-highres daxter-highres-lod0-jg -1 + ((daxter-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :longest-edge (meters 1) + :shadow daxter-highres-shadow-mg + :origin-joint-index 6 + :shadow-joint-index 6 + :light-index 1 + ) + +;; definition for symbol *sidekick-remap*, type pair +(define *sidekick-remap* + '(("run-to-stance-left" "run-to-stance") + ("run-to-stance-loop-left" "run-to-stance-loop") + ("stance-loop-left" "stance-loop") + ("run-to-stance-right" "run-to-stance") + ("run-to-stance-loop-right" "run-to-stance-loop") + ("stance-loop-right" "stance-loop") + ("run-to-stance-up" "run-to-stance") + ("run-to-stance-loop-up" "run-to-stance-loop") + ("stance-loop-up" "stance-loop") + ("run-to-stance-down" "run-to-stance") + ("run-to-stance-loop-down" "run-to-stance-loop") + ("stance-loop-down" "stance-loop") + ("run-right" "run") + ("run-left" "run") + ("walk-right" "walk") + ("walk-left" "walk") + ("gun-hit-elec" "hit-elec") + ("gun-attack-from-stance-end" + "gun-attack-from-stance-end" + "gun-attack-from-stance-end" + "gun-attack-from-stance-end" + "gun-attack-from-stance-end-alt1" + ) + ("gun-attack-butt-end" + "gun-attack-butt-end" + "gun-attack-butt-end" + "gun-attack-butt-end" + "gun-attack-butt-end" + "gun-attack-butt-end-alt1" + ) + ("pole-cycle" "pole-cycle" "pole-cycle2") + ("hit-from-front-alt1" "hit-from-front") + ("board-jump" + ,(lambda :behavior sidekick + ((arg0 object) (arg1 vector) (arg2 int)) + (let ((gp-0 (ppointer->process (-> self parent)))) + (when (time-elapsed? (-> self special-anim-time) (seconds 1)) + (set! (-> self special-anim-interp) 0.0) + (set! (-> self special-anim-frame) 0.0) + ) + (cond + ((or (and (= (-> (the-as target gp-0) control mod-surface name) 'spin) + (!= (-> (the-as target gp-0) board rotyv) 0.0) + ) + (!= (-> self special-anim-interp) 0.0) + ) + (case arg2 + ((1) + (set-time! (-> self special-anim-time)) + (cond + ((= (-> (the-as target gp-0) control mod-surface name) 'spin) + (set! (-> arg1 z) (* (lerp-scale 0.0 5.0 (fabs (-> (the-as target gp-0) board rotyv)) 0.0 182044.44) + (-> self special-anim-interp) + ) + ) + (set! (-> self special-anim-frame) (-> arg1 z)) + (seek! (-> self special-anim-interp) 1.0 (* 8.0 (seconds-per-frame))) + ) + (else + (seek! (-> self special-anim-interp) 0.0 (* 4.0 (seconds-per-frame))) + (set! (-> arg1 z) (* (-> self special-anim-frame) (-> self special-anim-interp))) + ) + ) + ) + ) + (if (>= (-> (the-as target gp-0) board rotyv) 0.0) + "board-spin-ccw" + "board-spin-cw" + ) + ) + (else + "board-jump" + ) + ) + ) + ) + ) + ) + ) + +;; definition for function cspace<-cspace+transformq! +(defun cspace<-cspace+transformq! ((arg0 cspace) (arg1 cspace) (arg2 transformq)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (-> arg0 bone transform))) + (quaternion->matrix s4-0 (-> arg2 quat)) + (.lvf vf1 (&-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad)) + (.lvf vf2 (&-> (-> arg1 bone) transform trans quad)) + (.lvf vf6 (&-> arg2 trans quad)) + (.lvf vf3 (&-> s4-0 rvec quad)) + (.lvf vf4 (&-> s4-0 uvec quad)) + (.lvf vf5 (&-> s4-0 fvec quad)) + (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + (.wait.vf) + (.mul.vf vf2 vf2 Q :mask #b111) + (.mov.vf vf2 vf0 :mask #b1000) + (.mul.x.vf vf3 vf3 vf1) + (.mul.y.vf vf4 vf4 vf1) + (.mul.z.vf vf5 vf5 vf1) + (.mul.x.vf acc vf3 vf6) + (.add.mul.y.vf acc vf4 vf6 acc) + (.add.mul.z.vf acc vf5 vf6 acc) + (.add.mul.w.vf vf2 vf2 vf0 acc :mask #b111) + (.svf (&-> s4-0 trans quad) vf2) + (.svf (&-> s4-0 rvec quad) vf3) + (.svf (&-> s4-0 uvec quad) vf4) + (.svf (&-> s4-0 fvec quad) vf5) + s4-0 + ) + ) + ) + +;; definition for function target-sidekick-setup +;; WARN: Return type mismatch int vs none. +(defbehavior target-sidekick-setup target ((arg0 symbol)) + (if (zero? (-> self sidekick)) + (set! (-> self sidekick) (the-as (pointer sidekick) #f)) + ) + (cond + (arg0 + (if (not (-> self sidekick)) + (set! (-> self sidekick) + (process-spawn sidekick :init init-sidekick :name "sidekick" :from *8k-dead-pool* :to self) + ) + ) + ) + ((-> self sidekick) + (deactivate (-> self sidekick 0)) + (set! (-> self sidekick) (the-as (pointer sidekick) #f)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate sidekick-clone (sidekick) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (case message + (('matrix) + (case (-> block param 0) + (('play-anim) + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-cspace+transformq!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) (the-as basic (-> self parent 0 node-list data))) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) (the-as basic (-> self offset))) + ) + (('copy-parent) + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-cspace!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) (the-as basic (-> self parent 0 node-list data))) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) #f) + ) + (('root) + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-cspace-normalized!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) (the-as basic (-> self parent 0 node-list data))) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) #f) + ) + (('indax) + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-transformq+trans!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) (the-as basic (-> self parent 0 control trans))) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) + (the-as basic (-> self parent 0 control cspace-offset)) + ) + ) + (('board) + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-cspace-normalized!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) (the-as basic (-> self parent 0 node-list data 37))) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) #f) + ) + (else + (set! v0-0 (-> self node-list data)) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param0) + (the-as (function cspace transformq none) cspace<-cspace+transformq!) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param1) + (the-as basic (-> self parent 0 control sidekick-root parent)) + ) + (set! (-> (the-as (inline-array cspace) v0-0) 0 param2) (the-as basic (-> self offset))) + ) + ) + v0-0 + ) + (('shadow) + (set! v0-0 (-> block param 0)) + (set! (-> self shadow-in-movie?) (the-as symbol v0-0)) + v0-0 + ) + (('blend-shape) + (cond + ((-> block param 0) + (set! v0-0 (logior (-> self skel status) (joint-control-status blend-shape))) + (set! (-> self skel status) (the-as joint-control-status v0-0)) + ) + (else + (set! v0-0 (logclear (-> self skel status) (joint-control-status blend-shape))) + (set! (-> self skel status) (the-as joint-control-status v0-0)) + ) + ) + v0-0 + ) + (('cleanup) + (joint-control-cleanup + (-> self skel) + (-> *target-anim-control* heap) + (the-as art-joint-anim daxter-stance-loop-ja) + ) + ) + ) + ) + :code looping-code + :post (behavior () + (local-vars (v1-100 symbol)) + (let ((v1-0 (-> self parent))) + (when (not (and (-> (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) + ) + next-state + ) + (let ((v1-4 (-> self parent))) + (= (-> (the-as target (if v1-4 + (the-as target (-> v1-4 0 self)) + ) + ) + next-state + name + ) + 'process-drawable-art-error + ) + ) + ) + ) + (quaternion-rotate-y! + (-> self control quat) + (-> self parent 0 control quat) + (-> self parent 0 upper-body twist z) + ) + (set! (-> self anim-seed) (-> self parent 0 anim-seed)) + (set! (-> self draw status) (-> self parent 0 draw status)) + (cond + ((logtest? (-> self parent 0 target-effect) 1) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logior! (-> self draw global-effect) (draw-control-global-effect no-textures)) + ) + (else + (logclear! (-> self draw global-effect) (draw-control-global-effect no-textures)) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw-bounds2)) + (let ((gp-0 0)) + (cond + ((and (not (logtest? (-> self parent 0 focus-status) (focus-status edge-grab))) + (> (-> self parent 0 skel float-channels) 0) + ) + (let ((gp-1 (-> self skel))) + (joint-control-copy! gp-1 (-> self parent 0 skel)) + (set! (-> gp-1 root-channel) + (the-as (inline-array joint-control-channel) (-> gp-1 channel (-> gp-1 active-channels))) + ) + (dotimes (s5-0 (the-as int (-> self parent 0 skel float-channels))) + (let ((s4-0 (-> gp-1 channel (+ s5-0 (-> gp-1 active-channels))))) + (mem-copy! + (the-as pointer s4-0) + (the-as pointer (-> self parent 0 skel channel (+ s5-0 (-> self parent 0 skel active-channels)))) + 64 + ) + (set! (-> s4-0 frame-interp 0) (-> s4-0 frame-interp 1)) + (set! (-> s4-0 command) (joint-control-command blend)) + ) + ) + (dotimes (v1-70 (the-as int (-> gp-1 allocated-length))) + (set! (-> gp-1 channel v1-70 parent) gp-1) + ) + (+! (-> gp-1 active-channels) (-> self parent 0 skel float-channels)) + (set! (-> gp-1 float-channels) (the-as uint 0)) + ) + (set! gp-0 1) + ) + (else + (joint-control-copy! (-> self skel) (-> self parent 0 skel)) + ) + ) + (joint-control-remap! + (-> self skel) + (-> self draw art-group) + (-> self parent 0 draw art-group) + *sidekick-remap* + (the-as int (-> self anim-seed)) + "" + ) + (cond + ((zero? gp-0) + (set! (-> self skel effect channel-offset) (-> self parent 0 skel effect channel-offset)) + ) + ((= gp-0 1) + (set! (-> self skel effect channel-offset) 0) + 0 + ) + ) + ) + (let ((v1-97 (-> self parent 0 draw color-mult quad))) + (set! (-> self draw color-mult quad) v1-97) + ) + (let ((v1-98 #x20000) + (a0-27 (-> self parent)) + ) + (cond + ((and (logtest? (the-as focus-status v1-98) (-> (the-as target (if a0-27 + (the-as target (-> a0-27 0 self)) + ) + ) + focus-status + ) + ) + (begin + (let* ((v1-101 #t) + (a0-30 (-> self parent)) + (a0-32 (the-as lightjak-info (-> (the-as target (if a0-30 + (the-as target (-> a0-30 0 self)) + ) + ) + lightjak + ) + ) + ) + ) + (cmove-#f-zero v1-100 a0-32 v1-101) + ) + v1-100 + ) + ) + (set-vector! (-> self draw color-emissive) 0.1 0.4 1.0 0.5) + ) + (else + (let ((a0-37 (-> self parent 0 draw color-emissive quad))) + (set! (-> self draw color-emissive quad) a0-37) + ) + ) + ) + ) + (set! (-> self draw force-fade) (-> self parent 0 draw force-fade)) + (set! (-> self draw death-vertex-skip) (-> self parent 0 draw death-vertex-skip)) + (set! (-> self draw death-effect) (-> self parent 0 draw death-effect)) + (set! (-> self draw death-timer) (-> self parent 0 draw death-timer)) + (set! (-> self draw death-timer-org) (-> self parent 0 draw death-timer-org)) + (set! (-> self draw death-draw-overlap) (-> self parent 0 draw death-draw-overlap)) + (quaternion-copy! (-> self offset quat) (-> self control quat)) + (let ((f0-7 (* (-> self parent 0 darkjak-interp) (-> self parent 0 darkjak-giant-interp)))) + (set! (-> self offset trans x) (* 286.72 f0-7)) + (set! (-> self offset trans y) (* 204.8 f0-7)) + (set! (-> self offset trans z) (* 409.6 f0-7)) + ) + (cond + ((= (-> self parent 0 skel override 0) 0.00001) + (set! (-> self skel override 0) 0.00001) + (set! (-> self skel override 41) 1.0) + (set! (-> self skel override 46) 1.0) + (set! (-> self skel override 52) 1.0) + ) + ((!= (-> self skel override 0) 0.0) + (set! (-> self skel override 0) 0.0) + (set! (-> self skel override 41) 0.0) + ) + ) + (let ((f30-0 (vector-length (-> self parent 0 control transv)))) + (seek! + (-> self ear 0 twist-max z) + (lerp-scale 0.0 5461.3335 f30-0 4096.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! (-> self ear 0 twist-speed-x) (lerp-scale 1.0 8.0 f30-0 4096.0 122880.0) (* 10.0 (seconds-per-frame))) + (let ((f0-26 (+ (-> self ear 0 twist z) (* (-> self ear 0 twist-speed-x) (seconds-per-frame))))) + (set! (-> self ear 0 twist z) (- f0-26 (* (the float (the int (/ f0-26 1.0))) 1.0))) + ) + (trs-set! + (-> self ear 0) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (* (sin (* 32768.0 (-> self ear 0 twist z))) (-> self ear 0 twist-max z)) + ) + (the-as vector #f) + ) + (seek! + (-> self ear 1 twist-max z) + (lerp-scale 0.0 5461.3335 f30-0 4096.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! (-> self ear 1 twist-speed-x) (lerp-scale 1.0 8.0 f30-0 4096.0 122880.0) (* 10.0 (seconds-per-frame))) + (let ((f0-41 (+ (-> self ear 1 twist z) (* (-> self ear 1 twist-speed-x) (seconds-per-frame))))) + (set! (-> self ear 1 twist z) (- f0-41 (* (the float (the int (/ f0-41 1.0))) 1.0))) + ) + (trs-set! + (-> self ear 1) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (* (sin (* 32768.0 (-> self ear 1 twist z))) (-> self ear 1 twist-max z)) + ) + (the-as vector #f) + ) + (seek! + (-> self flap 0 twist-max z) + (lerp-scale 0.0 5461.3335 f30-0 4096.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! (-> self flap 0 twist-speed-x) (lerp-scale 1.0 8.0 f30-0 4096.0 122880.0) (* 10.0 (seconds-per-frame))) + (let ((f0-56 (+ (-> self flap 0 twist z) (* (-> self flap 0 twist-speed-x) (seconds-per-frame))))) + (set! (-> self flap 0 twist z) (- f0-56 (* (the float (the int (/ f0-56 1.0))) 1.0))) + ) + (trs-set! + (-> self flap 0) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (* (sin (* 32768.0 (-> self flap 0 twist z))) (-> self flap 0 twist-max z)) + ) + (the-as vector #f) + ) + (seek! + (-> self flap 1 twist-max z) + (lerp-scale 0.0 5461.3335 f30-0 4096.0 122880.0) + (* 65536.0 (seconds-per-frame)) + ) + (seek! (-> self flap 1 twist-speed-x) (lerp-scale 1.0 8.0 f30-0 4096.0 122880.0) (* 10.0 (seconds-per-frame))) + ) + (let ((f0-71 (+ (-> self flap 1 twist z) (* (-> self flap 1 twist-speed-x) (seconds-per-frame))))) + (set! (-> self flap 1 twist z) (- f0-71 (* (the float (the int (/ f0-71 1.0))) 1.0))) + ) + (trs-set! + (-> self flap 1) + (the-as vector #f) + (quaternion-rotate-x! + (new 'stack-no-clear 'quaternion) + (the-as quaternion *null-vector*) + (* (sin (* 32768.0 (-> self flap 1 twist z))) (-> self flap 1 twist-max z)) + ) + (the-as vector #f) + ) + (update-anim-data (-> self skel)) + (do-joint-math (-> self draw) (-> self node-list) (-> self skel)) + ) + ) + (when *display-sidekick-stats* + (format *stdcon* "~%") + (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) + (add-debug-sphere + *display-sidekick-stats* + (bucket-id debug-no-zbuf1) + (-> self parent 0 control sidekick-root parent bone transform trans) + (meters 0.1) + (new 'static 'rgba :g #xff :a #x80) + ) + (add-debug-sphere + *display-sidekick-stats* + (bucket-id debug-no-zbuf1) + (-> self node-list data 3 bone transform trans) + (meters 0.1) + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + (add-debug-sphere + *display-sidekick-stats* + (bucket-id debug-no-zbuf1) + (-> self node-list data 0 bone transform trans) + (meters 0.1) + (new 'static 'rgba :r #xff :a #x80) + ) + (add-debug-matrix + *display-sidekick-stats* + (bucket-id debug-no-zbuf1) + (-> self node-list data 0 bone transform) + (meters 2) + ) + ) + (set! (-> self draw shadow) + (the-as + shadow-geo + (if (or (and (movie?) (-> self shadow-in-movie?)) (logtest? (focus-status indax) (-> self parent 0 focus-status))) + daxter-shadow-mg + ) + ) + ) + (let ((a0-84 (-> self skel effect))) + (if a0-84 + (effect-control-method-9 a0-84) + ) + ) + (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) + (merc-blend-shape self) + ) + (if (logtest? (-> self skel status) (joint-control-status eye-anim-valid eye-anim)) + (merc-eye-anim self) + ) + (when (!= (not (-> *setting-control* user-current mirror)) (not (-> self mirror))) + (cond + ((-> self mirror) + (deactivate (-> self mirror 0)) + (set! (-> self mirror) (the-as (pointer process-drawable) #f)) + ) + (else + (let ((gp-14 (process-spawn + manipy + :init manipy-init + (-> self control trans) + (-> self entity) + (art-group-get-by-name *level* "skel-sidekick" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (send-event (ppointer->process gp-14) 'anim-mode 'mirror) + (send-event (ppointer->process gp-14) 'mirror #t) + (set! (-> self mirror) (the-as (pointer process-drawable) gp-14)) + (let ((v0-55 (-> (the-as process-drawable (-> gp-14 0)) node-list data))) + (set! (-> v0-55 0 param0) (the-as (function cspace transformq none) cspace<-cspace!)) + (set! (-> v0-55 0 param1) (the-as basic (-> self node-list data))) + (set! (-> v0-55 0 param2) #f) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 7 of type sidekick +;; WARN: Return type mismatch process-drawable vs sidekick. +(defmethod relocate ((this sidekick) (offset int)) + (if (nonzero? (-> this ear 0)) + (&+! (-> this ear 0) offset) + ) + (if (nonzero? (-> this ear 1)) + (&+! (-> this ear 1) offset) + ) + (if (nonzero? (-> this flap 0)) + (&+! (-> this flap 0) offset) + ) + (if (nonzero? (-> this flap 1)) + (&+! (-> this flap 1) offset) + ) + (the-as sidekick ((method-of-type process-drawable relocate) this offset)) + ) + +;; definition for function init-sidekick +(defbehavior init-sidekick sidekick () + (logior! (-> self mask) (process-mask sidekick)) + (set! (-> self control) (the-as control-info (new 'process 'trsqv))) + (vector-identity! (-> self control scale)) + (quaternion-identity! (-> self control quat)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-sidekick" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self draw shadow-ctrl) *target-shadow-control*) + (logior! (-> self skel status) (joint-control-status sync-math blend-shape eye-anim)) + (set! (-> self draw light-index) (the-as uint 30)) + (let ((v1-14 (-> self node-list data))) + (set! (-> v1-14 0 param0) (the-as (function cspace transformq none) cspace<-cspace+transformq!)) + (set! (-> v1-14 0 param1) (the-as basic (-> self parent 0 control sidekick-root parent))) + (set! (-> v1-14 0 param2) (the-as basic (-> self offset))) + ) + (set! (-> self ear 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 10)) + (set! (-> self ear 0 parented-scale?) #t) + (set! (-> self ear 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 12)) + (set! (-> self ear 1 parented-scale?) #t) + (set! (-> self flap 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 41)) + (set! (-> self flap 0 parented-scale?) #t) + (set! (-> self flap 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 43)) + (set! (-> self flap 1 parented-scale?) #t) + (set! (-> self shadow-in-movie?) #t) + (set! (-> self mirror) (the-as (pointer process-drawable) #f)) + (set! (-> self skel override) (new 'process 'boxed-array float 54)) + (go sidekick-clone) + ) diff --git a/test/decompiler/reference/jak3/engine/target/surface-h_REF.gc b/test/decompiler/reference/jak3/engine/target/surface-h_REF.gc index c5d52475686..2a317351932 100644 --- a/test/decompiler/reference/jak3/engine/target/surface-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/surface-h_REF.gc @@ -85,7 +85,7 @@ on impact, during touch, on exit, etc." (format #t "~1Tslope-up-traction: ~f~%" (-> this slope-up-traction)) (format #t "~1Talign-speed: ~f~%" (-> this align-speed)) (format #t "~1Tslope-change-preserve: ~f~%" (-> this slope-change-preserve)) - (format #t "~1Thook[5] @ #x~X~%" (-> this hook)) + (format #t "~1Thook[5] @ #x~X~%" (&-> this active-hook)) (format #t "~1Tactive-hook: ~A~%" (-> this active-hook)) (format #t "~1Ttouch-hook: ~A~%" (-> this touch-hook)) (format #t "~1Timpact-hook: ~A~%" (-> this impact-hook)) @@ -1370,7 +1370,3 @@ on impact, during touch, on exit, etc." ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/target/target-anim_REF.gc b/test/decompiler/reference/jak3/engine/target/target-anim_REF.gc new file mode 100644 index 00000000000..e108f93dff6 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-anim_REF.gc @@ -0,0 +1,1867 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function target-land-anim +(defbehavior target-land-anim target () + (cond + ((using-gun? self) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-red) (pickup-type eco-dark)) + jakb-gun-jump-land-ja + ) + (else + jakb-gun-jump-land-side-ja + ) + ) + ) + (else + (let ((v1-9 (ja-group))) + (if (and (or (and v1-9 (= v1-9 (-> self draw art-group data 444))) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + ) + (= (-> self ext-anim) (target-anim dark)) + ) + (-> self draw art-group data 445) + jakb-jump-land-ja + ) + ) + ) + ) + ) + +;; definition for function target-stance-anim +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-stance-anim target () + (local-vars (sv-64 int) (sv-72 ground-tween-info)) + (set! sv-64 22) + (set! sv-72 (new 'stack 'ground-tween-info)) + (let ((v1-4 (ja-group))) + (cond + ((and v1-4 (or (= v1-4 jakb-wade-shallow-walk-ja) (= v1-4 jakb-wade-deep-walk-ja))) + (set! sv-64 45) + ) + ((let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 jakb-roll-flip-ja)) + ) + ((lambda :behavior target + () + (cond + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-roll-flip-land-ja) + 0.0 + 0 + 30 + 1.0 + 10.0 + #f + ) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-roll-flip-land-ja) + 0.0 + 0 + 30 + 1.0 + 6.0 + #f + ) + ) + ) + (ja-no-eval :group! jakb-roll-flip-land-ja :num! (seek! (ja-aframe 48.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 48.0 0))) + ) + (ja-channel-push! 1 (seconds 0.05)) + (let ((gp-2 (target-land-anim))) + (ja-no-eval :group! gp-2 :num! (seek!) :frame-num (ja-aframe 64.0 0)) + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-roll-flip-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 55.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (none) + ) + ) + ) + ((let ((v1-18 (ja-group))) + (and v1-18 (or (= v1-18 jakb-gun-attack-from-stance-end-ja) + (= v1-18 jakb-gun-attack-from-stance-blue-end-ja) + (= v1-18 jakb-lightjak-shield-end-ja) + (= v1-18 jakb-attack-from-stance-alt-end-ja) + (= v1-18 jakb-attack-from-stance-end-ja) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-33 (ja-group))) + (and v1-33 + (or (= v1-33 jakb-attack-from-stance-ja) + (= v1-33 jakb-gun-attack-from-stance-ja) + (= v1-33 jakb-gun-attack-from-stance-blue-ja) + (= v1-33 jakb-lightjak-shield-ja) + ) + ) + ) + ((lambda :behavior target + () + (set! (-> self control mod-surface) *attack-end-mods*) + (let ((gp-0 (not (using-gun? self)))) + (let* ((v1-3 (ja-group)) + (a1-0 (cond + ((and v1-3 (= v1-3 jakb-gun-attack-from-stance-ja)) + jakb-gun-attack-from-stance-end-ja + ) + ((let ((v1-10 (ja-group))) + (and v1-10 (= v1-10 jakb-gun-attack-from-stance-blue-ja)) + ) + jakb-gun-attack-from-stance-blue-end-ja + ) + ((and (= (-> self ext-anim) (target-anim light)) (let ((v1-20 (ja-group))) + (and v1-20 (= v1-20 jakb-lightjak-shield-ja)) + ) + ) + jakb-lightjak-shield-end-ja + ) + ((and (rand-vu-percent? 0.3) (zero? (-> self ext-anim))) + jakb-attack-from-stance-alt-end-ja + ) + (else + jakb-attack-from-stance-end-ja + ) + ) + ) + ) + (ja-no-eval :group! a1-0 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (when (nonzero? (-> self gun track-target-hold-time)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (goto cfg-43) + ) + (if (and gp-0 (using-gun? self)) + (goto cfg-43) + ) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek!)) + ) + ) + (quaternion-copy! (-> self control dir-targ) (-> self control unknown-quaternion04)) + (label cfg-43) + (set! (-> self control mod-surface) *walk-mods*) + (let ((v1-73 (ja-group))) + (when (and (and v1-73 (= v1-73 jakb-gun-attack-from-stance-end-ja)) + (and (using-gun? self) (= (gun->eco (-> self gun gun-type)) (pickup-type eco-yellow))) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-gun-front-to-side-hop-ja :num! (seek!) :frame-num (ja-aframe 5.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (none) + ) + ) + ) + ((let ((v1-40 (ja-group))) + (and v1-40 (= v1-40 (-> self draw art-group data 449))) + ) + (ja-no-eval :group! (-> self draw art-group data 450) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-70 (ja-group))) + (and v1-70 (= v1-70 jakb-smack-surface-ja)) + ) + (ja-no-eval :group! jakb-smack-surface-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-100 (ja-group))) + (and v1-100 (or (= v1-100 jakb-powerjak-get-on-ja) (= v1-100 jakb-powerjak-get-on-loop-ja))) + ) + (set! sv-64 60) + ) + ((let ((v1-107 (ja-group))) + (and v1-107 (= v1-107 jakb-darkjak-get-on-fast-ja)) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-122 (ja-group))) + (and v1-122 (or (= v1-122 jakb-attack-punch-ja) + (= v1-122 (-> self draw art-group data 452)) + (= v1-122 (-> self draw art-group data 459)) + (= v1-122 (-> self draw art-group data 454)) + (= v1-122 jakb-darkjak-attack-combo3-ja) + (= v1-122 (-> self draw art-group data 463)) + (= v1-122 (-> self draw art-group data 476)) + ) + ) + ) + ((lambda :behavior target + () + (set! (-> self control bend-target) (-> self control bend-amount)) + (set! (-> self control mod-surface) *walk-no-turn-mods*) + (let ((gp-0 (not (using-gun? self)))) + (let* ((v1-5 (ja-group)) + (a1-0 (cond + ((and v1-5 (= v1-5 (-> self draw art-group data 452))) + (logior! (-> self target-flags) (target-flags lleg-still)) + (-> self draw art-group data 453) + ) + ((let ((v1-14 (ja-group))) + (and v1-14 (= v1-14 (-> self draw art-group data 459))) + ) + (logior! (-> self target-flags) (target-flags lleg-still)) + (-> self draw art-group data 460) + ) + ((let ((v1-23 (ja-group))) + (and v1-23 (= v1-23 (-> self draw art-group data 454))) + ) + (logior! (-> self target-flags) (target-flags lleg-still)) + (-> self draw art-group data 455) + ) + ((let ((v1-32 (ja-group))) + (and v1-32 (= v1-32 jakb-darkjak-attack-combo3-ja)) + ) + (logior! (-> self target-flags) (target-flags lleg-still)) + jakb-darkjak-attack-combo3-end-ja + ) + ((let ((v1-41 (ja-group))) + (and v1-41 (= v1-41 (-> self draw art-group data 463))) + ) + (logior! (-> self target-flags) (target-flags lleg-still)) + (-> self draw art-group data 464) + ) + (else + (let ((v1-50 (ja-group))) + (cond + ((and v1-50 (= v1-50 (-> self draw art-group data 476))) + (logior! (-> self target-flags) (target-flags lleg-still)) + (-> self draw art-group data 477) + ) + ((and (rand-vu-percent? 0.3) (zero? (-> self ext-anim))) + jakb-attack-punch-alt-end-ja + ) + (else + jakb-attack-punch-end-ja + ) + ) + ) + ) + ) + ) + ) + (ja-no-eval :group! a1-0 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (seek! (-> self control bend-target) 0.0 (seconds-per-frame)) + (if (and gp-0 (using-gun? self)) + (goto cfg-59) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (label cfg-59) + (set! (-> self control mod-surface) *walk-mods*) + (set! (-> self control bend-target) 0.0) + (rot->dir-targ! (-> self control)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (none) + ) + ) + ) + ((let ((v1-129 (ja-group))) + (and v1-129 (= v1-129 jakb-gun-attack-butt-ja)) + ) + (set! (-> self control bend-target) (-> self control bend-amount)) + (set! (-> self control mod-surface) *walk-no-turn-mods*) + (let ((a1-22 jakb-gun-attack-butt-end-ja)) + (ja-no-eval :group! a1-22 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (seek! (-> self control bend-target) 0.0 (seconds-per-frame)) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control mod-surface) *walk-mods*) + (set! (-> self control bend-target) 0.0) + (rot->dir-targ! (-> self control)) + ) + ((let ((v1-163 (ja-group))) + (and v1-163 (= v1-163 jakb-gun-attack-butt-blue-ja)) + ) + (set! (-> self control bend-target) (-> self control bend-amount)) + (set! (-> self control mod-surface) *walk-no-turn-mods*) + (let ((a1-25 jakb-gun-attack-butt-blue-end-ja)) + (ja-no-eval :group! a1-25 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (seek! (-> self control bend-target) 0.0 (seconds-per-frame)) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control mod-surface) *walk-mods*) + (set! (-> self control bend-target) 0.0) + (rot->dir-targ! (-> self control)) + ) + ((let ((v1-197 (ja-group))) + (and (and v1-197 (or (= v1-197 jakb-gun-jump-land-ja) (= v1-197 jakb-gun-jump-land-side-ja))) + (not (using-gun? self)) + ) + ) + (set! sv-64 60) + ) + ((let ((v1-205 (ja-group))) + (and v1-205 (or (= v1-205 jakb-duck-stance-ja) + (= v1-205 jakb-duck-walk-ja) + (= v1-205 jakb-gun-duck-walk-ja) + (= v1-205 jakb-duck-roll-ja) + (= v1-205 jakb-gun-duck-roll-ja) + (= v1-205 (-> self draw art-group data 474)) + ) + ) + ) + (let ((t9-27 + (lambda :behavior target + () + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! (-> self draw art-group data 475) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + 12 + ) + ((nonzero? (-> self ext-anim)) + 30 + ) + (else + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! jakb-stance-to-duck-ja :num! (seek! 0.0 1.2) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0 1.2)) + ) + 12 + ) + ) + (none) + ) + ) + ) + (new 'stack-no-clear 'array 'time-frame 4) + (t9-27) + ) + ) + ((let ((v1-212 (ja-group))) + (or (and (and v1-212 (or (= v1-212 jakb-walk-ja) (= v1-212 (-> self draw art-group data 442)))) + (begin (set! sv-64 45) (< 0.5 (-> self skel root-channel 6 frame-interp (-> self skel active-frame-interp)))) + (not (using-gun? self)) + ) + (let ((v1-226 (ja-group))) + (and v1-226 (or (= v1-226 jakb-run-squash-ja) + (= v1-226 jakb-run-squash-weak-ja) + (= v1-226 jakb-attack-from-stance-run-end-ja) + (= v1-226 jakb-attack-from-stance-run-alt-end-ja) + ) + ) + ) + ) + ) + ((lambda :behavior target + ((arg0 (pointer time-frame))) + (cond + ((and (rand-vu-percent? 0.3) (not (and (focus-test? self dark) (nonzero? (-> self darkjak))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-run-to-stance-fast-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (using-gun? self) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (let* ((v1-32 (ja-group)) + (f30-1 (cond + ((and v1-32 (or (= v1-32 jakb-walk-ja) (= v1-32 (-> self draw art-group data 442)))) + (let ((f0-10 (+ 50.0 (* 0.8333333 (+ -25.0 (ja-aframe-num 0)))))) + (- f0-10 (* (the float (the int (/ f0-10 50.0))) 50.0)) + ) + ) + (else + 0.0 + ) + ) + ) + ) + (set! (-> arg0 0) (seconds 0.15)) + (ja-channel-push! 1 (-> arg0 0)) + (ja :group! jakb-run-to-stance-loop-ja :num! (identity (ja-aframe f30-1 0))) + ) + (dotimes (gp-2 3) + (until (ja-done? 0) + (if (using-gun? self) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + (ja :num-func num-func-identity :frame-num 0.0) + ) + (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek! (ja-aframe 82.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 82.0 0))) + ) + (when (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek! (ja-aframe 142.0 0)) :frame-num (ja-aframe 82.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 142.0 0))) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek!) :frame-num (ja-aframe 142.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (none) + ) + (new 'stack-no-clear 'array 'time-frame 4) + ) + ) + ((let ((v1-233 (ja-group))) + (and (and v1-233 (= v1-233 jakb-walk-ja)) (>= (-> self control ctrl-xz-vel) 5734.4)) + ) + (set! sv-64 45) + ) + ((and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (= (-> self ext-anim) (target-anim light)) (let ((v1-250 (ja-group))) + (and v1-250 (= v1-250 jakb-lightjak-get-on-land-ja)) + ) + ) + ) + (set! sv-64 45) + ) + ((and (= (-> self ext-anim) (target-anim light)) (let ((v1-260 (ja-group))) + (and v1-260 (= v1-260 jakb-lightjak-freeze-ja)) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-freeze-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (if (and (using-gun? self) (-> self next-state) (= (-> self next-state name) 'target-stance)) + (go target-gun-stance) + ) + (when (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (= (-> self ext-anim) (target-anim light)) + (zero? (-> self lightjak latch-out-time)) + (let ((v1-306 (ja-group))) + (not (and v1-306 (or (= v1-306 jakb-lightjak-heal-end-ja) + (= v1-306 jakb-lightjak-swoop-land-ja) + (= v1-306 jakb-lightjak-get-on-land-ja) + (= v1-306 jakb-lightjak-shield-end-ja) + (= v1-306 jakb-lightjak-freeze-land-ja) + ) + ) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-stance-to-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (goto cfg-316) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (until #f + (let ((gp-0 (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (= (-> self ext-anim) (target-anim dark)) + (zero? (-> self darkjak latch-out-time)) + (not (using-gun? self)) + ) + ) + (-> self draw art-group data 446) + ) + ((and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (= (-> self ext-anim) (target-anim light)) (zero? (-> self lightjak latch-out-time))) + ) + jakb-lightjak-stance-ja + ) + (else + jakb-stance-loop-ja + ) + ) + ) + ) + (when (not (and (ja-group? gp-0) (= (ja-group-size) 1))) + (ja-channel-push! 1 (the-as time-frame sv-64)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (while (let ((v1-385 (ja-group))) + (cond + ((and (and v1-385 (= v1-385 (-> self draw art-group data 446))) + (not (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (= (-> self ext-anim) (target-anim dark)) + (zero? (-> self darkjak latch-out-time)) + (not (using-gun? self)) + ) + ) + ) + ) + (set! sv-64 60) + #f + ) + (else + #t + ) + ) + ) + (suspend) + (ja :num! (loop!)) + (if (can-play-stance-amibent?) + (go target-stance-ambient) + ) + ) + (label cfg-316) + ) + #f + (none) + ) + +;; definition for function target-stance-push +;; WARN: Return type mismatch int vs none. +(defbehavior target-stance-push target ((arg0 int)) + (let ((v1-2 (ja-group))) + (cond + ((or (and (and v1-2 (= v1-2 jakb-walk-ja)) + (< 0.5 (-> self skel root-channel 6 frame-interp (-> self skel active-frame-interp))) + ) + (let ((v1-14 (ja-group))) + (and v1-14 (or (= v1-14 jakb-run-squash-ja) + (= v1-14 jakb-run-squash-weak-ja) + (= v1-14 jakb-attack-from-stance-run-end-ja) + (= v1-14 jakb-attack-from-stance-run-alt-end-ja) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! jakb-run-to-stance-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! arg0 (seconds 0.15)) + ) + ((let ((v1-68 (ja-group))) + (and (and v1-68 (or (= v1-68 jakb-jump-short-land-ja) + (= v1-68 jakb-jump-land-ja) + (= v1-68 jakb-gun-jump-land-ja) + (= v1-68 jakb-gun-jump-land-side-ja) + (= v1-68 (-> self draw art-group data 445)) + ) + ) + (not (ja-max? 0)) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! arg0 (seconds 0.075)) + ) + ((let ((v1-84 (ja-group))) + (not (and (and v1-84 (= v1-84 jakb-stance-loop-ja)) (= (ja-group-size) 1))) + ) + (ja-channel-push! arg0 (seconds 0.075)) + ) + ) + ) + (none) + ) + +;; definition for function target-falling-anim +;; INFO: Used lq/sq +(defbehavior target-falling-anim target ((arg0 int) (arg1 time-frame)) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 + (or (= v1-2 jakb-jump-loop-ja) (= v1-2 jakb-attack-uppercut-ja) (= v1-2 jakb-gun-attack-upperbutt-ja)) + ) + ) + ((let ((v1-8 (ja-group))) + (and v1-8 (or (= v1-8 jakb-edge-grab-stance0-ja) (= v1-8 jakb-edge-grab-stance1-ja))) + ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! jakb-edge-grab-off-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-37 (ja-group))) + (and v1-37 (= v1-37 jakb-edge-grab-off-ja)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.15)) + ) + (else + (let ((v1-52 (ja-group))) + (cond + ((and v1-52 (= v1-52 jakb-roll-flip-ja)) + (let ((s5-0 (current-time))) + (while (or (= arg0 -1) (not (time-elapsed? s5-0 arg0))) + (when (time-elapsed? s5-0 (seconds 0.01)) + (let ((v1-62 (ja-group))) + (when (not (and v1-62 (= v1-62 jakb-jump-loop-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-jump-loop-ja :num! min) + ) + ) + ) + (let ((v1-71 (new-stack-vector0)) + (f0-12 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-71 (-> self control transv) (vector-float*! v1-71 (-> self control dynam gravity-normal) f0-12)) + (let* ((f2-0 (vector-length v1-71)) + (f1-2 f2-0) + (f2-1 (* 0.9 f2-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-12) + (vector-float*! v1-71 v1-71 (/ f2-1 f1-2)) + ) + ) + ) + (suspend) + (let ((v1-74 (ja-group))) + (if (and v1-74 (= v1-74 jakb-jump-loop-ja)) + (ja :num! (loop!)) + (ja :num! (seek!)) + ) + ) + ) + ) + (return #f) + ) + (else + (ja-channel-push! 1 arg1) + (ja :group! jakb-jump-loop-ja) + (while (!= (-> self skel root-channel 0) (-> self skel channel)) + (suspend) + ) + ) + ) + ) + ) + ) + ) + (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) + (let ((s5-1 (current-time))) + (while (or (= arg0 -1) + (and (not (time-elapsed? s5-1 arg0)) (not (logtest? (-> self control status) (collide-status on-surface)))) + ) + (suspend) + (ja :group! jakb-jump-loop-ja :num! (loop!)) + ) + ) + #f + ) + +;; definition for function target-falling-anim-trans +;; WARN: Return type mismatch int vs none. +(defbehavior target-falling-anim-trans target () + (let ((v1-2 (ja-group))) + (cond + ((not (and v1-2 (or (= v1-2 jakb-jump-loop-ja) + (= v1-2 jakb-jump-land-ja) + (= v1-2 jakb-gun-jump-land-ja) + (= v1-2 jakb-gun-jump-land-side-ja) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.33)) + (ja :group! jakb-jump-loop-ja) + ) + ((and (logtest? (-> self control status) (collide-status on-surface)) + (let ((v1-15 (ja-group))) + (and (not (and v1-15 (= v1-15 jakb-jump-land-ja))) + (not (logtest? (-> self control status) (collide-status on-water))) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.02)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim (target-land-anim))) + ) + ((let ((v1-23 (ja-group))) + (and v1-23 (= v1-23 jakb-jump-loop-ja)) + ) + (ja :num! (loop!)) + ) + ((let ((v1-33 (ja-group))) + (and v1-33 + (or (= v1-33 jakb-jump-land-ja) (= v1-33 jakb-gun-jump-land-ja) (= v1-33 jakb-gun-jump-land-side-ja)) + ) + ) + (ja :num! (seek!)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-walk-anim +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Return type mismatch symbol vs none. +(defbehavior target-walk-anim target ((arg0 int)) + (local-vars (sv-16 float)) + (let ((f24-0 0.0) + (f26-0 (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control ctrl-xz-vel)))))) + (f30-0 0.0) + (f28-0 0.0) + (s5-0 #f) + ) + (let ((v1-6 (ja-group))) + (cond + ((and v1-6 (= v1-6 jakb-turn-around-ja)) + (set! f26-0 1.0) + (ja-channel-push! 7 (seconds 0.05)) + ) + ((let ((v1-12 (ja-group))) + (and v1-12 (or (= v1-12 jakb-duck-roll-ja) (= v1-12 jakb-gun-duck-roll-ja))) + ) + (ja-channel-push! 7 (seconds 0.075)) + (set! f26-0 1.0) + ) + ((let ((v1-19 (ja-group))) + (and v1-19 (= v1-19 jakb-attack-from-stance-ja)) + ) + ((lambda :behavior target + () + (let ((f30-0 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control ctrl-xz-vel)))))) + (cond + ((and (rand-vu-percent? 0.3) (and (< 20480.0 (-> self control ctrl-xz-vel)) (zero? (-> self ext-anim)))) + (ja-no-eval :group! jakb-attack-from-stance-alt-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 29.0 0) f30-0)) + ) + (ja-no-eval :group! jakb-attack-from-stance-run-alt-end-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! jakb-attack-from-stance-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 29.0 0) f30-0)) + ) + (ja-no-eval :group! jakb-attack-from-stance-run-end-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (ja-channel-push! 7 (seconds 0.05)) + (none) + ) + ) + (set! f26-0 1.0) + (set! f24-0 30.0) + ) + ((let ((v1-27 (ja-group))) + (and v1-27 (or (= v1-27 jakb-darkjak-get-off-ja) (= v1-27 (-> self draw art-group data 461)))) + ) + (set! f26-0 1.0) + (ja-channel-push! 7 (seconds 0.3)) + ) + ((let ((v1-33 (ja-group))) + (and v1-33 (or (= v1-33 jakb-attack-punch-ja) + (= v1-33 jakb-attack-punch-end-ja) + (= v1-33 jakb-gun-attack-butt-ja) + (= v1-33 jakb-gun-attack-butt-blue-ja) + (= v1-33 (-> self draw art-group data 453)) + (= v1-33 (-> self draw art-group data 460)) + (= v1-33 (-> self draw art-group data 455)) + (= v1-33 jakb-darkjak-attack-combo3-end-ja) + (= v1-33 (-> self draw art-group data 464)) + ) + ) + ) + (set! f26-0 1.0) + (set! f24-0 30.0) + (ja-channel-push! 7 (seconds 0.15)) + ) + ((let ((v1-40 (ja-group))) + (and (and v1-40 + (or (= v1-40 jakb-walk-ja) (= v1-40 jakb-gun-walk-side-ja) (= v1-40 (-> self draw art-group data 442))) + ) + (= (ja-group-size) 7) + ) + ) + (set! f24-0 (ja-aframe-num 0)) + (set! f26-0 (-> self control unknown-float002)) + (set! f30-0 (-> self control unknown-float-n12iuh3n1)) + (set! f28-0 (-> self control unknown-float-ki1jhbn23hj)) + ) + ((let ((v1-50 (ja-group))) + (and v1-50 (= v1-50 jakb-ice-skate-ja)) + ) + (set! f24-0 (ja-aframe-num 0)) + (ja-channel-push! 7 (seconds 0.1)) + ) + ((let ((v1-55 (ja-group))) + (and v1-55 (= v1-55 jakb-wade-shallow-walk-ja)) + ) + (set! f24-0 (ja-aframe-num 0)) + (ja-channel-push! 7 (seconds 0.05)) + ) + ((let ((v1-60 (ja-group))) + (and (or (and v1-60 + (or (= v1-60 jakb-jump-loop-ja) + (= v1-60 jakb-roll-flip-ja) + (= v1-60 jakb-attack-from-jump-end-ja) + (= v1-60 jakb-attack-uppercut-ja) + (= v1-60 jakb-gun-attack-upperbutt-ja) + (= v1-60 jakb-flop-down-land-ja) + ) + ) + (let ((v1-66 (ja-group))) + (and (and v1-66 (or (= v1-66 jakb-jump-ja) (= v1-66 (-> self draw art-group data 444)))) + (< 30.0 (ja-aframe-num 0)) + ) + ) + ) + (< 12288.0 (-> self control ctrl-xz-vel)) + ) + ) + ((lambda :behavior target + () + (let ((gp-0 (ja-group)) + (f30-0 (-> self control ground-impact-vel)) + ) + (let ((v1-7 (ja-group))) + (if (and v1-7 (or (= v1-7 jakb-roll-flip-ja) (= v1-7 jakb-attack-from-jump-end-ja))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-channel-set! 1) + ) + ) + (cond + ((< (if (= gp-0 jakb-jump-ja) + 77824.0 + 102400.0 + ) + f30-0 + ) + (ja-no-eval :group! jakb-run-squash-ja :num! (seek! (ja-aframe 3.0 0) 1.00001) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 3.0 0) 1.00001)) + ) + ) + ((< (if (= gp-0 jakb-jump-ja) + 61440.0 + 102400.0 + ) + f30-0 + ) + (ja-no-eval :group! jakb-run-squash-ja :num! (seek! (ja-aframe 3.0 0) 1.00001) :frame-num (ja-aframe -1.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 3.0 0) 1.00001)) + ) + ) + (else + (ja-no-eval :group! jakb-run-squash-weak-ja :num! (seek! (ja-aframe 4.0 0) 1.00001) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 4.0 0) 1.00001)) + ) + ) + ) + ) + (when (and (using-gun? self) (not (-> self gun charge-active?))) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-run-blue-ja) 16.0 90 60 1.0 0.0 #f) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-run-ja) + 16.0 + 90 + 60 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (/ (* (fmax 20480.0 (-> self control ctrl-xz-vel)) (seconds-per-frame)) + (/ (-> *TARGET-bank* run-up-cycle-dist) (-> *TARGET-bank* run-cycle-length)) + ) + ) + ) + ) + (ja-channel-push! 7 (seconds 0.1)) + (none) + ) + ) + (set! f24-0 30.0) + (set! f26-0 1.0) + ) + ((let ((v1-78 (ja-group))) + (and v1-78 (or (= v1-78 jakb-jump-ja) (= v1-78 (-> self draw art-group data 444)))) + ) + (ja-channel-push! 7 (seconds 0.05)) + (set! s5-0 #t) + ) + (else + (let ((v1-84 (ja-group))) + (cond + ((and v1-84 (= v1-84 jakb-smack-surface-ja)) + (ja-channel-push! 7 (seconds 0.15)) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (set! f24-0 55.0) + (ja-channel-push! 7 (seconds 0.1)) + ) + (else + (ja-channel-push! 7 (seconds 0.05)) + ) + ) + ) + ) + ) + ) + (set! (-> self skel root-channel 3 command) (joint-control-command push)) + (set! (-> self skel root-channel 6 command) (joint-control-command stack)) + (ja :group! jakb-walk-ja) + (let ((f24-1 (ja-aframe f24-0 0))) + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (= (-> self ext-anim) (target-anim dark)) (not (using-gun? self))) + ) + (let ((s4-0 (-> self skel root-channel 0))) + (let ((f0-3 0.0)) + (set! (-> s4-0 frame-interp 1) f0-3) + (set! (-> s4-0 frame-interp 0) f0-3) + ) + (set! (-> s4-0 dist) 12288.0) + (joint-control-channel-group-eval! + s4-0 + (the-as art-joint-anim (-> self draw art-group data 442)) + num-func-identity + ) + (set! (-> s4-0 frame-num) f24-1) + ) + ) + ((and (using-gun? self) (or (= (gun->eco (-> self gun gun-type)) (pickup-type eco-yellow)) + (= (gun->eco (-> self gun gun-type)) (pickup-type eco-blue)) + ) + ) + (let ((s4-1 (-> self skel root-channel 0))) + (let ((f0-5 0.0)) + (set! (-> s4-1 frame-interp 1) f0-5) + (set! (-> s4-1 frame-interp 0) f0-5) + ) + (set! (-> s4-1 dist) 12288.0) + (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim jakb-gun-walk-side-ja) num-func-identity) + (set! (-> s4-1 frame-num) f24-1) + ) + ) + (else + (let ((s4-2 (-> self skel root-channel 0))) + (let ((f0-7 0.0)) + (set! (-> s4-2 frame-interp 1) f0-7) + (set! (-> s4-2 frame-interp 0) f0-7) + ) + (set! (-> s4-2 dist) (-> *TARGET-bank* walk-cycle-dist)) + (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim jakb-walk-ja) num-func-identity) + (set! (-> s4-2 frame-num) f24-1) + ) + ) + ) + (let ((s4-3 (-> self skel root-channel 1))) + (let ((f0-9 0.0)) + (set! (-> s4-3 frame-interp 1) f0-9) + (set! (-> s4-3 frame-interp 0) f0-9) + ) + (set! (-> s4-3 dist) (-> *TARGET-bank* walk-down-cycle-dist)) + (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim jakb-walk-down-ja) num-func-identity) + (set! (-> s4-3 frame-num) f24-1) + ) + (let ((s4-4 (-> self skel root-channel 2))) + (let ((f0-11 0.0)) + (set! (-> s4-4 frame-interp 1) f0-11) + (set! (-> s4-4 frame-interp 0) f0-11) + ) + (set! (-> s4-4 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (joint-control-channel-group-eval! s4-4 (the-as art-joint-anim jakb-walk-left-ja) num-func-identity) + (set! (-> s4-4 frame-num) f24-1) + ) + (let ((s4-5 (-> self skel root-channel 4))) + (let ((f0-13 0.0)) + (set! (-> s4-5 frame-interp 1) f0-13) + (set! (-> s4-5 frame-interp 0) f0-13) + ) + (set! (-> s4-5 dist) (-> *TARGET-bank* run-down-cycle-dist)) + (joint-control-channel-group-eval! s4-5 (the-as art-joint-anim jakb-run-down-ja) num-func-identity) + (set! (-> s4-5 frame-num) f24-1) + ) + (let ((s4-6 (-> self skel root-channel 5))) + (let ((f0-15 0.0)) + (set! (-> s4-6 frame-interp 1) f0-15) + (set! (-> s4-6 frame-interp 0) f0-15) + ) + (set! (-> s4-6 dist) (-> *TARGET-bank* run-side-cycle-dist)) + (joint-control-channel-group-eval! s4-6 (the-as art-joint-anim jakb-run-left-ja) num-func-identity) + (set! (-> s4-6 frame-num) f24-1) + ) + (cond + ((using-gun? self) + (let ((s4-7 (-> self skel root-channel 3))) + (let ((f0-17 0.0)) + (set! (-> s4-7 frame-interp 1) f0-17) + (set! (-> s4-7 frame-interp 0) f0-17) + ) + (set! (-> s4-7 dist) (-> *TARGET-bank* run-cycle-dist)) + (joint-control-channel-group-eval! s4-7 (the-as art-joint-anim jakb-gun-front-run-ja) num-func-identity) + (set! (-> s4-7 frame-num) f24-1) + ) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (let ((s4-8 (-> self skel root-channel 3))) + (let ((f0-19 0.0)) + (set! (-> s4-8 frame-interp 1) f0-19) + (set! (-> s4-8 frame-interp 0) f0-19) + ) + (set! (-> s4-8 dist) 27033.6) + (joint-control-channel-group-eval! + s4-8 + (the-as art-joint-anim (-> self draw art-group data 443)) + num-func-identity + ) + (set! (-> s4-8 frame-num) f24-1) + ) + ) + (else + (let ((s4-9 (-> self skel root-channel 3))) + (let ((f0-21 0.0)) + (set! (-> s4-9 frame-interp 1) f0-21) + (set! (-> s4-9 frame-interp 0) f0-21) + ) + (set! (-> s4-9 dist) (-> *TARGET-bank* run-cycle-dist)) + (joint-control-channel-group-eval! s4-9 (the-as art-joint-anim jakb-run-ja) num-func-identity) + (set! (-> s4-9 frame-num) f24-1) + ) + ) + ) + ) + (let ((s4-10 (current-time)) + (f24-2 (if (and (using-gun? self) (or (= (gun->eco (-> self gun gun-type)) (pickup-type eco-yellow)) + (= (gun->eco (-> self gun gun-type)) (pickup-type eco-blue)) + ) + ) + 0.0 + 1.0 + ) + ) + ) + (until (and (>= arg0 0) (time-elapsed? s4-10 arg0)) + (let ((f20-0 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control local-slope-z))))) + (f22-1 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) + ) + (set! sv-16 (fabs (deg-diff (quaternion-y-angle (-> self control dir-targ)) (y-angle (-> self control))))) + (set! f26-0 (seek + f26-0 + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control ctrl-xz-vel))))) + (* 2.0 (seconds-per-frame)) + ) + ) + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (set! f26-0 + (seek f26-0 (lerp-scale f26-0 (* 0.7 f26-0) sv-16 1820.4445 3640.889) (* 2.0 (seconds-per-frame))) + ) + ) + (cond + ((< 0.5 f26-0) + (let ((v1-211 (-> self skel effect))) + (set! (-> v1-211 channel-offset) 3) + ) + 0 + (logclear! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + ) + (else + (let ((v1-216 (-> self skel effect))) + (set! (-> v1-216 channel-offset) 0) + ) + 0 + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + ) + ) + (let ((f0-37 (fabs (- f20-0 f30-0)))) + (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-37))))) + ) + (let ((f0-42 (fabs (- f22-1 f28-0)))) + (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (* 0.25 f0-42))))) + ) + ) + (set! (-> self control unknown-float-n12iuh3n1) f30-0) + (set! (-> self control unknown-float-ki1jhbn23hj) f28-0) + (set! (-> self control unknown-float002) f26-0) + (cond + ((>= f30-0 0.0) + (let ((v1-233 (-> self skel root-channel 1))) + (let ((f0-48 (* (fabs f30-0) f24-2))) + (set! (-> v1-233 frame-interp 1) f0-48) + (set! (-> v1-233 frame-interp 0) f0-48) + ) + (set! (-> v1-233 dist) (-> *TARGET-bank* walk-up-cycle-dist)) + (set! (-> v1-233 frame-group) (the-as art-joint-anim jakb-walk-up-ja)) + ) + (let ((v1-236 (-> self skel root-channel 4))) + (let ((f0-50 (fabs f30-0))) + (set! (-> v1-236 frame-interp 1) f0-50) + (set! (-> v1-236 frame-interp 0) f0-50) + ) + (set! (-> v1-236 dist) (-> *TARGET-bank* run-up-cycle-dist)) + (set! (-> v1-236 frame-group) (the-as art-joint-anim jakb-run-up-ja)) + ) + ) + (else + (let ((v1-239 (-> self skel root-channel 1))) + (let ((f0-53 (* (fabs f30-0) f24-2))) + (set! (-> v1-239 frame-interp 1) f0-53) + (set! (-> v1-239 frame-interp 0) f0-53) + ) + (set! (-> v1-239 dist) (-> *TARGET-bank* walk-down-cycle-dist)) + (set! (-> v1-239 frame-group) (the-as art-joint-anim jakb-walk-down-ja)) + ) + (let ((v1-242 (-> self skel root-channel 4))) + (let ((f0-55 (fabs f30-0))) + (set! (-> v1-242 frame-interp 1) f0-55) + (set! (-> v1-242 frame-interp 0) f0-55) + ) + (set! (-> v1-242 dist) (-> *TARGET-bank* run-down-cycle-dist)) + (set! (-> v1-242 frame-group) (the-as art-joint-anim jakb-run-down-ja)) + ) + ) + ) + (cond + ((>= f28-0 0.0) + (let ((v1-245 (-> self skel root-channel 2))) + (let ((f0-59 (* (fabs f28-0) f24-2))) + (set! (-> v1-245 frame-interp 1) f0-59) + (set! (-> v1-245 frame-interp 0) f0-59) + ) + (set! (-> v1-245 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (set! (-> v1-245 frame-group) (the-as art-joint-anim jakb-walk-right-ja)) + ) + (let ((v1-248 (-> self skel root-channel 5))) + (let ((f0-61 (fabs f28-0))) + (set! (-> v1-248 frame-interp 1) f0-61) + (set! (-> v1-248 frame-interp 0) f0-61) + ) + (set! (-> v1-248 dist) (-> *TARGET-bank* run-side-cycle-dist)) + (set! (-> v1-248 frame-group) (the-as art-joint-anim jakb-run-right-ja)) + ) + ) + (else + (let ((v1-251 (-> self skel root-channel 2))) + (let ((f0-64 (* (fabs f28-0) f24-2))) + (set! (-> v1-251 frame-interp 1) f0-64) + (set! (-> v1-251 frame-interp 0) f0-64) + ) + (set! (-> v1-251 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (set! (-> v1-251 frame-group) (the-as art-joint-anim jakb-walk-left-ja)) + ) + (let ((v1-254 (-> self skel root-channel 5))) + (let ((f0-66 (fabs f28-0))) + (set! (-> v1-254 frame-interp 1) f0-66) + (set! (-> v1-254 frame-interp 0) f0-66) + ) + (set! (-> v1-254 dist) (-> *TARGET-bank* run-side-cycle-dist)) + (set! (-> v1-254 frame-group) (the-as art-joint-anim jakb-run-left-ja)) + ) + ) + ) + (let ((v1-257 (-> self skel root-channel 6))) + (set! (-> v1-257 frame-interp 1) f26-0) + (set! (-> v1-257 frame-interp 0) f26-0) + ) + (let* ((f1-14 (* (current-cycle-distance (-> self skel)) (-> self control scale x))) + (f0-70 (/ (-> self control ctrl-xz-vel) (* 60.0 (/ f1-14 (-> *TARGET-bank* run-cycle-length))))) + ) + (ja :num! (loop! f0-70)) + ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (ja :chan 3 :num! (chan 0)) + (ja :chan 4 :num! (chan 0)) + (ja :chan 5 :num! (chan 0)) + (if (and s5-0 (!= (-> self skel root-channel 0) (-> self skel channel))) + (ja-blend-eval) + ) + (suspend) + ) + ) + ) + (none) + ) + +;; definition for function target-hit-ground-flop-anim +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-hit-ground-flop-anim target ((arg0 symbol) (arg1 symbol)) + (let ((f30-0 (if (= arg0 'swim) + 0.4 + 1.0 + ) + ) + ) + (if (using-gun? self) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-flop-down-land-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-channel-set! 1) + (let ((s5-0 (-> self skel root-channel 0))) + (set! (-> s5-0 frame-group) (the-as art-joint-anim jakb-flop-down-land-ja)) + (set! (-> s5-0 param 0) + (the float (+ (-> (the-as art-joint-anim jakb-flop-down-land-ja) frames num-frames) -1)) + ) + (let ((f30-1 (seek f30-0 1.0 (* 0.5 (seconds-per-frame))))) + (set! (-> s5-0 param 1) f30-1) + (set! (-> s5-0 frame-num) 0.0) + (joint-control-channel-group! s5-0 (the-as art-joint-anim jakb-flop-down-land-ja) num-func-seek!) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (if arg1 + (align-opts adjust-y-vel) + (align-opts adjust-y-vel adjust-xz-vel) + ) + 1.0 + 1.0 + 1.5 + ) + (when (and (>= 25.0 (ja-aframe-num 0)) + (and (>= (ja-aframe-num 0) 21.0) + (and (-> self next-state) (= (-> self next-state name) 'target-flop-hit-ground)) + (!= (-> self tobot?) 'tobot) + (!= (-> self control unknown-spool-anim00) 'stuck) + ) + ) + (when (and (cpad-hold? (-> self control cpad number) x) (can-jump? #f) (!= (-> self control ground-pat event) 7)) + (let ((v1-55 (new-stack-vector0))) + (let ((f0-8 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-55 (-> self control transv) (vector-float*! v1-55 (-> self control dynam gravity-normal) f0-8)) + ) + (let* ((f0-9 (vector-length v1-55)) + (f1-3 f0-9) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-55 v1-55 (/ f0-9 f1-3)) + ) + ) + ) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.4))) + (if (using-gun? self) + (go + target-high-jump + (-> *TARGET-bank* flop-jump-height-min) + (-> *TARGET-bank* flop-jump-height-max) + (if arg1 + 'flop + 'flop-forward + ) + ) + (go + target-duck-high-jump + (-> *TARGET-bank* flop-jump-height-min) + (-> *TARGET-bank* flop-jump-height-max) + (if arg1 + 'flop + 'flop-forward + ) + ) + ) + ) + ) + (suspend) + (let ((s5-1 (-> self skel root-channel 0))) + (set! (-> s5-1 param 0) (the float (+ (-> s5-1 frame-group frames num-frames) -1))) + (set! f30-1 (seek f30-1 1.0 (* 0.5 (seconds-per-frame)))) + (set! (-> s5-1 param 1) f30-1) + (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-hit-ground-anim +;; WARN: Function target-hit-ground-anim has a return type of none, but the expression builder found a return statement. +(defbehavior target-hit-ground-anim target ((arg0 symbol) (arg1 symbol)) + (cond + ((logtest? (water-flag swimming) (-> self water flags)) + ) + ((let ((v1-5 (ja-group))) + (and v1-5 (or (= v1-5 jakb-flop-down-ja) + (= v1-5 jakb-flop-down-loop-ja) + (= v1-5 jakb-moving-flop-down-ja) + (= v1-5 jakb-moving-flop-down-loop-ja) + ) + ) + ) + (target-hit-ground-flop-anim arg0 arg1) + ) + ((and (= (-> self control ground-pat material) (pat-material ice)) (< 16384.0 (-> self control ctrl-xz-vel))) + ) + ((and (= (-> self ext-anim) (target-anim light)) (let ((v1-23 (ja-group))) + (and v1-23 (or (= v1-23 jakb-lightjak-swoop1-ja) + (= v1-23 jakb-lightjak-swoop2-ja) + (= v1-23 jakb-lightjak-swoop-fall-ja) + (= v1-23 jakb-lightjak-swoop-fall-loop-ja) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-swoop-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((and (= (-> self ext-anim) (target-anim light)) + (let ((v1-55 (ja-group))) + (and v1-55 (or (= v1-55 jakb-lightjak-freeze-ja) (= v1-55 jakb-lightjak-heal-loop-ja))) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-swoop-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-84 (ja-group))) + (or (and v1-84 + (or (= v1-84 jakb-jump-loop-ja) (= v1-84 (-> self draw art-group data 444)) (= v1-84 jakb-flop-jump-ja)) + ) + (let ((v1-90 (ja-group))) + (and (and v1-90 (= v1-90 jakb-jump-ja)) + (or (>= (ja-aframe-num 0) 38.0) (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + ) + ) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-push! 1 (seconds 0.02)) + (let ((a1-14 (target-land-anim))) + (ja-no-eval :group! a1-14 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (let ((v1-110 (ja-group))) + (if (or (and (and v1-110 (or (= v1-110 jakb-gun-jump-land-ja) (= v1-110 jakb-gun-jump-land-side-ja))) + (not (using-gun? self)) + ) + (let ((v1-117 (ja-group))) + (and (and v1-117 (= v1-117 jakb-jump-land-ja)) (and (>= (ja-aframe-num 0) 60.0) (using-gun? self))) + ) + ) + (goto cfg-108) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (label cfg-108) + ) + ((let ((v1-134 (ja-group))) + (and (and v1-134 (or (= v1-134 jakb-jump-ja) (= v1-134 (-> self draw art-group data 444)))) + (>= (ja-aframe-num 0) 35.0) + (not (using-gun? self)) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-set! 1) + (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 50.0 0)) + (until (ja-done? 0) + (if (and (using-gun? self) (>= (ja-aframe-num 0) 60.0)) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-196 (ja-group))) + (and v1-196 + (or (= v1-196 jakb-jump-ja) (= v1-196 jakb-duck-high-jump-ja) (= v1-196 (-> self draw art-group data 444))) + ) + ) + ((lambda :behavior target + () + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-set! 1) + (cond + ((using-gun? self) + (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek! (ja-aframe 41.0 0)) :frame-num (ja-aframe 38.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 41.0 0))) + ) + (ja-no-eval :num! (seek! 0.0)) + (ja-channel-push! 1 (seconds 0.1)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-red) (pickup-type eco-dark)) + (ja-no-eval :group! jakb-gun-jump-land-ja :num! (seek!) :frame-num (ja-aframe 64.0 0)) + (until (ja-done? 0) + (ja-blend-eval) + (if (not (using-gun? self)) + (goto cfg-19) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-gun-jump-land-side-ja :num! (seek!) :frame-num (ja-aframe 64.0 0)) + (until (ja-done? 0) + (ja-blend-eval) + (if (not (using-gun? self)) + (goto cfg-19) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (label cfg-19) + ) + (else + (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek!) :frame-num (ja-aframe 38.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 50.0 0)) + (until (ja-done? 0) + (if (and (using-gun? self) (>= (ja-aframe-num 0) 60.0)) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (none) + ) + ) + ) + ((let ((v1-202 (ja-group))) + (and v1-202 + (or (= v1-202 jakb-hit-from-front-ja) (= v1-202 jakb-hit-from-front-alt1-ja) (= v1-202 jakb-hit-from-back-ja)) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (let* ((v1-210 (ja-group)) + (f30-0 (if (and v1-210 (= v1-210 jakb-hit-from-back-ja)) + 24576.0 + -24576.0 + ) + ) + ) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek!) :frame-num (ja-aframe 38.0 0)) + (until (ja-done? 0) + (set-forward-vel f30-0) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 50.0 0)) + (until (ja-done? 0) + (if (and (using-gun? self) (>= (ja-aframe-num 0) 60.0)) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-267 (ja-group))) + (and v1-267 + (or (= v1-267 jakb-jump-ja) + (= v1-267 (-> self draw art-group data 444)) + (= v1-267 jakb-attack-from-jump-ja) + (= v1-267 jakb-attack-from-jump-loop-ja) + (= v1-267 jakb-attack-from-jump-end-ja) + (= v1-267 jakb-flop-down-land-ja) + (= v1-267 jakb-attack-uppercut-ja) + (= v1-267 jakb-gun-attack-upperbutt-ja) + (= v1-267 jakb-gun-attack-upperbutt-blue-ja) + (= v1-267 jakb-board-get-off-ja) + ) + ) + ) + ((lambda :behavior target + () + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-push! 1 (seconds 0.04)) + (cond + ((using-gun? self) + (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek! (ja-aframe 41.0 0)) :frame-num (ja-aframe 38.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 41.0 0))) + ) + (ja-no-eval :num! (seek! 0.0)) + (ja-channel-push! 1 (seconds 0.1)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-red) (pickup-type eco-dark)) + (ja-no-eval :group! jakb-gun-jump-land-ja :num! (seek!) :frame-num (ja-aframe 64.0 0)) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-gun-jump-land-side-ja :num! (seek!) :frame-num (ja-aframe 64.0 0)) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-no-eval :group! (-> self draw art-group data 445) :num! (seek!) :frame-num (ja-aframe 42.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 42.0 0)) + (until (ja-done? 0) + (if (and (using-gun? self) (>= (ja-aframe-num 0) 60.0)) + (return #f) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (none) + ) + ) + ) + ((let ((v1-273 (ja-group))) + (and v1-273 (or (= v1-273 jakb-carry-jump-ja) (= v1-273 jakb-carry-jump-loop-ja))) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! jakb-carry-jump-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-304 (ja-group))) + (and v1-304 (or (= v1-304 jakb-jump-land-ja) + (= v1-304 jakb-gun-jump-land-ja) + (= v1-304 jakb-gun-jump-land-side-ja) + (= v1-304 jakb-carry-jump-land-ja) + (= v1-304 jakb-mech-jump-land-ja) + (= v1-304 jakb-mech-carry-jump-land-ja) + ) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-320 (ja-group))) + (and v1-320 + (or (= v1-320 jakb-mech-jump-ja) (= v1-320 jakb-mech-jump-loop-ja) (= v1-320 jakb-mech-hit-front-ja)) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (ja-channel-push! 1 (seconds 0.017)) + (ja-no-eval :group! jakb-mech-jump-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-351 (ja-group))) + (and v1-351 (or (= v1-351 jakb-mech-carry-jump-ja) (= v1-351 jakb-mech-carry-jump-loop-ja))) + ) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (let ((v1-358 (ja-group))) + (if (and v1-358 (= v1-358 jakb-mech-carry-jump-loop-ja)) + (ja-channel-set! 1) + (ja-channel-push! 1 (seconds 0.04)) + ) + ) + (ja-no-eval :group! jakb-mech-carry-jump-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (none) + ) + +;; definition for function target-attack-air-anim +;; WARN: Return type mismatch symbol vs none. +(defbehavior target-attack-air-anim target () + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-ja) + 0.0 + 30 + 30 + 0.6 + 0.0 + #f + ) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-ja) + 3.0 + 30 + 30 + 0.5 + 0.0 + #f + ) + ) + ) + ) + (set! (-> self control unknown-float41) 0.0) + (set! (-> self control unknown-float42) 0.0) + (ja-channel-push! 1 (seconds 0.075)) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + (ja-no-eval :group! jakb-attack-from-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + (ja :group! jakb-attack-from-jump-loop-ja :num! min) + (let ((f30-0 -393216.0)) + (let ((f0-11 (target-height-above-ground)) + (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (while (not (or (and (< (fabs (/ f0-11 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (time-elapsed? (-> self state-time) (seconds 1.7)) + ) + ) + (quaternion-rotate-y! + (-> self control quat-for-control) + (-> self control quat-for-control) + (* f30-0 (seconds-per-frame)) + ) + (suspend) + (ja :num! (loop!)) + (set! f0-11 (target-height-above-ground)) + (set! f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + ) + (ja-no-eval :group! jakb-attack-from-jump-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (cond + ((< (ja-aframe-num 0) 32.0) + (quaternion-rotate-y! + (-> self control quat-for-control) + (-> self control quat-for-control) + (* f30-0 (seconds-per-frame)) + ) + ) + (else + (let ((f0-25 + (deg-diff + (quaternion-y-angle (-> self control quat-for-control)) + (quaternion-y-angle (-> self control dir-targ)) + ) + ) + ) + (quaternion-rotate-y! + (-> self control quat-for-control) + (-> self control quat-for-control) + (* -0.2 (fabs f0-25)) + ) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (none) + ) + +;; definition for function target-edge-grab-anim +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-edge-grab-anim target ((arg0 float)) + (ja-channel-push! 1 (seconds 0.15)) + (ja :group! jakb-falling-to-edge-grab-ja :num! min) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-set! 1) + (until #f + (ja-no-eval :group! jakb-edge-grab-stance0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (can-play-stance-amibent?) + (suspend) + (ja :num! (seek!)) + ) + (+! (-> self anim-seed) 1) + (ja-no-eval :group! jakb-edge-grab-stance1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (can-play-stance-amibent?) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc new file mode 100644 index 00000000000..ce18f3ea191 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc @@ -0,0 +1,3146 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *auto-continue*, type symbol +(define *auto-continue* #f) + +;; definition for function next-continue +;; WARN: Return type mismatch object vs continue-point. +(defun next-continue ((arg0 continue-point)) + (let* ((v1-0 #f) + (a1-0 *level-load-list*) + (a2-0 (car a1-0)) + ) + (while (not (null? a1-0)) + (let* ((a2-2 (-> (the-as level-load-info (-> (the-as symbol a2-0) value)) continues)) + (a3-0 (car a2-2)) + ) + (while (not (null? a2-2)) + (if (and v1-0 (logtest? (continue-flags continue-flag-16) (-> (the-as continue-point a3-0) flags))) + (return (the-as continue-point a3-0)) + ) + (if (= a3-0 arg0) + (set! v1-0 #t) + ) + (set! a2-2 (cdr a2-2)) + (set! a3-0 (car a2-2)) + ) + ) + (set! a1-0 (cdr a1-0)) + (set! a2-0 (car a1-0)) + ) + ) + (the-as continue-point #f) + ) + +;; definition for function arrive-at-continue +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior arrive-at-continue target ((arg0 continue-point)) + (cond + ((logtest? (-> arg0 flags) (continue-flags title)) + enter-state + #t + (go target-title) + ) + ((logtest? (-> arg0 flags) (continue-flags title-movie)) + enter-state + (go target-title) + ) + ((logtest? (-> arg0 flags) (continue-flags intro)) + (pre-intro-play) + ) + ((logtest? (-> arg0 flags) (continue-flags hero-mode)) + (when (string= (-> arg0 name) "intro-start-hero") + (logior! (-> self game secrets) (game-secrets hero-mode)) + (logior! (-> self game purchase-secrets) (game-secrets hero-mode)) + ) + (intro-play) + ) + ((logtest? (-> arg0 flags) (continue-flags warp-gate)) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 0.05)) + (suspend) + ) + ) + (let ((s5-1 (new 'static 'vector)) + (a2-0 (find-nearest-entity (-> arg0 trans) warp-gate)) + ) + (when a2-0 + (set! (-> s5-1 quad) (-> a2-0 extra trans quad)) + (+! (-> s5-1 y) 9011.2) + (go target-warp-in s5-1 (-> arg0 trans)) + ) + ) + ) + ((logtest? (continue-flags pilot-dax) (-> arg0 flags)) + (go target-indax-start (the-as handle #f) (if (logtest? (continue-flags cf27) (-> arg0 flags)) + 'hang + #t + ) + ) + ) + ((logtest? (continue-flags cf23) (-> arg0 flags)) + (go target-flut-start (the-as handle #f) 'normal -1) + ) + ((logtest? (continue-flags cf24) (-> arg0 flags)) + (go target-flut-start (the-as handle #f) 'racer -1) + ) + ((logtest? (continue-flags cf28) (-> arg0 flags)) + (go target-flut-start (the-as handle #f) 'fight -1) + ) + ((logtest? (continue-flags cf31) (-> arg0 flags)) + (send-event self 'get-pickup (pickup-type eco-pill-light) 100.0) + (case (-> arg0 vehicle-type) + ((38) + (go target-lightjak-get-on (lightjak-stage ls0 ls2 swoop ls7)) + ) + (else + (go target-lightjak-get-on (lightjak-stage ls0 ls2 ls7)) + ) + ) + ) + ((logtest? (-> arg0 flags) (continue-flags demo-movie)) + (send-event self 'get-pickup (pickup-type eco-pill-dark) 100.0) + (go target-darkjak-get-on (darkjak-stage force-on bomb0 ds9)) + ) + ((logtest? (continue-flags cf25) (-> arg0 flags)) + (label cfg-39) + (let* ((v1-77 (-> arg0 vehicle-type)) + (s5-2 + (cond + ((= v1-77 7) + (process->handle (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 bt-gun-manager)))) + ) + ((= v1-77 14) + (process->handle + (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 scorpion-gun-manager))) + ) + ) + (else + (process->handle (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 target-turret)))) + ) + ) + ) + ) + (when (not (handle->process s5-2)) + (suspend) + (goto cfg-39) + ) + (suspend) + (case (-> arg0 vehicle-type) + ((14) + (send-event (handle->process s5-2) 'restart) + ) + ) + (send-event (handle->process s5-2) 'pickup) + ) + ) + ((logtest? (continue-flags cf30) (-> arg0 flags)) + (label cfg-84) + (let ((gp-1 (process->handle + (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 scorpion-gun-manager))) + ) + ) + ) + (when (not (handle->process gp-1)) + (suspend) + (goto cfg-84) + ) + (suspend) + (send-event (handle->process gp-1) 'restart) + (when (not (send-event (handle->process gp-1) 'pickup)) + (suspend) + 0 + ) + ) + ) + ((logtest? (continue-flags cf29) (-> arg0 flags)) + (label cfg-114) + (let ((gp-2 (process->handle (search-process-tree *active-pool* (lambda ((arg0 process)) (type? arg0 htorpedo)))))) + (when (not (handle->process gp-2)) + (suspend) + (goto cfg-114) + ) + (suspend) + (set-blackout-frames (seconds 10)) + (send-event self 'change-mode 'pilot-daxter (handle->process gp-2)) + ) + ) + ((logtest? (continue-flags record-sig) (-> arg0 flags)) + (go target-mech-start (the-as handle #f) 100.0 #t) + ) + ((logtest? (continue-flags test) (-> arg0 flags)) + ) + ((logtest? (continue-flags pilot) (-> arg0 flags)) + (case (-> arg0 vehicle-type) + ((41) + (go target-credits 1) + ) + ((42) + (go target-credits 2) + ) + ((43) + (go target-credits 3) + ) + (else + (go target-credits 0) + ) + ) + ) + ((and (logtest? (continue-flags record-path) (-> arg0 flags)) (!= (-> arg0 vehicle-type) 27)) + (set! (-> self mode-cache) (the-as basic 'pilot)) + (set! (-> self mode-param1) (the-as handle #f)) + (set! (-> self mode-param2) (-> arg0 vehicle-type)) + (when (= (-> arg0 vehicle-type) 28) + (let ((v1-172 (cond + ((have-vehicle-v-type? (the-as int (-> self game current-vehicle))) + (the-as int (-> self game current-vehicle)) + ) + ((have-vehicle-v-type? 13) + 13 + ) + ((have-vehicle-v-type? 12) + 12 + ) + ((have-vehicle-v-type? 14) + 14 + ) + ((have-vehicle-v-type? 15) + 15 + ) + ) + ) + ) + (set! (-> self mode-param2) (the-as uint v1-172)) + ) + ) + (set! (-> self mode-param3) (the-as uint #t)) + ) + ((logtest? (-> arg0 flags) (continue-flags demo-end)) + (go target-grab 'stance) + ) + (else + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 0.05)) + (suspend) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function apply-pos-from-entity +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior apply-pos-from-entity target ((arg0 continue-point)) + (local-vars (sv-1328 collide-query)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s1-0 (entity-by-name (the-as string (-> arg0 on-goto))))) + (cond + (s1-0 + (entity-birth-no-kill s1-0) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'apply-pos-from-entity) + (let ((t9-2 send-event-function) + (v1-2 s1-0) + ) + (t9-2 + (if v1-2 + (-> v1-2 extra process) + ) + a1-0 + ) + ) + ) + (let ((s0-0 (-> s1-0 extra perm))) + (logior! (-> s0-0 status) (entity-perm-status bit-5)) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'matrix)) + ) + (set! (-> s2-0 x) (* 4096.0 (the float (-> s0-0 user-int16 0)))) + (set! (-> s2-0 y) (-> s1-0 extra trans y)) + (set! (-> s2-0 z) (* 4096.0 (the float (-> s0-0 user-int16 1)))) + (set! sv-1328 (new 'stack-no-clear 'collide-query)) + (set-vector! (-> sv-1328 move-dist) 0.0 -204800.0 0.0 1.0) + (set! (-> sv-1328 start-pos quad) (-> s2-0 quad)) + (+! (-> sv-1328 start-pos y) 102400.0) + (let ((v1-20 sv-1328)) + (set! (-> v1-20 radius) 409.6) + (set! (-> v1-20 collide-with) (collide-spec backgnd)) + (set! (-> v1-20 ignore-process0) #f) + (set! (-> v1-20 ignore-process1) #f) + (set! (-> v1-20 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-20 action-mask) (collide-action solid)) + ) + (let ((f0-12 (fill-and-probe-using-line-sphere *collide-cache* sv-1328))) + (cond + ((>= f0-12 0.0) + (let ((v1-22 s2-0)) + (let ((a0-15 (-> sv-1328 start-pos))) + (let ((a1-3 (-> sv-1328 move-dist))) + (let ((a2-0 f0-12)) + (.mov vf7 a2-0) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> a0-15 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-22 quad) vf6) + ) + (set! (-> s2-0 y) (+ 4096.0 (-> s2-0 y))) + ) + (else + (format 0 "failed to find gem ground on pos-from-entity~%") + ) + ) + ) + (set! (-> s3-0 x) (* 4096.0 (the float (-> s0-0 user-int16 2)))) + (set! (-> s3-0 y) (-> s1-0 extra trans y)) + (set! (-> s3-0 z) (* 4096.0 (the float (-> s0-0 user-int16 3)))) + (let ((s1-1 (new 'stack-no-clear 'collide-query))) + (set-vector! (-> s1-1 move-dist) 0.0 -204800.0 0.0 1.0) + (set! (-> s1-1 start-pos quad) (-> s3-0 quad)) + (+! (-> s1-1 start-pos y) 102400.0) + (let ((v1-33 s1-1)) + (set! (-> v1-33 radius) 409.6) + (set! (-> v1-33 collide-with) (collide-spec backgnd)) + (set! (-> v1-33 ignore-process0) #f) + (set! (-> v1-33 ignore-process1) #f) + (set! (-> v1-33 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-33 action-mask) (collide-action solid)) + ) + (let ((f0-27 (fill-and-probe-using-line-sphere *collide-cache* s1-1))) + (cond + ((>= f0-27 0.0) + (let ((a0-26 s3-0)) + (let ((v1-35 (-> s1-1 start-pos))) + (let ((a1-6 (-> s1-1 move-dist))) + (let ((a2-1 f0-27)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-6 quad)) + ) + (.lvf vf4 (&-> v1-35 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-26 quad) vf6) + ) + (set! (-> s3-0 y) (+ 4096.0 (-> s3-0 y))) + ) + (else + (format 0 "failed to find jak ground on pos-from-entity~%") + ) + ) + ) + ) + (set! (-> arg0 trans quad) (-> s3-0 quad)) + (vector-! s4-0 s3-0 s2-0) + (set! (-> s4-0 y) 16384.0) + (vector+! (-> arg0 camera-trans) s4-0 s3-0) + (vector-negate! s4-0 s4-0) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (let ((s3-1 (new 'stack-no-clear 'quaternion))) + (quaternion-from-two-vectors! s3-1 (new 'static 'vector :z 1.0) s4-0) + (quaternion->matrix s5-0 s3-1) + (set-vector! + (-> arg0 quat) + (the int (* 32767.0 (-> s3-1 x))) + (the int (* 32767.0 (-> s3-1 y))) + (the int (* 32767.0 (-> s3-1 z))) + (the int (* 32767.0 (-> s3-1 w))) + ) + ) + (set! (-> arg0 camera-rot 0) (the int (* 32767.0 (-> s5-0 rvec x)))) + (set! (-> arg0 camera-rot 1) (the int (* 32767.0 (-> s5-0 rvec y)))) + (set! (-> arg0 camera-rot 2) (the int (* 32767.0 (-> s5-0 rvec z)))) + (set! (-> arg0 camera-rot 3) (the int (* 32767.0 (-> s5-0 uvec x)))) + (set! (-> arg0 camera-rot 4) (the int (* 32767.0 (-> s5-0 uvec y)))) + (set! (-> arg0 camera-rot 5) (the int (* 32767.0 (-> s5-0 uvec z)))) + (set! (-> arg0 camera-rot 6) (the int (* 32767.0 (-> s5-0 fvec x)))) + (set! (-> arg0 camera-rot 7) (the int (* 32767.0 (-> s5-0 fvec y)))) + (set! (-> arg0 camera-rot 8) (the int (* 32767.0 (-> s5-0 fvec z)))) + ) + ) + (let ((t9-11 quaternion-copy!) + (a0-46 (-> self control quat-for-control)) + (a1-12 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> a1-12 x) (* 0.00003051851 (the float (-> arg0 quat x)))) + (set! (-> a1-12 y) (* 0.00003051851 (the float (-> arg0 quat y)))) + (set! (-> a1-12 z) (* 0.00003051851 (the float (-> arg0 quat z)))) + (set! (-> a1-12 w) (* 0.00003051851 (the float (-> arg0 quat w)))) + (t9-11 a0-46 a1-12) + ) + (move-to-point! (-> self control) (-> arg0 trans)) + (rot->dir-targ! (-> self control)) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + ) + (else + (format 0 "ERROR: failed to find '~S' for pos-from-entity~%" (-> arg0 on-goto)) + ) + ) + ) + (none) + ) + ) + +;; definition for function target-continue-init-art +;; WARN: Return type mismatch int vs none. +(defbehavior target-continue-init-art target () + (let ((a1-0 (target-skel-group)) + (gp-0 (new 'stack-no-clear 'lod-set)) + ) + (setup-lods! gp-0 a1-0 (-> self draw art-group) (-> self entity)) + (lods-assign! (-> self draw) gp-0) + ) + (let ((gp-1 (target-skel-group))) + (when (-> gp-1 clothing) + (when (not (-> self draw cloth-instances)) + (set! (-> self draw cloth-instances) (new 'process 'boxed-array cloth-on-skeleton (-> gp-1 clothing length))) + (set! (-> self draw cloth-instances length) (-> self draw cloth-instances allocated-length)) + (dotimes (s5-0 (-> gp-1 clothing length)) + (set! (-> self draw cloth-instances s5-0) (new 'process 'cloth-on-skeleton)) + ) + ) + (case (-> self ext-geo) + (((target-geo jakc)) + (dotimes (s5-1 (-> gp-1 clothing length)) + (cloth-base-method-10 (-> self draw cloth-instances s5-1) (-> gp-1 clothing s5-1) (process->handle self)) + (logior! (-> self draw cloth-instances s5-1 flags) (cloth-flag need-reset active)) + ) + ) + (else + (dotimes (v1-41 (-> gp-1 clothing length)) + (logclear! (-> self draw cloth-instances v1-41 flags) (cloth-flag active)) + ) + ) + ) + ) + ) + (case (-> self ext-geo) + (((target-geo jakc)) + (set! (-> self draw shadow) + (the-as + shadow-geo + (-> self + draw + art-group + data + (-> (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar-c" (the-as (pointer level) #f))) shadow) + ) + ) + ) + ) + (((target-geo jakb)) + (set! (-> self draw shadow) + (the-as + shadow-geo + (-> self + draw + art-group + data + (-> (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar-normal" (the-as (pointer level) #f))) + shadow + ) + ) + ) + ) + ) + (else + (set! (-> self draw shadow) #f) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-continue (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (case message + (('change-mode) + (case (-> block param 0) + (('grab 'look-around) + #f + ) + (else + (set! (-> self mode-cache) (the-as basic (-> block param 0))) + (set! (-> self mode-param1) (if (>= argc 2) + (process->handle (the-as process (-> block param 1))) + (the-as handle #f) + ) + ) + (set! (-> self mode-param2) (-> block param 2)) + (set! v0-0 (-> block param 3)) + (set! (-> self mode-param3) (the-as uint v0-0)) + v0-0 + ) + ) + ) + (('want-continue) + (set! v0-0 (-> block param 0)) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :exit (behavior () + (set! (-> *level* camera-pos 0 quad) (-> (camera-pos) quad)) + (set! (-> *level* camera-pos 1 quad) (-> *level* camera-pos 0 quad)) + (set! (-> *level* target-pos 0 quad) (-> (target-pos 0) quad)) + (set! (-> *level* target-pos 1 quad) (-> *level* target-pos 0 quad)) + (set! (-> *setting-control* user-default border-mode) (-> *level* play?)) + (set! (-> *setting-control* user-default region-mode) #t) + (kill-persister *setting-control* (the-as engine-pers 'title-control) 'render) + (let ((v1-16 (-> self control root-prim))) + (set! (-> v1-16 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-16 prim-core collide-with) (-> self control backup-collide-with)) + ) + (remove-setting! 'allow-pause) + (remove-setting! 'allow-progress) + (remove-setting! 'allow-timeout) + (remove-setting! 'bg-a) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) + (remove-setting! 'ambient-volume) + (remove-setting! 'music) + (remove-setting! 'region-mode) + (remove-setting! 'border-mode) + (remove-setting! 'allow-continue) + (remove-setting! 'level-trans-time) + (remove-setting! 'speech-control) + (apply-settings *setting-control*) + (logclear! (-> self focus-status) (focus-status teleporting)) + (set! (-> self mode-cache) #f) + (set-time! (-> self teleport-time)) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (set! (-> self game kiosk-timeout) (-> *display* game-clock frame-counter)) + 0 + ) + :code (behavior ((arg0 continue-point)) + (local-vars (v1-126 symbol)) + (set! (-> self control mod-surface) *empty-mods-allow-gun*) + (let ((v1-2 (-> self control root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (set! *spawn-actors* #f) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self mode-cache) #f) + (set-time! (-> self state-time)) + (logior! (-> self focus-status) (focus-status teleporting)) + (let ((a0-4 (get-continue-by-name (-> self game) (-> arg0 name)))) + (cond + (a0-4 + (set! (-> self game last-continue) a0-4) + ) + ((string= (-> arg0 name) "default") + ) + (else + (format 0 "ERROR: TARGET: attempting to goto continue ~A which is not in level-info~%" (-> arg0 name)) + ) + ) + ) + (if (-> *art-control* reserve-buffer) + (reserve-free *art-control* (-> *art-control* reserve-buffer heap)) + ) + (kill-persister *setting-control* (the-as engine-pers 'fail) 'bg-a) + (kill-persister *setting-control* (the-as engine-pers 'fail-sfx-volume) 'sfx-volume) + (kill-persister *setting-control* (the-as engine-pers 'fail-dialog-volume) 'dialog-volume) + (kill-persister *setting-control* (the-as engine-pers 'fail-music-volume) 'music-volume) + (when (-> *setting-control* user-current render) + (when (not (logtest? (continue-flags no-blackout cf26) (-> arg0 flags))) + (add-setting! 'bg-a 'abs 1.0 0) + (set! (-> *setting-control* user-current bg-a) 1.0) + ) + ) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + (set-setting! 'dialog-volume 'abs 0.0 0) + (set-setting! 'music-volume 'abs 0.0 0) + (set-setting! 'region-mode #f 0.0 0) + (set-setting! 'border-mode #f 0.0 0) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'allow-timeout #f 0.0 0) + (set-setting! 'speech-control #f 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'level-trans-time #f 0.0 0) + (kill-persister *setting-control* (the-as engine-pers 'speech-control) 'speech-control) + (when (logtest? (continue-flags cf27) (-> arg0 flags)) + (set-setting! 'head-offset 'abs (meters 1) 0) + (set-setting! 'foot-offset 'abs (meters -1) 0) + (set-setting! 'target-height 'abs (meters 1.5) 0) + (logior! (-> self target-flags) (target-flags tf26)) + ) + (set! (-> *setting-control* user-default border-mode) #f) + (apply-settings *setting-control*) + (reset-target-state #t) + (target-exit) + (logior! (-> self focus-status) (focus-status teleporting)) + (ja-channel-set! 0) + (set! (-> self control mod-surface) *empty-mods-allow-gun*) + (let ((t9-29 quaternion-copy!) + (a0-39 (-> self control quat-for-control)) + (a1-25 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> a1-25 x) (* 0.00003051851 (the float (-> arg0 quat x)))) + (set! (-> a1-25 y) (* 0.00003051851 (the float (-> arg0 quat y)))) + (set! (-> a1-25 z) (* 0.00003051851 (the float (-> arg0 quat z)))) + (set! (-> a1-25 w) (* 0.00003051851 (the float (-> arg0 quat w)))) + (t9-29 a0-39 a1-25) + ) + (move-to-point! (-> self control) (-> arg0 trans)) + (rot->dir-targ! (-> self control)) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-reset! (-> self control transv)) + (if (not (string= (-> arg0 name) "default")) + (set! *external-cam-mode* #f) + ) + (if (not (logtest? (-> arg0 flags) (continue-flags no-blackout))) + (cam-stop) + ) + (suspend) + (let ((a0-47 (lookup-level-info (-> arg0 vis-nick)))) + (set! (-> *load-state* vis-nick) (if a0-47 + (-> a0-47 name) + ) + ) + ) + (dotimes (v1-104 10) + (cond + ((< v1-104 (-> arg0 want-count)) + (set! (-> *load-state* want v1-104 name) (-> arg0 want v1-104 name)) + (set! (-> *load-state* want v1-104 display?) (-> arg0 want v1-104 display?)) + ) + (else + (set! (-> *load-state* want v1-104 name) #f) + (set! (-> *load-state* want v1-104 display?) #f) + ) + ) + (set! (-> *load-state* want v1-104 force-vis?) #f) + (set! (-> *load-state* want v1-104 force-inside?) #f) + ) + (dotimes (v1-107 3) + (set! (-> *load-state* want-sound v1-107 name) (-> arg0 want-sound v1-107)) + (set! (-> *load-state* want-sound v1-107 mode) (the-as uint 1)) + ) + (load-state-method-21 *load-state*) + (when (not (string= (-> arg0 name) "default")) + (while (begin + (dotimes (s5-0 (-> arg0 want-count)) + (when (not (or (not (-> arg0 want s5-0 name)) + (not (-> arg0 want s5-0 display?)) + (let* ((a0-73 *level*) + (t9-37 (method-of-object a0-73 level-group-method-26)) + (a1-44 (-> arg0 want s5-0 name)) + ) + (= (t9-37 a0-73 a1-44) 'active) + ) + ) + ) + (set! v1-126 #t) + (goto cfg-53) + ) + ) + (let ((s5-1 *load-state*)) + (dotimes (s4-0 10) + (when (not (or (not (-> s5-1 want s4-0 name)) + (not (-> s5-1 want s4-0 display?)) + (let* ((a0-75 *level*) + (t9-38 (method-of-object a0-75 level-group-method-26)) + (a1-45 (-> s5-1 want s4-0 name)) + ) + (= (t9-38 a0-75 a1-45) 'active) + ) + ) + ) + (set! v1-126 #t) + (goto cfg-53) + ) + ) + ) + (set! v1-126 #f) + (label cfg-53) + v1-126 + ) + (suspend) + ) + ) + (if (logtest? (-> arg0 flags) (continue-flags copy-entity-pos)) + (apply-pos-from-entity arg0) + ) + (while (!= (-> self ext-geo) (-> self pending-ext-geo)) + (let ((s5-2 (-> self ext-geo-control))) + (when (not (or (= (-> s5-2 status) 'initialize) (= (-> self ext-geo) (target-geo none)))) + (unload-from-heap *anim-manager* (-> s5-2 heap)) + (unlink-shaders-in-heap *texture-page-dir* (-> s5-2 heap)) + ) + (case (-> self pending-ext-geo) + (((target-geo jakb) (target-geo jakb-old) (target-geo jakc)) + (set-pending-file s5-2 "jak-external" (the-as int (-> self pending-ext-geo)) (process->handle self) 0.0) + ) + (else + (set-pending-file s5-2 (the-as string #f) 0 (process->handle self) 0.0) + ) + ) + (if (= (-> s5-2 status) 'active) + (set! (-> self ext-geo) (the-as target-geo (-> s5-2 load-file-part))) + (set! (-> self ext-geo) (target-geo none)) + ) + (update s5-2) + ) + (suspend) + 0 + ) + (when (logtest? (continue-flags pilot-dax) (-> arg0 flags)) + (while (!= (-> self ext-anim) (-> self pending-ext-anim)) + (suspend) + ) + ) + (target-continue-init-art) + (remove-setting! 'music) + (remove-setting! 'music-volume) + (let ((s5-3 (-> *level* border?))) + (set! (-> *level* border?) (-> *level* play?)) + (set-setting! 'allow-continue #t 0.0 0) + (set-setting! 'border-mode #t 0.0 0) + (apply-settings *setting-control*) + (script-eval '(teleport)) + (script-eval (the-as pair (-> arg0 on-goto))) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'border-mode #f 0.0 0) + (apply-settings *setting-control*) + (set! (-> *level* border?) s5-3) + ) + (set! (-> *ACTOR-bank* birth-max) 1000) + (when (not (logtest? (-> arg0 flags) (continue-flags no-blackout))) + (new 'stack 'transformq) + (cam-start #t) + (suspend) + (when (not (string= (-> arg0 name) "default")) + (set! (-> *camera-combiner* trans quad) (-> arg0 camera-trans quad)) + (let ((s5-4 (-> *camera-combiner* inv-camera-rot)) + (s4-1 (-> arg0 camera-rot)) + ) + (matrix-identity! s5-4) + (set! (-> s5-4 rvec x) (* 0.00003051851 (the float (-> s4-1 0)))) + (set! (-> s5-4 rvec y) (* 0.00003051851 (the float (-> s4-1 1)))) + (set! (-> s5-4 rvec z) (* 0.00003051851 (the float (-> s4-1 2)))) + (set! (-> s5-4 uvec x) (* 0.00003051851 (the float (-> s4-1 3)))) + (set! (-> s5-4 uvec y) (* 0.00003051851 (the float (-> s4-1 4)))) + (set! (-> s5-4 uvec z) (* 0.00003051851 (the float (-> s4-1 5)))) + (set! (-> s5-4 fvec x) (* 0.00003051851 (the float (-> s4-1 6)))) + (set! (-> s5-4 fvec y) (* 0.00003051851 (the float (-> s4-1 7)))) + (set! (-> s5-4 fvec z) (* 0.00003051851 (the float (-> s4-1 8)))) + ) + ) + (cam-master-activate-slave #t) + ) + (send-event self 'level-enter (-> arg0 level)) + (dotimes (v1-242 (-> *level* length)) + (let ((a0-120 (-> *level* level v1-242))) + (if (= (-> a0-120 status) 'active) + (set! (-> a0-120 all-visible?) 'loading) + ) + ) + ) + (let ((s5-5 (level-get *level* (-> arg0 level)))) + (when s5-5 + (while (and (-> *level* vis?) (-> s5-5 vis-info 0) (= (-> s5-5 all-visible?) 'loading)) + (suspend) + ) + ) + ) + (set! *spawn-actors* #t) + (set! *teleport* #t) + (set! (-> *ACTOR-bank* birth-max) 1000) + (if (not (logtest? (continue-flags no-blackout cf26) (-> arg0 flags))) + (set-blackout-frames (seconds 0.1)) + ) + (let* ((a0-128 *game-info*) + (t9-66 (method-of-object a0-128 set-continue!)) + (a1-70 (the-as basic (-> self control unknown-spool-anim00))) + ) + (set! a1-70 (cond + ((the-as spool-anim a1-70) + (empty) + a1-70 + ) + (else + arg0 + ) + ) + ) + (t9-66 a0-128 a1-70 #f) + ) + (arrive-at-continue arg0) + (let* ((a0-130 *game-info*) + (t9-68 (method-of-object a0-130 set-continue!)) + (a1-71 (the-as basic (-> self control unknown-spool-anim00))) + ) + (set! a1-71 (cond + ((the-as spool-anim a1-71) + (empty) + a1-71 + ) + (else + arg0 + ) + ) + ) + (t9-68 a0-130 a1-71 #f) + ) + (when *auto-continue* + (let ((gp-1 (next-continue arg0))) + (when gp-1 + (format 0 "~A ~A ~A~%" (-> gp-1 level) (-> gp-1 name) gp-1) + (inspect global) + (process-spawn-function process (lambda ((arg0 continue-point)) (start 'play arg0)) gp-1) + ) + ) + ) + (when (not (-> *setting-control* user-current render)) + (set-setting! 'bg-a 'abs 1.0 0) + (apply-settings *setting-control*) + (while (!= (-> *setting-control* user-current bg-a) 1.0) + (suspend) + ) + (set-blackout-frames (seconds 0.1)) + (kill-persister *setting-control* (the-as engine-pers 'title-control-scene) 'render) + ) + (ja-channel-set! 1) + (ja :group! jakb-stance-loop-ja) + (suspend) + (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (when (-> self mode-cache) + (set! (-> self event-hook) target-standard-event-handler) + (send-event + self + 'change-mode + (-> self mode-cache) + (handle->process (-> self mode-param1)) + (-> self mode-param2) + (-> self mode-param3) + ) + (set! (-> self mode-cache) #f) + ) + (go target-stance) + ) + :post target-no-move-post + ) + +;; definition for symbol *smack-mods*, type surface +(define *smack-mods* (new 'static 'surface + :name 'jump + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 131072.0 + :tiltvvf 15.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (when (= arg3 1) + (let ((f30-0 (-> self control unknown-floatiujh1bnb2n3i1)) + (f28-0 (-> self control force-turn-to-strength)) + ) + (set! (-> arg0 seek0) (lerp (-> arg0 seek0) 409600.0 f28-0)) + (set! (-> arg0 seek90) (lerp (-> arg0 seek90) 409600.0 f28-0)) + (set! (-> arg0 seek180) (lerp (-> arg0 seek180) 409600.0 f28-0)) + (set! (-> arg0 target-speed) (lerp (-> arg0 target-speed) f30-0 f28-0)) + (set! (-> arg0 transv-max) (lerp (-> arg0 transv-max) f30-0 f28-0)) + ) + ) + ) + :mode 'air + :flags (surface-flag air gun-inactive gun-no-twist) + ) + ) + +;; definition for symbol *smack-up-mods*, type surface +(define *smack-up-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvf 30.0 + :turnvv 32768.0 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 131072.0 + :tiltvvf 15.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (when (= arg3 1) + (let ((f30-0 (-> self control unknown-floatiujh1bnb2n3i1)) + (f28-0 (-> self control force-turn-to-strength)) + ) + (set! (-> arg0 seek0) (lerp (-> arg0 seek0) 409600.0 f28-0)) + (set! (-> arg0 seek90) (lerp (-> arg0 seek90) 409600.0 f28-0)) + (set! (-> arg0 seek180) (lerp (-> arg0 seek180) 409600.0 f28-0)) + (set! (-> arg0 target-speed) (lerp (-> arg0 target-speed) f30-0 f28-0)) + (set! (-> arg0 transv-max) (lerp (-> arg0 transv-max) f30-0 f28-0)) + ) + ) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad air gun-inactive gun-no-twist) + ) + ) + +;; definition for function velocity-set-to-target! +;; INFO: Used lq/sq +(defbehavior velocity-set-to-target! target ((arg0 vector) (arg1 float) (arg2 attack-info)) + (let* ((v1-1 (-> self control trans)) + (gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 v1-1)) + ) + (set! (-> gp-1 y) 0.0) + (set! (-> self control force-turn-to-direction quad) (-> gp-1 quad)) + (vector-xz-normalize! (-> self control force-turn-to-direction) 1.0) + (set! (-> self control force-turn-to-speed) 1.0) + (set! (-> self control unknown-floatiujh1bnb2n3i1) arg1) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> arg2 control))) + gp-1 + ) + ) + +;; definition for function target-hit-effect +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-hit-effect target ((arg0 attack-info)) + (cond + ((logtest? (-> *part-group-id-table* 10 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) + (-> (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) + (-> arg0 intersection) + (the-as vector (-> self control root-prim prim-core)) + ) + ) + quad + ) + ) + (let ((s5-0 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-0 + (let ((t9-1 (method-of-type part-tracker-subsampler activate))) + (t9-1 (the-as part-tracker-subsampler s5-0) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-2 run-function-in-process) + (a0-9 s5-0) + (a1-2 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 10)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-2) a0-9 a1-2 *part-tracker-subsampler-params-default*) + ) + (-> s5-0 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) + (-> (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) + (-> arg0 intersection) + (the-as vector (-> self control root-prim prim-core)) + ) + ) + quad + ) + ) + (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-1 + (let ((t9-4 (method-of-type part-tracker activate))) + (t9-4 (the-as part-tracker s5-1) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-5 run-function-in-process) + (a0-18 s5-1) + (a1-5 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 10)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-5) a0-18 a1-5 *part-tracker-params-default*) + ) + (-> s5-1 ppointer) + ) + ) + ) + ) + (let ((v1-32 (-> arg0 mode))) + (cond + ((or (= v1-32 'endlessfall) (= v1-32 'instant-death) (= v1-32 'crush) (= v1-32 'tentacle)) + ) + ((begin + (target-timed-invulnerable (-> arg0 invinc-time) self 1) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.5)) + (focus-test? self indax) + ) + (let* ((v1-38 (rand-vu-int-count 4)) + (t0-0 (cond + ((zero? v1-38) + "ds176" + ) + ((= v1-38 1) + "ds177" + ) + ((= v1-38 2) + "ds178" + ) + (else + "ds179" + ) + ) + ) + ) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) t0-0 -99.0 0) + ) + ) + (sound-params-set! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2 -1.0) + ) + (else + (case (-> arg0 angle) + (('up) + (sound-play "hit-up") + ) + (else + (sound-play "oof") + ) + ) + ) + ) + ) + (let ((v1-50 (-> arg0 mode))) + (cond + ((or (= v1-50 'burn) (or (= v1-50 'burnup) (= v1-50 'lava) (= v1-50 'melt) (= v1-50 'fry) (= v1-50 'slime))) + (if (not (handle->process (-> self burn-proc))) + (set! (-> self burn-proc) (ppointer->handle (process-spawn-function + process + process-drawable-burn-effect + 1200 + :to (if (focus-test? self indax) + (ppointer->process (-> self sidekick)) + self + ) + ) + ) + ) + ) + ) + ((= v1-50 'tar) + (sound-play "get-burned") + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-hit-push +;; INFO: Used lq/sq +(defbehavior target-hit-push target ((arg0 vector) (arg1 matrix) (arg2 float) (arg3 float) (arg4 attack-info)) + (case (-> arg4 mode) + (('shock 'shockup 'shock-red 'shock-green) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.03)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (send-event self 'color-effect 'shock (seconds 0.2)) + (case (-> arg4 mode) + (('shock-red) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 3) + lightning-probe-callback + (the-as sparticle-launcher #f) + 0 + 0 + 40960.0 + ) + ) + (('shock-green) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 4) + lightning-probe-callback + (the-as sparticle-launcher #f) + 0 + 0 + 40960.0 + ) + ) + (else + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) + ) + ) + ) + (case (-> arg4 angle) + (('jump 'up 'up-forward) + (when (and (not (focus-test? self flut pilot mech indax)) + (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health)))) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #f)) + (go target-attack-air #f) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) + (and (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + ) + (go + target-flop + 65502.96 + -163840.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + 'flop + ) + ) + ) + ) + ) + (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (and (time-elapsed? (-> self state-time) (the-as time-frame (-> *TARGET-bank* stuck-time))) + (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) + ) + ) + #t + ) + (logior! (-> self control status) (collide-status on-surface)) + (return 'stuck) + ) + (let ((s1-0 (new-stack-vector0))) + (set! (-> s1-0 z) arg2) + (vector-matrix*! s1-0 s1-0 arg1) + (vector+! s1-0 s1-0 arg0) + (cond + ((< (vector-vector-distance arg0 s1-0) (fabs (-> arg4 dist))) + (velocity-set-to-target! s1-0 (fabs arg3) arg4) + #t + ) + (else + (set! (-> self control unknown-floatiujh1bnb2n3i1) 0.0) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> arg4 control))) + #f + ) + ) + ) + ) + +;; 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) (attack-mask vector)) + (!= (-> arg0 shove-back) 0.0) + ) + (forward-up-nopitch->quaternion (-> self control dir-targ) arg1 (-> self control dynam gravity-normal)) + ) + (case (-> arg0 angle) + (('back 'air) + (set! s5-0 #t) + ) + (('up-forward) + (set! (-> self control mod-surface) *smack-up-mods*) + ) + (('front) + (if (and (logtest? (-> arg0 mask) (attack-mask vector)) (!= (-> arg0 shove-back) 0.0)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-negate! (new 'stack-no-clear 'vector) arg1) + (-> self control dynam gravity-normal) + ) + ) + (set! s5-0 #t) + ) + (('jump) + (set! s5-0 #t) + (set! (-> self control mod-surface) *forward-high-jump-mods*) + ) + ) + s5-0 + ) + ) + +;; definition for function target-hit-setup-anim +;; WARN: Return type mismatch object vs none. +(defbehavior target-hit-setup-anim target ((arg0 attack-info)) + (let ((v1-0 (-> arg0 angle))) + (cond + ((= v1-0 'back) + (let ((v1-3 (ja-group))) + (when (not (and v1-3 (= v1-3 jakb-hit-from-back-ja))) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-hit-from-back-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-from-back-ja :num! min) + ) + ) + ) + ((= v1-0 'lava) + (let ((v1-19 (ja-group))) + (when (not (and v1-19 (= v1-19 jakb-hit-elec-ja))) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-elec-ja :num! min) + ) + ) + ) + ((or (= v1-0 'up) (= v1-0 'up-forward) (= v1-0 'lava)) + (let ((v1-28 (ja-group))) + (when (not (and v1-28 (= v1-28 jakb-hit-up-ja))) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-up-ja :num! min) + ) + ) + ) + ((or (= v1-0 'air) (= v1-0 'jump)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-jump-ja :num! (seek!) :frame-num 0.0) + (when (= (-> arg0 angle) 'air) + (sound-play "smack-surface") + (do-effect (-> self skel effect) (the-as symbol "group-smack-surface") 0.0 6) + (do-effect (-> self skel effect) (the-as symbol "group-smack-surface-dizzy") 0.0 9) + ) + ) + ((= v1-0 'shove) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-smack-surface-ja :num! (seek!) :frame-num 0.0) + (sound-play "smack-surface") + ) + ((rand-vu-percent? 0.5) + (let ((v1-77 (ja-group))) + (when (not (and v1-77 (= v1-77 jakb-hit-from-front-alt1-ja))) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-hit-from-front-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-from-front-alt1-ja :num! min) + ) + ) + ) + (else + (let ((v1-93 (ja-group))) + (when (not (and v1-93 (= v1-93 jakb-hit-from-front-ja))) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-hit-from-front-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-from-front-ja :num! min) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for function target-hit-move +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-hit-move target ((arg0 attack-info) (arg1 symbol) (arg2 (function none :behavior target)) (arg3 float)) + (local-vars (v1-29 symbol) (s1-1 symbol)) + (vector-identity! (-> self control transv)) + (let ((v1-1 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-1 (-> self control transv) (vector-float*! v1-1 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f0-2 (vector-length v1-1)) + (f1-1 f0-2) + (f2-1 (+ 2048.0 (sqrtf (* 491520.0 (-> arg0 shove-up))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) + (vector-float*! v1-1 v1-1 (/ f0-2 f1-1)) + ) + ) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> self control trans quad)) + (let ((s2-1 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (+ 32768.0 (vector-y-angle (-> arg0 vector))))) + (f30-1 0.0) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + #t + (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (ja-group) frames num-frames) -1)) (ja-step 0)))))) + (until v1-29 + (+! f30-1 (* (-> arg0 shove-back) f28-1 (seconds-per-frame))) + (set! s1-1 (target-hit-push s3-0 s2-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) + (suspend) + (ja :num! (seek!)) + (set! v1-29 (or (ja-done? 0) (and arg1 (logtest? (-> self control status) (collide-status on-surface))))) + ) + (while (and (or (not (logtest? (-> self control status) (collide-status on-surface))) s1-1) (!= s1-1 'stuck)) + (arg2) + (+! f30-1 (* (-> arg0 shove-back) f28-1 (seconds-per-frame))) + (set! s1-1 (target-hit-push s3-0 s2-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) + (if (not s1-1) + (logclear! (-> self focus-status) (focus-status hit)) + ) + (suspend) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-hit (target) + :event target-standard-event-handler + :exit (behavior () + (let ((v1-0 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-0 (-> self control transv) (vector-float*! v1-0 (-> self control dynam gravity-normal) f0-1)) + (let* ((f2-0 (vector-length v1-0)) + (f1-2 f2-0) + ) + (if (< 40960.0 f2-0) + (set! f2-0 40960.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-1) + (vector-float*! v1-0 v1-0 (/ f2-0 f1-2)) + ) + ) + ) + (when (not (and (-> self next-state) (let ((v1-4 (-> self next-state name))) + (or (= v1-4 'target-death) (= v1-4 'target-hit)) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status dead hit)) + (logclear! (-> self target-flags) (target-flags disable-attacks)) + ) + ((method-of-type focus clear-focused) (the-as focus (-> self gun track-target))) + (target-exit) + ) + :trans (behavior () + (when (= *cheat-mode* 'debug) + (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) + (set-time! (-> self control time-of-last-debug-heal)) + (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) + (go target-stance) + ) + ) + ) + :code (behavior ((arg0 symbol) (arg1 attack-info)) + (local-vars (sv-32 attack-info) (sv-36 vector)) + (logclear! (-> self water flags) (water-flag jump-out)) + (set-time! (-> self state-time)) + (set! (-> self neck flex-blend) 0.0) + (set! sv-32 (-> self attack-info)) + (set! sv-36 (new 'stack-no-clear 'vector)) + (let ((v1-7 sv-32)) + (set! (-> v1-7 attacker) (the-as handle #f)) + (set! (-> v1-7 mode) 'generic) + (set! (-> v1-7 shove-back) 6144.0) + (set! (-> v1-7 shove-up) 4915.2) + (set! (-> v1-7 angle) #f) + (set! (-> v1-7 trans quad) (-> self control trans quad)) + (set! (-> v1-7 control) 0.0) + (set! (-> v1-7 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout)) + (set! (-> v1-7 damage) (-> *FACT-bank* health-default-inc)) + ) + (case arg0 + (('shove) + (let ((v1-10 sv-32)) + (set! (-> v1-10 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-10 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-10 angle) 'shove) + ) + ) + ) + (let ((v1-13 (if (logtest? (-> arg1 mask) (attack-mask mode)) + (-> arg1 mode) + 'generic + ) + ) + ) + (when (or (= v1-13 'lava) (or (= v1-13 'melt) (= v1-13 'fry) (= v1-13 'slime))) + (let ((v1-16 sv-32)) + (set! (-> v1-16 shove-up) 32768.0) + (set! (-> v1-16 angle) 'lava) + (set! (-> v1-16 control) 1.0) + (set! (-> v1-16 damage) 4.0) + ) + ) + ) + (combine! sv-32 arg1 self) + (when (not (logtest? (-> sv-32 mask) (attack-mask vector))) + (vector-z-quaternion! (-> sv-32 vector) (-> self control quat-for-control)) + (vector-xz-normalize! (-> sv-32 vector) (- (fabs (-> sv-32 shove-back)))) + (set! (-> sv-32 vector y) (-> sv-32 shove-up)) + ) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (set! (-> sv-32 damage) (fmax 1.0 (ceil (* 0.5 (-> sv-32 damage))))) + 0 + ) + (set! (-> sv-36 quad) (-> sv-32 vector quad)) + (let ((f0-19 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) sv-36 1.0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-19) + 'front + 'back + ) + ) + ) + ) + (cond + ((= arg0 'attack) + (send-event (handle->process (-> self notify)) 'notify 'hit (-> sv-32 mode)) + (logior! (-> self focus-status) (focus-status hit)) + (set-time! (-> self game hit-time)) + (case (-> sv-32 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((gp-1 (new-stack-vector0))) + (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) + (ja-channel-set! 0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 1)) + (suspend) + ) + ) + (move-to-point! (-> self control) gp-1) + ) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-stance) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (go target-death (-> sv-32 mode)) + ) + ) + ) + (('fry) + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> sv-32 damage)) (the-as handle #f)) + (cond + ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (go target-death (-> sv-32 mode)) + ) + (else + (sound-play "death-melt") + (cond + ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-3 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-3 + (let ((t9-18 (method-of-type part-tracker-subsampler activate))) + (t9-18 + (the-as part-tracker-subsampler gp-3) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-19 run-function-in-process) + (a0-66 gp-3) + (a1-13 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 64)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-19) a0-66 a1-13 *part-tracker-subsampler-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-4 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-4 + (let ((t9-21 (method-of-type part-tracker activate))) + (t9-21 (the-as part-tracker gp-4) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-22 run-function-in-process) + (a0-72 gp-4) + (a1-16 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 64)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-22) a0-72 a1-16 *part-tracker-params-default*) + ) + (-> gp-4 ppointer) + ) + ) + ) + ) + ) + ) + ) + (('lava 'melt 'slime) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (cond + ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (go target-death (-> sv-32 mode)) + ) + (else + (sound-play "death-melt") + (cond + ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-6 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-6 + (let ((t9-28 (method-of-type part-tracker-subsampler activate))) + (t9-28 + (the-as part-tracker-subsampler gp-6) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-29 run-function-in-process) + (a0-89 gp-6) + (a1-23 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 64)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-29) a0-89 a1-23 *part-tracker-subsampler-params-default*) + ) + (-> gp-6 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((gp-7 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-7 + (let ((t9-31 (method-of-type part-tracker activate))) + (t9-31 (the-as part-tracker gp-7) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-32 run-function-in-process) + (a0-95 gp-7) + (a1-26 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 64)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-32) a0-95 a1-26 *part-tracker-params-default*) + ) + (-> gp-7 ppointer) + ) + ) + ) + ) + ) + ) + ) + (('drown-death + 'sharkey + 'dark-eco-pool + 'instant-death + 'crush + 'death + 'grenade + 'bot + 'turret + 'centipede + 'big-explosion + 'tentacle + ) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (if (= (-> self game mode) 'play) + (go target-death (-> sv-32 mode)) + ) + ) + (('explode) + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> sv-32 damage)) (the-as handle #f)) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (go target-death (-> sv-32 mode)) + ) + ) + (('smush) + (case (-> sv-32 angle) + (('front) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-negate! (new 'stack-no-clear 'vector) sv-36) + (-> self control dynam gravity-normal) + ) + ) + (else + (forward-up-nopitch->quaternion (-> self control dir-targ) sv-36 (-> self control dynam gravity-normal)) + ) + ) + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> sv-32 damage)) (the-as handle #f)) + (go target-hit-ground-hard (-> *TARGET-bank* fall-far)) + ) + (('shock 'shock-red 'shock-green) + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> sv-32 damage)) (the-as handle #f)) + (let* ((v1-211 (-> sv-32 mode)) + (gp-9 (cond + ((= v1-211 'shock-red) + (-> *part-group-id-table* 69) + ) + ((= v1-211 'shock-green) + (-> *part-group-id-table* 68) + ) + (else + (-> *part-group-id-table* 67) + ) + ) + ) + ) + (cond + ((logtest? (-> gp-9 flags) (sp-group-flag sp13)) + (let ((s5-5 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-5 + (let ((t9-44 (method-of-type part-tracker-subsampler activate))) + (t9-44 (the-as part-tracker-subsampler s5-5) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-45 run-function-in-process) + (a0-133 s5-5) + (a1-49 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) gp-9) + (set! (-> *part-tracker-subsampler-params-default* duration) (seconds 1)) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 6) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-45) a0-133 a1-49 *part-tracker-subsampler-params-default*) + ) + (-> s5-5 ppointer) + ) + ) + ) + (else + (let ((s5-6 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-6 + (let ((t9-47 (method-of-type part-tracker activate))) + (t9-47 (the-as part-tracker s5-6) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-48 run-function-in-process) + (a0-136 s5-6) + (a1-52 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) gp-9) + (set! (-> *part-tracker-params-default* duration) (seconds 1)) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 6) + ((the-as (function object object object none) t9-48) a0-136 a1-52 *part-tracker-params-default*) + ) + (-> s5-6 ppointer) + ) + ) + ) + ) + ) + (let ((gp-10 (-> self post-hook))) + (set! (-> self control mod-surface) *turn-around-mods*) + (set! (-> self post-hook) target-no-stick-post) + (if (using-gun? self) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-hit-elec-ja) 0.0 30 0 1.0 0.0 #f) + ) + (let ((v1-247 (new-stack-vector0))) + (let ((f0-36 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-247 + (-> self control transv) + (vector-float*! v1-247 (-> self control dynam gravity-normal) f0-36) + ) + ) + (let* ((f0-37 (vector-length v1-247)) + (f1-6 f0-37) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-247 v1-247 (/ f0-37 f1-6)) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-hit-elec-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((v1-263 (new-stack-vector0)) + (f0-44 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-263 + (-> self control transv) + (vector-float*! v1-263 (-> self control dynam gravity-normal) f0-44) + ) + (let* ((f1-9 (vector-length v1-263)) + (f2-1 f1-9) + (f0-45 (+ f0-44 (* 286720.0 (seconds-per-frame)))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-45) + (vector-float*! v1-263 v1-263 (/ f1-9 f2-1)) + ) + ) + ) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.03)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (send-event self 'color-effect 'shock (seconds 0.2)) + (case (-> sv-32 mode) + (('shock-red) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 3) + lightning-probe-callback + (the-as sparticle-launcher #f) + 0 + 0 + 40960.0 + ) + ) + (('shock-green) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 4) + lightning-probe-callback + (the-as sparticle-launcher #f) + 0 + 0 + 40960.0 + ) + ) + (else + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> sv-32 angle) 'back) + (set! (-> self post-hook) gp-10) + ) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> sv-32 damage)) (the-as handle #f)) + ) + ) + (target-hit-effect sv-32) + ) + (else + (case (-> sv-32 mode) + (('burn 'burnup) + (sound-play "get-burned") + ) + ) + ) + ) + (when (and (= (-> self game mode) 'play) (and (>= 0.0 (-> self fact health)) (using-gun? self))) + (send-event (ppointer->process (-> self gun gun)) 'notice 'die) + (target-gun-end-mode #f) + ) + (set! (-> self control mod-surface) *smack-mods*) + (target-hit-setup-anim sv-32) + (target-hit-move sv-32 (target-hit-orient sv-32 sv-36) target-falling-anim-trans 1.0) + (cond + ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (go target-death (-> sv-32 mode)) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (>= 1.0 (-> self fact health))) + (go target-darkjak-get-off) + ) + ((and (and (focus-test? self light) (nonzero? (-> self lightjak))) (>= 1.0 (-> self fact health))) + (go target-lightjak-get-off) + ) + (else + (go target-hit-ground #f) + ) + ) + ) + :post target-post + ) + +;; definition for symbol *death-spool-array*, type (array spool-anim) +(define *death-spool-array* + (new 'static 'boxed-array :type spool-anim + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-06" :anim-name "daxter-death-06" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-13" :anim-name "daxter-death-13" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-14" :anim-name "daxter-death-14" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-16" :anim-name "daxter-death-16" :parts 2 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-17" :anim-name "daxter-death-17" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-20" :anim-name "daxter-death-20" :parts 2 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-21" :anim-name "daxter-death-21" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-24" :anim-name "daxter-death-24" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-31" :anim-name "daxter-death-31" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-35" :anim-name "daxter-death-35" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-38" :anim-name "daxter-death-38" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-57" :anim-name "daxter-death-57" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-58" :anim-name "daxter-death-58" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-61" :anim-name "daxter-death-61" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-07" :anim-name "daxter-death-07" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-4" :anim-name "jak-death-4" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-10" :anim-name "daxter-death-10" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-1" :anim-name "jak-death-1" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-3" :anim-name "jak-death-3" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-12" :anim-name "daxter-death-12" :parts 2 :command-list '()) + (new 'static 'spool-anim :name "jak-death-5" :anim-name "jak-death-5" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "jak-death-2" :anim-name "jak-death-2" :parts 1 :command-list '()) + (new 'static 'spool-anim :name "daxter-death-18" :anim-name "daxter-death-18" :parts 1 :command-list '()) + ) + ) + +;; definition for function death-movie-remap +(defun death-movie-remap ((arg0 int) (arg1 int)) + (let ((v1-0 (/ arg0 arg1))) + (mod + (if (not (logtest? v1-0 1)) + (logxor v1-0 arg0) + (logand #xfffffff (- (logxor v1-0 arg0))) + ) + arg1 + ) + ) + ) + +;; definition of type kill-nearby-enemies-info +(deftype kill-nearby-enemies-info (basic) + ((dist float) + (pos vector :inline) + ) + ) + +;; definition for method 3 of type kill-nearby-enemies-info +(defmethod inspect ((this kill-nearby-enemies-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tpos: #~%" (-> this pos)) + (label cfg-4) + this + ) + +;; definition for symbol *kill-nearby-enemies-info*, type kill-nearby-enemies-info +(define *kill-nearby-enemies-info* (new 'static 'kill-nearby-enemies-info)) + +;; definition for function kill-nearby-enemies +;; INFO: Used lq/sq +(defun kill-nearby-enemies ((arg0 vector) (arg1 float)) + (let ((v1-0 *kill-nearby-enemies-info*)) + (set! (-> v1-0 dist) arg1) + (set! (-> v1-0 pos quad) (-> arg0 quad)) + ) + (iterate-process-tree + *entity-pool* + (lambda ((arg0 process-drawable)) + (if (and (logtest? (process-mask enemy) (-> arg0 mask)) + (type? arg0 process-drawable) + (nonzero? (-> arg0 root)) + (>= (-> *kill-nearby-enemies-info* dist) + (vector-vector-distance (-> arg0 root trans) (-> *kill-nearby-enemies-info* pos)) + ) + ) + (process-entity-status! arg0 (entity-perm-status bit-9) #t) + ) + ) + *null-kernel-context* + ) + ) + +;; definition for function target-death-anim-trans +;; WARN: Return type mismatch int vs none. +(defbehavior target-death-anim-trans target () + (send-event *camera* 'joystick 0.0 -1.0) + (compute-alignment! (-> self align)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (when (not (logtest? (-> self align flags) (align-flags disabled))) + (vector-matrix*! gp-0 (the-as vector (-> self align delta)) (-> self control c-R-w)) + (vector-float*! (-> self control transv) gp-0 (-> self clock frames-per-second)) + ) + ) + 0 + (none) + ) + +;; definition for function target-death-anim +;; WARN: Return type mismatch int vs none. +(defbehavior target-death-anim target ((arg0 spool-anim)) + (set! (-> self control mod-surface) *neutral-mods*) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-deatha-ja :num! (seek! (ja-aframe 30.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (if arg0 + (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> arg0 name) + 0 + -99.0 + (new 'static 'sound-id) + ) + ) + (target-death-anim-trans) + (suspend) + (ja :num! (seek! (ja-aframe 30.0 0))) + ) + 0 + (none) + ) + +;; definition for function target-death-main +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-death-main target ((arg0 symbol)) + (local-vars (sv-96 level) (sv-112 vector)) + (let ((v1-0 arg0)) + (if (= v1-0 'tar) + (sound-play "death-drown") + ) + ) + (+! (-> *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)) + ) + (+! (-> *game-info* death-movie-tick) 1) + ) + (let ((gp-2 + (-> *death-spool-array* (death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length))) + ) + ) + (if (= arg0 'bot) + (set! gp-2 (the-as spool-anim #f)) + ) + (set-setting! 'allow-progress #f 0.0 0) + (target-death-anim gp-2) + (cond + ((or (not gp-2) + (or (or (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self control status) (collide-status on-water)) + ) + (or (-> *setting-control* user-current spooling) + (let ((v1-31 (file-status *art-control* (-> gp-2 name) 0))) + (or (not (or (= v1-31 'locked) (= v1-31 'active))) + (and (string-prefix= "daxter" (-> gp-2 name)) + (or (not (art-group-get-by-name *level* "daxter-highres" (the-as (pointer level) #f))) + (not (logtest? (logand (game-feature sidekick) (-> *setting-control* user-current features)) + (-> self game features) + ) + ) + (= (-> self control ground-pat material) (pat-material snow)) + (= (-> self control ground-pat material) (pat-material deepsnow)) + ) + ) + ) + ) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (target-death-anim-trans) + (suspend) + (ja-eval) + ) + ) + ((string-prefix= "jak" (-> gp-2 name)) + (set! (-> self spool-anim) gp-2) + (set! (-> self post-hook) (lambda :behavior target () (target-death-anim-trans) (target-no-stick-post))) + (ja-play-spooled-anim + gp-2 + (the-as art-joint-anim jakb-stance-loop-ja) + (the-as art-joint-anim #f) + (the-as (function process-drawable symbol) false-func) + (spooler-flags) + ) + (set-blackout-frames (seconds 0.1)) + (set! (-> self spool-anim) #f) + ) + (else + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> gp-2 name) + 0 + -99.0 + (new 'static 'sound-id) + ) + (target-death-anim-trans) + (suspend) + (ja-eval) + ) + (kill-nearby-enemies (-> *target* control trans) 61440.0) + (set! (-> *ACTOR-bank* birth-max) 1000) + (set! (-> self trans-hook) #f) + (let ((t1-3 #x100000)) + (set-setting! 'features 'clear (shr t1-3 32) t1-3) + ) + (send-event self 'blend-shape #t) + (apply-settings *setting-control*) + (flag-setup) + (set! sv-96 (the-as level #f)) + (art-group-get-by-name *level* "daxter-highres" (new 'stack-no-clear 'array 'level 1)) + (let ((s4-1 (if (and sv-96 (nonzero? (-> sv-96 entity)) (> (-> sv-96 entity length) 0)) + (-> sv-96 entity data 0 entity) + ) + ) + ) + (when s4-1 + (let ((s5-2 (ppointer->handle (process-spawn + pov-camera + (-> self control trans) + (art-group-get-by-name *level* "skel-scenecamera" (the-as (pointer level) #f)) + gp-2 + 12 + self + '() + :name "pov-camera" + :to *target-pool* + ) + ) + ) + ) + (when (handle->process s5-2) + (let* ((s2-1 (get-process *default-dead-pool* manipy #x20000 1)) + (s3-1 + (when s2-1 + (let ((t9-33 (method-of-type manipy activate))) + (t9-33 (the-as manipy s2-1) (handle->process s5-2) "sidekick-highres" (the-as pointer #x70004000)) + ) + (let ((s3-2 run-function-in-process) + (s1-1 s2-1) + (s0-1 manipy-init) + ) + (set! sv-112 (-> self control trans)) + (let ((t0-6 (art-group-get-by-name *level* "skel-sidekick-highres" (the-as (pointer level) #f))) + (t1-5 #f) + (t2-3 0) + ) + ((the-as (function object object object object object object object none) s3-2) + s1-1 + s0-1 + sv-112 + s4-1 + t0-6 + t1-5 + t2-3 + ) + ) + ) + (-> s2-1 ppointer) + ) + ) + ) + (process-spawn-function + process + (lambda :behavior target ((arg0 handle)) (suspend) (send-event (handle->process arg0) 'light-index 240)) + (ppointer->handle s3-1) + :to self + ) + (send-event (ppointer->process s3-1) 'anim-mode 'clone-anim) + (send-event (ppointer->process s3-1) 'blend-shape #t) + ) + (send-event (handle->process s5-2) 'music-movie-volume 0.0) + (send-event (handle->process s5-2) 'sfx-movie-volume 0.5) + (send-event (handle->process s5-2) 'ambient-movie-volume 0.5) + (set! (-> self post-hook) target-no-ja-move-post) + (ja-channel-set! 0) + (while (handle->process s5-2) + (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> gp-2 name) + 0 + -99.0 + (new 'static 'sound-id) + ) + (suspend) + ) + (set-blackout-frames (seconds 0.2)) + (let ((a0-83 (handle->process s5-2))) + (if a0-83 + (deactivate a0-83) + ) + ) + ) + ) + ) + ) + (suspend) + (remove-setting! 'features) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-death-reset +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-death-reset target ((arg0 symbol) (arg1 symbol)) + (let ((v1-1 (-> *task-manager-engine* alive-list next0))) + *task-manager-engine* + (let ((s4-0 (-> v1-1 next0))) + (while (!= v1-1 (-> *task-manager-engine* alive-list-end)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'target) + (set! (-> a1-1 param 0) (the-as uint 'die)) + (set! (-> a1-1 param 1) (the-as uint arg0)) + (let ((v1-2 (send-event-function (the-as process-tree (-> (the-as connection v1-1) param1)) a1-1))) + (case v1-2 + (('wait) + (set! arg1 (the-as symbol v1-2)) + ) + ) + ) + ) + (set! v1-1 s4-0) + *task-manager-engine* + (set! s4-0 (-> s4-0 next0)) + ) + ) + ) + (cond + ((= (the-as object arg1) 'wait) + (set! (-> self trans-hook) #f) + (set! (-> self control unknown-word04) (the-as uint #f)) + (when (not (focus-test? self pilot)) + (set! (-> self post-hook) target-no-ja-move-post) + (ja-post) + ) + (while (not (-> self control unknown-spool-anim00)) + (send-event *camera* 'joystick 0.0 -1.0) + (suspend) + ) + ) + (else + (suspend) + 0 + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (initialize! (-> self game) 'life (the-as game-save #f) (the-as string #f) (-> self death-resetter)) + (set-time! (-> self state-time)) + (sleep-code) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-death (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (case (-> block param 0) + (('bot 'grab) + (set! (-> self control unknown-word04) (the-as uint #t)) + (if (>= argc 2) + (mem-copy! (the-as pointer (-> self death-resetter)) (the-as pointer (-> block param 1)) 16) + ) + ) + ) + ) + (('change-mode) + (case (-> block param 0) + (('grab) + (case (-> block param 1) + (('dead) + #t + ) + (else + #f + ) + ) + ) + ) + ) + (('notify) + (when (type? proc pov-camera) + (case (-> block param 0) + (('die 'abort-request) + (set! (-> self control unknown-word04) (the-as uint #t)) + (set-blackout-frames (seconds 0.2)) + ) + ) + ) + ) + (('get-pickup) + #f + ) + (('touched) + #f + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :exit (behavior () + (let ((a0-0 (-> self spool-anim))) + (when (and a0-0 (= (-> *setting-control* user-current spooling) (process->ppointer self))) + (ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1) + (ja-channel-set! 1) + (ja :group! jakb-stance-loop-ja :num! min) + ) + ) + (logclear! (-> self focus-status) (focus-status dead hit)) + (logclear! (-> self target-flags) (target-flags disable-attacks)) + (target-exit) + (remove-setting! 'process-mask) + (remove-setting! 'allow-progress) + (remove-setting! 'mode-name) + (let ((v1-20 (-> self control root-prim))) + (set! (-> v1-20 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-20 prim-core collide-with) (-> self control backup-collide-with)) + ) + (set! (-> self control pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :board #x1) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (send-event (ppointer->process (-> self gun gun)) 'reset) + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + :trans (-> target-hit trans) + :code (behavior ((arg0 symbol)) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self control did-move-to-pole-or-max-jump-height) + (the-as float (send-event (handle->process (-> self attack-info attacker)) 'target 'die arg0)) + ) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noendlessfall #x1)) + (target-timed-invulnerable-off self 0) + (let ((s5-0 (-> self child))) + (while s5-0 + (send-event (ppointer->process s5-0) 'notice 'die) + (set! s5-0 (-> s5-0 0 brother)) + ) + ) + (cond + ((-> *setting-control* user-current death-info) + (mem-copy! + (the-as pointer (-> self death-resetter)) + (&-> (-> *setting-control* user-current death-info) node) + 16 + ) + ) + (else + (set! (-> self death-resetter continue) #f) + (set! (-> self death-resetter node) (game-task-node none)) + (set! (-> self death-resetter reset-mode) 'life) + (set! (-> self death-resetter execute) #f) + ) + ) + (let ((v1-29 arg0)) + (cond + ((or (= v1-29 'bot) (or (= v1-29 'centipede) (= v1-29 'tentacle))) + (set-setting! 'process-mask 'set 0.0 (process-mask platform projectile death)) + ) + ((= v1-29 'endlessfall) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy projectile death guard)) + ) + ((or (= v1-29 'instant-death) + (= v1-29 'lava) + (= v1-29 'fry) + (= v1-29 'slime) + (= v1-29 'dark-eco-pool) + (= v1-29 'melt) + (= v1-29 'explode) + (= v1-29 'grenade) + (= v1-29 'big-explosion) + (= v1-29 'turret) + ) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + ) + (else + (let ((v1-38 (-> self water flags))) + (if (or (and (logtest? (water-flag touch-water) v1-38) + (logtest? (water-flag under-water swimming) v1-38) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + (= (-> self control cur-pat material) (pat-material waterbottom)) + ) + (set! arg0 'drown) + ) + ) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death guard)) + (if (using-gun? self) + (target-gun-end-mode #f) + ) + ) + ) + ) + (apply-settings *setting-control*) + (set! (-> self control transv quad) (the-as uint128 0)) + (logior! (-> self focus-status) (focus-status dead)) + (logior! (-> self target-flags) (target-flags disable-attacks)) + (let ((v1-61 arg0)) + (cond + ((or (= v1-61 'none) (= v1-61 'instant-death)) + ) + (else + (b! + (not (or (= v1-61 'dark-eco-pool) (= v1-61 'explode) (= v1-61 'grenade) (= v1-61 'big-explosion))) + cfg-138 + :delay (nop!) + ) + (let ((s5-1 (handle->process (-> self attack-info attacker)))) + (when (if (type? s5-1 water-vol) + s5-1 + ) + (logior! (-> self target-flags) (target-flags tf14)) + (set! (-> self alt-cam-pos y) (+ 4096.0 (-> self water height))) + ) + ) + (set! (-> self control mod-surface) *neutral-mods*) + (case arg0 + (('dark-eco-pool) + (sound-play "death-darkeco") + (cond + ((logtest? (-> *part-group-id-table* 62 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-3 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-3 + (let ((t9-15 (method-of-type part-tracker-subsampler activate))) + (t9-15 + (the-as part-tracker-subsampler s5-3) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-16 run-function-in-process) + (a0-66 s5-3) + (a1-29 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 62)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-16) a0-66 a1-29 *part-tracker-subsampler-params-default*) + ) + (-> s5-3 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-4 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-4 + (let ((t9-18 (method-of-type part-tracker activate))) + (t9-18 (the-as part-tracker s5-4) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-19 run-function-in-process) + (a0-72 s5-4) + (a1-32 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 62)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-19) a0-72 a1-32 *part-tracker-params-default*) + ) + (-> s5-4 ppointer) + ) + ) + ) + ) + (let ((v1-110 (-> self control root-prim))) + (set! (-> v1-110 prim-core collide-as) (collide-spec)) + (set! (-> v1-110 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self post-hook) target-no-ja-move-post) + (ja-channel-set! 0) + (ja-post) + (let ((s5-5 (current-time))) + (until (time-elapsed? s5-5 (seconds 2)) + (suspend) + ) + ) + ) + (('grenade 'big-explosion 'explode) + (set! (-> self post-hook) target-no-stick-post) + (set! (-> self control dynam gravity-max) 294912.0) + (set! (-> self control dynam gravity-length) 294912.0) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (case arg0 + (('big-explosion) + (sound-play "jak-explode") + ) + (else + (sound-play "explosion") + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 65 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-8 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-8 + (let ((t9-27 (method-of-type part-tracker-subsampler activate))) + (t9-27 + (the-as part-tracker-subsampler s5-8) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-28 run-function-in-process) + (a0-92 s5-8) + (a1-41 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 65)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-28) a0-92 a1-41 *part-tracker-subsampler-params-default*) + ) + (-> s5-8 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-9 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-9 + (let ((t9-30 (method-of-type part-tracker activate))) + (t9-30 (the-as part-tracker s5-9) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-31 run-function-in-process) + (a0-98 s5-9) + (a1-44 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 65)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-31) a0-98 a1-44 *part-tracker-params-default*) + ) + (-> s5-9 ppointer) + ) + ) + ) + ) + (set-vector! (-> self control transv) 0.0 65502.96 0.0 1.0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-hit-from-front-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (and (logtest? (-> self control status) (collide-status on-surface)) + (>= 409.6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (goto cfg-122) + ) + (suspend) + (ja :num! (seek!)) + ) + (while (not (or (logtest? (-> self control status) (collide-status on-surface)) + (time-elapsed? (-> self state-time) (seconds 2)) + ) + ) + (suspend) + ) + (label cfg-122) + (when (logtest? (-> self control status) (collide-status on-surface)) + (let ((v1-220 (-> self water flags))) + (b! + (or (and (logtest? (water-flag touch-water) v1-220) + (logtest? (water-flag under-water swimming) v1-220) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + (= (-> self control cur-pat material) (pat-material waterbottom)) + ) + cfg-168 + :delay (nop!) + ) + ) + (set! (-> self post-hook) target-no-move-post) + (let ((v1-232 (-> self control root-prim))) + (set! (-> v1-232 prim-core collide-as) (collide-spec)) + (set! (-> v1-232 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-death-painful-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self control transv quad) (the-as uint128 0)) + (vector-seek! + (-> self draw color-mult) + (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0) + (* 5.0 (seconds-per-frame)) + ) + (suspend) + (ja :num! (seek!)) + ) + (let ((s5-10 (current-time))) + (until (time-elapsed? s5-10 (seconds 2)) + (suspend) + ) + ) + ) + ) + ) + (b! #t cfg-206 :delay (nop!)) + (label cfg-138) + (cond + ((= v1-61 'turret) + (let ((v1-269 (-> self control root-prim))) + (set! (-> v1-269 prim-core collide-as) (collide-spec)) + (set! (-> v1-269 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self post-hook) target-no-ja-move-post) + (ja-channel-set! 0) + (ja-post) + (let ((s5-11 (current-time))) + (until (time-elapsed? s5-11 (seconds 1.2)) + (suspend) + ) + ) + ) + ((= v1-61 'endlessfall) + ((lambda :behavior target + () + (local-vars (v1-24 symbol)) + (sound-play "death-fall") + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) + ) + (sound-params-set! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2 -1.0) + (set-setting! 'mode-name 'cam-endlessfall 0.0 0) + (logclear! (-> self water flags) (water-flag swim-ground)) + (let ((f0-1 (fmin -4096.0 (- (-> self control ground-impact-vel))))) + (set! (-> self control unknown-word04) (the-as uint f0-1)) + (let ((v1-13 (new-stack-vector0))) + (let ((f1-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-13 (-> self control transv) (vector-float*! v1-13 (-> self control dynam gravity-normal) f1-3)) + ) + (let* ((f1-4 (vector-length v1-13)) + (f2-1 f1-4) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-1) + (vector-float*! v1-13 v1-13 (/ f1-4 f2-1)) + ) + ) + ) + ) + (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) + (set! v1-24 'target-hit-ground-hard) + (goto cfg-17) + ) + (target-falling-anim 30 (seconds 0.33)) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.8)) + (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) + (set! v1-24 'target-hit-ground-hard) + (goto cfg-17) + ) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((v1-49 (new-stack-vector0)) + (f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + ) + 0.0 + (vector-! + v1-49 + (-> self control transv) + (vector-float*! v1-49 (-> self control dynam gravity-normal) (the-as float f0-7)) + ) + (let* ((f1-7 (vector-length v1-49)) + (f2-2 f1-7) + ) + (if (< (the-as float (-> self control unknown-word04)) (the-as float f0-7)) + (set! f0-7 (-> self control unknown-word04)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f0-7)) + (vector-float*! v1-49 v1-49 (/ f1-7 f2-2)) + ) + ) + ) + (ja :group! jakb-launch-jump-loop-ja :num! (loop! 0.5)) + (suspend) + ) + ) + (set! v1-24 #f) + (label cfg-17) + (when (= v1-24 'target-hit-ground-hard) + (set-action! + *gui-control* + (gui-action fade) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> self control mod-surface) *neutral-mods*) + (set! (-> self post-hook) target-no-move-post) + (set! (-> self control transv quad) (the-as uint128 0)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-death-painful-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (vector-seek! (-> self draw color-mult) *identity-vector* (seconds-per-frame)) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 2)) + (suspend) + ) + ) + ) + (remove-setting! 'mode-name) + ) + ) + ) + ((or (= v1-61 'burn) (= v1-61 'burnup)) + (cond + ((logtest? (-> *part-group-id-table* 66 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-12 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-12 + (let ((t9-45 (method-of-type part-tracker-subsampler activate))) + (t9-45 + (the-as part-tracker-subsampler s5-12) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-46 run-function-in-process) + (a0-130 s5-12) + (a1-56 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 66)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-46) a0-130 a1-56 *part-tracker-subsampler-params-default*) + ) + (-> s5-12 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-13 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-13 + (let ((t9-48 (method-of-type part-tracker activate))) + (t9-48 (the-as part-tracker s5-13) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-49 run-function-in-process) + (a0-136 s5-13) + (a1-59 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 66)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-49) a0-136 a1-59 *part-tracker-params-default*) + ) + (-> s5-13 ppointer) + ) + ) + ) + ) + (target-death-anim (the-as spool-anim #f)) + ) + ((or (= v1-61 'lava) (= v1-61 'melt) (= v1-61 'fry) (= v1-61 'slime)) + ((lambda :behavior target + ((arg0 symbol)) + (local-vars (gp-2 vector)) + (sound-play "death-melt") + (let ((gp-1 (if (= arg0 'slime) + (-> *part-group-id-table* 63) + (-> *part-group-id-table* 64) + ) + ) + ) + (cond + ((logtest? (-> gp-1 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-1 + (let ((t9-3 (method-of-type part-tracker-subsampler activate))) + (t9-3 + (the-as part-tracker-subsampler s5-1) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-4 run-function-in-process) + (a0-9 s5-1) + (a1-3 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) gp-1) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-4) a0-9 a1-3 *part-tracker-subsampler-params-default*) + ) + (-> s5-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-2 + (let ((t9-6 (method-of-type part-tracker activate))) + (t9-6 (the-as part-tracker s5-2) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-7 run-function-in-process) + (a0-15 s5-2) + (a1-6 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) gp-1) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-7) a0-15 a1-6 *part-tracker-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + ) + ) + (let ((f30-0 (-> self control trans y))) + (logior! (-> self target-flags) (target-flags tf6)) + (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (logclear! (-> self water flags) (water-flag swim-ground)) + (let ((v1-38 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-38 (-> self control transv) (vector-float*! v1-38 (-> self control dynam gravity-normal) f0-2)) + ) + (let* ((f0-3 (vector-length v1-38)) + (f1-1 f0-3) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-38 v1-38 (/ f0-3 f1-1)) + ) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (set! (-> self control mod-surface) *dive-mods*) + (set! (-> self control dynam gravity-max) 409.6) + (set! (-> self control dynam gravity-length) 409.6) + (cond + ((and (logtest? (-> self control status) (collide-status on-surface)) + (and (= (-> self ext-anim) (target-anim default)) + (begin + (set! gp-2 (new 'stack-no-clear 'vector)) + (find-collision-below + gp-2 + (vector+! (new 'stack-no-clear 'vector) (-> self control trans) (new 'static 'vector :y -409.6 :w 1.0)) + 40960.0 + ) + ) + (< (+ -8192.0 (-> self control trans y)) (-> gp-2 y)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-death-lava-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (target-death-anim-trans) + (if (< (+ -409.6 f30-0) (-> self control trans y)) + (seek! (-> self control trans y) (+ -409.6 f30-0) (* 81920.0 (seconds-per-frame))) + ) + (suspend) + (ja :num! (seek!)) + ) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-death-swim-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (< (+ -10240.0 f30-0) (-> self control trans y)) + (seek! (-> self control trans y) (+ -10240.0 f30-0) (* 81920.0 (seconds-per-frame))) + ) + (suspend) + (ja :num! (seek!)) + ) + (dotimes (gp-3 1) + (ja-no-eval :group! jakb-death-swim-loop-ja :num! (seek! max 0.75) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.75)) + ) + ) + (ja-no-eval :group! jakb-death-swim-end-ja :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + #f + ) + ) + ) + ) + arg0 + ) + ) + ((or (= v1-61 'drown) (= v1-61 'drown-death)) + (label cfg-168) + ((lambda :behavior target + () + (logior! (-> self target-flags) (target-flags tf14)) + (set! (-> self alt-cam-pos y) (+ -8192.0 (-> self water height))) + (sound-play "death-drown") + (logclear! (-> self water flags) (water-flag swim-ground)) + (set! (-> self control mod-surface) *dive-mods*) + (set! (-> self control dynam gravity-max) 6144.0) + (set! (-> self control dynam gravity-length) 6144.0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-death-swim-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (< (+ -10240.0 (-> self water height)) (-> self control trans y)) + (seek! (-> self control trans y) (+ -10240.0 (-> self water height)) (* 81920.0 (seconds-per-frame))) + ) + (suspend) + (ja :num! (seek!)) + ) + (dotimes (gp-1 1) + (ja-no-eval :group! jakb-death-swim-loop-ja :num! (seek! max 0.75) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.75)) + ) + ) + (ja-no-eval :group! jakb-death-swim-end-ja :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + #f + ) + ) + ) + ((or (= v1-61 'target-hit-ground-hard) (= v1-61 'smush)) + (set! (-> self control mod-surface) *neutral-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-death-painful-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((s5-14 (current-time))) + (until (time-elapsed? s5-14 (seconds 2)) + (suspend) + ) + ) + ) + ((= v1-61 'centipede) + (set! (-> self trans-hook) #f) + (set! (-> self control mod-surface) *neutral-mods*) + (set! (-> self post-hook) target-no-move-post) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-hit-from-back-ja :num! min) + (while (not (-> self control unknown-spool-anim00)) + (suspend) + (ja :num! (loop!)) + ) + ) + ((= v1-61 'tentacle) + (set! (-> self trans-hook) #f) + (let ((s5-16 (-> self attack-info attacker))) + (target-darkjak-end-mode #f) + (set! (-> self post-hook) target-no-ja-move-post) + (while (and (handle->process s5-16) + (not (-> self control unknown-spool-anim00)) + (-> self control did-move-to-pole-or-max-jump-height) + ) + (handle->process s5-16) + (clone-anim-once s5-16 #t "") + (suspend) + 0 + ) + ) + ) + ((= v1-61 'bot) + ((lambda :behavior target + () + (set! (-> self trans-hook) #f) + (let ((gp-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! gp-0 (- (current-time) (-> self clock old-frame-counter))) + (if (-> self control unknown-spool-anim00) + (return (the-as object #f)) + ) + (suspend) + ) + (if (or (> gp-0 0) + (let ((v1-14 (ja-group))) + (and v1-14 (or (= v1-14 jakb-jump-ja) (= v1-14 jakb-jump-loop-ja) (= v1-14 jakb-duck-high-jump-ja))) + ) + ) + (target-hit-ground-anim #f (are-still?)) + ) + ) + (target-stance-push 1) + (until #f + (ja-no-eval :group! jakb-stance-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (-> self control unknown-spool-anim00) + (return (the-as object #f)) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + ) + (else + (target-death-main arg0) + ) + ) + ) + ) + ) + (label cfg-206) + (target-death-reset arg0 #f) + ) + :post target-no-stick-post + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc b/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc new file mode 100644 index 00000000000..7dcd5bb2ef4 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc @@ -0,0 +1,3574 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *gun-walk-mods*, type surface +(define *gun-walk-mods* + (new 'static 'surface + :name 'run + :turnv 18204.445 + :turnvf 60.0 + :turnvv 72817.78 + :turnvvf 300.0 + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (let* ((f0-0 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) + (f30-0 (lerp-scale 0.0 1.0 (fabs f0-0) 1820.4445 6371.5557)) + ) + (cond + ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (>= (-> self gun track-turnv-range) + (vector-vector-distance (-> self control trans) (-> self gun track-trans)) + ) + ) + (let* ((s5-1 (-> self control)) + (s3-0 (-> self gun track-trans)) + (f0-4 + (deg-diff (y-angle s5-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s3-0 (-> s5-1 trans)))) + ) + ) + (set! (-> self control unknown-float003) (lerp-scale 0.0 2.0 (fabs f0-4) 0.0 3640.889)) + ) + #t + ) + ((< (-> self control unknown-float003) f30-0) + (seek! (-> self control unknown-float003) f30-0 (* 4.0 (seconds-per-frame))) + ) + (else + (seek! (-> self control unknown-float003) f30-0 (seconds-per-frame)) + ) + ) + ) + (let ((f30-1 131072.0) + (f0-15 30.0) + ) + (when (< 1.0 (-> self control unknown-float003)) + (set! f30-1 (lerp-scale 131072.0 291271.12 (-> self control unknown-float003) 1.0 2.0)) + (set! f0-15 (lerp-scale 30.0 15.0 (-> self control unknown-float003) 1.0 2.0)) + (set! (-> arg0 turnvv) f30-1) + (set! (-> arg0 turnvvf) f0-15) + ) + (set! (-> arg0 turnv) f30-1) + (set! (-> arg0 turnvf) f0-15) + ) + (cond + ((and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) + (set! (-> arg0 turnvv) 0.0) + (set! (-> arg0 turnvvf) 0.0) + (set! (-> arg0 seek0) 0.0) + (set! (-> arg0 seek90) 0.0) + (set! (-> arg0 seek180) 0.0) + (set! (-> arg0 transv-max) 0.0) + ) + ((and (-> self next-state) (= (-> self next-state name) 'target-gun-stance)) + (set! (-> arg0 turnv) 364088.88) + (set! (-> arg0 turnvf) 30.0) + arg0 + ) + ) + ) + ) + ) + :flags (surface-flag look-around no-turn-around) + ) + ) + +;; definition for function want-to-gun? +(defbehavior want-to-gun? process ((arg0 target) (arg1 symbol)) + (local-vars (v1-43 symbol)) + (and (logtest? (-> arg0 game features) (game-feature gun)) + (time-elapsed? (-> arg0 gun gun-time) (seconds 0.1)) + (not (focus-test? arg0 dead hit board mech dark teleporting)) + (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> arg0 control current-surface flags))) + (not (logtest? (target-flags prevent-gun invisible) (-> arg0 target-flags))) + (logtest? (logand (game-feature + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + ) + (-> *setting-control* user-current features) + ) + (-> arg0 game features) + ) + (-> *setting-control* user-current gun) + (or (not (logtest? (-> arg0 control current-surface flags) (surface-flag duck))) (can-exit-duck? arg0)) + (or (not (focus-test? arg0 pilot)) (-> arg0 pilot gun?)) + (not (and (-> arg0 next-state) (let ((v1-29 (-> arg0 next-state name))) + (or (= v1-29 'target-powerjak-get-on) (= v1-29 'target-lightjak-get-on)) + ) + ) + ) + (zero? (-> arg0 lightjak shield-start-time)) + (or arg1 + (nonzero? (-> arg0 gun using-gun-type)) + (begin + (set! v1-43 (and (cpad-hold? (-> arg0 control cpad number) r1) + (not (focus-test? arg0 grabbed)) + (begin (set! v1-43 #t) (set! (-> arg0 gun latch?) v1-43) v1-43) + ) + ) + v1-43 + ) + (-> arg0 gun latch?) + ) + (not (-> arg0 skel top-anim frame-group)) + (time-elapsed? (-> arg0 control time-of-last-debug-float) (seconds 0.1)) + (not (-> arg0 board latch?)) + ) + ) + +;; definition for function target-gun-event-handler +(defbehavior target-gun-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'gun + ) + (else + (case arg2 + (('change-mode) + (case (-> arg3 param 0) + (('grab) + (when (not (focus-test? self dead)) + (if (not (-> arg3 param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + (('gun) + (let ((v1-9 (-> arg3 param 2))) + (when (nonzero? v1-9) + (set! (-> self gun using-gun-type) (the-as pickup-type v1-9)) + v1-9 + ) + ) + ) + (('falling) + (go target-falling #f) + ) + (('look-around) + (go target-look-around) + ) + (('normal 'board 'pilot) + (if (and (using-gun? self) (target-gun-end-mode #f)) + (go target-stance) + ) + ) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +;; definition for function target-gun-setup +;; WARN: Return type mismatch int vs none. +(defbehavior target-gun-setup target ((arg0 symbol)) + (when (zero? (-> self gun)) + (if (= (-> self game gun-type) (pickup-type none)) + (set! (-> self game gun-type) (pickup-type gun-red-1)) + ) + (set! (-> self gun) (new 'process 'gun-info)) + (set! (-> self gun process) (the-as (pointer target) (process->ppointer self))) + (set! (-> self gun strip) #f) + (set! (-> self gun uv-slide) 0.0) + (set! (-> self gun gun) (the-as (pointer gun) #f)) + (set! (-> self gun active?) #f) + (set! (-> self gun latch?) #f) + (set! (-> self gun put-away?) #f) + (set! (-> self gun charge-active?) (the-as handle #f)) + (set! (-> self gun mode-sound-bank) #f) + (set! (-> self skel top-anim) (new 'process 'top-anim-joint-control self)) + (set! (-> self skel interp-select 0) 0) + (set! (-> self skel interp-select 1) 0) + (quaternion-identity! (the-as quaternion (-> self gun top-anim-twist))) + (set! (-> self gun combo-window-state) #f) + ((method-of-type focus reset-to-collide-spec) + (the-as focus (-> self gun track-target)) + (collide-spec jak player-list) + ) + (reset-to-collide-spec (-> self gun track-target 1) (collide-spec jak player-list)) + (add-connection *pad-engine* self target-gun-marking-menu self #f #f) + ) + (if (not arg0) + (target-gun-end-mode #f) + ) + (when (-> self gun gun) + (deactivate (-> self gun gun 0)) + (set! (-> self gun gun) (the-as (pointer gun) #f)) + ) + (if arg0 + (set! (-> self gun gun) (process-spawn gun :init gun-init :name "gun" :from *8k-dead-pool* :to self)) + ) + 0 + (none) + ) + +;; definition for function target-gun-init +;; WARN: Return type mismatch int vs none. +(defbehavior target-gun-init target ((arg0 pickup-type)) + (target-darkjak-end-mode #f) + (let ((gp-0 (-> self gun))) + (if (zero? (-> gp-0 hips)) + (set! (-> gp-0 hips) (new 'process 'joint-mod (joint-mod-mode rotate) self 38)) + ) + (if (zero? (-> gp-0 upper-body)) + (set! (-> gp-0 upper-body) (-> self upper-body)) + ) + (mode-set! (-> gp-0 hips) (joint-mod-mode rotate)) + (set! (-> gp-0 gun-roty) (y-angle (-> self control))) + (reset (-> self skel top-anim)) + (set! (-> self skel top-anim interp) 1.0) + (quaternion-identity! (the-as quaternion (-> self gun top-anim-twist))) + (quaternion-identity! (the-as quaternion (-> self gun top-anim-twist-targ))) + (set! (-> self gun top-anim-twist-reset) (the-as uint 0)) + (set! (-> gp-0 gun-type) (pickup-type gun-yellow-1)) + (target-gun-type-set! arg0) + (set-time! (-> gp-0 gun-get-on-time)) + ) + (set! (-> self board latch?) #f) + (set! (-> self gun put-away?) #f) + (set! (-> self gun active?) #f) + (set! (-> self gun surpress-time) 0) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) + (set! (-> self gun track-turn) 0.0) + (set! (-> self gun track-tilt) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (set! (-> self gun turn-fast-hold-time) 0) + (set! (-> self gun gun-delay-fire) 0.0) + ((method-of-type focus reset-to-collide-spec) + (the-as focus (-> self gun track-target)) + (collide-spec jak player-list) + ) + (set! (-> self gun fire-dir-rot) 0.0) + (set! (-> self control unknown-float003) 0.0) + (set! (-> self gun blue-whine-volume) 0.0) + (if (zero? (-> self gun blue-whine-sound-id)) + (set! (-> self gun blue-whine-sound-id) (new-sound-id)) + ) + (sound-play "gun-takeout") + (set! (-> self gun charge-ammo) 0.0) + (set! (-> self gun charge-start-time) 0) + (set! (-> self gun top-anim-tilt-up) 0.0) + (let ((f30-0 + (if (or (nonzero? (-> self gun fire-pending)) (cpad-hold? (-> self control cpad number) r1) (-> self gun latch?)) + 2.0 + 1.0 + ) + ) + ) + (cond + ((focus-test? self pilot-riding) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-red)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-dark)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-dark-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + ) + ) + (else + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-yellow-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-red)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + (((pickup-type eco-dark)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-dark-takeout-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + ) + ) + ) + ) + ) + (if (= (-> self control collide-mode) 'duck) + (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) + (target-collide-set! 'gun 0.0) + ) + 0 + (none) + ) + +;; definition for function target-gun-exit +(defun target-gun-exit () + #f + ) + +;; definition for function target-gun-end-mode +(defbehavior target-gun-end-mode target ((arg0 symbol)) + (let ((s5-0 #f)) + (when (using-gun? self) + (set! (-> self gun fire-pending) 0) + (mode-set! (-> self gun hips) (joint-mod-mode flex-blend)) + (send-event *camera* 'clear-slave-option (cam-slave-options STICKY_ANGLE BLOCK_RIGHT_STICK GUN_CAM)) + (send-event *camera* 'set-dist #f #f) + (send-event *camera* 'yes-follow) + (let ((v1-17 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-17 command) (sound-command set-param)) + (set! (-> v1-17 id) (-> self gun blue-whine-sound-id)) + (set! (-> v1-17 params volume) -4) + (set! (-> v1-17 auto-time) 120) + (set! (-> v1-17 auto-from) 2) + (set! (-> v1-17 params mask) (the-as uint 17)) + (-> v1-17 id) + ) + (set! (-> self gun active?) #f) + (cond + ((and (not (logtest? (surface-flag gun-fast-exit) (-> self control current-surface flags))) + (not (focus-test? self dead)) + (!= arg0 'fast-exit) + ) + (sound-play "gun-putaway") + (cond + ((focus-test? self pilot-riding) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-red)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-dark)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-dark-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (else + (set! (-> self skel top-anim interp) 0.0) + ) + ) + ) + (else + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-yellow-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-red)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-takeout-ja) + 14.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (((pickup-type eco-dark)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-dark-takeout-ja) + 0.0 + 10 + 0 + -1.0 + 0.0 + #f + ) + (set! (-> self skel top-anim frame-post-put-away) (the-as basic #t)) + ) + (else + (set! (-> self skel top-anim interp) 0.0) + ) + ) + ) + ) + ) + (else + (set! (-> self skel top-anim interp) 0.0) + ) + ) + (set! (-> self gun gun-delay-fire) 0.0) + (set! (-> self gun gun-type) (pickup-type none)) + (setting-control-method-14 *setting-control* (-> self gun mode-sound-bank)) + (set! (-> self gun mode-sound-bank) #f) + (remove-setting! 'sound-flava) + (if (= (-> self control collide-mode) 'duck) + (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) + (target-collide-set! 'normal 0.0) + ) + (set! s5-0 #t) + ) + (when arg0 + (set! (-> self gun using-gun-type) (pickup-type none)) + (set! (-> self gun latch?) #f) + (set! (-> self gun put-away?) #f) + ) + s5-0 + ) + ) + +;; definition for function quat<-gun! +(defun quat<-gun! ((arg0 quaternion) (arg1 quaternion)) + (gun->eco (the-as pickup-type arg1)) + (quaternion-copy! arg0 (the-as quaternion *null-vector*)) + ) + +;; definition for function target-gun-ammo-out-pick +(defbehavior target-gun-ammo-out-pick target () + (cond + ((and (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow-1 gun-yellow-2 gun-yellow-3)) + (-> self game features) + ) + ) + (< 0.0 (-> self game gun-ammo 0)) + ) + 29 + ) + ((and (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red-1 gun-red-2 gun-red-3)) + (-> self game features) + ) + ) + (< 0.0 (-> self game gun-ammo 1)) + ) + 26 + ) + ((and (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue-1 gun-blue-2 gun-blue-3)) + (-> self game features) + ) + ) + (< 0.0 (-> self game gun-ammo 2)) + ) + 32 + ) + ((and (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (game-feature gun-dark-1 gun-dark-2 gun-dark-3) (-> *setting-control* user-current features)) + (-> self game features) + ) + ) + (< 0.0 (-> self game gun-ammo 3)) + ) + 35 + ) + (else + 0 + ) + ) + ) + +;; definition for function target-gun-type-set! +;; WARN: Return type mismatch int vs none. +(defbehavior target-gun-type-set! target ((arg0 pickup-type)) + (if (= arg0 (pickup-type none)) + (set! arg0 (-> self game gun-type)) + ) + (when (not (logtest? (the-as game-feature (ash 1 (+ (the-as int arg0) -20))) + (logand (-> self game features) (-> *setting-control* user-current features)) + ) + ) + (when (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow-1)) + (-> self game features) + ) + ) + (set! arg0 (pickup-type gun-yellow-1)) + (goto cfg-39) + ) + (when (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red-1)) + (-> self game features) + ) + ) + (set! arg0 (pickup-type gun-red-1)) + (goto cfg-39) + ) + (when (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue-1)) + (-> self game features) + ) + ) + (set! arg0 (pickup-type gun-blue-1)) + (goto cfg-39) + ) + (when (and (logtest? (-> self game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark-1)) + (-> self game features) + ) + ) + (set! arg0 (pickup-type gun-dark-1)) + (goto cfg-39) + ) + (set! arg0 (pickup-type none)) + (label cfg-39) + (cond + ((zero? (the-as int arg0)) + (set! arg0 (the-as pickup-type arg0)) + (goto cfg-116) + ) + (else + (empty) + ) + ) + ) + (set! (-> self game gun-type) (the-as pickup-type arg0)) + (set! (-> self gun track-turnv-range) 81920.0) + (set! (-> self gun track-tilt-range) 0.0) + (set! (-> self gun track-turn-range) 0.0) + (set! (-> self gun track-turn-max) 1820.4445) + (set! (-> self gun track-tilt-max) 16019.911) + (set! (-> self gun gun-control) (the-as uint 1)) + (set! (-> self gun fire-spin) 0.0) + (set! (-> self gun fire-spinv) 0.0) + (set! (-> self gun fire-time) 0) + (set! (-> self gun laser-active?) #t) + (set! (-> self gun top-anim-gun-height) 5283.84) + (set! (-> self gun top-anim-low-high) 0.0) + (set! (-> self gun gun-delay-fire) 0.0) + (set! (-> self skel top-anim frame-speed) 1.0) + (set! (-> self skel top-anim frame-targ) #f) + (truncate-player-ammo (pickup-type ammo-red)) + (truncate-player-ammo (pickup-type ammo-yellow)) + (truncate-player-ammo (pickup-type ammo-blue)) + (truncate-player-ammo (pickup-type ammo-dark)) + (when (using-gun? self) + (let ((s5-0 (gun->eco (-> self gun gun-type)))) + (-> self gun gun-type) + (set! (-> self gun gun-type) (the-as pickup-type arg0)) + (set! (-> self gun using-gun-type) (the-as pickup-type arg0)) + (setting-control-method-14 *setting-control* (-> self gun mode-sound-bank)) + (set! (-> self gun mode-sound-bank) #f) + ((lambda :behavior target + ((arg0 pickup-type)) + (case arg0 + (((pickup-type gun-yellow-1)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modeguy1 0.0 0))) + ) + (((pickup-type gun-yellow-2)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modeguy2 0.0 0))) + ) + (((pickup-type gun-yellow-3)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modeguy3 0.0 0))) + ) + (((pickup-type gun-red-1)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegur1 0.0 0))) + ) + (((pickup-type gun-red-2)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegur2 0.0 0))) + ) + (((pickup-type gun-red-3)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegur3 0.0 0))) + ) + (((pickup-type gun-blue-1)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegub1 0.0 0))) + ) + (((pickup-type gun-blue-2)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegub2 0.0 0))) + ) + (((pickup-type gun-blue-3)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegub3 0.0 0))) + ) + (((pickup-type gun-dark-1)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegud1 0.0 0))) + ) + (((pickup-type gun-dark-2)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegud2 0.0 0))) + ) + (((pickup-type gun-dark-3)) + (set! (-> self gun mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modegud3 0.0 0))) + ) + ) + (none) + ) + (the-as pickup-type arg0) + ) + (case (the-as int arg0) + ((32 29 35 26) + (set! (-> self gun ammo-required) 1.0) + ) + ((27) + (set! (-> self gun ammo-required) 1.0) + ) + ((28) + (set! (-> self gun ammo-required) (if (logtest? (game-secrets gun-upgrade-red-3) (-> *game-info* secrets)) + 8.0 + 10.0 + ) + ) + ) + ((36) + (set! (-> self gun ammo-required) 1.0) + ) + ((37) + (set! (-> self gun ammo-required) (if (logtest? (game-secrets gun-upgrade-dark-3) (-> *game-info* secrets)) + 8.0 + 10.0 + ) + ) + ) + ((33) + (set! (-> self gun ammo-required) 1.0) + ) + ((34) + (set! (-> self gun ammo-required) 1.0) + ) + ((30) + (set! (-> self gun ammo-required) 1.0) + ) + ((31) + (set! (-> self gun ammo-required) 10.0) + ) + ) + (case (the-as int arg0) + ((32 33 34) + (set! (-> self gun gun-control) (the-as uint 4)) + (set! (-> self gun fire-range) 327680.0) + (set! (-> self gun track-find-range) 327680.0) + (set! (-> self gun track-turn-range) 327680.0) + (set! (-> self gun track-turn-max) 910.2222) + (set! (-> self gun track-tilt-range) 327680.0) + (set! (-> self gun track-angle-mult) 1.75) + (set! (-> self gun track-require) (the-as uint 26)) + (set! (-> self gun fire-delay) (the-as uint 15)) + (set! (-> self gun combo-fire-delay) (the-as uint 30)) + (set! (-> self gun track-beam-size) 2457.6) + (remove-setting! 'gun-min-height) + (remove-setting! 'gun-max-height) + ) + ((29 30) + (set! (-> self gun fire-range) 409600.0) + (set! (-> self gun track-find-range) 286720.0) + (set! (-> self gun track-tilt-range) 409600.0) + (set! (-> self gun track-turn-range) 409600.0) + (set! (-> self gun track-angle-mult) 1.75) + (set! (-> self gun track-require) (the-as uint 26)) + (set! (-> self gun fire-delay) (the-as uint 96)) + (set! (-> self gun combo-fire-delay) (the-as uint 30)) + (set! (-> self gun track-beam-size) 819.2) + (remove-setting! 'gun-min-height) + (remove-setting! 'gun-max-height) + ) + ((31) + (set! (-> self gun fire-delay) (the-as uint 0)) + (set! (-> self gun laser-active?) #f) + (set! (-> self gun fire-range) 0.0) + (set! (-> self gun track-find-range) 0.0) + (set! (-> self gun track-tilt-range) 0.0) + (set! (-> self gun track-turn-range) 0.0) + (set! (-> self gun track-turn-max) 0.0) + (set! (-> self gun track-angle-mult) 0.0) + (set! (-> self gun track-require) (the-as uint 0)) + 0 + ) + ((26 28) + (set! (-> self gun fire-range) 61440.0) + (set! (-> self gun track-find-range) 81920.0) + (set! (-> self gun track-tilt-range) 61440.0) + (set! (-> self gun track-turn-range) 61440.0) + (set! (-> self gun track-turn-max) 910.2222) + (set! (-> self gun track-angle-mult) 0.0) + (set! (-> self gun track-require) (the-as uint 26)) + (if (or (and (logtest? (game-secrets gun-upgrade-red-1) (-> *game-info* secrets)) (= (the-as int arg0) 26)) + (and (logtest? (game-secrets gun-upgrade-red-3) (-> *game-info* secrets)) (= (the-as int arg0) 28)) + ) + (set! (-> self gun fire-delay) (the-as uint 180)) + (set! (-> self gun fire-delay) (the-as uint 330)) + ) + (set! (-> self gun combo-fire-delay) (the-as uint 150)) + (set! (-> self gun track-beam-size) 1228.8) + (remove-setting! 'gun-min-height) + (set-setting! 'gun-max-height 'abs (meters 6) 0) + ) + ((27) + (set! (-> self gun fire-delay) (the-as uint 240)) + (set! (-> self gun gun-control) (the-as uint 2)) + (set! (-> self gun laser-active?) #f) + (set! (-> self gun fire-range) 0.0) + (set! (-> self gun track-find-range) 0.0) + (set! (-> self gun track-tilt-range) 0.0) + (set! (-> self gun track-turn-range) 0.0) + (set! (-> self gun track-turn-max) 0.0) + (set! (-> self gun track-angle-mult) 0.0) + (set! (-> self gun track-require) (the-as uint 0)) + 0 + ) + ((35 36 37) + (set! (-> self gun gun-control) (the-as uint 2)) + (set! (-> self gun fire-range) 1638400.0) + (set! (-> self gun track-tilt-range) 1638400.0) + (set! (-> self gun track-turn-range) 1638400.0) + (set! (-> self gun track-find-range) 1638400.0) + (set! (-> self gun track-angle-mult) 1.75) + (set! (-> self gun fire-delay) (the-as uint 255)) + (set! (-> self gun combo-fire-delay) (the-as uint 150)) + (set! (-> self gun track-beam-size) 1228.8) + (set! (-> self gun track-require) (the-as uint 24)) + (remove-setting! 'gun-min-height) + (remove-setting! 'gun-max-height) + ) + ) + (quat<-gun! (the-as quaternion (-> self gun top-anim-twist-targ)) (the-as quaternion arg0)) + (set! (-> self skel top-anim frame-post-blend) 0.1333333) + ((lambda :behavior target + ((arg0 pickup-type) (arg1 pickup-type)) + (cond + ((focus-test? self pilot-riding) + (let ((v1-2 (gun->eco arg0))) + (cond + ((or (and (= arg1 (pickup-type eco-red)) (= v1-2 (pickup-type eco-dark))) + (and (= arg1 v1-2) (or (= v1-2 (pickup-type eco-red)) (= v1-2 (pickup-type eco-dark)))) + ) + (if (rand-vu-percent? 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-dark-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-yellow-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ) + ((and (= arg1 (pickup-type eco-dark)) (= v1-2 (pickup-type eco-red))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-dark-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((or (and (= arg1 (pickup-type eco-red)) (= v1-2 (pickup-type eco-yellow))) + (and (= arg1 v1-2) (= v1-2 (pickup-type eco-yellow))) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-yellow-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-2 (pickup-type eco-red))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-yellow-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-red)) (= v1-2 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-blue-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-2 (pickup-type eco-red))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-blue-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-2 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-blue-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 v1-2) (= v1-2 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-blue-ja) + 0.0 + 30 + 0 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-2 (pickup-type eco-yellow))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-blue-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-dark)) (= v1-2 (pickup-type eco-yellow))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-yellow-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-dark)) (= v1-2 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-blue-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-2 (pickup-type eco-dark))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-blue-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-2 (pickup-type eco-dark))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-yellow-ja) + 0.0 + 30 + 0 + -1.0 + 0.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ) + ) + ) + (else + (let ((v1-60 (gun->eco arg0))) + (cond + ((and (= arg1 (pickup-type eco-red)) (= v1-60 (pickup-type eco-dark))) + (if (rand-vu-percent? 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-front-hop-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-transformation-twirl-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-2" :group 1)) + ) + ) + ) + ((or (and (= arg1 (pickup-type eco-dark)) (= v1-60 (pickup-type eco-red))) + (and (= arg1 v1-60) + (or (= v1-60 (pickup-type eco-red)) (= v1-60 (pickup-type eco-dark)) (= v1-60 (pickup-type eco-yellow))) + ) + ) + (if (rand-vu-percent? 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-front-hop-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-transformation-twirl-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-2" :group 1)) + ) + ) + ) + ((and (= arg1 v1-60) (= v1-60 (pickup-type eco-blue))) + (if (or (rand-vu-percent? 0.5) (nonzero? (-> self ext-anim))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-side-hop-1-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-side-hop-2-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ) + ((and (= arg1 (pickup-type eco-dark)) (= v1-60 (pickup-type eco-yellow))) + (if (rand-vu-percent? 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-transformation-twirl-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-2" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-to-side-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-3" :group 1)) + ) + ) + ) + ((and (= arg1 (pickup-type eco-red)) (= v1-60 (pickup-type eco-yellow))) + (if (rand-vu-percent? 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-transformation-twirl-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-2" :group 1)) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-to-side-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-3" :group 1)) + ) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-60 (pickup-type eco-red))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-front-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-60 (pickup-type eco-dark))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-to-front-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-1" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-red)) (= v1-60 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-to-blue-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-4" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-dark)) (= v1-60 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-to-blue-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-4" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-60 (pickup-type eco-red))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-to-front-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-5" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-60 (pickup-type eco-dark))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-to-front-hop-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-5" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-yellow)) (= v1-60 (pickup-type eco-blue))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-to-blue-hop-ja) + 0.0 + 30 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-4" :group 1)) + ) + ) + ((and (= arg1 (pickup-type eco-blue)) (= v1-60 (pickup-type eco-yellow))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-to-yellow-ja) + 0.0 + 19 + 19 + 1.0 + 2.0 + (the-as symbol (static-sound-spec "gun-trans-6" :group 1)) + ) + ) + ) + ) + ) + ) + (none) + ) + (the-as pickup-type arg0) + s5-0 + ) + ) + ) + (set! (-> self gun upper-body twist-max x) (-> self gun track-tilt-max)) + (set! (-> self gun upper-body twist-max y) (-> self gun track-turn-max)) + (set! (-> self gun upper-body twist-max z) (-> self gun track-tilt-range)) + (set! (-> self gun upper-body twist-max w) (-> self gun track-turn-range)) + (set! (-> self gun upper-body max-dist) (fmax (-> self gun track-tilt-range) (-> self gun track-turn-range))) + (label cfg-116) + (none) + ) + +;; definition for function target-gun-marking-menu +;; WARN: Return type mismatch int vs none. +(defun target-gun-marking-menu ((arg0 target)) + (local-vars (v1-64 int) (v1-102 int) (v1-140 int)) + (update (-> arg0 ext-anim-control)) + (when (and (not (paused?)) + (not (and (focus-test? arg0 dark) (nonzero? (-> arg0 darkjak)))) + (or (not (logtest? (surface-flag sf29) (-> arg0 control current-surface flags))) + (-> *setting-control* user-current change-gun) + ) + (-> *setting-control* user-current gun) + ) + (let ((s5-0 (the-as int (-> arg0 gun using-gun-type)))) + (cond + ((cpad-pressed? (-> arg0 control cpad number) down) + (set! (-> arg0 gun gun-select-time 1) (-> *display* real-clock frame-counter)) + (set! s5-0 + (cond + ((= (gun->eco (the-as pickup-type s5-0)) (pickup-type eco-yellow)) + (dotimes (v1-26 3) + (+! s5-0 1) + (if (< 31 s5-0) + (set! s5-0 29) + ) + (when (logtest? (the-as game-feature (ash 1 (+ s5-0 -20))) + (logand (-> arg0 game features) (-> *setting-control* user-current features)) + ) + (set! s5-0 s5-0) + (goto cfg-49) + ) + ) + 29 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow-1)) + (-> arg0 game features) + ) + ) + 29 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow-2)) + (-> arg0 game features) + ) + ) + 30 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow-3)) + (-> arg0 game features) + ) + ) + 31 + ) + (else + (empty) + s5-0 + ) + ) + ) + (label cfg-49) + ) + ((cpad-pressed? (-> arg0 control cpad number) up) + (set! (-> arg0 gun gun-select-time 0) (-> *display* real-clock frame-counter)) + (set! v1-64 + (cond + ((= (gun->eco (the-as pickup-type s5-0)) (pickup-type eco-red)) + (dotimes (v1-63 3) + (set! s5-0 (+ s5-0 1)) + (if (< 28 s5-0) + (set! s5-0 26) + ) + (when (logtest? (the-as game-feature (ash 1 (+ s5-0 -20))) + (logand (-> arg0 game features) (-> *setting-control* user-current features)) + ) + (set! v1-64 s5-0) + (goto cfg-86) + ) + ) + 26 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red-1)) + (-> arg0 game features) + ) + ) + 26 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red-2)) + (-> arg0 game features) + ) + ) + 27 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red-3)) + (-> arg0 game features) + ) + ) + 28 + ) + (else + s5-0 + ) + ) + ) + (label cfg-86) + (set! s5-0 v1-64) + ) + ((cpad-pressed? (-> arg0 control cpad number) left) + (set! (-> arg0 gun gun-select-time 2) (-> *display* real-clock frame-counter)) + (set! v1-102 + (cond + ((= (gun->eco (the-as pickup-type s5-0)) (pickup-type eco-blue)) + (dotimes (v1-101 3) + (set! s5-0 (+ s5-0 1)) + (if (< 34 s5-0) + (set! s5-0 32) + ) + (when (logtest? (the-as game-feature (ash 1 (+ s5-0 -20))) + (logand (-> arg0 game features) (-> *setting-control* user-current features)) + ) + (set! v1-102 s5-0) + (goto cfg-123) + ) + ) + 32 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue-1)) + (-> arg0 game features) + ) + ) + 32 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue-2)) + (-> arg0 game features) + ) + ) + 33 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue-3)) + (-> arg0 game features) + ) + ) + 34 + ) + (else + s5-0 + ) + ) + ) + (label cfg-123) + (set! s5-0 v1-102) + ) + ((cpad-pressed? (-> arg0 control cpad number) right) + (set! (-> arg0 gun gun-select-time 3) (-> *display* real-clock frame-counter)) + (set! v1-140 + (cond + ((= (gun->eco (the-as pickup-type s5-0)) (pickup-type eco-dark)) + (dotimes (v1-139 3) + (set! s5-0 (+ s5-0 1)) + (if (< 37 s5-0) + (set! s5-0 35) + ) + (when (logtest? (the-as game-feature (ash 1 (+ s5-0 -20))) + (logand (-> arg0 game features) (-> *setting-control* user-current features)) + ) + (set! v1-140 s5-0) + (goto cfg-160) + ) + ) + 35 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark-1)) + (-> arg0 game features) + ) + ) + 35 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (game-feature gun-dark-2) (-> *setting-control* user-current features)) + (-> arg0 game features) + ) + ) + 36 + ) + ((and (logtest? (-> arg0 game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (game-feature gun-dark-3) (-> *setting-control* user-current features)) + (-> arg0 game features) + ) + ) + 37 + ) + (else + s5-0 + ) + ) + ) + (label cfg-160) + (set! s5-0 v1-140) + ) + ) + (when (and (nonzero? s5-0) + (logtest? (the-as game-feature (ash 1 (+ s5-0 -20))) + (logand (-> arg0 game features) (-> *setting-control* user-current features)) + ) + (or (not (focus-test? arg0 pilot)) (and (nonzero? (-> arg0 pilot)) (-> arg0 pilot gun?))) + (begin (set! (-> arg0 gun using-gun-type) (the-as pickup-type s5-0)) s5-0) + (!= s5-0 (-> arg0 gun gun-type)) + (let ((v1-179 (-> arg0 skel top-anim frame-targ))) + (or (not v1-179) + (= v1-179 (-> arg0 draw art-group data 342)) + (= v1-179 (-> arg0 draw art-group data 338)) + (= v1-179 (-> arg0 draw art-group data 343)) + (= v1-179 (-> arg0 draw art-group data 339)) + (= v1-179 (-> arg0 draw art-group data 296)) + (= v1-179 (-> arg0 draw art-group data 238)) + ) + ) + (not (handle->process (-> arg0 gun charge-active?))) + ) + (cond + ((using-gun? arg0) + (sound-play "select-option") + (send-event arg0 'gun-type s5-0) + ) + ((want-to-gun? arg0 #t) + (send-event arg0 'change-mode 'gun #f s5-0) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-gun-build-track-list +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-gun-build-track-list target () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (-> self gun track-dir))) + (set! (-> s4-0 quad) + (-> (if (and (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + ) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + ) + (-> self gun fire-dir) + (-> self control to-target-pt-xz) + ) + quad + ) + ) + (vector-flatten! s4-0 s4-0 (-> self control c-R-w uvec)) + (vector-normalize! s4-0 1.0) + (+! (-> gp-0 y) 6144.0) + (vector+float*! gp-0 gp-0 s4-0 -32768.0) + (vector+float*! s5-0 gp-0 s4-0 (+ 32768.0 (-> self gun track-find-range))) + ) + (let ((s4-1 (-> self focus-search)) + (s3-0 (vector-average! (new 'stack-no-clear 'vector) gp-0 s5-0)) + ) + (set! (-> s3-0 w) (* 0.5 (vector-vector-distance gp-0 s5-0))) + (set! (-> s4-1 length) + (fill-actor-list-for-box *actor-hash* (the-as bounding-box s3-0) (-> s4-1 data) (-> s4-1 allocated-length)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-gun-find-track +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-gun-find-track target () + (if (logtest? (-> self gun upper-body track-mode) (track-mode lock-on)) + (logior! (-> self gun track?) (gun-track-flags gutflags-3)) + (logclear! (-> self gun track?) (gun-track-flags gutflags-3)) + ) + (let ((gp-0 (the-as process-focusable #f))) + (when (and (or (not (time-elapsed? (-> self control time-of-last-nonzero-input) (seconds 0.2))) + (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (or (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) + (= (gun->eco (-> self gun gun-type)) (pickup-type eco-dark)) + ) + ) + (>= (current-time) (-> self gun track-target-hold-time)) + ) + (target-gun-build-track-list) + (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg neckB)))) + (+! (-> gp-1 y) 2048.0) + (cond + ((logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + (set! gp-0 (find-nearest-focusable + (-> self focus-search) + (-> self control trans) + (+ 32768.0 (-> self gun track-find-range)) + (search-info-flag crate attackable enemy cull-angle probe prefer-center) + (the-as search-info-flag (-> self gun track-require)) + (-> self gun track-dir) + gp-1 + 10922.667 + ) + ) + ) + ((or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) + ) + (set! gp-0 (find-nearest-focusable + (-> self focus-search) + (-> self control trans) + (fmin 122880.0 (+ 32768.0 (-> self gun track-find-range))) + (search-info-flag crate attackable enemy cull-angle probe) + (the-as search-info-flag (-> self gun track-require)) + (-> self gun track-dir) + gp-1 + 16384.0 + ) + ) + ) + ((= (gun->eco (-> self gun gun-type)) (pickup-type eco-dark)) + (set! gp-0 (find-nearest-focusable + (-> self focus-search) + (-> self control trans) + (+ 32768.0 (-> self gun track-find-range)) + (search-info-flag crate attackable enemy cull-angle prefer-center) + (the-as search-info-flag (-> self gun track-require)) + (-> self gun track-dir) + gp-1 + 5461.3335 + ) + ) + ) + (else + (set! gp-0 (find-nearest-focusable + (-> self focus-search) + (-> self control trans) + (+ 32768.0 (-> self gun track-find-range)) + (search-info-flag crate attackable enemy cull-angle probe prefer-center) + (the-as search-info-flag (-> self gun track-require)) + (-> self gun track-dir) + gp-1 + 5461.3335 + ) + ) + ) + ) + ) + ) + (cond + (gp-0 + (set! (-> self gun track-target-hold-time) 0) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) + (set! (-> self gun track-trans quad) (-> (get-trans gp-0 3) quad)) + (when ((method-of-type focus try-update-focus) (the-as focus (-> self gun track-target)) gp-0) + (set-time! (-> self gun track-start-time)) + (if (not (time-elapsed? (-> self control time-of-last-nonzero-input) (seconds 0.2))) + (set-time! (-> self gun track-press-start-time)) + ) + ) + (if (logtest? (process-mask->search-info-flag gp-0) (search-info-flag guard enemy attackable-priority)) + (try-update-focus (-> self gun track-target 1) gp-0) + ) + ) + (else + (let ((s5-2 (handle->process (-> self gun track-target 0 handle)))) + (cond + ((or (not s5-2) + (or (and (focus-test? (the-as process-focusable s5-2) dead) (zero? (-> self gun track-target-hold-time))) + (and (not (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) + ) + (and (not (logtest? (surface-flag spin) (-> self control current-surface flags))) + (let ((f30-0 21845.334) + (s4-1 (-> self control)) + (s2-0 (-> self gun track-trans)) + ) + (< f30-0 + (fabs + (deg-diff (y-angle s4-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-1 trans)))) + ) + ) + ) + ) + ) + (or (and (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) + ) + (< 102400.0 (vector-vector-distance (-> self control trans) (-> self gun track-trans))) + (< (vector-dot + (-> self gun track-dir) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + 1.0 + ) + ) + 0.5 + ) + ) + (logtest? (process-mask->search-info-flag (the-as process-focusable s5-2)) (search-info-flag abort)) + ) + ) + ) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) + (set! (-> self gun track-target-hold-time) 0) + ((method-of-type focus clear-focused) (the-as focus (-> self gun track-target))) + ) + (else + (let ((a0-67 (process-mask->search-info-flag (the-as process-focusable s5-2)))) + (cond + ((and (not (not (or (zero? a0-67) (logtest? a0-67 (search-info-flag abort))))) + (zero? (-> self gun track-target-hold-time)) + ) + (logclear! (-> self gun track?) (gun-track-flags gutflags-2)) + (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) + ) + (else + (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((s5-3 (handle->process (-> self gun track-target 1 handle)))) + (cond + ((logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + (send-event *camera* 'set-slave-option (cam-slave-options STICKY_ANGLE)) + ) + (s5-3 + (let ((s4-7 (get-trans (the-as process-focusable s5-3) 3))) + (let ((s3-1 (new 'stack-no-clear 'vector4w))) + (cond + ((and (logtest? (process-mask->search-info-flag (the-as process-focusable s5-3)) + (search-info-flag guard enemy attackable-priority) + ) + (transform-point-qword! s3-1 s4-7) + ) + (let ((v1-171 (+ (/ (-> s3-1 x) 16) -2048))) + (+ (/ (-> s3-1 y) 16) -2048) + (let ((a0-90 (abs v1-171))) + (cond + ((< a0-90 65) + (send-event *camera* 'set-slave-option (cam-slave-options STICKY_ANGLE)) + ) + ((let ((a0-94 120)) + (set! v1-171 (abs v1-171)) + (< a0-94 v1-171) + ) + (send-event *camera* 'clear-slave-option (cam-slave-options STICKY_ANGLE)) + ) + ) + ) + ) + ) + (else + (send-event *camera* 'clear-slave-option (cam-slave-options STICKY_ANGLE)) + ) + ) + ) + (if (and s5-3 *gun-marks* (!= gp-0 s5-3)) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) s4-7 (-> s4-7 w) (new 'static 'rgba :g #x80 :b #xff :a #x40)) + ) + ) + ) + (else + (send-event *camera* 'clear-slave-option (cam-slave-options STICKY_ANGLE)) + ) + ) + ) + ) + (when (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (if *gun-marks* + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> self gun track-trans) + (-> self gun track-trans w) + (new 'static 'rgba :r #xff :g #xff :a #x40) + ) + ) + (send-event (handle->process (-> self gun track-target 0 handle)) 'tracked) + ) + 0 + (none) + ) + +;; definition for function target-top-anim-base-mode +;; WARN: Return type mismatch int vs none. +(defbehavior target-top-anim-base-mode target ((arg0 int)) + (cond + ((focus-test? self pilot-riding) + (case (-> self gun gun-type) + (((pickup-type gun-yellow-1) (pickup-type gun-yellow-2) (pickup-type gun-yellow-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-idle-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-blue-1) (pickup-type gun-blue-2) (pickup-type gun-blue-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-idle-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-red-1) (pickup-type gun-red-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-idle-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-dark-1) (pickup-type gun-red-2) (pickup-type gun-dark-2) (pickup-type gun-dark-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-dark-idle-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (else + (case (-> self gun gun-type) + (((pickup-type gun-yellow-1) (pickup-type gun-yellow-2)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-stance-yellow-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + (set! (-> self gun top-anim-low-high) 1.0) + (if (zero? (-> self gun fire-pending)) + (set-time! (-> self gun fire-time)) + ) + ) + (((pickup-type gun-yellow-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-stance-yellow-low-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-blue-1) (pickup-type gun-blue-2) (pickup-type gun-blue-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-stance-blue-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-red-1) (pickup-type gun-red-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-stance-dark-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type gun-dark-1) (pickup-type gun-red-2) (pickup-type gun-dark-2) (pickup-type gun-dark-3)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-stance-dark-ja) + 0.0 + arg0 + 0 + 1.0 + 0.0 + #f + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-gun-combo-start +;; WARN: Return type mismatch int vs none. +(defbehavior target-gun-combo-start target ((arg0 int) (arg1 time-frame)) + (target-top-anim-base-mode arg0) + (set! (-> self gun surpress-time) (+ (current-time) arg0)) + (set! (-> self gun track-target-hold-time) (+ (current-time) arg1)) + 0 + (none) + ) + +;; definition for function target-gun-joint-pre0 +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-gun-joint-pre0 target () + (if (!= (not (logtest? (-> self game features) (game-feature gun))) (not (-> self gun gun))) + (target-gun-setup (logtest? (-> self game features) (game-feature gun))) + ) + (if (and (time-elapsed? (-> self gun combo-window-start) (seconds 0.7)) (zero? (-> self gun fire-pending))) + (set! (-> self gun combo-window-state) #f) + ) + (cond + ((and (cpad-pressed? (-> self control cpad number) r1) + (not (time-elapsed? (-> self gun combo-window-start) (seconds 0.7))) + (not (focus-test? self mech dark)) + (not (logtest? (surface-flag gun-off) (-> self control current-surface flags))) + (not (logtest? (target-flags prevent-gun invisible) (-> self target-flags))) + (zero? (-> self gun track-target-hold-time)) + ) + (when (send-event self 'gun-combo #f) + (let ((gp-0 (combo-tracker-method-13 + (-> self gun attack-combo) + (the-as handle #f) + (-> self control trans) + 61440.0 + (-> self control c-R-w fvec) + 65536.0 + ) + ) + ) + (when gp-0 + (if (not (using-gun? self)) + (send-event self 'change-mode 'gun #f (pickup-type none)) + ) + (combo-tracker-method-12 + (-> self gun attack-combo) + (-> self control trans) + (get-trans gp-0 3) + gp-0 + (current-time) + ) + ((method-of-type focus try-update-focus) (the-as focus (-> self gun track-target)) gp-0) + (try-update-focus (-> self gun track-target 1) gp-0) + (set! (-> self gun track-trans quad) (-> (get-trans gp-0 3) quad)) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set-time! (-> self gun fire-pending-time)) + (target-gun-combo-start 20 (seconds 0.4)) + (send-event self 'gun-combo #t) + (case (-> self gun combo-window-state) + (('target-attack 'target-running-attack) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-red) (pickup-type eco-dark)) + ) + (else + (+! (-> self gun fire-pending) 2) + ) + ) + ) + ) + ) + ) + ) + ) + ((and (cpad-pressed? (-> self control cpad number) r1) + (not (focus-test? self mech dark)) + (using-gun? self) + (logtest? (surface-flag gun-turn-fast) (-> self control current-surface flags)) + (not (logtest? (target-flags prevent-gun invisible) (-> self target-flags))) + (zero? (-> self gun track-target-hold-time)) + (or (zero? (-> self gun turn-fast-hold-time)) (>= (current-time) (-> self gun turn-fast-hold-time))) + ) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set-time! (-> self gun fire-pending-time)) + (target-top-anim-base-mode 60) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) + (set! (-> self gun turn-fast-hold-time) (+ (current-time) (seconds 0.2))) + (send-event self 'gun-combo #t) + ) + ) + (when (and (not (using-gun? self)) (want-to-gun? self #f)) + (let ((gp-2 (nonzero? (-> self gun using-gun-type)))) + (send-event self 'change-mode 'gun #f (-> self gun using-gun-type)) + (when (and (not gp-2) (or (cpad-hold? (-> self control cpad number) r1) (-> self gun latch?))) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set-time! (-> self gun fire-pending-time)) + ) + ) + ) + (cond + ((using-gun? self) + (when (and (nonzero? (-> self gun top-anim-twist-reset)) + (< (the-as time-frame (-> self gun top-anim-twist-reset)) (current-time)) + ) + (quat<-gun! (the-as quaternion (-> self gun top-anim-twist-targ)) (the-as quaternion (-> self gun gun-type))) + (set! (-> self gun top-anim-twist-reset) (the-as uint 0)) + 0 + ) + (cond + ((and (= (-> self control collide-mode) 'normal) (!= (-> self control collide-mode) 'duck)) + (target-collide-set! 'gun 0.0) + ) + ((= (-> self control collide-mode) 'gun) + (cond + ((or (and (not (logtest? (-> self control status) (collide-status on-surface))) + (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (< 2048.0 (target-height-above-ground)) + ) + ) + (focus-test? self edge-grab) + (-> *setting-control* user-current doorway) + ) + (if (!= (-> self control duck-gun-tube-transision) 0.0) + (target-collide-set! 'gun 0.0) + ) + ) + (else + (when (!= (-> self control duck-gun-tube-transision) 1.0) + (when (= (-> self control collide-mode) 'gun) + (let ((gp-3 (new 'stack-no-clear 'collide-query)) + (s5-2 (new 'stack-no-clear 'inline-array 'sphere 1)) + ) + (dotimes (s4-1 1) + ((method-of-type sphere new) (the-as symbol (-> s5-2 s4-1)) sphere) + ) + (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (set! (-> s5-2 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) + (set! (-> s5-2 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-1 0.0 1.0)) + (let ((v1-214 gp-3)) + (set! (-> v1-214 spheres) s5-2) + (set! (-> v1-214 best-other-prim) (the-as collide-shape-prim 1)) + (set! (-> v1-214 collide-with) (-> self control root-prim prim-core collide-with)) + (set! (-> v1-214 ignore-process0) #f) + (set! (-> v1-214 ignore-process1) #f) + (set! (-> v1-214 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-214 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-214 action-mask) (collide-action solid)) + ) + (if (not (fill-and-probe-using-spheres *collide-cache* gp-3)) + (target-collide-set! 'gun f30-1) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (target-gun-find-track) + (cond + ((and (= (gun->eco (-> self gun gun-type)) (pickup-type eco-blue)) + (not (logtest? (-> self gun track?) (gun-track-flags gutflags-0))) + ) + (let ((f0-8 (vector-vector-distance (-> self gun fire-point) (-> self gun laser-hit-point)))) + (cond + ((< f0-8 122880.0) + (seek! + (-> self gun top-anim-tilt-up) + (lerp-scale -1820.4445 0.0 f0-8 61440.0 122880.0) + (* 5461.3335 (seconds-per-frame)) + ) + ) + ((!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (seek! (-> self gun top-anim-tilt-up) 0.0 (* 1820.4445 (seconds-per-frame))) + ) + ) + ) + (quaternion-rotate-x! + (the-as quaternion (-> self gun top-anim-twist-targ)) + (the-as quaternion *null-vector*) + (-> self gun top-anim-tilt-up) + ) + ) + (else + (set! (-> self gun top-anim-tilt-up) 0.0) + (quat<-gun! (the-as quaternion (-> self gun top-anim-twist-targ)) (the-as quaternion (-> self gun gun-type))) + ) + ) + (quaternion-slerp! + (the-as quaternion (-> self gun top-anim-twist)) + (the-as quaternion (-> self gun top-anim-twist)) + (the-as quaternion (-> self gun top-anim-twist-targ)) + 0.1 + ) + (trs-set! + (-> self upper-body) + (the-as vector #f) + (the-as quaternion (-> self gun top-anim-twist)) + (the-as vector #f) + ) + (cond + ((or (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) + (and (nonzero? (-> self gun turn-fast-hold-time)) (< (current-time) (-> self gun turn-fast-hold-time))) + (and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (logtest? (-> self gun track?) (gun-track-flags gutflags-2)) + ) + (or (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + (focus-test? self pilot-riding) + ) + ) + (seek! (-> self upper-body twist z) 0.0 (* 65536.0 (seconds-per-frame))) + ) + ((logtest? (surface-flag gun-no-twist) (-> self control current-surface flags)) + (seek! (-> self upper-body twist z) 0.0 (* 16384.0 (seconds-per-frame))) + ) + ((and (< 0.0 (-> self control turn-to-magnitude)) + (not (logtest? (-> self control current-surface flags) (surface-flag duck))) + ) + (let* ((f0-28 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) + (f0-30 (fmax -5461.3335 (fmin 5461.3335 f0-28))) + ) + (seek! (-> self upper-body twist z) f0-30 (fabs (* 0.2 f0-30))) + ) + ) + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> self control trans quad)) + (if (logtest? (surface-flag gun-no-twist) (-> self control current-surface flags)) + (set! (-> self upper-body flex-blend) 0.0) + (seek! (-> self upper-body flex-blend) 1.0 (* 8.0 (seconds-per-frame))) + ) + (when (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (set! (-> self gun top-anim-look-at quad) (-> self gun track-trans quad)) + (let ((gp-6 (new 'stack-no-clear 'vector))) + (set! (-> gp-6 quad) (-> self gun top-anim-look-at quad)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (+! (-> gp-6 y) -409.6) + ) + (((pickup-type eco-blue)) + (+! (-> gp-6 y) 2457.6) + ) + (else + (+! (-> gp-6 y) -1638.4) + ) + ) + (if (not (logtest? (surface-flag gun-no-twist) (-> self control current-surface flags))) + (target-set! (-> self upper-body) gp-6) + ) + (when *gun-marks* + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> self gun top-anim-look-at) + (meters 0.2) + (the-as rgba (new 'static 'rgba :r #xff :a #x80)) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + gp-6 + (meters 0.1) + (the-as rgba (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + ) + ) + (let ((v1-341 (-> self neck))) + (set! (-> v1-341 blend) 0.0) + ) + ) + (cond + ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (logtest? (process-mask->search-info-flag + (the-as process-focusable (handle->process (-> self gun track-target 0 handle))) + ) + (search-info-flag guard enemy attackable-priority) + ) + ) + (if (and (not (time-elapsed? (-> self gun track-press-start-time) (seconds 0.5))) + (< (-> self control time-between-zero-inputs) (seconds 0.5)) + (and (= (-> self control turn-to-magnitude) 0.0) + (not (logtest? (-> self control current-surface flags) (surface-flag air attack))) + (-> self gun active?) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + ) + (cond + ((or (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) + (and (nonzero? (-> self gun turn-fast-hold-time)) (< (current-time) (-> self gun turn-fast-hold-time))) + ) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) + (set! (-> self gun upper-body twist-max y) 21845.334) + (set! (-> self gun upper-body twist-speed-y) 0.2) + (set! (-> self gun upper-body twist-speed-x) 0.6) + ) + ((and (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) + ) + (< (vector-vector-distance (-> self control trans) (-> self gun track-trans)) 81920.0) + ) + (set! (-> self gun upper-body twist-max y) 16384.0) + (set! (-> self gun upper-body twist-speed-y) 0.2) + (set! (-> self gun upper-body twist-speed-x) 0.1) + ) + ((or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (let ((f30-2 10922.667) + (gp-10 deg-diff) + (v1-424 (-> self control)) + (a1-49 (-> self gun track-trans)) + ) + (>= f30-2 + (gp-10 + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) a1-49 (-> v1-424 trans))) + (vector-y-angle (-> self control to-target-pt-xz)) + ) + ) + ) + ) + (set! (-> self gun upper-body twist-max y) + (lerp-scale + 10922.667 + (-> self gun track-turn-max) + (vector-vector-distance (-> self control trans) (-> self gun track-trans)) + 20480.0 + 61440.0 + ) + ) + (set! (-> self gun upper-body twist-speed-y) + (lerp-scale + 0.3 + 0.1 + (vector-vector-distance (-> self control trans) (-> self gun track-trans)) + 16384.0 + 40960.0 + ) + ) + (set! (-> self gun upper-body twist-speed-x) 0.1) + ) + (else + (set! (-> self gun upper-body twist-max y) (-> self gun track-turn-max)) + (set! (-> self gun upper-body twist-speed-y) 0.1) + (set! (-> self gun upper-body twist-speed-x) 0.1) + ) + ) + ) + (else + (set! (-> self gun upper-body twist-max y) (-> self gun track-turn-max)) + (set! (-> self gun upper-body twist-speed-y) 0.1) + (set! (-> self gun upper-body twist-speed-x) 0.1) + ) + ) + (set! (-> self gun upper-body track-mode) (the-as track-mode (-> self gun track?))) + (when (not (time-elapsed? (-> self gun fire-time) (seconds 1.5))) + (let ((v1-466 (-> self neck))) + (set! (-> v1-466 blend) 0.0) + ) + ) + ) + (else + (seek! (-> self upper-body flex-blend) 0.0 (* 16.0 (seconds-per-frame))) + (seek! (-> self upper-body twist z) 0.0 (* 65536.0 (seconds-per-frame))) + ) + ) + 0 + (none) + ) + +;; definition for function target-gun-joint-pre +;; WARN: Return type mismatch int vs none. +(defbehavior target-gun-joint-pre target () + (local-vars (gp-0 art-element)) + (target-gun-joint-pre0) + (cond + ((focus-test? self pilot-riding) + (let ((v1-3 (gun->eco (-> self gun gun-type)))) + (set! (-> self skel top-anim base-anim) (cond + ((= v1-3 (pickup-type eco-yellow)) + jakb-pilot-gun-yellow-idle-ja + ) + ((= v1-3 (pickup-type eco-red)) + jakb-pilot-gun-red-idle-ja + ) + ((= v1-3 (pickup-type eco-blue)) + jakb-pilot-gun-blue-idle-ja + ) + (else + jakb-pilot-gun-dark-idle-ja + ) + ) + ) + ) + ) + (else + (let ((v1-14 (gun->eco (-> self gun gun-type)))) + (set! gp-0 + (cond + ((= v1-14 (pickup-type eco-yellow)) + (let ((v1-17 (ja-group))) + (cond + ((and (and v1-17 (or (= v1-17 self) (= v1-17 jakb-gun-walk-side-ja) (= v1-17 jakb-wade-shallow-walk-ja))) + (< (-> self gun top-anim-low-high) 0.5) + ) + (let ((s5-0 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 (if (< 0.9 (-> self control unknown-float002)) + jakb-gun-front-run-ja + jakb-gun-front-walk-ja + ) + ) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-0 (= (-> s5-0 frame-group) gp-0)) + (set! (-> s5-0 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + ((let ((v1-42 (ja-group))) + (and (and v1-42 (or (= v1-42 self) (= v1-42 jakb-gun-duck-walk-ja))) (< (-> self gun top-anim-low-high) 0.5)) + ) + (let ((s5-1 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 jakb-gun-duck-walk-ja) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-1 (= (-> s5-1 frame-group) gp-0)) + (set! (-> s5-1 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + ((< (-> self gun top-anim-low-high) 0.5) + jakb-gun-stance-yellow-low-ja + ) + (else + (when (and (or (time-elapsed? (-> self gun fire-time) (seconds 1.5)) + (= (-> self gun gun-type) (pickup-type gun-yellow-3)) + ) + (let ((v1-74 (-> self skel top-anim frame-group))) + (or (= v1-74 jakb-gun-yellow-highlow-ja) (= v1-74 jakb-gun-stance-yellow-ja)) + ) + (not (logtest? (focus-status pilot) (-> self focus-status))) + ) + (seek! (-> self gun top-anim-low-high) 0.0 (* 6.0 (seconds-per-frame))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-yellow-highlow-ja) + 0.0 + 0 + 60 + (if (< 20480.0 (-> self control ctrl-xz-vel)) + 2.0 + 1.0 + ) + 0.0 + #f + ) + ) + jakb-gun-stance-yellow-ja + ) + ) + ) + ) + ((= v1-14 (pickup-type eco-red)) + (let ((v1-92 (ja-group))) + (cond + ((and v1-92 (or (= v1-92 self) (= v1-92 jakb-walk-ja) (= v1-92 jakb-wade-shallow-walk-ja))) + (let ((s5-2 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 (if (< 0.9 (-> self control unknown-float002)) + jakb-gun-front-run-ja + jakb-gun-front-walk-ja + ) + ) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-2 (= (-> s5-2 frame-group) gp-0)) + (set! (-> s5-2 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + (else + (let ((v1-114 (ja-group))) + (cond + ((and v1-114 (or (= v1-114 self) (= v1-114 jakb-gun-duck-walk-ja))) + (let ((s5-3 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 jakb-gun-duck-walk-ja) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-3 (= (-> s5-3 frame-group) gp-0)) + (set! (-> s5-3 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + ((or (< (-> self gun top-anim-low-high) 0.5) (nonzero? (-> self ext-anim))) + jakb-gun-stance-ja + ) + (else + (when (and (or (time-elapsed? (-> self gun fire-time) (seconds 2.5)) + (= (-> self gun gun-type) (pickup-type gun-red-2)) + (and (< 4096.0 (-> self control ctrl-xz-vel)) (time-elapsed? (-> self gun fire-time) (seconds 1.25))) + ) + (let ((v1-153 (-> self skel top-anim frame-group))) + (or (= v1-153 jakb-gun-stance-red-sideways-ja) + (= v1-153 jakb-gun-red-from-sideways-ja) + (= v1-153 jakb-gun-stance-ja) + ) + ) + ) + (seek! (-> self gun top-anim-low-high) 0.0 (* 6.0 (seconds-per-frame))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-from-sideways-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + jakb-gun-stance-red-sideways-ja + ) + ) + ) + ) + ) + ) + ) + ((= v1-14 (pickup-type eco-blue)) + (let ((v1-168 (ja-group))) + (cond + ((and (and v1-168 (or (= v1-168 self) (= v1-168 jakb-gun-walk-side-ja) (= v1-168 jakb-wade-shallow-walk-ja))) + (< (-> self gun top-anim-low-high) 0.5) + (or (time-elapsed? (-> self gun fire-time) (seconds 0.2)) + (and (= (-> self gun gun-type) (pickup-type gun-blue-2)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-gun-stance))) + ) + ) + ) + (let ((s5-4 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 (if (< 0.9 (-> self control unknown-float002)) + jakb-gun-run-blue-ja + jakb-gun-walk-blue-ja + ) + ) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-4 (= (-> s5-4 frame-group) gp-0)) + (set! (-> s5-4 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + ((and (= (-> self gun gun-type) (pickup-type gun-blue-2)) + (not (time-elapsed? (-> self gun fire-time) (seconds 0.05))) + (-> self next-state) + (= (-> self next-state name) 'target-gun-stance) + ) + jakb-gun-blue-stance-2-ja + ) + (else + jakb-gun-stance-blue-ja + ) + ) + ) + ) + ((let ((v1-218 (ja-group))) + (and v1-218 (or (= v1-218 self) (= v1-218 jakb-walk-ja) (= v1-218 jakb-wade-shallow-walk-ja))) + ) + (let ((s5-5 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 (if (< 0.9 (-> self control unknown-float002)) + jakb-gun-front-run-ja + jakb-gun-front-walk-ja + ) + ) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-5 (= (-> s5-5 frame-group) gp-0)) + (set! (-> s5-5 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + (else + (let ((v1-240 (ja-group))) + (cond + ((and v1-240 (or (= v1-240 self) (= v1-240 jakb-gun-duck-walk-ja))) + (let ((s5-6 (get-channel (-> self skel top-anim) 0))) + (set! gp-0 jakb-gun-duck-walk-ja) + (set! (-> self skel top-anim base-anim-blend) 0.1) + (when (and s5-6 (= (-> s5-6 frame-group) gp-0)) + (set! (-> s5-6 frame-num) (ja-frame-num 0)) + (set! (-> self skel top-anim base-anim-speed) 0.0) + ) + ) + gp-0 + ) + (else + jakb-gun-stance-dark-ja + ) + ) + ) + ) + ) + ) + ) + (set! (-> self skel top-anim base-anim) gp-0) + ) + ) + 0 + (none) + ) + +;; definition for function target-gun-compute-pos +;; INFO: Used lq/sq +(defbehavior target-gun-compute-pos target () + (let ((a1-0 (-> self node-list data 36 bone transform)) + (a2-0 (if (-> self sidekick) + (-> self sidekick 0 node-list data 28 bone transform) + (-> self node-list data 36 bone transform) + ) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (matrix-lerp! gp-0 a1-0 a2-0 (-> self gun gun-daxter)) + (matrix->transformq (-> self gun gun-pos) gp-0) + (set! (-> self gun gun-pos scale quad) (-> self control scale quad)) + (when (and (using-gun? self) + (and (focus-test? self edge-grab) (let ((v1-18 (ja-group))) + (and v1-18 (or (= v1-18 jakb-jump-loop-ja) + (= v1-18 jakb-falling-to-edge-grab-ja) + (= v1-18 jakb-edge-grab-stance0-ja) + (= v1-18 jakb-edge-grab-stance1-ja) + ) + ) + ) + ) + ) + (let ((s4-0 (new 'static 'vector :y 491.52 :w 1.0)) + (a1-5 (new 'static 'vector :x -16384.0 :z -16384.0 :w 1.0)) + (s5-0 (new 'stack-no-clear 'quaternion)) + ) + (matrix-rotate-xyz! gp-0 a1-5) + (matrix->quaternion s5-0 gp-0) + (vector+! (the-as vector (-> self gun gun-pos)) (-> *edge-grab-info* center-hold) s4-0) + (vector+float*! + (the-as vector (-> self gun gun-pos)) + (the-as vector (-> self gun gun-pos)) + (-> self node-list data 0 bone transform fvec) + 778.24 + ) + (quaternion-normalize! (quaternion*! (-> self gun gun-pos quat) (-> self control quat) s5-0)) + ) + ) + gp-0 + ) + ) + +;; definition for function target-gun-joint-points +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-gun-joint-points target () + (when (-> self gun gun) + (set! (-> self gun gun-daxter) + (if (and (focus-test? self pilot-riding) + (nonzero? (-> self skel float-channels)) + (= (-> (get-channel (-> self skel top-anim) (the-as int (+ (-> self skel float-channels) -1))) frame-interp 1) + 1.0 + ) + ) + 1.0 + 0.0 + ) + ) + (cond + ((using-gun? self) + (set! (-> self gun gun-roty-targ) (y-angle (-> self control))) + (set! (-> self gun gun-roty) (-> self gun gun-roty-targ)) + (set! (-> self gun gun-roty-rel) 0.0) + (let ((v1-24 (get-channel (-> self skel top-anim) 0))) + (cond + ((not v1-24) + ) + ((handle->process (-> self gun charge-active?)) + (cond + ((and (= (-> v1-24 frame-group) jakb-gun-dark-fire-ja) (>= (-> v1-24 frame-num) 8.5)) + (set! (-> v1-24 frame-num) 5.0) + ) + ((and (= (-> v1-24 frame-group) jakb-pilot-gun-dark-fire-ja) (>= (-> v1-24 frame-num) 8.0)) + (set! (-> v1-24 frame-num) 3.0) + ) + ((and (= (-> v1-24 frame-group) jakb-gun-red-fire-2-ja) (>= (-> v1-24 frame-num) 8.5)) + (set! (-> v1-24 frame-num) 5.0) + ) + ((not (-> self skel top-anim frame-targ)) + (case (-> self gun gun-type) + (((pickup-type gun-red-2)) + (if (!= (-> v1-24 frame-group) jakb-gun-red-fire-2-ja) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-fire-2-ja) + 0.0 + 30 + 15 + 1.0 + 0.0 + #f + ) + ) + ) + (((pickup-type gun-dark-1) (pickup-type gun-dark-2) (pickup-type gun-dark-3)) + (if (!= (-> v1-24 frame-group) jakb-gun-dark-fire-ja) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-dark-fire-ja) 0.0 30 15 1.0 0.0 #f) + ) + ) + ) + ) + ) + ) + ((and (= (-> v1-24 frame-group) jakb-gun-dark-fire-ja) (< (-> v1-24 frame-num) 9.0)) + (set! (-> v1-24 frame-num) 10.0) + ) + ((and (= (-> v1-24 frame-group) jakb-pilot-gun-dark-fire-ja) (< (-> v1-24 frame-num) 9.0)) + (set! (-> v1-24 frame-num) 9.0) + ) + ((and (= (-> v1-24 frame-group) jakb-gun-red-fire-2-ja) (< (-> v1-24 frame-num) 9.0)) + (let ((a0-65 (new-stack-vector0))) + (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! a0-65 (-> self control transv) (vector-float*! a0-65 (-> self control dynam gravity-normal) f0-17)) + ) + (let* ((f0-18 (vector-length a0-65)) + (f1-8 f0-18) + (f2-0 65502.96) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! a0-65 a0-65 (/ f0-18 f1-8)) + ) + ) + ) + (set! (-> v1-24 frame-num) 10.0) + ) + ((and (= (-> v1-24 frame-group) jakb-gun-yellow-fire-3-ja) + (!= (-> self gun gun-delay-fire) 0.0) + (< (-> self gun gun-delay-fire) (-> v1-24 frame-num)) + ) + (target-gun-fire-yellow (-> self gun gun-type)) + (set! (-> self gun gun-delay-fire) 0.0) + ) + ) + ) + (set! (-> self gun active?) + (and (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> self control current-surface flags))) + (and (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) + (>= (current-time) (-> self gun surpress-time)) + (let ((v1-48 (-> self skel top-anim frame-group)) + (f0-24 (-> self skel top-anim frame-num)) + ) + (and (not (and v1-48 + (or (= v1-48 jakb-gun-red-takeout-ja) + (= v1-48 jakb-gun-blue-takeout-ja) + (= v1-48 jakb-gun-yellow-takeout-ja) + (= v1-48 jakb-gun-dark-takeout-ja) + (and jakb-pilot-gun-red-takeout-ja + (or (= v1-48 jakb-pilot-gun-red-takeout-ja) + (= v1-48 jakb-pilot-gun-blue-takeout-ja) + (= v1-48 jakb-pilot-gun-yellow-takeout-ja) + (= v1-48 jakb-pilot-gun-dark-takeout-ja) + (= v1-48 jakb-pilot-gun-red-dark-ja) + (= v1-48 jakb-pilot-gun-red-yellow-ja) + (= v1-48 jakb-pilot-gun-red-blue-ja) + (= v1-48 jakb-pilot-gun-yellow-blue-ja) + ) + ) + (and (= v1-48 jakb-gun-attack-butt-end-ja) (>= 6.8 f0-24)) + (or (and (= v1-48 jakb-gun-attack-butt-blue-end-ja) (>= 6.8 f0-24)) + (and jakb-gun-dark-fire-twirl-ja + (or (= v1-48 jakb-gun-dark-fire-twirl-ja) (= v1-48 jakb-gun-yellow-fire-twirl-ja)) + ) + (= v1-48 jakb-gun-transformation-twirl-ja) + (= v1-48 jakb-gun-front-to-side-hop-ja) + (= v1-48 jakb-gun-side-to-front-hop-ja) + (= v1-48 jakb-gun-side-to-side-hop-1-ja) + (= v1-48 jakb-gun-side-to-side-hop-2-ja) + (= v1-48 jakb-gun-blue-to-front-hop-ja) + (= v1-48 jakb-gun-front-to-blue-hop-ja) + (= v1-48 jakb-gun-hit-from-front-ja) + (= v1-48 jakb-gun-hit-from-back-ja) + ) + ) + ) + ) + (let ((v1-53 (-> self skel top-anim frame-group-push))) + (not (and v1-53 + (or (= v1-53 jakb-gun-red-takeout-ja) + (= v1-53 jakb-gun-blue-takeout-ja) + (= v1-53 jakb-gun-yellow-takeout-ja) + (= v1-53 jakb-gun-dark-takeout-ja) + (and jakb-pilot-gun-red-takeout-ja + (or (= v1-53 jakb-pilot-gun-red-takeout-ja) + (= v1-53 jakb-pilot-gun-blue-takeout-ja) + (= v1-53 jakb-pilot-gun-yellow-takeout-ja) + (= v1-53 jakb-pilot-gun-dark-takeout-ja) + (= v1-53 jakb-pilot-gun-red-dark-ja) + (= v1-53 jakb-pilot-gun-red-yellow-ja) + (= v1-53 jakb-pilot-gun-red-blue-ja) + (= v1-53 jakb-pilot-gun-yellow-blue-ja) + ) + ) + (and jakb-gun-dark-fire-twirl-ja + (or (= v1-53 jakb-gun-dark-fire-twirl-ja) (= v1-53 jakb-gun-yellow-fire-twirl-ja)) + ) + (= v1-53 jakb-gun-transformation-twirl-ja) + (= v1-53 jakb-gun-front-to-side-hop-ja) + (= v1-53 jakb-gun-side-to-front-hop-ja) + (= v1-53 jakb-gun-side-to-side-hop-1-ja) + (= v1-53 jakb-gun-side-to-side-hop-2-ja) + (= v1-53 jakb-gun-blue-to-front-hop-ja) + (= v1-53 jakb-gun-front-to-blue-hop-ja) + (= v1-53 jakb-gun-hit-from-front-ja) + (= v1-53 jakb-gun-hit-from-back-ja) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (if (-> self gun active?) + (set-time! (-> self gun active-time)) + ) + (set! (-> self gun laser-active?) + (not (logtest? (surface-flag gun-inactive gun-hide gun-off laser-hide) (-> self control current-surface flags)) + ) + ) + (when (and (not (and (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> self control current-surface flags))) + (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) + (>= (current-time) (-> self gun surpress-time)) + ) + ) + (and (time-elapsed? (-> self gun fire-pending-time) (seconds 0.2)) + (time-elapsed? (-> self gun active-time) (seconds 0.2)) + (= (-> self gun fire-pending) 1) + ) + ) + (set! (-> self gun fire-pending) 0) + 0 + ) + (if (and (or (logtest? (surface-flag gun-hide gun-off) (-> self control current-surface flags)) + (logtest? (target-flags prevent-gun invisible) (-> self target-flags)) + (and (or (and (cpad-hold? (-> self control cpad number) up) + (>= (- (-> *display* real-clock frame-counter) (-> self gun gun-select-time 0)) (seconds 0.8)) + ) + (and (cpad-hold? (-> self control cpad number) down) + (>= (- (-> *display* real-clock frame-counter) (-> self gun gun-select-time 1)) (seconds 0.8)) + ) + (and (cpad-hold? (-> self control cpad number) left) + (>= (- (-> *display* real-clock frame-counter) (-> self gun gun-select-time 2)) (seconds 0.8)) + ) + (and (cpad-hold? (-> self control cpad number) right) + (>= (- (-> *display* real-clock frame-counter) (-> self gun gun-select-time 3)) (seconds 0.8)) + ) + ) + (not (cpad-hold? (-> self control cpad number) r1)) + (not (logtest? (surface-flag gun-inactive) (-> self control current-surface flags))) + (not (logtest? (-> self focus-status) (focus-status grabbed))) + ) + (or (-> self gun put-away?) + (not (logtest? (-> self game features) (game-feature gun))) + (not (logtest? (the-as game-feature (ash 1 (+ (the-as int (-> self gun gun-type)) -20))) + (logand (-> self game features) (-> *setting-control* user-current features)) + ) + ) + (not (-> *setting-control* user-current gun)) + (focus-test? self dead dark) + (-> self board latch?) + ) + ) + (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) + (let ((v1-170 (-> self skel top-anim frame-targ))) + (or (not v1-170) + (= v1-170 jakb-gun-side-jump-ja) + (= v1-170 jakb-gun-front-jump-ja) + (= v1-170 jakb-gun-side-jump-land-ja) + (= v1-170 jakb-gun-front-jump-land-ja) + (= v1-170 jakb-gun-front-run-ja) + (= v1-170 jakb-gun-front-walk-ja) + (= v1-170 jakb-gun-run-blue-ja) + (= v1-170 jakb-gun-walk-blue-ja) + (logtest? (surface-flag gun-fast-exit) (-> self control current-surface flags)) + ) + ) + ) + (target-gun-end-mode (not (logtest? (surface-flag gun-hide) (-> self control current-surface flags)))) + ) + ) + (else + (set! (-> self gun active?) #f) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-gun-fire +;; WARN: Return type mismatch symbol vs none. +(defbehavior target-gun-fire target ((arg0 pickup-type)) + (when (using-gun? self) + (set! (-> self gun gun-delay-fire) 0.0) + (let ((gp-0 (-> self gun)) + (s5-0 (gun->ammo arg0)) + ) + #t + (let* ((v1-2 (gun->eco (-> gp-0 gun-type))) + (v1-3 (cond + ((= v1-2 (pickup-type eco-yellow)) + (target-gun-can-fire-yellow? arg0) + ) + ((= v1-2 (pickup-type eco-red)) + (target-gun-can-fire-red? arg0) + ) + ((= v1-2 (pickup-type eco-blue)) + (target-gun-can-fire-blue? arg0) + ) + ((= v1-2 (pickup-type eco-dark)) + (target-gun-can-fire-dark? arg0) + ) + ) + ) + (f0-1 (-> self game gun-ammo (+ s5-0 -15))) + ) + (cond + ((and v1-3 (or (>= f0-1 (-> self gun ammo-required)) + (logtest? (target-flags tf16) (-> self target-flags)) + (logtest? (game-secrets endless-ammo) (-> self game secrets)) + ) + ) + (send-event (handle->process (-> self gun track-target 0 handle)) 'tracked-fire (-> gp-0 gun-type)) + (case (-> gp-0 gun-type) + (((pickup-type gun-blue-1) + (pickup-type gun-yellow-1) + (pickup-type gun-dark-1) + (pickup-type gun-red-1) + (pickup-type gun-red-3) + (pickup-type gun-yellow-2) + (pickup-type gun-dark-2) + (pickup-type gun-dark-3) + ) + (pickup-collectable! (-> self fact) s5-0 (- (-> self gun ammo-required)) (the-as handle #f)) + (if (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (not (logtest? (-> self lightjak stage) (lightjak-stage ls1))) + ) + (pickup-collectable! (-> self fact) (pickup-type eco-pill-light) -1.0 (the-as handle #f)) + ) + ) + ) + (case (-> gp-0 gun-type) + (((pickup-type gun-blue-1) (pickup-type gun-blue-3)) + (cond + ((focus-test? self pilot-riding) + (let ((v1-39 (get-channel (-> self skel top-anim) 0))) + (when (not (or (= (-> self skel top-anim frame-group) jakb-pilot-gun-blue-fire-ja) + (and v1-39 (= (-> v1-39 frame-group) jakb-pilot-gun-blue-fire-ja)) + ) + ) + (if (< 4096.0 (-> self control ctrl-xz-vel)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-fire-single-ja) + 1.0 + 9 + 9 + 1.0 + 0.0 + #f + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-blue-fire-single-ja) + 1.0 + 6 + 6 + 1.0 + 0.0 + #f + ) + ) + ) + ) + ) + (else + (let ((v1-56 (get-channel (-> self skel top-anim) 0))) + (when (not (or (= (-> self skel top-anim frame-group) jakb-gun-blue-fire-ja) + (and v1-56 (= (-> v1-56 frame-group) jakb-gun-blue-fire-ja)) + ) + ) + (if (< 4096.0 (-> self control ctrl-xz-vel)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-fire-single-ja) + 1.0 + 9 + 9 + 1.0 + 0.0 + #f + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-fire-single-ja) + 1.0 + 6 + 6 + 1.0 + 0.0 + #f + ) + ) + ) + ) + ) + ) + (target-gun-fire-blue (-> self gun gun-type)) + ) + (((pickup-type gun-blue-2)) + (let ((v1-75 (get-channel (-> self skel top-anim) 0))) + (if (not (or (= (-> self skel top-anim frame-group) jakb-gun-blue-fire-2-ja) + (and v1-75 (= (-> v1-75 frame-group) jakb-gun-blue-fire-2-ja)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-gun-stance))) + ) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-blue-fire-2-ja) + 0.0 + (cond + ((and v1-75 + (or (= (-> v1-75 frame-group) jakb-gun-blue-fire-2-ja) (= (-> v1-75 frame-group) jakb-gun-blue-stance-2-ja)) + ) + 0 + ) + ((not (time-elapsed? (-> self gun fire-time) (seconds 0.05))) + 75 + ) + (else + 15 + ) + ) + 15 + 1.0 + 0.0 + #f + ) + ) + ) + (target-gun-fire-blue (-> self gun gun-type)) + ) + (((pickup-type gun-yellow-1) (pickup-type gun-yellow-2)) + (cond + ((focus-test? self pilot-riding) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-fire-ja) + 0.0 + 15 + 0 + 1.0 + 0.0 + #f + ) + ) + ((< (-> self gun top-anim-low-high) 0.5) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-yellow-fire-low-ja) + 0.0 + 15 + 0 + 1.0 + 0.0 + #f + ) + (set! (-> self gun top-anim-low-high) 1.0) + ) + (else + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-yellow-fire-ja) 0.0 0 0 1.0 0.0 #f) + ) + ) + (target-gun-fire-yellow (-> self gun gun-type)) + ) + (((pickup-type gun-yellow-3)) + (cond + ((focus-test? self pilot-riding) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-yellow-fire-ja) + 0.0 + 15 + 0 + 1.0 + 0.0 + #f + ) + (target-gun-fire-yellow (-> self gun gun-type)) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-yellow-fire-3-ja) + 0.0 + 0 + 15 + 1.0 + 0.0 + #f + ) + (set! (-> self gun gun-delay-fire) 2.5) + ) + ) + ) + (((pickup-type gun-red-1) (pickup-type gun-red-3)) + 1.0 + (let* ((s5-1 600) + (s4-1 (or (and (logtest? (game-secrets gun-upgrade-red-1) (-> *game-info* secrets)) + (= (-> gp-0 gun-type) (pickup-type gun-red-1)) + ) + (and (logtest? (game-secrets gun-upgrade-red-3) (-> *game-info* secrets)) + (= (-> gp-0 gun-type) (pickup-type gun-red-3)) + ) + ) + ) + (f30-0 (if s4-1 + 1.4 + 1.0 + ) + ) + ) + (cond + ((focus-test? self pilot-riding) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-red-fire-ja) + 0.0 + 15 + 0 + (if (= f30-0 1.0) + f30-0 + (* 1.05 f30-0) + ) + 0.0 + #f + ) + ) + ((and (< 0.5 (-> self gun top-anim-low-high)) (zero? (-> self ext-anim))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-fire-from-sideways-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + (set! (-> self gun top-anim-low-high) 0.0) + ) + ((and (rand-vu-percent? 0.2) + (not (time-elapsed? (-> self gun fire-time) s5-1)) + (= (-> self ext-anim) (target-anim default)) + (= (-> gp-0 gun-type) (pickup-type gun-red-1)) + (not (logtest? (game-secrets gun-upgrade-red-1) (-> self game secrets))) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-dark-fire-twirl-ja) + 0.0 + 0 + 15 + (if (logtest? (game-feature feature21) (-> self game features)) + 1.7 + 1.0 + ) + 0.0 + #f + ) + ) + ((and (or (rand-vu-percent? 0.2) (= (-> self skel top-anim frame-targ) jakb-gun-red-fire-ja)) + (and (not (time-elapsed? (-> self gun fire-time) s5-1)) (zero? (-> self ext-anim))) + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-fire-to-sideways-ja) + 0.0 + 0 + 15 + f30-0 + 0.0 + #f + ) + (set! (-> self gun top-anim-low-high) 1.0) + ) + (s4-1 + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-fire-fast-ja) + 0.0 + 0 + 15 + 1.0 + 0.0 + #f + ) + ) + (else + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-red-fire-ja) 1.0 0 15 f30-0 0.0 #f) + ) + ) + ) + (target-gun-fire-red (-> self gun gun-type)) + ) + (((pickup-type gun-dark-1) (pickup-type gun-dark-2) (pickup-type gun-dark-3)) + (if (focus-test? self pilot-riding) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-dark-fire-ja) + 0.0 + 30 + 15 + 1.0 + 0.0 + #f + ) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-dark-fire-ja) 0.0 30 15 1.0 0.0 #f) + ) + (target-gun-fire-dark (-> self gun gun-type)) + ) + (((pickup-type gun-red-2)) + (if (focus-test? self pilot-riding) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-pilot-gun-dark-fire-ja) + 0.0 + 30 + 15 + 1.0 + 0.0 + #f + ) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-red-fire-2-ja) + 0.0 + 30 + 15 + 1.0 + 0.0 + #f + ) + ) + (target-gun-fire-red (-> self gun gun-type)) + ) + ) + #t + ) + (else + (let ((v1-231 (target-gun-ammo-out-pick))) + (cond + ((nonzero? v1-231) + (if (nonzero? v1-231) + (set! (-> self gun using-gun-type) (the-as pickup-type v1-231)) + ) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + ) + (else + (sound-play "walk-san1") + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for function target-gun-check +;; WARN: Return type mismatch int vs none. +(defbehavior target-gun-check target () + (when (using-gun? self) + (let ((gp-0 (-> self gun))) + (cond + ((and (focus-test? self pilot-riding) (nonzero? (-> self skel float-channels))) + (set! (-> self skel top-anim interp-select 0) (the-as uint (shl 8 32))) + (set! (-> self skel top-anim interp-select 1) (the-as uint 0)) + 0 + ) + (else + (set! (-> self skel top-anim interp-select 0) (the-as uint #x3ff0001bffffbff0)) + (set! (-> self skel top-anim interp-select 1) (the-as uint 0)) + 0 + ) + ) + (if (not (or (focus-test? self in-head) (= (gun->eco (-> self gun gun-type)) (pickup-type eco-red)))) + (gun-info-method-9 gp-0) + ) + (if (and (logtest? (surface-flag spin) (-> self control current-surface flags)) + (logtest? (-> self control current-surface flags) (surface-flag air)) + ) + (set! (-> gp-0 combo-window-state) 'target-attack-air) + ) + (if (cpad-pressed? (-> self control cpad number) r1) + (set-time! (-> gp-0 fire-start-time)) + ) + (case (-> gp-0 gun-control) + ((1) + (when (and (cpad-pressed? (-> self control cpad number) r1) + (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) + ) + (set-time! (-> gp-0 fire-pending-time)) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set! (-> gp-0 fire-charge) 0.5) + ) + (when (and (or (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) + (case (-> gp-0 combo-window-state) + (('target-attack-air 'target-attack 'target-running-attack) + (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 combo-fire-delay))) + ) + ) + ) + (> (-> gp-0 fire-pending) 0) + (-> self gun active?) + ) + (seekl! (-> self gun fire-pending) 0 1) + (cond + ((send-event self 'gun (-> gp-0 gun-type)) + (set-time! (-> self gun fire-time)) + ) + (else + (set! (-> self gun fire-time) 0) + 0 + ) + ) + #t + ) + ) + ((2) + (when (and (cpad-hold? (-> self control cpad number) r1) + (and (not (handle->process (-> self gun charge-active?))) + (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) + ) + ) + (set-time! (-> gp-0 fire-pending-time)) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set! (-> gp-0 fire-charge) 0.5) + ) + (when (and (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) + (> (-> gp-0 fire-pending) 0) + (-> self gun active?) + ) + (seekl! (-> self gun fire-pending) 0 1) + (cond + ((send-event self 'gun (-> gp-0 gun-type)) + (set-time! (-> self gun fire-time)) + ) + (else + (set! (-> self gun fire-time) 0) + 0 + ) + ) + #t + ) + ) + ((4) + (cond + ((and (cpad-hold? (-> self control cpad number) r1) (-> gp-0 active?)) + (seek! (-> gp-0 fire-spinv) 218453.33 (* 145635.56 (seconds-per-frame))) + (if (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) + (set! (-> gp-0 fire-spinv) 218453.33) + ) + ) + (else + (seek! (-> gp-0 fire-spinv) 0.0 (* 109226.664 (seconds-per-frame))) + ) + ) + (set! (-> gp-0 fire-spin) + (the float (sar (shl (the int (+ (-> gp-0 fire-spin) (* (-> gp-0 fire-spinv) (seconds-per-frame)))) 48) 48)) + ) + (cond + ((= (-> gp-0 gun-type) (pickup-type gun-blue-2)) + (set! (-> gp-0 fire-delay) (the-as uint 0)) + 0 + ) + (else + (set! (-> gp-0 fire-delay) (the-as uint (the int (lerp-scale 120.0 30.0 (-> gp-0 fire-spinv) 0.0 218453.33)))) + ) + ) + (when (and (>= (-> gp-0 fire-spinv) 218453.33) + (and (or (< 0.0 (-> self game gun-ammo 2)) + (logtest? (target-flags tf16) (-> self target-flags)) + (logtest? (game-secrets endless-ammo) (-> self game secrets)) + ) + (and (-> gp-0 active?) + (or (= (-> gp-0 gun-type) (pickup-type gun-blue-1)) (= (-> gp-0 gun-type) (pickup-type gun-blue-3))) + (not (or (= (-> self skel top-anim frame-group) jakb-gun-blue-fire-ja) + (= (-> self skel top-anim frame-group) jakb-pilot-gun-blue-fire-ja) + ) + ) + ) + ) + ) + (let* ((f0-23 (+ (-> self gun top-anim-blue-cycle) (the float (rand-vu-int-range 1 3)))) + (f0-24 (- f0-23 (* (the float (the int (/ f0-23 4.0))) 4.0))) + ) + (set! (-> self gun top-anim-blue-cycle) f0-24) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim (if (focus-test? self pilot-riding) + jakb-pilot-gun-blue-fire-ja + jakb-gun-blue-fire-ja + ) + ) + (* 6.0 f0-24) + 0 + 5 + 1.0 + (- 18.0 (* 6.0 f0-24)) + #f + ) + ) + ) + (when (and (cpad-hold? (-> self control cpad number) r1) + (-> self gun active?) + (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) + ) + (set-time! (-> gp-0 fire-pending-time)) + (if (zero? (-> self gun fire-pending)) + (+! (-> self gun fire-pending) 1) + ) + (set! (-> gp-0 fire-charge) 0.5) + ) + (when (and (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) + (> (-> gp-0 fire-pending) 0) + (-> self gun active?) + ) + (seekl! (-> self gun fire-pending) 0 1) + (cond + ((send-event self 'gun (-> gp-0 gun-type)) + (set-time! (-> self gun fire-time)) + ) + (else + (set! (-> self gun fire-time) 0) + 0 + ) + ) + #t + ) + ) + ) + (case (gun->eco (-> gp-0 gun-type)) + (((pickup-type eco-blue)) + (set! (-> gp-0 blue-whine-volume) (* 0.000004577637 (-> gp-0 fire-spinv))) + (sound-play-by-name + (static-sound-name "blue-gun-whine") + (-> gp-0 blue-whine-sound-id) + (the int (* 1024.0 (fmin 1.0 (* 2.0 (-> gp-0 blue-whine-volume))))) + (the int (* 1524.0 (lerp-scale -0.9 0.5 (-> gp-0 blue-whine-volume) 0.0 1.0))) + 0 + (sound-group) + #t + ) + ) + (else + (when (!= (-> gp-0 blue-whine-volume) 0.0) + (let ((v1-253 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-253 command) (sound-command set-param)) + (set! (-> v1-253 id) (-> gp-0 blue-whine-sound-id)) + (set! (-> v1-253 params volume) -4) + (set! (-> v1-253 auto-time) 120) + (set! (-> v1-253 auto-from) 2) + (set! (-> v1-253 params mask) (the-as uint 17)) + (-> v1-253 id) + ) + (set! (-> gp-0 blue-whine-volume) 0.0) + ) + ) + ) + (set-time! (-> gp-0 gun-time)) + ) + ) + 0 + (none) + ) + +;; definition for function camera-rotate-to-vector +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defun camera-rotate-to-vector ((arg0 vector) (arg1 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg0 quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> (camera-matrix) fvec quad)) + (vector-flatten! s5-0 s5-0 arg1) + (vector-normalize! s5-0 1.0) + (vector-flatten! s4-0 s4-0 arg1) + (vector-normalize! s4-0 1.0) + (let ((f30-0 (vector-y-angle s5-0)) + (f0-0 (vector-y-angle s4-0)) + ) + (send-event *camera* 'joystick (fmax -1.0 (fmin 1.0 (* 0.00018310547 (deg-diff f0-0 f30-0)))) 1.0) + ) + ) + ) + (none) + ) + +;; definition for function target-gun-real-post +;; INFO: Used lq/sq +(defbehavior target-gun-real-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s4-0 (new-stack-vector0))) + (read-pad s4-0) + (turn-to-vector s4-0 (debounce-speed + (-> self control pad-magnitude) + (-> self control last-pad-magnitude) + (-> self control pad-xz-dir) + (-> self control last-pad-xz-dir) + ) + ) + ) + (add-thrust) + (add-gravity) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (let ((a2-1 (new 'stack-no-clear 'collide-query)) + (v1-13 (-> self control)) + ) + (set! (-> a2-1 collide-with) (-> v1-13 root-prim prim-core collide-with)) + (set! (-> a2-1 ignore-process0) self) + (set! (-> a2-1 ignore-process1) #f) + (set! (-> a2-1 ignore-pat) (-> v1-13 pat-ignore-mask)) + (set! (-> a2-1 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide v1-13 (-> v1-13 transv) a2-1 (meters 1)) + ) + (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (>= (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + (-> *TARGET-bank* edge-grab-height-off-ground) + ) + ) + (target-method-28 *target* *collide-cache* *collide-edge-spec*) + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (ja-post) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +;; definition for function target-gun-post +(defbehavior target-gun-post target () + (target-gun-real-post) + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/target/target-h_REF.gc b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc index 7ba7ee67ad2..827ad1982a5 100644 --- a/test/decompiler/reference/jak3/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc @@ -3,20 +3,21 @@ ;; definition of type target (deftype target (process-focusable) - ((control control-info :overlay-at root) + ((fact fact-info-target :override) + (control control-info :overlay-at root) (skel2 joint-control) (shadow-backup shadow-geo) - (target-flags target-flags :overlay-at state-flags) + (target-flags target-flags :overlay-at state-flags) (game game-info) (neck joint-mod) (head joint-mod) (upper-body joint-mod) (horns joint-mod) - (hair joint-mod 2) - (arm-ik joint-mod-ik 2) - (leg-ik joint-mod-ik 2) - (foot joint-mod 2) - (cloth basic) + (hair joint-mod 2) + (arm-ik joint-mod-ik 2) + (leg-ik joint-mod-ik 2) + (foot joint-mod 2) + (cloth symbol) (init-time time-frame) (teleport-time time-frame) (state-hook-time time-frame) @@ -25,15 +26,15 @@ (sidekick (pointer sidekick)) (manipy (pointer manipy)) (mirror (pointer process-drawable)) - (attack-info attack-info :inline) - (attack-info-rec attack-info :inline) - (attack-info-old attack-info 8 :inline) + (attack-info attack-info :inline) + (attack-info-rec attack-info :inline) + (attack-info-old attack-info 8 :inline) (anim-seed uint64) - (alt-cam-pos vector :inline) + (alt-cam-pos vector :inline) (current-level level) - (saved-pos transformq :inline) + (saved-pos transformq :inline) (saved-owner handle) - (alt-neck-pos vector :inline) + (alt-neck-pos vector :inline) (focus-search (array collide-shape)) (handle-search (array handle)) (excitement float) @@ -47,20 +48,20 @@ (burn-proc handle) (pre-joint-hook (function none :behavior target)) (notify handle) - (death-resetter resetter-spec :inline) + (death-resetter resetter-spec :inline) (mode-cache basic) - (mode-param1 uint64) + (mode-param1 handle) (mode-param2 uint64) (mode-param3 uint64) (major-mode-exit-hook basic) (major-mode-event-hook basic) (sub-mode-exit-hook basic) - (ext-geo-control basic) - (pending-ext-geo int32) - (ext-geo int32) - (ext-anim-control basic) - (pending-ext-anim int32) - (ext-anim int32) + (ext-geo-control external-art-buffer) + (pending-ext-geo target-geo) + (ext-geo target-geo) + (ext-anim-control external-art-buffer) + (pending-ext-anim target-anim) + (ext-anim target-anim) (tobot-state state) (tobot? symbol) (tobot-recorder basic) @@ -94,64 +95,66 @@ (invisible-interp float) (invisible-start-time time-frame) (invisible-duration time-frame) - (invisible-shadow-dir-backup vector :inline) + (invisible-shadow-dir-backup vector :inline) ) (:methods - (target-method-28 () none) - (target-method-29 () none) + (target-method-28 (_type_ collide-cache collide-edge-spec) none) + (target-init! (_type_ continue-point symbol) none) ) (:states target-attack - target-attack-air - target-attack-uppercut - target-attack-uppercut-jump - target-blast-recover - target-board-clone-anim + (target-attack-air symbol) + (target-attack-uppercut float float) + (target-attack-uppercut-jump float float) + (target-blast-recover rigid-body-impact) + (target-board-clone-anim handle) target-board-duck-stance target-board-falling - target-board-flip - target-board-get-off + (target-board-flip float float symbol) + (target-board-get-off handle symbol) target-board-get-on - target-board-grab - target-board-grenade + (target-board-grab symbol) + (target-board-grenade handle) target-board-halfpipe - target-board-hit + (target-board-hit symbol attack-info) target-board-hit-ground - target-board-hold - target-board-jump + (target-board-hold float float symbol) + (target-board-jump meters meters symbol) target-board-jump-kick - target-board-ride-edge + (target-board-ride-edge symbol) target-board-stance - target-board-start - target-board-trickx - target-board-tricky + (target-board-start handle) + (target-board-trickx float float symbol) + (target-board-tricky float float symbol) target-board-turn-around - target-board-turn-to - target-board-wall-kick - target-clone-anim - target-continue - target-credits + (target-board-turn-to vector time-frame) + (target-board-wall-kick vector float) + target-carry-pickup + (target-clone-anim handle) + (target-continue continue-point) + (target-credits int) target-darkjak-bomb0 target-darkjak-bomb1 target-darkjak-get-off - target-darkjak-get-on + (target-darkjak-get-on darkjak-stage) target-darkjak-running-attack target-darkjak-smack target-darkjak-smack-charge - target-death - target-double-jump - target-duck-high-jump - target-duck-high-jump-jump - target-duck-stance - target-duck-walk - target-eco-powerup + (target-death symbol) + target-demo + (target-double-jump float float) + (target-duck-high-jump float float symbol) + (target-duck-high-jump-jump float float symbol) + (target-duck-stance symbol) + (target-duck-walk symbol) + (target-eco-powerup int float) target-edge-grab - target-edge-grab-jump + (target-edge-grab-jump float float symbol) target-edge-grab-off - target-falling + (target-falling symbol) target-float - target-flop - target-flop-hit-ground + (target-flop float float float object) + (target-flop-hit-ground symbol) target-flut-air-attack target-flut-air-attack-hit-ground target-flut-clone-anim @@ -169,17 +172,19 @@ target-flut-kanga-catch target-flut-running-attack target-flut-stance - target-flut-start + (target-flut-start handle symbol int) target-flut-walk - target-grab - target-grab-ride + (target-grab symbol) + (target-grab-ride handle) target-gun-stance target-gun-walk target-hide - target-high-jump - target-hit - target-hit-ground - target-hit-ground-hard + (target-high-jump float float object) + (target-hit symbol attack-info) + (target-hit-ground symbol) + (target-hit-ground-hard float) + target-ice-stance + target-ice-walk target-indax-attack target-indax-attack-air target-indax-death @@ -193,23 +198,24 @@ target-indax-jump target-indax-running-attack target-indax-stance - target-indax-start + (target-indax-start handle object) target-indax-trip target-indax-walk - target-invisible-get-on - target-jump - target-jump-forward + (target-invisible-get-on handle time-frame) + (target-jump float float surface) + (target-jump-forward float float) target-ladder - target-launch + (target-ladder-start handle) + (target-launch float symbol vector int) target-launch-dir target-lightjak-freeze target-lightjak-get-off - target-lightjak-get-on - target-lightjak-regen + (target-lightjak-get-on lightjak-stage) + (target-lightjak-regen int) target-lightjak-shield - target-lightjak-swoop - target-lightjak-swoop-again - target-lightjak-swoop-falling + (target-lightjak-swoop float) + (target-lightjak-swoop-again float) + (target-lightjak-swoop-falling symbol) target-load-wait target-look-around target-mech-carry-drag @@ -234,44 +240,58 @@ target-mech-punch target-mech-shield target-mech-stance - target-mech-start + (target-mech-start handle float symbol) target-mech-walk target-pilot-clone-anim target-pilot-daxter-perch target-pilot-death - target-pilot-edge-grab + (target-pilot-edge-grab pilot-edge-grab-info) target-pilot-get-off target-pilot-get-on target-pilot-grab target-pilot-hit target-pilot-impact target-pilot-stance - target-pilot-start - target-play-anim - target-pole-cycle - target-pole-flip-forward - target-pole-flip-forward-jump - target-pole-flip-up - target-pole-flip-up-jump + (target-pilot-start handle symbol symbol) + (target-play-anim string handle) + (target-pole-cycle handle) + (target-pole-flip-forward float float float) + (target-pole-flip-forward-jump float float) + (target-pole-flip-up float float float) + (target-pole-flip-up-jump float float) target-powerjak-get-on + (target-racing-start handle) target-roll - target-roll-flip + (target-roll-flip float float) target-running-attack target-slide-down target-slide-down-to-ground target-stance target-stance-ambient target-stance-look-around + target-startup target-swim - target-swim-jump + target-swim-down + (target-swim-jump float float) + (target-swim-jump-jump float float surface) + target-swim-stance + target-swim-up + target-swim-walk target-title target-tube + (target-tube-start handle) target-turn-around + target-turret-get-off + (target-turret-get-on handle) + (target-turret-stance handle) + target-turret-stance-fire target-wade-stance target-wade-walk target-walk - target-warp-in + (target-warp-in vector vector) target-warp-out + target-yellow-jump-blast + tobot-stance ) ) @@ -385,16 +405,17 @@ ;; definition of type sidekick (deftype sidekick (process-drawable) - ((control control-info :overlay-at root) - (anim-seed uint64 :offset 208) + ((parent (pointer target) :override) + (control control-info :overlay-at root) + (anim-seed uint64 :offset 208) (shadow-in-movie? symbol) (special-anim-time time-frame) (special-anim-interp float) (special-anim-frame float) - (offset transformq :inline) + (offset transformq :inline) (mirror (pointer process-drawable)) - (ear joint-mod 2) - (flap joint-mod 2) + (ear joint-mod 2) + (flap joint-mod 2) ) (:states sidekick-clone @@ -430,7 +451,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc new file mode 100644 index 00000000000..64d528200be --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc @@ -0,0 +1,2162 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function target-shoved +(defbehavior target-shoved target ((arg0 meters) (arg1 meters) (arg2 process) (arg3 (state object object target))) + (let ((s5-0 (new 'static 'attack-info))) + (set! (-> s5-0 attacker) (process->handle arg2)) + (set! (-> s5-0 shove-back) arg0) + (set! (-> s5-0 shove-up) arg1) + (set! (-> s5-0 angle) + (if (not (logtest? (logior (-> self control status) (-> self control old-status)) (collide-status on-surface))) + 'air + 'shove + ) + ) + (set! (-> s5-0 mask) (attack-mask attacker shove-back shove-up angle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (go arg3 'shove s5-0) + ) + ) + +;; definition for function attack-mode-is-invinc +(defun attack-mode-is-invinc ((arg0 symbol) (arg1 symbol)) + (case arg1 + (('dark-eco-pool + 'endlessfall + 'melt + 'lava + 'fry + 'slime + 'bot + 'instant-death + 'grenade + 'drill-mech-master + 'centipede + 'drown-death + 'crush + 'death + 'tentacle + ) + #t + ) + ) + ) + +;; definition for function target-attacked +;; INFO: Used lq/sq +(defbehavior target-attacked target ((arg0 symbol) + (arg1 attack-info) + (arg2 process) + (arg3 touching-shapes-entry) + (arg4 (state symbol attack-info target)) + ) + (let ((s4-0 (if (logtest? (-> arg1 mask) (attack-mask mode)) + (-> arg1 mode) + ) + ) + (s2-0 arg0) + ) + (when (or (and (not (focus-test? self hit)) (not (logtest? (target-flags disable-attacks) (-> self target-flags)))) + (= s4-0 'endlessfall) + ) + (case s4-0 + (('endlessfall) + (if (not (-> *setting-control* user-current endlessfall)) + (return #f) + ) + ) + ) + (cond + ((or (logtest? (target-flags tf2 tinvuln1 tinvuln2) (-> self target-flags)) + (and (or (logtest? (-> self target-flags) (target-flags tf4)) + (logtest? (game-secrets invulnerable) (-> self game secrets)) + ) + (not (attack-mode-is-invinc 'normal s4-0)) + ) + (or (when (< 0.0 (-> self fact shield-level)) + (send-event (ppointer->process (-> self lightjak shield)) 'hit) + #t + ) + (and (-> *setting-control* user-current board-trail) + (focus-test? self board) + (< 0.0 (-> self fact eco-green)) + ) + (and (= s4-0 'darkeco) + (and (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (or (logtest? (-> self target-flags) (target-flags tf15)) (focus-test? self dangerous)) + ) + ) + ) + ) + (case arg0 + (('attack-or-shove) + ) + (('attack-invinc) + (set! arg0 'attack) + ) + (else + (return #f) + ) + ) + ) + (else + (case arg0 + (('attack-or-shove 'attack-invinc) + (set! arg0 'attack) + ) + ) + ) + ) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer arg1) 168) + (compute-intersect-info (-> self attack-info-rec) arg1 self arg2 arg3) + (when (not (focus-test? self mech)) + (if (and (not (target-log-attack (-> self attack-info-rec) (if (logtest? (attack-mask test) (-> arg1 mask)) + 'test + 'log + ) + ) + ) + (!= s2-0 'attack-invinc) + ) + (return #f) + ) + ) + (if (logtest? (attack-mask test) (-> arg1 mask)) + (return #t) + ) + (set! (-> self control attacked-by-id) (the-as int (-> self attack-info-rec id))) + (cond + ((and (logtest? (-> self attack-info-rec mask) (attack-mask mode)) + (or (= (-> self attack-info-rec mode) 'damage) (= (-> self attack-info-rec mode) 'shock-no-interrupt)) + (not (and (= (-> self game mode) 'play) (>= 0.0 (- (-> self fact health) (-> self attack-info-rec damage))))) + ) + (pickup-collectable! + (-> self fact) + (pickup-type health) + (if (logtest? (attack-mask damage) (-> self attack-info-rec mask)) + (- (-> self attack-info-rec damage)) + (- (-> *FACT-bank* health-single-inc)) + ) + (the-as handle #f) + ) + (cond + ((logtest? (-> *part-group-id-table* 10 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) + (-> (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) + (-> self attack-info-rec intersection) + (the-as vector (-> self control root-prim prim-core)) + ) + ) + quad + ) + ) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-7 (method-of-type part-tracker-subsampler activate))) + (t9-7 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-8 run-function-in-process) + (a0-39 gp-1) + (a1-14 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 10)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-8) a0-39 a1-14 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) + (-> (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) + (-> self attack-info-rec intersection) + (the-as vector (-> self control root-prim prim-core)) + ) + ) + quad + ) + ) + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-10 (method-of-type part-tracker activate))) + (t9-10 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-11 run-function-in-process) + (a0-48 gp-2) + (a1-17 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 10)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-11) a0-48 a1-17 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + (target-timed-invulnerable + (if (logtest? (-> self attack-info-rec mask) (attack-mask invinc-time)) + (-> self attack-info-rec invinc-time) + (-> *TARGET-bank* hit-invulnerable-timeout) + ) + self + 1 + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.5)) + (case (-> self attack-info-rec mode) + (('damage) + (sound-play "oof") + ) + (else + (cond + ((logtest? (-> *part-group-id-table* 67 flags) (sp-group-flag sp13)) + (let ((gp-4 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-4 + (let ((t9-17 (method-of-type part-tracker-subsampler activate))) + (t9-17 (the-as part-tracker-subsampler gp-4) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-18 run-function-in-process) + (a0-55 gp-4) + (a1-23 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 67)) + (set! (-> *part-tracker-subsampler-params-default* duration) (seconds 1)) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 6) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-18) a0-55 a1-23 *part-tracker-subsampler-params-default*) + ) + (-> gp-4 ppointer) + ) + ) + ) + (else + (let ((gp-5 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-5 + (let ((t9-20 (method-of-type part-tracker activate))) + (t9-20 (the-as part-tracker gp-5) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-21 run-function-in-process) + (a0-58 gp-5) + (a1-26 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 67)) + (set! (-> *part-tracker-params-default* duration) (seconds 1)) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 6) + ((the-as (function object object object none) t9-21) a0-58 a1-26 *part-tracker-params-default*) + ) + (-> gp-5 ppointer) + ) + ) + ) + ) + (process-spawn-function + process + (lambda :behavior target + () + (let ((gp-0 (current-time)) + (s5-0 (current-time)) + ) + (until (time-elapsed? s5-0 (seconds 1)) + (when (time-elapsed? gp-0 (seconds 0.03)) + (set! gp-0 (current-time)) + (process-drawable-shock-effect + *target* + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + (suspend) + ) + ) + (none) + ) + :to self + ) + ) + ) + #t + ) + (else + (logior! (-> self focus-status) (focus-status ignore hit)) + (when (and (= (-> self game mode) 'play) + (and (or (and (>= 0.0 (- (-> self fact health) (-> self attack-info-rec damage))) + (and (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (not (and (focus-test? self flut) (= (-> self flut mode) 'normal))) + ) + ) + (attack-mode-is-invinc 'normal s4-0) + ) + (= arg0 'attack) + ) + ) + (logior! (-> self focus-status) (focus-status dead)) + (logior! (-> self target-flags) (target-flags disable-attacks)) + ) + (go arg4 arg0 (-> self attack-info-rec)) + ) + ) + ) + ) + ) + +;; definition for function target-got-impact-impulse +;; INFO: Used lq/sq +(defbehavior target-got-impact-impulse target ((arg0 rigid-body-impact)) + (when (< 20480.0 (-> arg0 impulse)) + (let ((v1-1 (new 'stack-no-clear 'vector))) + (let ((f0-2 (fmin 81920.0 (* 0.333 (-> arg0 impulse))))) + (vector-float*! v1-1 (-> arg0 normal) f0-2) + (set! (-> v1-1 y) f0-2) + ) + (send-event + self + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (vector v1-1)) + ) + ) + ) + (logior! (-> self control penetrated-by) (penetrate vehicle)) + #t + ) + ) + +;; definition for function target-darkjak-effect-trans +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior target-darkjak-effect-trans target ((arg0 handle) (arg1 (pointer process-drawable)) (arg2 (pointer time-frame)) (arg3 time-frame)) + (local-vars (sv-112 vector) (sv-128 matrix)) + (let ((s2-0 sp-launch-particles-var) + (s1-0 *sp-particle-system-2d*) + (s0-0 (-> *part-id-table* 173)) + ) + (set! sv-128 *launch-matrix*) + (set! sv-112 (-> sv-128 trans)) + (let ((v1-6 (-> (process-drawable-random-point! + (the-as process-drawable (ppointer->process arg1)) + (new 'stack-no-clear 'vector) + ) + quad + ) + ) + ) + (set! (-> sv-112 quad) v1-6) + ) + (let ((a3-1 #f) + (t0-0 #f) + (t1-0 1.0) + ) + (s2-0 s1-0 s0-0 sv-128 (the-as sparticle-launch-state a3-1) (the-as sparticle-launch-control t0-0) t1-0) + ) + ) + (send-event (ppointer->process arg1) 'color-effect 'dark (seconds 0.2)) + (when (time-elapsed? (-> arg2 0) (seconds 0.05)) + (set-time! (-> arg2 0)) + (cond + ((and *target* (>= (-> *target* darkjak lightning-count) 10)) + ) + ((and (not (time-elapsed? arg3 (seconds 0.5))) (handle->process arg0)) + (if *target* + (+! (-> *target* darkjak lightning-count) 2) + ) + (process-drawable2-shock-effect + (the-as process-drawable (handle->process arg0)) + (the-as process-drawable (ppointer->process arg1)) + (-> *lightning-spec-id-table* 10) + lightning-probe-callback + (-> *part-id-table* 187) + ) + ) + (else + (if *target* + (+! (-> *target* darkjak lightning-count) 2) + ) + (send-event (handle->process arg0) 'color-effect 'shock (seconds 0.2)) + (process-drawable-shock-effect + (the-as process-drawable (ppointer->process arg1)) + (-> *lightning-spec-id-table* 10) + lightning-probe-callback + (-> *part-id-table* 187) + 0 + 0 + 40960.0 + ) + ) + ) + ) + (none) + ) + +;; definition for function target-send-attack +;; INFO: Used lq/sq +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +(defbehavior target-send-attack target ((arg0 process) (arg1 symbol) (arg2 touching-shapes-entry) (arg3 int) (arg4 int) (arg5 penetrate)) + (local-vars (sv-96 symbol) (sv-128 vector) (sv-132 touching-prims-entry) (sv-136 int) (sv-144 int)) + (set! sv-144 arg3) + (let ((s1-0 arg4) + (s0-0 arg5) + ) + (if (and (= arg1 'bomb) + (logtest? (process-mask guard) (-> arg0 mask)) + (not (-> *setting-control* user-current gun-target-guards?)) + ) + (return #f) + ) + 2.0 + 0.0 + (let* ((f30-0 (penetrate-using->damage s0-0)) + (s2-0 arg0) + (s5-0 (if (type? s2-0 process-focusable) + (the-as process-focusable s2-0) + ) + ) + (s2-1 (and s5-0 (focus-test? s5-0 dead hit))) + ) + (set! sv-96 + (the-as symbol (send-event + arg0 + 'attack + arg2 + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint sv-144)) + (damage f30-0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode arg1) + (count (the-as uint s1-0)) + (penetrate-using s0-0) + ) + ) + ) + ) + ) + (when sv-96 + (let ((v1-17 (new 'stack-no-clear 'vector))) + (set! (-> v1-17 quad) (-> self control trans quad)) + (set! sv-128 v1-17) + ) + (set! sv-132 (if arg2 + (prims-touching? arg2 (-> self control) (the-as uint 256)) + ) + ) + (set! sv-136 -1) + (cond + ((not arg2) + ) + (sv-132 + (set! sv-136 1) + (get-intersect-point sv-128 sv-132 (-> self control) arg2) + ) + ((let ((v0-6 (prims-touching? arg2 (-> self control) (the-as uint 128)))) + (set! sv-132 v0-6) + v0-6 + ) + (set! sv-136 0) + (get-intersect-point sv-128 sv-132 (-> self control) arg2) + ) + ) + (set! (-> self control send-attack-dest) (process->handle arg0)) + (set-time! (-> self control send-attack-time)) + (send-event self 'hit arg1 arg0 arg2 sv-128) + (set! arg0 (and (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage bomb0)) + ) + arg0 + ) + ) + (when arg0 + (when (and s5-0 (not s2-1) (-> self control danger-mode) (not (logtest? (-> s5-0 mask) (process-mask dark-effect)))) + (logior! (-> s5-0 mask) (process-mask dark-effect)) + (process-spawn-function + process + (lambda :behavior target + ((arg0 handle)) + (local-vars (sv-16 int)) + (let ((gp-0 (-> self parent))) + (let ((s4-0 (current-time))) + (set! sv-16 0) + (+! (-> self clock ref-count) -1) + (+! (-> gp-0 0 clock ref-count) 1) + (set! (-> self clock) (-> gp-0 0 clock)) + (while (let ((v1-10 gp-0)) + (and (or (focus-test? + (the-as process-focusable (if v1-10 + (the-as process-focusable (-> v1-10 0 self)) + ) + ) + dead + hit + ) + (let ((v1-15 gp-0)) + (and (-> (the-as process (if v1-15 + (the-as process (-> v1-15 0 self)) + ) + ) + next-state + ) + (let ((v1-18 gp-0)) + (= (-> (the-as process (if v1-18 + (the-as process (-> v1-18 0 self)) + ) + ) + next-state + name + ) + 'knocked + ) + ) + ) + ) + ) + (not (time-elapsed? s4-0 (seconds 15))) + (not (logtest? (-> (the-as process-focusable (-> gp-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) + ) + ) + ) + (target-darkjak-effect-trans + arg0 + (the-as (pointer process-drawable) gp-0) + (the-as (pointer time-frame) (& sv-16)) + s4-0 + ) + (suspend) + ) + ) + (logclear! (-> gp-0 0 mask) (process-mask dark-effect)) + (send-event (ppointer->process gp-0) 'color-effect #f 0) + ) + (none) + ) + (process->handle self) + :to s5-0 + ) + ) + ) + (let ((v1-57 arg1)) + (cond + ((or (= v1-57 'spin) (= v1-57 'spin-air) (= v1-57 'board-spin) (= v1-57 'board-zap)) + (case sv-136 + ((1) + (cond + ((logtest? (-> *part-group-id-table* 11 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-1 + (let ((t9-13 (method-of-type part-tracker-subsampler activate))) + (t9-13 (the-as part-tracker-subsampler s5-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-14 run-function-in-process) + (a0-46 s5-1) + (a1-16 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 11)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-14) a0-46 a1-16 *part-tracker-subsampler-params-default*) + ) + (-> s5-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-2 + (let ((t9-16 (method-of-type part-tracker activate))) + (t9-16 (the-as part-tracker s5-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-17 run-function-in-process) + (a0-51 s5-2) + (a1-19 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 11)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-17) a0-51 a1-19 *part-tracker-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + ) + ) + (else + (do-effect (-> self skel effect) (the-as symbol "group-spin-hit") -1.0 49) + ) + ) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 49 + (the-as basic #f) + (cond + ((= arg1 'board-spin) + (static-sound-name "board-impact") + ) + ((= arg1 'board-zap) + (static-sound-name "board-zap-hit") + ) + ((using-gun? self) + (static-sound-name "gun-spin-hit") + ) + (else + (static-sound-name "spin-hit") + ) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.2)) + ) + ((or (= v1-57 'get-on) (= v1-57 'darkjak)) + (let ((v1-105 sv-136)) + (when (or (zero? v1-105) (= v1-105 1)) + (cond + ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-23 (method-of-type part-tracker-subsampler activate))) + (t9-23 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-24 run-function-in-process) + (a0-71 gp-1) + (a1-26 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-24) a0-71 a1-26 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-26 (method-of-type part-tracker activate))) + (t9-26 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-27 run-function-in-process) + (a0-76 gp-2) + (a1-29 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-27) a0-76 a1-29 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + ) + ) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 3 + (the-as basic #f) + (static-sound-name "get-on-hit") + ) + ) + ((= v1-57 'shield) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 3 + (the-as basic #f) + (static-sound-name "shield-attack") + ) + ) + ((or (= v1-57 'punch) (= v1-57 'dark-smack) (= v1-57 'mech-punch)) + (let ((v1-147 sv-136)) + (when (or (zero? v1-147) (= v1-147 1)) + (cond + ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((s5-4 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-4 + (let ((t9-31 (method-of-type part-tracker-subsampler activate))) + (t9-31 (the-as part-tracker-subsampler s5-4) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-32 run-function-in-process) + (a0-91 s5-4) + (a1-36 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-32) a0-91 a1-36 *part-tracker-subsampler-params-default*) + ) + (-> s5-4 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((s5-5 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-5 + (let ((t9-34 (method-of-type part-tracker activate))) + (t9-34 (the-as part-tracker s5-5) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-35 run-function-in-process) + (a0-96 s5-5) + (a1-39 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-35) a0-96 a1-39 *part-tracker-params-default*) + ) + (-> s5-5 ppointer) + ) + ) + ) + ) + ) + ) + (cond + ((= arg1 'mech-punch) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 28 + (the-as basic #f) + (static-sound-name "mech-punch-hit") + ) + ) + (else + (let ((name (if (using-gun? self) + (the-as sound-name (static-sound-name "gun-punch-hit")) + (the-as sound-name (static-sound-name "punch-hit")) + ) + ) + ) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 28 + (the-as basic #f) + (the-as sound-name name) + ) + ) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) + ) + ((= v1-57 'flip) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 49 + (the-as basic #f) + (static-sound-name "punch-hit") + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.1)) + ) + ((= v1-57 'uppercut) + (let ((v1-199 sv-136)) + (when (or (zero? v1-199) (= v1-199 1)) + (cond + ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((gp-3 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-3 + (let ((t9-43 (method-of-type part-tracker-subsampler activate))) + (t9-43 (the-as part-tracker-subsampler gp-3) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-44 run-function-in-process) + (a0-116 gp-3) + (a1-47 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-44) a0-116 a1-47 *part-tracker-subsampler-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (let ((gp-4 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-4 + (let ((t9-46 (method-of-type part-tracker activate))) + (t9-46 (the-as part-tracker gp-4) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-47 run-function-in-process) + (a0-121 gp-4) + (a1-50 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-47) a0-121 a1-50 *part-tracker-params-default*) + ) + (-> gp-4 ppointer) + ) + ) + ) + ) + ) + ) + (do-effect (-> self skel effect) (the-as symbol "group-uppercut-hit") -1.0 28) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 28 + (the-as basic #f) + (static-sound-name "uppercut-hit") + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) + ) + ((or (= v1-57 'flop) (= v1-57 'flop-down)) + (do-effect (-> self skel effect) (the-as symbol "group-flop-hit") -1.0 28) + (do-effect (-> self skel effect) (the-as symbol "group-flop-hit") -1.0 19) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 28 + (the-as basic #f) + (static-sound-name "flop-hit") + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) + ) + ((= v1-57 'flut-attack) + (play-effect-sound + (-> self skel effect) + (the-as symbol "sound") + -1.0 + 28 + (the-as basic #f) + (static-sound-name "flut-punch-hit") + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.2)) + ) + ((= v1-57 'darkjak) + (set-time! (-> self darkjak attack-time)) + (let* ((v1-256 *game-info*) + (a0-141 (+ (-> v1-256 attack-id) 1)) + ) + (set! (-> v1-256 attack-id) a0-141) + (set! (-> self darkjak attack-id) a0-141) + a0-141 + ) + ) + ((= v1-57 'lightjak) + (set-time! (-> self darkjak attack-time)) + (let* ((v1-260 *game-info*) + (a0-145 (+ (-> v1-260 attack-id) 1)) + ) + (set! (-> v1-260 attack-id) a0-145) + (set! (-> self darkjak attack-id) a0-145) + a0-145 + ) + ) + ) + ) + ) + ) + ) + sv-96 + ) + +;; definition for function target-generic-event-handler +;; INFO: Used lq/sq +(defbehavior target-generic-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object) (a0-35 level-load-info) (a1-13 level-load-info)) + (case arg2 + (('get-pickup) + (when (not (focus-test? self dead)) + (let ((s4-1 (-> arg3 param 0)) + (f28-0 (the-as float (-> arg3 param 1))) + ) + (if (!= (pickup-collectable! (-> self fact) (the-as pickup-type s4-1) 0.0 (the-as handle #f)) + (pickup-collectable! (-> self fact) (the-as pickup-type s4-1) f28-0 (process->handle arg0)) + ) + #t + 'full + ) + ) + ) + ) + (('test-pickup) + (let ((a1-6 (-> arg3 param 0))) + (pickup-collectable! (-> self fact) (the-as pickup-type a1-6) 0.0 (the-as handle #f)) + ) + ) + (('reset-pickup) + (reset! (-> self fact) (the-as symbol (-> arg3 param 0))) + ) + (('reset-collide) + (cond + ((-> self control collide-mode) + (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) + ) + ((-> self control danger-mode) + (target-danger-set! (-> self control danger-mode) #f) + ) + ) + ) + (('level-deactivate) + (cond + ((and (focus-test? self pilot) (let ((a0-19 (lookup-level-info (the-as symbol (-> arg3 param 0))))) + (or (and a0-19 (logtest? (-> a0-19 level-flags) (level-flags lf7))) + (and (= (-> arg3 param 0) 'lctypatk) (-> self pilot as-daxter?)) + (= (-> arg3 param 0) 'desliz) + ) + ) + ) + (ja-channel-set! 0) + (target-gun-end-mode #t) + (set! (-> self skel top-anim interp) 0.0) + (let ((v1-34 (get-channel (-> self skel top-anim) 0))) + (if v1-34 + (set! (-> v1-34 frame-interp 1) 0.0) + ) + ) + (update (-> self skel top-anim)) + (cond + ((focus-test? self teleporting) + #f + ) + ((focus-test? self grabbed) + (set! (-> self event-hook) #f) + (go target-grab 'stance) + ) + (else + (set! (-> self event-hook) #f) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + ) + ) + ((and (focus-test? self flut) + (begin (set! a0-35 (lookup-level-info (the-as symbol (-> arg3 param 0)))) a0-35) + (logtest? (-> a0-35 level-flags) (level-flags lf8)) + ) + (ja-channel-set! 0) + (target-gun-end-mode #t) + (when (not (focus-test? self grabbed teleporting)) + (set! (-> self event-hook) #f) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + ) + ((and (focus-test? self mech) + (begin (set! a1-13 (lookup-level-info (the-as symbol (-> arg3 param 0)))) a1-13) + (logtest? (level-flags lf16) (-> a1-13 level-flags)) + ) + (ja-channel-set! 0) + (when (not (focus-test? self grabbed teleporting)) + (set! (-> self event-hook) #f) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + ) + ) + ) + (('level-enter) + (let ((s5-1 (level-get *level* (the-as symbol (-> arg3 param 0))))) + (when s5-1 + (let ((v1-66 (-> s5-1 info))) + (set! (-> self fact buzzer) 0.0) + (if (zero? (-> self game task-enter-times (-> v1-66 task-level))) + (set! (-> self game task-enter-times (-> v1-66 task-level)) (-> *display* game-clock frame-counter)) + ) + ) + (let ((s4-2 (-> *game-info* sub-task-list))) + (dotimes (s3-1 (-> s4-2 length)) + (when (nonzero? s3-1) + (let ((s2-0 (-> s4-2 s3-1))) + (when (and (= (-> s5-1 info taskname) (-> s2-0 level)) + (zero? (-> self game task-start-time (-> s2-0 task))) + (= s3-1 (-> *game-info* play-list (-> s2-0 task) play-node)) + (or (logtest? (-> s2-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 s2-0)) + (not (task-complete? (-> self game) (-> s2-0 task))) + (not (logtest? (-> s2-0 flags) (game-task-node-flag utility-node))) + ) + (when (zero? (-> self game task-start-time (-> s2-0 task))) + (format #t "--------------> set task start time for ~A~%" (-> s2-0 name)) + (set! (-> self game task-start-time (-> s2-0 task)) (-> *display* game-clock frame-counter)) + ) + ) + ) + ) + ) + ) + (update-task-masks 'level) + (format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0)) + ) + ) + ) + (('get-attack-count) + (set! v0-0 (+ (-> self control attack-count) (-> arg3 param 0))) + (set! (-> self control attack-count) (the-as uint v0-0)) + v0-0 + ) + (('continue) + (when (not (focus-test? self dead)) + (logior! (-> self focus-status) (focus-status teleporting)) + (go target-continue (the-as continue-point (-> arg3 param 0))) + ) + ) + (('query) + (case (-> arg3 param 0) + (('powerup) + (and (= (-> self fact eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact eco-level))) + ) + (('pickup) + (pickup-collectable! (-> self fact) (the-as pickup-type (-> arg3 param 1)) 0.0 (the-as handle #f)) + ) + (('ground-height) + (target-height-above-ground) + ) + (('gun-type) + (-> self gun gun-type) + ) + ) + ) + (('release) + (when (and (nonzero? (-> self gun)) (handle->process (-> self gun charge-active?))) + (set! (-> self gun charge-active?) (the-as handle #f)) + (set! v0-0 (current-time)) + (set! (-> self gun fire-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + (('trans) + (case (-> arg3 param 0) + (('save) + (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (logior! (-> self target-flags) (target-flags tf12)) + (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) + ) + (('restore) + (logclear! (-> self target-flags) (target-flags tf12)) + (let ((gp-1 (-> arg3 param 1))) + (move-to-point! (-> self control) (the-as vector (+ gp-1 0))) + (quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16))) + ) + (rot->dir-targ! (-> self control)) + (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! v0-0 (current-time)) + (set! (-> self control last-time-on-surface) (the-as time-frame v0-0)) + v0-0 + ) + (('reset) + (set! v0-0 (logclear (-> self target-flags) (target-flags tf12))) + (set! (-> self target-flags) (the-as target-flags v0-0)) + v0-0 + ) + ) + ) + (('effect) + (target-powerup-effect (the-as symbol (-> arg3 param 0))) + ) + (('color-effect) + (set! (-> self color-effect) (the-as basic (-> arg3 param 0))) + (set-time! (-> self color-effect-start-time)) + (set! v0-0 (-> arg3 param 1)) + (set! (-> self color-effect-duration) (the-as time-frame v0-0)) + v0-0 + ) + (('do-effect) + (do-effect (-> self skel effect) (the-as symbol (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1) + (if (-> self sidekick) + (do-effect + (-> self sidekick 0 skel effect) + (the-as symbol (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + -1 + ) + ) + ) + (('effect-control) + #f + ) + (('neck) + (set! (-> self neck flex-blend) (the-as float (-> arg3 param 0))) + (cond + ((-> arg3 param 1) + (logior! (-> self target-flags) (target-flags tf13)) + (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (look-at! (-> self neck) (-> self alt-neck-pos) 'force arg0) + ) + (else + (set! v0-0 (logclear (-> self target-flags) (target-flags tf13))) + (set! (-> self target-flags) (the-as target-flags v0-0)) + v0-0 + ) + ) + ) + (('sidekick) + (cond + ((and (-> arg3 param 0) (not (-> self sidekick))) + (let ((gp-2 (get-process *default-dead-pool* sidekick #x4000 1))) + (set! v0-0 (when gp-2 + (let ((t9-38 (method-of-type sidekick activate))) + (t9-38 (the-as sidekick gp-2) self "sidekick" (the-as pointer #x70004000)) + ) + (run-now-in-process gp-2 init-sidekick) + (-> gp-2 ppointer) + ) + ) + ) + (set! (-> self sidekick) (the-as (pointer sidekick) v0-0)) + v0-0 + ) + ((and (not (-> arg3 param 0)) (-> self sidekick)) + (deactivate (-> self sidekick 0)) + (set! (-> self sidekick) (the-as (pointer sidekick) #f)) + #f + ) + ) + ) + (('manipy) + (let ((v1-176 (get-continue-by-name (-> self game) (the-as string (-> arg3 param 1))))) + (when (and v1-176 (not (-> self manipy))) + (let ((t9-42 external-target-spawn) + (a0-150 (-> v1-176 trans)) + (a1-38 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> a1-38 x) (* 0.00003051851 (the float (-> v1-176 quat x)))) + (set! (-> a1-38 y) (* 0.00003051851 (the float (-> v1-176 quat y)))) + (set! (-> a1-38 z) (* 0.00003051851 (the float (-> v1-176 quat z)))) + (set! (-> a1-38 w) (* 0.00003051851 (the float (-> v1-176 quat w)))) + (let ((a2-23 self) + (a3-10 (-> arg3 param 2)) + (v1-178 (-> arg3 param 0)) + ) + (set! v0-0 (t9-42 a0-150 a1-38 a2-23 (the-as symbol a3-10) (cond + ((= v1-178 'manual) + (manipy-options mo0) + ) + ((= v1-178 'auto) + (manipy-options mo1) + ) + (else + (manipy-options) + ) + ) + ) + ) + ) + ) + (set! (-> self manipy) (the-as (pointer manipy) v0-0)) + v0-0 + ) + ) + ) + (('blend-shape) + (if (-> arg3 param 0) + (logior! (-> self skel status) (joint-control-status blend-shape)) + (logclear! (-> self skel status) (joint-control-status blend-shape)) + ) + (let ((a1-39 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-39 from) (process->ppointer arg0)) + (set! (-> a1-39 num-params) arg1) + (set! (-> a1-39 message) arg2) + (set! (-> a1-39 param 0) (-> arg3 param 0)) + (set! (-> a1-39 param 1) (-> arg3 param 1)) + (set! (-> a1-39 param 2) (-> arg3 param 2)) + (set! (-> a1-39 param 3) (-> arg3 param 3)) + (set! (-> a1-39 param 4) (-> arg3 param 4)) + (set! (-> a1-39 param 5) (-> arg3 param 5)) + (send-event-function (ppointer->process (-> self sidekick)) a1-39) + ) + ) + (('shadow) + (cond + ((-> arg3 param 0) + (let ((v1-196 (-> self draw shadow-ctrl))) + (logclear! (-> v1-196 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (else + (let ((v1-198 (-> self draw shadow-ctrl))) + (logior! (-> v1-198 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + ) + (('rotate-y-angle) + (quaternion-rotate-y! + (-> self control quat-for-control) + (-> self control quat-for-control) + (the-as float (-> arg3 param 0)) + ) + (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (rot->dir-targ! (-> self control)) + ) + ) + (('touched) + (cond + ((< 0.0 (-> self fact shield-level)) + (let ((s4-3 (-> self control penetrate-using))) + (set! (-> self control penetrate-using) (penetrate touch shield)) + (set! v0-0 (target-send-attack + arg0 + 'shield + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self fact shield-attack-id)) + 0 + (-> self control penetrate-using) + ) + ) + (set! (-> self control penetrate-using) s4-3) + ) + v0-0 + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (or (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage disable-force-on)) + ) + (logtest? (process-mask crate) (-> arg0 mask)) + ) + ) + (target-send-attack + arg0 + 'darkjak + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self darkjak attack-id)) + 0 + (penetrate touch dark-skin) + ) + ) + (else + (send-event arg0 'touch (-> arg3 param 0)) + ) + ) + ) + (('dry) + (set! (-> self water drip-wetness) 0.0) + ) + (('reset-height) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + #f + ) + (('draw) + (cond + ((-> arg3 param 0) + (when (logtest? (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (process-drawable-reset-all-cloth self) + ) + ) + (else + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + ) + (let ((a1-46 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-46 from) (process->ppointer arg0)) + (set! (-> a1-46 num-params) arg1) + (set! (-> a1-46 message) arg2) + (set! (-> a1-46 param 0) (-> arg3 param 0)) + (set! (-> a1-46 param 1) (-> arg3 param 1)) + (set! (-> a1-46 param 2) (-> arg3 param 2)) + (set! (-> a1-46 param 3) (-> arg3 param 3)) + (set! (-> a1-46 param 4) (-> arg3 param 4)) + (set! (-> a1-46 param 5) (-> arg3 param 5)) + (send-event-function (ppointer->process (-> self manipy)) a1-46) + ) + ) + (('draw-vehicle) + (when (nonzero? (-> self pilot)) + (if (-> arg3 param 0) + (send-event (handle->process (-> self pilot vehicle)) 'unhide) + (send-event (handle->process (-> self pilot vehicle)) 'hide) + ) + ) + ) + (('no-load-wait) + (set! v0-0 (+ (current-time) (the-as time-frame (-> arg3 param 0)))) + (set! (-> self no-load-wait) (the-as uint v0-0)) + v0-0 + ) + (('no-look-around) + (set! (-> self no-look-around-wait) (the-as uint (+ (current-time) (the-as time-frame (-> arg3 param 0))))) + (if (and (-> self next-state) (= (-> self next-state name) 'target-look-around)) + (send-event self 'end-mode 'in-head) + ) + ) + (('change-state) + (go + (the-as (state object object object object target) (-> arg3 param 0)) + (-> arg3 param 1) + (-> arg3 param 2) + (-> arg3 param 3) + (-> arg3 param 4) + ) + ) + (('tobot) + (set! v0-0 (-> arg3 param 0)) + (set! (-> self tobot?) (the-as symbol v0-0)) + v0-0 + ) + (('carry-info) + (-> self carry) + ) + (('gun-type) + (cond + ((-> arg3 param 0) + (target-gun-type-set! (the-as pickup-type (-> arg3 param 0))) + ) + (else + (set! v0-0 #t) + (set! (-> self gun put-away?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + (('kill-vehicle) + (if (nonzero? (-> self pilot)) + (send-event (handle->process (-> self pilot vehicle)) 'go-die) + ) + ) + (('get-notify) + (set! v0-0 (process->handle (the-as process (-> arg3 param 0)))) + (set! (-> self notify) (the-as handle v0-0)) + v0-0 + ) + (('invulnerable) + (target-timed-invulnerable (the-as time-frame (-> arg3 param 0)) self 2) + #t + ) + ) + ) + +;; definition for function target-standard-event-handler +;; INFO: Used lq/sq +(defbehavior target-standard-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (at-0 int) (v1-317 object) (a2-5 symbol)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg2)) + (b! (not (or (= v1-0 'attack) (= v1-0 'attack-or-shove) (= v1-0 'attack-invinc))) cfg-7 :delay (nop!)) + (let ((v0-0 + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-hit + ) + ) + ) + (b! #t cfg-435 :delay (nop!)) + (label cfg-7) + (b! (!= v1-0 'shove) cfg-21 :delay (nop!)) + (set! v0-0 (when (not (and (-> self next-state) (= (-> self next-state name) 'target-hit))) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 168) + (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) + (set! (-> self attack-info-rec attacker) (process->handle arg0)) + (logior! (-> self attack-info-rec mask) (attack-mask attacker)) + ) + (go target-hit 'shove (-> self attack-info-rec)) + ) + ) + (b! #t cfg-435 :delay (nop!)) + (label cfg-21) + (set! v0-0 + (cond + ((= v1-0 'push-trans) + (let ((v1-15 (-> self control additional-decaying-velocity))) + (.lvf vf1 (&-> (the-as vector (-> arg3 param 0)) quad)) + (let ((f0-0 (-> self clock frames-per-second))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-15 quad) vf1) + ) + (set-time! (-> self control additional-decaying-velocity-end-time)) + (set! (-> self control additional-decaying-velocity-decay-start-time) + (+ (current-time) (the-as time-frame (-> arg3 param 1))) + ) + #t + ) + ((= v1-0 'push-transv) + (set! (-> self control additional-decaying-velocity quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set-time! (-> self control additional-decaying-velocity-end-time)) + (set! (-> self control additional-decaying-velocity-decay-start-time) + (+ (current-time) (the-as time-frame (-> arg3 param 1))) + ) + #t + ) + ((= v1-0 'launch) + (set! (-> self control transv quad) (-> (the-as vector (-> arg3 param 3)) quad)) + (go + target-jump + (the-as float (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + (the-as surface (-> arg3 param 2)) + ) + ) + ((= v1-0 'launch-dir) + (when (not (focus-test? self board)) + (set! (-> self control unknown-vector37 quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> self control sliding-start-time) (the-as time-frame (-> arg3 param 1))) + (set! (-> self control unknown-word04) (the-as uint (the-as float (-> arg3 param 2)))) + (go target-launch-dir) + ) + ) + ((= v1-0 'powerup) + (if (and (and (-> self next-state) + (let ((v1-42 (-> self next-state name))) + (or (= v1-42 'target-stance) (= v1-42 'target-walk) (= v1-42 'target-stance-look-around)) + ) + ) + (zero? (-> self ext-anim)) + ) + (go target-eco-powerup (the-as int (-> arg3 param 0)) (the-as float (-> arg3 param 1))) + ) + ) + ((= v1-0 'loading) + (if (not (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (or (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self control status) (collide-status on-water)) + ) + (or (logtest? (-> self target-flags) (target-flags tf1)) + (focus-test? self dead dangerous hit grabbed in-head edge-grab pole flut tube board pilot mech) + (>= (the-as time-frame (-> self no-load-wait)) (current-time)) + ) + ) + ) + (go target-load-wait) + ) + ) + ((begin + (b! (!= v1-0 'gun-combo) cfg-66 :delay (nop!)) + (set! v0-0 #t) + (b! #t cfg-435 :delay (nop!)) + (label cfg-66) + (b! (!= v1-0 'change-mode) cfg-283 :delay (nop!)) + (let ((v1-63 (-> arg3 param 0))) + (b! (!= v1-63 'grab) cfg-73 :delay (empty-form)) + (set! v0-0 (when (not (focus-test? self dead)) + (if (not (-> arg3 param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + (b! #t cfg-282 :delay (nop!)) + (label cfg-73) + (b! (!= v1-63 'grab-ride) cfg-84 :delay (empty-form)) + (set! v0-0 (when (not (focus-test? self dead)) + (if (not (-> arg3 param 1)) + #t + (go target-grab-ride (process->handle arg0)) + ) + ) + ) + (b! #t cfg-282 :delay (nop!)) + (label cfg-84) + (b! (!= v1-63 'look-around) cfg-86 :delay (empty-form)) + (set! v0-0 (go target-look-around)) + (b! #t cfg-282 :delay (nop!)) + (label cfg-86) + (b! (!= v1-63 'falling) cfg-88 :delay (empty-form)) + (set! v0-0 (go target-falling #f)) + (b! #t cfg-282 :delay (nop!)) + (label cfg-88) + (b! (!= v1-63 'racer) cfg-97 :delay (empty-form)) + (if *debug-segment* + (load-package "racerp" global) + ) + (set! v0-0 (go target-racing-start (process->handle (the-as process (-> arg3 param 1))))) + (b! #t cfg-282 :delay (nop!)) + (label cfg-97) + (b! (!= v1-63 'flut) cfg-110 :delay (empty-form)) + (set! v0-0 (go + target-flut-start + (process->handle (the-as process (-> arg3 param 1))) + (the-as symbol (if (>= arg1 3) + (-> arg3 param 2) + 'normal + ) + ) + (if (>= arg1 4) + (the-as int (-> arg3 param 3)) + -1 + ) + ) + ) + (b! #t cfg-282 :delay (nop!)) + (label cfg-110) + (set! v0-0 + (cond + ((= v1-63 'board) + (if (logtest? (logand (game-feature board) (-> *setting-control* user-current features)) (-> self game features)) + (go target-board-start (process->handle (the-as process (-> arg3 param 1)))) + ) + ) + ((begin (set! a2-5 (= v1-63 'pilot)) (or a2-5 + (begin (set! a2-5 (= v1-63 'pilot-race)) a2-5) + (begin (set! a2-5 (= v1-63 'pilot-daxter)) a2-5) + (= v1-63 'pilot-race-daxter) + ) + ) + (let ((s5-1 (the-as object (-> arg3 param 1)))) + (when (not (the-as uint s5-1)) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 behavior) (the-as uint 4)) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 nav-mesh) #f) + (set! (-> s4-0 nav-branch) #f) + (set! (-> s4-0 proc) #f) + (set! (-> s4-0 handle) (the-as handle #f)) + (set! (-> s4-0 user-data) (the-as uint 0)) + (set! (-> s4-0 flags) (traffic-spawn-flags tsf5 tsf6)) + (set! (-> s4-0 guard-type) (the-as uint 11)) + (set! (-> s4-0 entity) #f) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> self control trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> self control quat)) + (set! (-> s4-0 id) (the-as uint 0)) + (let ((v1-101 (vehicle-spawn + (the-as process (-> arg3 param 2)) + (the-as type s4-0) + (the-as traffic-object-spawn-params a2-5) + ) + ) + ) + (if v1-101 + (set! s5-1 v1-101) + ) + ) + ) + ) + (when s5-1 + (let* ((v1-102 (-> arg3 param 0)) + (a2-6 (if (or (= v1-102 'pilot-daxter) (= v1-102 'pilot-race-daxter)) + #t + #f + ) + ) + ) + (go target-pilot-start (process->handle s5-1) (the-as symbol (-> arg3 param 3)) a2-6) + ) + ) + ) + ) + ((= v1-63 'mech) + (go + target-mech-start + (process->handle (the-as process (-> arg3 param 1))) + (the-as float (if (>= arg1 2) + (the-as int (-> arg3 param 2)) + #x42c80000 + ) + ) + #f + ) + ) + ((= v1-63 'indax) + (go target-indax-start (process->handle (the-as process (-> arg3 param 1))) (-> arg3 param 2)) + ) + ((= v1-63 'gun) + (when (logtest? (-> self game features) (game-feature gun)) + (let ((gp-1 (-> arg3 param 2))) + (cond + ((using-gun? self) + (when (nonzero? gp-1) + (set! (-> self gun using-gun-type) (the-as pickup-type gp-1)) + gp-1 + ) + ) + (else + (target-gun-init (the-as pickup-type gp-1)) + ) + ) + ) + ) + ) + ((= v1-63 'tube) + (if (and (logtest? (-> self control status) (collide-status on-surface)) + (not (or (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self control status) (collide-status on-water)) + ) + ) + ) + (go target-tube-start (process->handle (the-as process (-> arg3 param 1)))) + ) + ) + ((= v1-63 'turret) + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-turret-get-on (process->handle (the-as process (-> arg3 param 1)))) + ) + ) + ((= v1-63 'darkjak) + (cond + ((focus-test? self dead) + #f + ) + ((and (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (and (logtest? (the-as game-feature (logand (game-feature darkjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (-> *setting-control* user-current darkjak) + ) + ) + (go target-darkjak-get-on (the-as darkjak-stage (-> arg3 param 2))) + ) + ((logtest? (-> arg3 param 2) 1024) + (logclear! (-> self darkjak stage) (darkjak-stage force-on)) + (set! v0-0 (+ (- (seconds 20) (-> self fact darkjak-start-time)) (current-time))) + (set! (-> self fact darkjak-effect-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ((= v1-63 'lightjak) + (cond + ((focus-test? self dead) + #f + ) + ((and (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (and (logtest? (the-as game-feature (logand (game-feature lightjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (-> *setting-control* user-current lightjak) + ) + ) + (go target-lightjak-get-on (the-as lightjak-stage (-> arg3 param 2))) + ) + ((logtest? (-> arg3 param 2) 256) + (logclear! (-> self lightjak stage) (lightjak-stage ls0)) + (set! v0-0 (+ (- (seconds 20) (-> self fact lightjak-start-time)) (current-time))) + (set! (-> self fact lightjak-effect-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ((= v1-63 'invisible) + (let ((a1-17 (if (>= arg1 2) + (the-as int (-> arg3 param 2)) + (the-as int (-> *TARGET-bank* invisible-duration)) + ) + ) + ) + (cond + ((focus-test? self dead) + #f + ) + ((and (not (logtest? (target-flags invisible) (-> self target-flags))) + (logtest? (the-as game-feature (logand (game-feature artifact-invis) (-> *setting-control* user-current features))) + (-> self game features) + ) + (zero? (-> self ext-anim)) + ) + (go target-invisible-get-on (process->handle arg0) (the-as time-frame a1-17)) + ) + ) + ) + ) + ((= v1-63 'hide) + (go target-hide) + ) + ((= v1-63 'blast-recover) + (if (= (-> self ext-anim) (target-anim default)) + (go target-blast-recover (the-as rigid-body-impact (-> arg3 param 1))) + ) + ) + ((= v1-63 'normal) + (b! + (not (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) + ) + ) + ) + cfg-266 + :delay (empty-form) + ) + (set! v0-0 (go target-darkjak-get-off)) + (b! #t cfg-282 :delay (nop!)) + (label cfg-266) + (cond + ((and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-lightjak-get-off))) + ) + ) + (go target-lightjak-get-off) + ) + ((logtest? (target-flags invisible) (-> self target-flags)) + (target-invisible-stop) + ) + ) + ) + ) + ) + ) + (label cfg-282) + (b! #t cfg-435 :delay (nop!)) + (label cfg-283) + (b! (!= v1-0 'end-mode) cfg-337 :delay (nop!)) + (let ((v1-224 (-> arg3 param 0))) + (b! (!= v1-224 'gun) cfg-291 :delay (empty-form)) + (set! v0-0 (if (and (using-gun? self) (target-gun-end-mode #t)) + (go target-stance) + ) + ) + (b! #t cfg-336 :delay (nop!)) + (label cfg-291) + (b! (!= v1-224 'darkjak) cfg-307 :delay (empty-form)) + (set! v0-0 + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) + ) + ) + (go target-darkjak-get-off) + ) + ) + (b! #t cfg-336 :delay (nop!)) + (label cfg-307) + (set! v0-0 + (cond + ((= v1-224 'lightjak) + (if (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-lightjak-get-off))) + ) + ) + (go target-lightjak-get-off) + ) + ) + ((= v1-224 'freeze) + (if (nonzero? (-> self lightjak)) + (send-event (handle->process (-> self lightjak freeze-control)) 'die (-> arg3 param 1)) + ) + ) + ((= v1-224 'invisible) + (target-invisible-stop) + ) + ) + ) + ) + (label cfg-336) + (b! #t cfg-435 :delay (nop!)) + (label cfg-337) + (= v1-0 'gun) + ) + (target-gun-fire (the-as pickup-type (-> arg3 param 0))) + ) + ((= v1-0 'darkjak) + (when (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (zero? (-> self darkjak want-stage))) + (let ((v1-266 (-> arg3 param 0))) + (when (logtest? v1-266 16) + (set! (-> self darkjak want-stage) (the-as darkjak-stage v1-266)) + (go target-darkjak-bomb0) + ) + ) + ) + ) + (else + (b! (!= v1-0 'play-anim) cfg-352 :delay (nop!)) + (set! v0-0 (go target-play-anim (the-as string (-> arg3 param 0)) (the-as handle arg1))) + (b! #t cfg-435 :delay (nop!)) + (label cfg-352) + (cond + ((= v1-0 'clone-anim) + (go target-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + ((= v1-0 'edge-grab) + (if (not (focus-test? self dead hit grabbed)) + (go target-edge-grab) + ) + ) + ((= v1-0 'pilot-edge-grab) + (if (not (focus-test? self dead hit grabbed)) + (go target-pilot-edge-grab (the-as pilot-edge-grab-info (-> arg3 param 0))) + ) + ) + ((= v1-0 'pole-grab) + (if (and (not (focus-test? self dead hit grabbed pole)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 2) + ) + jakb-pole-cycle-ja + ) + (go target-pole-cycle (process->handle arg0)) + ) + ) + ((= v1-0 'ladder) + (if (and (not (focus-test? self dead hit grabbed pole)) + (or (not (-> arg3 param 0)) ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 2) + ) + ) + jakb-ladder-stance-ja + ) + (go target-ladder-start (process->handle arg0)) + ) + ) + ((= v1-0 'swim) + (if (not (or (= (-> self control mod-surface mode) 'swim) + (= (-> self control mod-surface mode) 'dive) + (and (-> self next-state) (= (-> self next-state name) 'target-hit)) + (focus-test? self dead hit grabbed) + ) + ) + (go target-swim-stance) + ) + ) + (else + (b! (!= v1-0 'wade) cfg-428 :delay (nop!)) + (set! v0-0 + (if (and (!= (-> self control mod-surface mode) 'wade) + (begin + (let ((v1-316 (-> self next-state))) + (b! (not v1-316) cfg-422 :likely-delay (set! v1-317 v1-316)) + ) + (let ((v1-319 (-> self next-state name))) + (set! v1-317 (or (= v1-319 'target-stance) (= v1-319 'target-walk) (= v1-319 'target-stance-look-around))) + ) + (label cfg-422) + (and v1-317 (not (logtest? (-> self focus-status) (focus-status dead hit grabbed)))) + ) + ) + (go target-wade-stance) + ) + ) + (b! #t cfg-435 :delay (nop!)) + (label cfg-428) + (cond + ((= v1-0 'slide) + (if (not (focus-test? self dead hit grabbed on-water under-water)) + (go target-slide-down-to-ground) + ) + ) + ((= v1-0 'impact-impulse) + (let ((a0-286 (-> arg3 param 0))) + (target-got-impact-impulse (the-as rigid-body-impact a0-286)) + ) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + ) + ) + (label cfg-435) + v0-0 + ) + ) + ) + ) + +;; definition for function target-dangerous-event-handler +(defbehavior target-dangerous-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (cond + ((< 0.0 (-> self fact shield-level)) + (let ((s4-1 (-> self control penetrate-using))) + (set! (-> self control penetrate-using) (penetrate touch shield)) + (let ((v0-0 (the-as object (target-send-attack + arg0 + 'shield + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self fact shield-attack-id)) + 0 + (-> self control penetrate-using) + ) + ) + ) + ) + (set! (-> self control penetrate-using) s4-1) + v0-0 + ) + ) + ) + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + (target-send-attack + arg0 + (-> self control danger-mode) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-hit + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for function target-bonk-event-handler +;; INFO: Used lq/sq +(defbehavior target-bonk-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (cond + ((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) + ) + (< (* 16384.0 (-> self clock time-adjust-ratio)) + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control transv) (-> self control last-transv)) + ) + ) + (begin + (vector-normalize! + (vector-! + s4-0 + (the-as vector (-> self control collision-spheres 0 prim-core)) + (-> self control actor-contact-pt) + ) + 1.0 + ) + (< 0.01 (-> s4-0 y)) + ) + ) + (if (< 0.75 (-> s4-0 y)) + (send-event + arg0 + 'bonk + (-> arg3 param 0) + (fmax + (-> self control ground-impact-vel) + (- (vector-dot (-> self control transv) (-> self control dynam gravity-normal))) + ) + ) + ) + (let ((f0-7 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control highest-jump-mark) (-> self control trans)) + ) + ) + ) + (when (< (-> *TARGET-bank* fall-far) f0-7) + (when (and (target-send-attack + arg0 + 'bonk + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + (not (logtest? (-> self focus-status) (focus-status dead hit))) + ) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (target-timed-invulnerable (seconds 0.1) self 1) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + ) + ) + #f + ) + ((= arg2 'jump) + (sound-play "jump-long") + (go + target-jump + (the-as float (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + (the-as surface (-> arg3 param 2)) + ) + ) + ) + ) + ) + +;; definition for function target-jump-event-handler +(defbehavior target-jump-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (and (= arg2 'swim) (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (return #f) + ) + (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) + (cond + (v0-0 + (empty) + v0-0 + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +;; definition for function target-walk-event-handler +(defbehavior target-walk-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) + (cond + (v0-0 + (empty) + v0-0 + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +;; definition for function target-exit +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-exit target () + (set! (-> self control mod-surface) *walk-mods*) + (set! (-> self control anim-collide-offset-local quad) (the-as uint128 0)) + (set! (-> self control anim-collide-offset-world quad) (the-as uint128 0)) + (set! (-> self control old-anim-collide-offset-world quad) (the-as uint128 0)) + (set! (-> self control draw-offset quad) (the-as uint128 0)) + (set! (-> self control force-turn-to-strength) 0.0) + (set! (-> self control bend-target) 0.0) + (set! (-> self control bomb-scale) 0.0) + (logclear! + (-> self target-flags) + (target-flags tf1 tf5 tf13 tf14 tf15 lleg-still rleg-still lleg-no-ik rleg-no-ik) + ) + (logclear! (-> self focus-status) (focus-status hit grabbed in-head teleporting)) + (target-danger-set! 'harmless #f) + (logior! (-> self water flags) (water-flag swim-ground)) + (logclear! (-> self water flags) (water-flag jump-out)) + (set! (-> self water drip-mult) 1.0) + (set! (-> self neck flex-blend) 1.0) + (set! (-> self neck base-joint) (the-as uint 6)) + (set! (-> self control duck-gun-tube-transision) 0.0) + (logclear! (-> self skel status) (joint-control-status valid-spooled-frame)) + (logclear! (-> self control status) (collide-status touch-ceiling-sticky)) + (initialize (-> self control impact-ctrl) self -1 0.0 (collide-spec)) + (combo-tracker-method-12 + (-> self control unknown-combo-tracker00) + *null-vector* + *null-vector* + (the-as process #f) + 0 + ) + 0 + (none) + ) + +;; definition for function target-state-hook-exit +;; WARN: Return type mismatch (function none) vs none. +(defbehavior target-state-hook-exit target () + (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) + (none) + ) + +;; definition for function target-effect-exit +;; WARN: Return type mismatch target-flags vs none. +(defbehavior target-effect-exit target () + (let ((v1-1 (-> self skel effect))) + (set! (-> v1-1 channel-offset) 0) + ) + 0 + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc new file mode 100644 index 00000000000..eb3781f3b27 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc @@ -0,0 +1,628 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 659 + :init-specs ((:num 0.1) + (:rot-x 5) + (:r 4096.0) + (:g 4096.0) + (:b 4096.0) + (:fade-g 1.3653333) + (:accel-y (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (distort)) + (:next-time (seconds 0.5)) + (:next-launcher 660) + ) + ) + +;; failed to figure out what this is: +(defpart 660 + :init-specs ((:fade-g -1.3653333)) + ) + +;; definition for function target-invisible-start +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-invisible-start target ((arg0 time-frame)) + (logior! (-> self target-flags) (target-flags invisible)) + (set-time! (-> self invisible-start-time)) + (set! (-> self invisible-duration) arg0) + (set-setting! 'cloth #f 0.0 0) + (target-gun-end-mode #f) + (if (and (focus-test? self light) (nonzero? (-> self lightjak))) + (send-event self 'end-mode 'lightjak) + ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (send-event self 'end-mode 'lightjak) + ) + (set! (-> self invisible-shadow-dir-backup quad) (-> self draw shadow-ctrl settings shadow-dir quad)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-idol-activate + :id 182 + :duration (seconds 0.035) + :linger-duration (seconds 10) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 661 :flags (sp3)) (sp-item 662 :flags (sp3)) (sp-item 663 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 661 + :init-specs ((:texture (new 'static 'texture-id :index #x4b :page #x4)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 2250)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters -0.125)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.375) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409600.0) + ) + ) + +;; failed to figure out what this is: +(defpart 662 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 200.0) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.225)) + (:vel-x (meters 0.06666667) (meters 0.006666667)) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.94 0.04) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-z (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 663 + :init-specs ((:texture (new 'static 'texture-id :index #xa0 :page #x4)) + (:num 30.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.42666668) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 60) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function target-invisible-stop +;; WARN: Return type mismatch int vs none. +(defbehavior target-invisible-stop target () + (logclear! (-> self target-flags) (target-flags invisible)) + (remove-setting! 'cloth) + 0 + (none) + ) + +;; definition of type invis-particle-joint +(deftype invis-particle-joint (structure) + ((joint int16) + (distance float) + (size float) + (spawn? symbol) + ) + ) + +;; definition for method 3 of type invis-particle-joint +(defmethod inspect ((this invis-particle-joint)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'invis-particle-joint) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (format #t "~1Tdistance: ~f~%" (-> this distance)) + (format #t "~1Tsize: ~f~%" (-> this size)) + (format #t "~1Tspawn?: ~A~%" (-> this spawn?)) + (label cfg-4) + this + ) + +;; definition for symbol *invis-joint-list*, type (array invis-particle-joint) +(define *invis-joint-list* + (new 'static 'boxed-array :type invis-particle-joint + (new 'static 'invis-particle-joint :joint 4 :distance 819.2 :size 1638.4 :spawn? #t) + (new 'static 'invis-particle-joint :joint 5 :distance 819.2 :size 1638.4 :spawn? #t) + (new 'static 'invis-particle-joint :joint 6 :distance 1228.8 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 8 :distance 1228.8 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 9 :distance 1638.4 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 17 :distance 1228.8 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 18 :distance 819.2 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 19 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 24 :distance 409.6 :size 409.6 :spawn? #t) + (new 'static 'invis-particle-joint :joint 26 :distance 1228.8 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 27 :distance 819.2 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 28 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 33 :distance 409.6 :size 409.6 :spawn? #t) + (new 'static 'invis-particle-joint :joint 39 :distance 614.4 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 40 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 41 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 42 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 45 :distance 614.4 :size 1228.8 :spawn? #t) + (new 'static 'invis-particle-joint :joint 46 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 47 :distance 409.6 :size 819.2 :spawn? #t) + (new 'static 'invis-particle-joint :joint 48 :distance 409.6 :size 819.2 :spawn? #t) + ) + ) + +;; definition for function target-invisible-process +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-invisible-process target () + (cond + ((logtest? (target-flags invisible) (-> self target-flags)) + (seek! (-> self invisible-interp) 1.0 (* 2.0 (seconds-per-frame))) + (if (time-elapsed? (-> self invisible-start-time) (-> self invisible-duration)) + (target-invisible-stop) + ) + (when (= (-> self invisible-interp) 1.0) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> (math-camera-pos) quad)) + (dotimes (s5-0 (-> *invis-joint-list* length)) + (when (-> *invis-joint-list* s5-0 spawn?) + (let ((v1-22 (-> *invis-joint-list* s5-0 joint)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector<-cspace! s4-0 (-> self node-list data v1-22)) + (vector-! s3-0 gp-0 s4-0) + (vector-normalize! s3-0 (-> *invis-joint-list* s5-0 distance)) + (vector+! s4-0 s4-0 s3-0) + ) + (set! (-> *part-id-table* 659 init-specs 2 initial-valuef) (-> *invis-joint-list* s5-0 size)) + (set! (-> *part-id-table* 659 init-specs 3 initial-valuef) (* 0.5 (-> *invis-joint-list* s5-0 size))) + (set! (-> *part-id-table* 659 init-specs 4 initial-valuef) (* 0.5 (-> *invis-joint-list* s5-0 size))) + (launch-particles (-> *part-id-table* 659) s4-0) + ) + ) + ) + ) + ) + (vector-lerp! + (-> self draw shadow-ctrl settings shadow-dir) + (-> self invisible-shadow-dir-backup) + (new 'static 'vector :y -1.0 :w 1.0) + (-> self invisible-interp) + ) + (set! (-> self draw shadow-ctrl settings shadow-dir w) (-> self invisible-shadow-dir-backup w)) + (logand! (-> self target-effect) -2) + (if (= (-> self invisible-interp) 1.0) + (logior! (-> self target-effect) 1) + ) + (if (and (time-elapsed? (-> self invisible-start-time) (+ (-> self invisible-duration) (seconds -2))) + (< (mod (- (current-time) (-> self invisible-start-time)) 60) 30) + ) + (logand! (-> self target-effect) -2) + ) + ) + ((!= (-> self invisible-interp) 0.0) + (logand! (-> self target-effect) -2) + (seek! (-> self invisible-interp) 0.0 (* 0.5 (seconds-per-frame))) + ) + ) + (cond + ((= (-> self invisible-interp) 0.0) + (logclear! (-> self draw status) (draw-control-status force-fade)) + ) + (else + (logior! (-> self draw status) (draw-control-status force-fade)) + (set! (-> self draw force-fade) + (the-as uint (the int (lerp-scale 128.0 16.0 (-> self invisible-interp) 0.0 1.0))) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-invisible-get-on (target) + :event target-standard-event-handler + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (remove-setting! 'gun) + (persist-with-delay *setting-control* 'gun (seconds 0.5) 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-gun-end-mode #t) + ) + :code (behavior ((arg0 handle) (arg1 time-frame)) + (set-time! (-> self state-time)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *grab-mods*) + (target-gun-end-mode #f) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + (set-forward-vel 0.0) + (let ((s4-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! s4-0 (- (current-time) (-> self clock old-frame-counter))) + (if (>= s4-0 300) + (go target-falling #f) + ) + (suspend) + ) + ) + (when (= (-> self ext-anim) (target-anim default)) + (let* ((s5-1 (handle->process arg0)) + (v1-24 (if (type? s5-1 process-drawable) + (the-as process-drawable s5-1) + ) + ) + ) + (when v1-24 + (let ((s4-1 (-> v1-24 root trans)) + (v1-27 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg main))) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) s4-1 v1-27) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-stance-to-invisible-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-invisible-loop-ja :num! (seek! (ja-aframe 20.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + (target-invisible-start arg1) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self trans-hook) (lambda :behavior target () (if (move-legs?) + (go target-stance) + ) + ) + ) + (dotimes (gp-1 1) + (ja-no-eval :group! jakb-invisible-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja-no-eval :group! jakb-invisible-to-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (go target-stance) + ) + :post (-> target-grab post) + ) + +;; definition of type dark-maker-idol +(deftype dark-maker-idol (process-drawable) + ((root collide-shape :override) + (humming-sound ambient-sound) + ) + (:state-methods + idle + active + ) + ) + +;; definition for method 3 of type dark-maker-idol +(defmethod inspect ((this dark-maker-idol)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Thumming-sound: ~A~%" (-> this humming-sound)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-dark-maker-idol dark-maker-idol dark-maker-idol-lod0-jg dark-maker-idol-idle-ja + ((dark-maker-idol-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2) + :shadow-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (dark-maker-idol) + :virtual #t + :trans (behavior () + (when (and *target* + (logtest? (the-as game-feature (logand (game-feature artifact-invis) (-> *setting-control* user-current features))) + (-> *game-info* features) + ) + (and (and *target* (and (>= 24576.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (not (focus-test? *target* dead ignore hit in-head pole flut light board dark teleporting)) + (can-display-query? self "idol" -99.0) + (-> *target* current-level) + (zero? (-> *target* ext-anim)) + ) + ) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((v1-21 gp-0)) + (set! (-> v1-21 width) (the float 340)) + ) + (let ((v1-22 gp-0)) + (set! (-> v1-22 height) (the float 80)) + ) + (let ((v1-23 gp-0) + (a0-16 (-> *setting-control* user-default language)) + ) + (set! (-> v1-23 scale) (if (or (= a0-16 (language-enum korean)) (= a0-16 (language-enum russian))) + 0.9 + 0.7 + ) + ) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text (lookup-text! *common-text* (text-id text-0083) #f) gp-0 #f 44 (bucket-id bucket579)) + ) + (if (and (cpad-pressed? 0 triangle) + (send-event + *target* + 'change-mode + 'invisible + self + (the int (* 300.0 (res-lump-float + (-> self entity) + 'duration + :default (* 0.0033333334 (the float (-> *TARGET-bank* invisible-duration))) + ) + ) + ) + ) + ) + (go-virtual active) + ) + 3 + ) + (if *target* + (look-at! + (-> *target* neck) + (vector+! + (new 'stack-no-clear 'vector) + (the-as vector (-> self root root-prim prim-core)) + (new 'static 'vector :y 2048.0 :w 1.0) + ) + 'nothing-special + self + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (let ((gp-0 (and *target* (logtest? (target-flags invisible) (-> *target* target-flags))))) + (let ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 5324.8)) + (a1-2 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) + ) + (set! (-> a1-2 trans quad) (-> s5-1 quad)) + (if (and (nonzero? (-> self part)) (not gp-0)) + (sparticle-launch-control-method-17 (-> self part) a1-2) + ) + ) + (update-vol! (-> self humming-sound) (if gp-0 + 0.0 + 0.8 + ) + ) + ) + (update! (-> self humming-sound)) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate active (dark-maker-idol) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.66)) + (suspend) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 182 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-1 (method-of-type part-tracker-subsampler activate))) + (t9-1 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-2 run-function-in-process) + (a0-5 gp-1) + (a1-2 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 182)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-2) a0-5 a1-2 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-4 (method-of-type part-tracker activate))) + (t9-4 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-5 run-function-in-process) + (a0-11 gp-2) + (a1-5 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 182)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-5) a0-11 a1-5 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + (if *target* + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 5) + 300 + #f + *target* + 19 + 4 + :name "lightning-tracker" + :to self + :unk 0 + ) + ) + (sound-play "dark-maker") + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 2)) + (suspend) + ) + ) + (go-virtual idle) + ) + :post (behavior () + (update-vol! + (-> self humming-sound) + (lerp-clamp 0.8 0.0 (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + ) + (update! (-> self humming-sound)) + (when (nonzero? (-> self part)) + (let ((gp-2 (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 5324.8)) + (a1-4 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) + ) + (set! (-> a1-4 trans quad) (-> gp-2 quad)) + (sparticle-launch-control-method-17 (-> self part) a1-4) + ) + ) + (ja-post) + ) + ) + +;; definition for method 11 of type dark-maker-idol +(defmethod init-from-entity! ((this dark-maker-idol) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 0) + (set-vector! (-> v1-2 local-sphere) 0.0 4096.0 0.0 8192.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-maker-idol" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (task-node-closed? (game-task-node volcano-darkeco-resolution)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 82) this)) + ) + (set! (-> this humming-sound) (new 'process 'ambient-sound "dark-maker-amb" (-> this root trans) 0.0)) + (set-falloff-far! (-> this humming-sound) 122880.0) + (update-vol! (-> this humming-sound) 0.8) + (update-pitch-mod! (-> this humming-sound) 0.0) + (go (method-of-object this idle)) + ) + +;; definition for method 7 of type dark-maker-idol +(defmethod relocate ((this dark-maker-idol) (offset int)) + (if (nonzero? (-> this humming-sound)) + (&+! (-> this humming-sound) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type dark-maker-idol +(defmethod deactivate ((this dark-maker-idol)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this humming-sound)) + (stop! (-> this humming-sound)) + ) + (call-parent-method this) + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc new file mode 100644 index 00000000000..a13e95a2c3f --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc @@ -0,0 +1,3656 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-lightjak-get-on-charge + :id 174 + :duration (seconds 2) + :linger-duration (seconds 2) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 630 :flags (is-3d)) + (sp-item 631 :flags (is-3d)) + (sp-item 632 :flags (is-3d)) + (sp-item 633 :flags (is-3d)) + (sp-item 634) + ) + ) + +;; failed to figure out what this is: +(defpart 630 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -2)) + (:scale-x (meters 3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 80)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 90.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 631 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -2)) + (:scale-x (meters 3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 124.99999)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 90.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 632 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -2)) + (:scale-x (meters 3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 35)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 90.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 633 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -2)) + (:scale-x (meters 3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 170)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 90.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 634 + :init-specs ((:texture (new 'static 'texture-id :index #x96 :page #x4)) + (:num 1.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters 8)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.1) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters -0.00083333335) (meters -0.00083333335)) + (:fade-a 2.56) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.167)) + (:next-launcher 635) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 635 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightjak-get-on + :id 175 + :duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 636 :period (seconds 5) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpart 636 + :init-specs ((:texture (new 'static 'texture-id :index #x93 :page #x4)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 12)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g -1.6) + (:fade-b -1.6) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightjak-get-off + :id 176 + :duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 637 :period (seconds 5) :length (seconds 0.017)) + (sp-item 638 :period (seconds 5) :length (seconds 0.017)) + (sp-item 639 :period (seconds 5) :length (seconds 0.085)) + ) + ) + +;; failed to figure out what this is: +(defpart 637 + :init-specs ((:texture (new 'static 'texture-id :index #x93 :page #x4)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 12)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g -1.6) + (:fade-b -1.6) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 638 + :init-specs ((:texture (new 'static 'texture-id :index #x94 :page #x4)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:fade-b -0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 639 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 60.0) + (:y (meters -1.5) (meters 3)) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 32.0 64.0) + (:g :copy r) + (:b 128.0) + (:a 128.0 128.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:accel-y (meters 0.00016666666) (meters 0.00066666666)) + (:friction 0.95 0.05) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.5)) + (:next-launcher 640) + (:conerot-x (degrees 90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 640 + :init-specs ((:scalevel-x (meters -0.00016666666) (meters -0.00016666666)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.425 -0.425) + (:friction 0.99) + (:next-time (seconds 0.017)) + (:next-launcher 641) + ) + ) + +;; failed to figure out what this is: +(defpart 641 + :init-specs ((:accel-x (meters -0.0013333333) (meters 0.0026666666)) + (:accel-z (meters -0.0013333333) (meters 0.0026666666)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 641) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightjak-regen + :id 177 + :duration (seconds 2) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 642 :flags (is-3d)) + (sp-item 643 :flags (is-3d)) + (sp-item 644 :flags (is-3d)) + (sp-item 645 :flags (is-3d)) + (sp-item 646) + (sp-item 647 :period (seconds 5) :length (seconds 1.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 642 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -5) (meters -1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 80)) + (:scale-y (meters 6)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 648) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 648 + :init-specs ((:fade-a -1.28)) + ) + +;; failed to figure out what this is: +(defpart 643 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -5) (meters -1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 124.99999)) + (:scale-y (meters 6)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 648) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 644 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -5) (meters -1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 35)) + (:scale-y (meters 6)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 648) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 645 + :init-specs ((:texture (new 'static 'texture-id :index #x80 :page #x4)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -5) (meters -1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 170)) + (:scale-y (meters 6)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 648) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 646 + :init-specs ((:texture (new 'static 'texture-id :index #x96 :page #x4)) + (:num 0.5 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters 8)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.1) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters -0.00083333335) (meters -0.00083333335)) + (:fade-a 0.85333335) + (:timer (seconds 1) (seconds 1.665)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.5)) + (:next-launcher 649) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 649 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpart 647 + :init-specs ((:texture (new 'static 'texture-id :index #x64 :page #x4)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 10) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters -0.033333335) (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667 0.10666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 650 + :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x4)) + (:num 1.0) + (:y (meters -0.025)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 651 + :init-specs ((:texture (new 'static 'texture-id :index #xd :page #x4)) + (:num 1.0) + (:scale-x (meters 10.5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightjak-shield-start + :id 178 + :duration (seconds 0.5) + :linger-duration (seconds 1) + :flags (sp0 sp4 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 653 :flags (sp3) :binding 652) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + (sp-item 652 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 653 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 1.0) + (:y (meters -1) (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:timer (seconds -0.005)) + (:func 'spt-func-relative-pos) + ) + ) + +;; failed to figure out what this is: +(defpart 652 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 1.0 3.0) + (:z (meters 2) (meters 1)) + (:scale-x (meters 0.05) (meters 0.05)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.013333334) (meters -0.013333334)) + (:vel-y (meters 0.053333335)) + (:fade-a -0.42666668 -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 ready-to-launch left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightjak-shield-hit + :id 179 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 654)) + ) + +;; failed to figure out what this is: +(defpart 654 + :init-specs ((:texture (new 'static 'texture-id :index #x19 :page #x4)) + (:num 1.0) + (:scale-x (meters 6.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightjak-freeze-hands + :id 180 + :duration (seconds 0.5) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 655)) + ) + +;; failed to figure out what this is: +(defpart 655 + :init-specs ((:texture (new 'static 'texture-id :index #xe :page #x4)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.64) + (:fade-g -0.21333334) + (:fade-b -0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightjak-freeze-burst + :id 181 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 656 :flags (sp3)) (sp-item 657 :flags (sp3)) (sp-item 658 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 658 + :init-specs ((:texture (new 'static 'texture-id :index #x4b :page #x4)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 2250)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters -0.125)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.375) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409600.0) + ) + ) + +;; failed to figure out what this is: +(defpart 657 + :init-specs ((:texture (new 'static 'texture-id :index #x3d :page #x4)) + (:num 100.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.45)) + (:vel-y (meters 0.06666667) (meters 0.006666667)) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.94 0.04) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 80) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 656 + :init-specs ((:texture (new 'static 'texture-id :index #xa0 :page #x4)) + (:num 30.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 40.0 40.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.53333336) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.93 0.02) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 60) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function point-off-screen +;; INFO: Used lq/sq +(defun point-off-screen ((arg0 vector)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! s3-0 0.0 -280.0 0.0 1.0) + (vector-! s4-0 (camera-pos) (target-pos 0)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (set! (-> s5-0 quad) (-> (target-pos 0) quad)) + (reverse-transform-point! arg0 s5-0 s4-0 s3-0) + ) + arg0 + ) + +;; failed to figure out what this is: +(let ((v1-39 (copy *walk-mods* 'global))) + (set! (-> v1-39 name) 'lightjak) + (set! (-> v1-39 flags) (surface-flag gun-off)) + (set! *lightjak-trans-mods* v1-39) + ) + +;; definition for function want-to-powerjak? +(defbehavior want-to-powerjak? target () + (and (or (cpad-hold? (-> self control cpad number) l2) (nonzero? (-> self lightjak get-on-latch))) + (and (not *pause-lock*) + (not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (and (or (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (not (logtest? (target-flags invisible) (-> self target-flags))) + ) + (or (and (-> *setting-control* user-current darkjak) + (logtest? (the-as game-feature (logand (game-feature darkjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (not (focus-test? + self + dead + hit + grabbed + in-head + under-water + edge-grab + pole + flut + tube + light + board + pilot + mech + carry + indax + teleporting + ) + ) + (time-elapsed? (-> self fact darkjak-start-time) (seconds 0.05)) + ) + (and (-> *setting-control* user-current lightjak) + (logtest? (the-as game-feature (logand (game-feature lightjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (not (focus-test? + self + dead + hit + grabbed + in-head + under-water + edge-grab + pole + flut + tube + board + pilot + mech + dark + carry + indax + teleporting + ) + ) + (time-elapsed? (-> self fact lightjak-start-time) (seconds 0.05)) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate target-powerjak-get-on (target) + :event target-standard-event-handler + :exit (behavior () + (set! (-> self lightjak get-on-latch) (the-as uint 0)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (logclear! (-> self target-flags) (target-flags tf4)) + (remove-setting! 'gun) + (persist-with-delay *setting-control* 'gun (seconds 0.5) 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-gun-end-mode #t) + ) + :code (behavior () + (logior! (-> self target-flags) (target-flags tf4)) + (set-time! (-> self state-time)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *lightjak-trans-mods*) + (set! (-> self lightjak get-on-latch) (the-as uint 0)) + (set! (-> self control unknown-word04) + (the-as uint (and (focus-test? self light) (nonzero? (-> self lightjak)))) + ) + (target-gun-end-mode #f) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + (let ((gp-0 + (lambda :behavior target + ((arg0 symbol)) + (show-hud 'hud-health) + (cond + ((and (or (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + ) + (not (cpad-hold? (-> self control cpad number) l2)) + (zero? (-> self lightjak get-on-latch)) + ) + (cond + ((-> self lightjak get-off-lock) + (go target-stance) + ) + ((and (focus-test? self light) (nonzero? (-> self lightjak))) + (go target-lightjak-get-off) + ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (go target-darkjak-get-off) + ) + ) + ) + ((and (time-elapsed? (-> self state-time) (seconds 0.1)) + (not (-> self lightjak get-off-lock)) + (not (cpad-hold? (-> self control cpad number) l2)) + (zero? (-> self lightjak get-on-latch)) + (want-to-darkjak?) + ) + (set! (-> self lightjak get-on-latch) (the-as uint 512)) + ) + ((and (or (not (want-to-powerjak?)) + (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2)) + (cpad-pressed? (-> self control cpad number) r2) + ) + (time-elapsed? (-> self state-time) (seconds 0.05)) + ) + (go target-stance) + ) + ((and (cpad-pressed? (-> self control cpad number) triangle) + (let ((v1-77 #t)) + (set! (-> self lightjak get-off-lock) v1-77) + v1-77 + ) + (logtest? (the-as game-feature (logand (game-feature lightjak-regen) (-> *setting-control* user-current features))) + (-> self game features) + ) + (and (< (-> self fact health) (-> self fact health-max)) (want-to-lightjak?)) + ) + (set! (-> self lightjak get-on-latch) (the-as uint 8)) + ) + ((and (cpad-pressed? (-> self control cpad number) x) + (let ((v1-96 #t)) + (set! (-> self lightjak get-off-lock) v1-96) + v1-96 + ) + (logtest? (the-as game-feature (logand (game-feature lightjak-swoop) (-> *setting-control* user-current features))) + (-> self game features) + ) + (>= (-> self game eco-pill-light) (-> *FACT-bank* lightjak-swoop-inc)) + (= (-> self fact shield-level) 0.0) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-feet))) + (and (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) (want-to-lightjak?)) + ) + (set! (-> self lightjak get-on-latch) (the-as uint 16)) + ) + ((and (cpad-pressed? (-> self control cpad number) square) + (let ((v1-126 #t)) + (set! (-> self lightjak get-off-lock) v1-126) + v1-126 + ) + (logtest? (the-as game-feature (logand (game-feature lightjak-freeze) (-> *setting-control* user-current features))) + (-> self game features) + ) + (>= (-> self game eco-pill-light) (-> *FACT-bank* lightjak-freeze-min)) + (and (not (handle->process (-> self lightjak freeze-control))) (want-to-lightjak?)) + ) + (set! (-> self lightjak get-on-latch) (the-as uint 32)) + ) + ((and (cpad-pressed? (-> self control cpad number) circle) + (let ((v1-149 #t)) + (set! (-> self lightjak get-off-lock) v1-149) + v1-149 + ) + (logtest? (game-feature lightjak-shield) (-> self game features)) + (>= (-> self game eco-pill-light) (-> *FACT-bank* lightjak-shield-inc)) + (and (not (handle->process (-> self lightjak freeze-control))) (want-to-lightjak?)) + ) + (set! (-> self lightjak get-on-latch) (the-as uint 64)) + ) + ) + (cond + ((or (!= (-> self skel root-channel 0) (-> self skel channel)) + (!= (-> self skel top-anim interp) 0.0) + (not arg0) + ) + #f + ) + ((and (nonzero? (-> self lightjak get-on-latch)) (or (want-to-lightjak?) (want-to-darkjak?))) + (set! (-> self lightjak lightjak-before-powerjak) (the-as symbol (-> self control unknown-spool-anim00))) + (case (-> self lightjak get-on-latch) + ((512) + (go target-darkjak-get-on (darkjak-stage bomb0)) + ) + ((8) + (if (and (focus-test? self light) (nonzero? (-> self lightjak))) + (go target-lightjak-regen 0) + (go target-lightjak-get-on (lightjak-stage ls2 regen)) + ) + ) + ((16) + (cond + ((and (focus-test? self light) (nonzero? (-> self lightjak))) + (logior! (-> self lightjak stage) (lightjak-stage swoop)) + (if (not (-> self lightjak wings)) + (set! (-> self lightjak wings) (process-spawn wings :init wings-init 'open :name "wings" :to self)) + ) + (go target-stance) + ) + (else + (go target-lightjak-get-on (lightjak-stage ls2 swoop)) + ) + ) + ) + ((32) + (if (and (focus-test? self light) (nonzero? (-> self lightjak))) + (go target-lightjak-freeze) + (go target-lightjak-get-on (lightjak-stage ls2 freeze)) + ) + ) + ((64) + (if (and (focus-test? self light) (nonzero? (-> self lightjak))) + (go target-stance) + (go target-lightjak-get-on (lightjak-stage ls2 ls6)) + ) + ) + ) + ) + ((nonzero? (-> self lightjak get-on-latch)) + (set! (-> self lightjak get-on-latch) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + (set-forward-vel 0.0) + (let ((s5-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! s5-0 (- (current-time) (-> self clock old-frame-counter))) + (if (>= s5-0 300) + (go target-falling #f) + ) + (gp-0 #f) + (suspend) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-powerjak-get-on-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-0 #t) + (suspend) + (ja :num! (seek!)) + ) + (logclear! (-> self target-flags) (target-flags tf4)) + (until #f + (ja-no-eval :group! jakb-powerjak-get-on-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-0 #t) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + #f + (go target-stance) + ) + :post (-> target-grab post) + ) + +;; definition for function target-lightjak-setup +;; WARN: Return type mismatch int vs none. +(defbehavior target-lightjak-setup target ((arg0 symbol)) + (when (zero? (-> self lightjak)) + (set! (-> self lightjak) (new 'process 'lightjak-info)) + (set! (-> self lightjak process) (the-as (pointer target) (process->ppointer self))) + (let* ((v1-4 (-> self game)) + (a0-5 (+ (-> v1-4 attack-id) 1)) + ) + (set! (-> v1-4 attack-id) a0-5) + (set! (-> self lightjak attack-id) a0-5) + ) + (set! (-> self lightjak tone) (the-as uint (new-sound-id))) + (set! (-> self lightjak freeze-control) (the-as handle #f)) + (set! (-> self lightjak freeze-screen) (the-as handle #f)) + (set! (-> self lightjak wings) (the-as (pointer wings) #f)) + (set! (-> self lightjak shield) (the-as (pointer lightjak-shield) #f)) + (set! (-> self lightjak latch-out-time) 0) + (set! (-> self lightjak mode-sound-bank) #f) + (set! (-> self lightjak get-off-lock) #f) + (set! (-> self lightjak lightjak-before-powerjak) #f) + ) + 0 + (none) + ) + +;; definition for function want-to-lightjak? +(defbehavior want-to-lightjak? target () + (and (not *pause-lock*) + (-> *setting-control* user-current lightjak) + (logtest? (the-as game-feature (logand (game-feature lightjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (not (focus-test? + self + dead + hit + grabbed + in-head + under-water + edge-grab + pole + flut + tube + board + pilot + mech + dark + carry + indax + teleporting + ) + ) + (not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (and (and (time-elapsed? (-> self fact lightjak-start-time) (seconds 0.05)) (< 0.0 (-> self game eco-pill-light))) + (zero? (-> self lightjak latch-out-time)) + (time-elapsed? (-> self lightjak regen-time) (seconds 0.3)) + ) + ) + ) + +;; definition for function target-lightjak-end-mode +;; WARN: Return type mismatch int vs none. +(defbehavior target-lightjak-end-mode target ((arg0 symbol)) + (when (and (focus-test? self light) (nonzero? (-> self lightjak))) + (cond + (arg0 + (set! (-> self lightjak get-off-lock) #f) + (set! (-> self lightjak lightjak-before-powerjak) #f) + (logclear! (-> self focus-status) (focus-status light)) + (send-event self 'reset-collide) + (logclear! (-> self target-flags) (target-flags tf4)) + (remove-setting! 'sound-flava) + (remove-setting! 'string-min-length) + (remove-setting! 'string-max-length) + (remove-setting! 'string-spline-max-move) + (remove-setting! 'string-spline-accel) + (remove-setting! 'string-spline-max-move-player) + (remove-setting! 'string-spline-accel-player) + (setting-control-method-14 *setting-control* (-> self lightjak mode-sound-bank)) + (set! (-> self lightjak mode-sound-bank) #f) + (let ((v1-33 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-33 command) (sound-command set-param)) + (set! (-> v1-33 id) (the-as sound-id (-> self lightjak tone))) + (set! (-> v1-33 params volume) -4) + (set! (-> v1-33 auto-time) 120) + (set! (-> v1-33 auto-from) 2) + (set! (-> v1-33 params mask) (the-as uint 17)) + (-> v1-33 id) + ) + (case (get-status *gui-control* (the-as sound-id (-> self lightjak on-off))) + (((gui-status pending) (gui-status ready) (gui-status unknown)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + (set! (-> self pending-ext-anim) (target-anim default)) + (if (< (-> self game eco-pill-light) 1.0) + (send-event self 'get-pickup (pickup-type eco-pill-light) -1.0) + ) + (let ((v1-53 (ja-group))) + (when (not (and (and v1-53 (or (= v1-53 jakb-lightjak-get-off-ja) (= v1-53 jakb-lightjak-get-on-ja))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + (joint-control-cleanup + (-> self skel) + (-> self ext-anim-control heap) + (the-as art-joint-anim jakb-stance-loop-ja) + ) + (send-event (ppointer->process (-> self sidekick)) 'cleanup) + ) + ) + (let ((a0-39 (ppointer->process (-> self lightjak wings)))) + (when a0-39 + (deactivate a0-39) + (set! (-> self lightjak wings) (the-as (pointer wings) #f)) + ) + ) + (let ((a0-40 (ppointer->process (-> self lightjak shield)))) + (when a0-40 + (deactivate a0-40) + (set! (-> self lightjak shield) (the-as (pointer lightjak-shield) #f)) + ) + ) + (remove-setting! 'attack) + (set! (-> self fact shield-level) 0.0) + (set! (-> self lightjak shield-start-time) 0) + (remove-from-process *part-engine* self) + (set! (-> self lightjak latch-out-time) 0) + 0 + ) + ((zero? (-> self lightjak latch-out-time)) + (when (!= (-> self lightjak-interp) 0.0) + (case (get-status *gui-control* (the-as sound-id (-> self lightjak on-off))) + (((gui-status pending) (gui-status ready) (gui-status active)) + ) + (else + (set! (-> self lightjak on-off) + (the-as + uint + (add-process *gui-control* self (gui-channel jak-effect-1) (gui-action queue) "jak-onof" -99.0 0) + ) + ) + ) + ) + ) + (set-time! (-> self lightjak latch-out-time)) + (send-event (ppointer->process (-> self lightjak wings)) 'end-mode) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-lightjak-do-effect +;; INFO: Used lq/sq +(defbehavior target-lightjak-do-effect target () + (let ((f30-0 (-> self lightjak-interp))) + (cond + ((< 0.0 f30-0) + (logior! (-> self target-effect) 2) + (logior! (-> self target-effect) 16) + (sound-play-by-name + (static-sound-name "ltjak-chill") + (the-as sound-id (-> self lightjak tone)) + (the int (* 1024.0 f30-0)) + 0 + 0 + (sound-group) + (-> self control trans) + ) + ) + (else + (when (logtest? (-> self target-effect) 2) + (let ((v1-14 (get-status *gui-control* (the-as sound-id (-> self lightjak on-off))))) + (cond + ((= v1-14 (gui-status ready)) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ((and (= (-> *setting-control* user-current mode-sound-bank) 'modelit) + (= (-> *setting-control* user-target mode-sound-bank) 'modelit) + (not (or (focus-test? self board) (-> self board latch?))) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (sound-play "ljak-off") + ) + ((= v1-14 (gui-status pending)) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (else + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (add-process *gui-control* self (gui-channel jak-effect-2) (gui-action play) "jak-onof" -99.0 0) + ) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 176 flags) (sp-group-flag sp13)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-10 (method-of-type part-tracker-subsampler activate))) + (t9-10 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-11 run-function-in-process) + (a0-23 gp-1) + (a1-15 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 176)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 6) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-11) a0-23 a1-15 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-13 (method-of-type part-tracker activate))) + (t9-13 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-14 run-function-in-process) + (a0-26 gp-2) + (a1-18 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 176)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 6) + ((the-as (function object object object none) t9-14) a0-26 a1-18 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + ) + (logand! (-> self target-effect) -3) + (logand! (-> self target-effect) -17) + ) + ) + (when (and (< 0.0 f30-0) (and (not (focus-test? self in-head)) + (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp))) + (not (movie?)) + (< (-> *setting-control* user-current slow-time) 1.0) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'vector)) + (f30-1 (fmin 1.0 (-> self clock clock-ratio))) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 623) (sp-field-id spt-a)) initial-valuef) + (* 16.0 (- 1.0 (-> *setting-control* user-current slow-time))) + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg main)) :rate f30-1) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg upper_body)) + :rate f30-1 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg chest)) :rate f30-1) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg neckA)) :rate f30-1) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg MhairA)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg MhairB)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Lshould)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rshould)) + :rate f30-1 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Larm)) :rate f30-1) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rarm)) :rate f30-1) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Lforarm)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rforarm)) + :rate f30-1 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg hips)) :rate f30-1) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Lthigh)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rthigh)) + :rate f30-1 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Lknee)) :rate f30-1) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rknee)) :rate f30-1) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Lankle)) + :rate f30-1 + ) + (launch-particles + (-> *part-id-table* 623) + (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rankle)) + :rate f30-1 + ) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Ltoes)) :rate f30-1) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-3 (joint-node jakb-lod0-jg Rtoes)) :rate f30-1) + ) + ) + ) + (none) + ) + +;; definition for function target-lightjak-process +;; WARN: Return type mismatch int vs none. +(defbehavior target-lightjak-process target () + (if (and (not (cpad-hold? (-> self control cpad number) l2)) + (not (and (-> self next-state) (= (-> self next-state name) 'target-powerjak-get-on))) + ) + (set! (-> self lightjak get-off-lock) #f) + ) + (cond + ((nonzero? (-> self lightjak latch-out-time)) + (if (time-elapsed? (-> self lightjak latch-out-time) (seconds 0.4)) + (target-lightjak-end-mode #t) + ) + ) + ((and (focus-test? self light) (nonzero? (-> self lightjak))) + (let ((a1-0 'eco-red)) + (target-danger-set! (-> self control danger-mode) a1-0) + ) + (update-transforms (-> self control)) + (let ((a1-1 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-1 options) (overlaps-others-options)) + (set! (-> a1-1 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-1 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-1) + ) + (target-danger-set! (-> self control danger-mode) #f) + (update-transforms (-> self control)) + (when (and (or (< (-> self game eco-pill-light) 1.0) + (not (-> *setting-control* user-current lightjak)) + (not (logtest? (the-as game-feature (logand (game-feature lightjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + ) + ) + (and (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) + (let ((v1-50 (-> self next-state name))) + (or (= v1-50 'target-lightjak-get-on) + (= v1-50 'target-lightjak-get-off) + (= v1-50 'target-lightjak-swoop) + (= v1-50 'target-lightjak-swoop-again) + (= v1-50 'target-lightjak-swoop-falling) + (= v1-50 'target-lightjak-freeze) + (= v1-50 'target-lightjak-regen) + ) + ) + ) + ) + (or (not (logtest? (-> self lightjak stage) (lightjak-stage ls0 ls1))) + (not (-> *setting-control* user-current lightjak)) + (not (logtest? (the-as game-feature (logand (game-feature lightjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + ) + ) + ) + ) + (if (and (and (-> self next-state) (let ((v1-61 (-> self next-state name))) + (or (= v1-61 'target-stance) (= v1-61 'target-hit-ground)) + ) + ) + (not (handle->process (-> self lightjak freeze-control))) + ) + (go target-lightjak-get-off) + (target-lightjak-end-mode #f) + ) + ) + ) + (else + (set! (-> self lightjak-interp) 0.0) + ) + ) + (when (nonzero? (-> self lightjak shield-start-time)) + (set-time! (-> self fact shield-use-time)) + (set-time! (-> self water distort-time)) + (target-gun-end-mode #t) + (if (-> self lightjak shield) + (send-event (ppointer->process (-> self lightjak shield)) 'open) + (set! (-> self lightjak shield) + (process-spawn lightjak-shield :init lightjak-shield-init :name "lightjak-shield" :to self) + ) + ) + (when (time-elapsed? (-> self lightjak shield-count-time) (seconds 0.33)) + (let* ((v1-93 (-> self game)) + (a0-46 (+ (-> v1-93 attack-id) 1)) + ) + (set! (-> v1-93 attack-id) a0-46) + (set! (-> self fact shield-attack-id) a0-46) + ) + (if (not (logtest? (-> self lightjak stage) (lightjak-stage ls1))) + (send-event + self + 'get-pickup + (pickup-type eco-pill-light) + (* -0.33333334 (-> *FACT-bank* lightjak-shield-inc)) + ) + ) + (set-time! (-> self lightjak shield-count-time)) + ) + (when (not (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (logtest? (game-feature lightjak-shield) (-> self game features)) + (or (cpad-hold? (-> self control cpad number) circle) + (and (and (focus-test? self light) + (nonzero? (-> self lightjak)) + (logtest? (-> self lightjak stage) (lightjak-stage ls6)) + ) + (not (time-elapsed? (-> self lightjak start-time) (seconds 3))) + ) + ) + (>= (-> self game eco-pill-light) (-> *FACT-bank* lightjak-shield-inc)) + (not (handle->process (-> self lightjak freeze-control))) + ) + ) + ) + (send-event (ppointer->process (-> self lightjak shield)) 'close) + (set! (-> self fact shield-level) 0.0) + (set! (-> self lightjak shield-start-time) 0) + (remove-setting! 'attack) + (apply-settings *setting-control*) + ) + ) + (when (and (zero? (-> self lightjak shield-start-time)) + (zero? (-> self lightjak latch-out-time)) + (logtest? (game-feature lightjak-shield) (-> self game features)) + (and (focus-test? self light) (nonzero? (-> self lightjak))) + (or (cpad-hold? (-> self control cpad number) circle) + (and (and (focus-test? self light) + (nonzero? (-> self lightjak)) + (logtest? (-> self lightjak stage) (lightjak-stage ls6)) + ) + (not (time-elapsed? (-> self lightjak start-time) (seconds 3))) + ) + ) + (>= (-> self game eco-pill-light) 1.0) + (not (and (-> self next-state) + (let ((v1-189 (-> self next-state name))) + (or (= v1-189 'target-flop) + (= v1-189 'target-lightjak-freeze) + (= v1-189 'target-lightjak-shield) + (= v1-189 'target-lightjak-regen) + (= v1-189 'target-lightjak-get-off) + ) + ) + ) + ) + (and (not (handle->process (-> self lightjak freeze-control))) + (= (-> self ext-anim) (target-anim light)) + (time-elapsed? (-> self lightjak regen-time) (seconds 0.5)) + ) + ) + (set-time! (-> self lightjak shield-start-time)) + (set! (-> self lightjak shield-count-time) 0) + (set! (-> self fact shield-level) 1.0) + (let* ((v1-205 (-> self game)) + (a0-94 (+ (-> v1-205 attack-id) 1)) + ) + (set! (-> v1-205 attack-id) a0-94) + (set! (-> self fact shield-attack-id) a0-94) + ) + (set-setting! 'attack #f 0.0 0) + (apply-settings *setting-control*) + (set! (-> self fact lightjak-effect-time) + (+ (- (seconds 20) (-> self fact lightjak-start-time)) (current-time)) + ) + (when (and (time-elapsed? (-> self fact shield-use-time) (seconds 0.1)) + (and (-> self next-state) (let ((v1-221 (-> self next-state name))) + (or (= v1-221 'target-stance) + (= v1-221 'target-jump) + (= v1-221 'target-falling) + (= v1-221 'target-hit-ground) + (= v1-221 'target-double-jump) + ) + ) + ) + (>= (-> self control last-time-on-surface) (-> self fact shield-start-time)) + ) + (set-time! (-> self fact shield-start-time)) + (go target-lightjak-shield) + ) + ) + (target-lightjak-do-effect) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-lightjak-get-on (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('lightjak) + (when (zero? (-> self lightjak want-stage)) + (set! (-> self lightjak want-stage) (the-as lightjak-stage (-> block param 0))) + #t + ) + ) + (('touched) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self control) + (the-as uint 1920) + ) + (target-send-attack + proc + (-> self control danger-mode) + (the-as touching-shapes-entry (-> block param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + (target-generic-event-handler proc argc message block) + ) + ) + (('attack-invinc) + (target-attacked + message + (the-as attack-info (-> block param 1)) + proc + (the-as touching-shapes-entry (-> block param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 lightjak-stage)) + (set! (-> self control lightjak-sound-id) (new 'static 'sound-id)) + 0 + ) + :exit (behavior () + (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-0 command) (sound-command set-param)) + (set! (-> v1-0 id) (-> self control unknown-sound-id00)) + (set! (-> v1-0 params volume) -4) + (set! (-> v1-0 auto-time) 48) + (set! (-> v1-0 auto-from) 2) + (set! (-> v1-0 params mask) (the-as uint 17)) + (-> v1-0 id) + ) + (when (nonzero? (-> self control lightjak-sound-id)) + (set-action! + *gui-control* + (gui-action fade) + (-> self control lightjak-sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> self control lightjak-sound-id) (new 'static 'sound-id)) + 0 + ) + (remove-setting! 'process-mask) + (logclear! (-> self target-flags) (target-flags tf4)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self lightjak-interp) 1.0) + (target-danger-set! 'harmless #f) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (remove-setting! 'gun) + (persist-with-delay *setting-control* 'gun (seconds 0.5) 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-gun-end-mode #t) + ) + :code (behavior ((arg0 lightjak-stage)) + (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-darkjak-end-mode #t) + (send-event (handle->process (-> self notify)) 'notify 'attack 24) + (set! (-> self lightjak stage) (logior arg0 (lightjak-stage ls2))) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *lightjak-trans-mods*) + (set-time! (-> self lightjak start-time)) + (set! (-> self lightjak attack-count) 0) + (set! (-> self lightjak latch-out-time) 0) + (logior! (-> self focus-status) (focus-status light)) + (set! (-> self pending-ext-anim) (target-anim light)) + (set-time! (-> self fact lightjak-start-time)) + (set! (-> self fact lightjak-effect-time) (seconds 20)) + (set! (-> self lightjak mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modelit 0.0 0))) + (target-start-attack) + (target-danger-set! 'get-on #f) + (cond + ((logtest? arg0 (lightjak-stage freeze)) + ) + (else + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile guard vehicle)) + ) + ) + (logior! (-> self target-flags) (target-flags tf4)) + (when (logtest? arg0 (lightjak-stage ls7)) + (set! (-> self post-hook) target-no-move-post) + (while (!= (-> self ext-anim) (target-anim light)) + (if (= (-> self prev-state name) 'target-continue) + (set-blackout-frames (seconds 0.1)) + ) + (suspend) + ) + (if (and (not (-> self lightjak wings)) (logtest? arg0 (lightjak-stage swoop))) + (set! (-> self lightjak wings) (process-spawn wings :init wings-init 'force :name "wings" :to self)) + ) + (go target-stance) + ) + (set! (-> self control unknown-sound-id00) (sound-play "jak-suspend")) + (set! (-> self lightjak on-off) + (the-as + uint + (add-process *gui-control* self (gui-channel jak-effect-1) (gui-action queue) "jak-onof" -99.0 0) + ) + ) + (set-forward-vel 0.0) + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (if (logtest? arg0 (lightjak-stage swoop)) + 2.0 + 1.0 + ) + ) + ) + (ja-no-eval :group! jakb-lightjak-get-on-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 f30-0 1.0) + (suspend) + (ja :num! (seek!)) + ) + ) + (set! (-> self control dynam gravity-max) 0.0) + (set! (-> self control dynam gravity-length) 0.0) + (set! (-> self control transv quad) (the-as uint128 0)) + (let ((s5-2 + (cond + ((logtest? (-> *part-group-id-table* 174 flags) (sp-group-flag sp13)) + (let ((s4-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s4-1 + (let ((t9-24 (method-of-type part-tracker-subsampler activate))) + (t9-24 (the-as part-tracker-subsampler s4-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-25 run-function-in-process) + (a0-42 s4-1) + (a1-16 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 174)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 6) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-25) a0-42 a1-16 *part-tracker-subsampler-params-default*) + ) + (-> s4-1 ppointer) + ) + ) + ) + (else + (let ((s4-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s4-2 + (let ((t9-27 (method-of-type part-tracker activate))) + (t9-27 (the-as part-tracker s4-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-28 run-function-in-process) + (a0-45 s4-2) + (a1-19 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 174)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 6) + ((the-as (function object object object none) t9-28) a0-45 a1-19 *part-tracker-params-default*) + ) + (-> s4-2 ppointer) + ) + ) + ) + ) + ) + ) + (while (!= (-> self ext-anim) (target-anim light)) + (let ((v1-117 (point-off-screen (new 'stack-no-clear 'vector)))) + (set! (-> *part-id-table* 630 init-specs 9 initial-valuef) + (* 1.1 (- (-> v1-117 y) (-> self control trans y))) + ) + (set! (-> *part-id-table* 631 init-specs 9 initial-valuef) + (* 1.1 (- (-> v1-117 y) (-> self control trans y))) + ) + (set! (-> *part-id-table* 632 init-specs 9 initial-valuef) + (* 1.1 (- (-> v1-117 y) (-> self control trans y))) + ) + (set! (-> *part-id-table* 633 init-specs 9 initial-valuef) + (* 1.1 (- (-> v1-117 y) (-> self control trans y))) + ) + ) + (let ((v1-125 (ja-group))) + (when (not (and v1-125 (= v1-125 jakb-lightjak-get-on-loop-ja))) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! jakb-lightjak-get-on-loop-ja :num! min) + ) + ) + (suspend) + (ja :num! (loop!)) + ) + (send-event (ppointer->process s5-2) 'die) + ) + (let ((v1-144 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-144 command) (sound-command set-param)) + (set! (-> v1-144 id) (-> self control unknown-sound-id00)) + (set! (-> v1-144 params volume) -4) + (set! (-> v1-144 auto-time) 48) + (set! (-> v1-144 auto-from) 2) + (set! (-> v1-144 params mask) (the-as uint 17)) + (-> v1-144 id) + ) + (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) + (set! (-> self lightjak-interp) 1.0) + (add-connection + *part-engine* + self + 8 + self + 650 + (new 'static 'vector :x 278.528 :y 643.072 :z 757.76 :w 163840.0) + ) + (add-connection + *part-engine* + self + 8 + self + 650 + (new 'static 'vector :x -278.528 :y 643.072 :z 757.76 :w 163840.0) + ) + (let ((v1-154 (log2 (the-as int (-> self draw mgeo seg-table (log2 8)))))) + (logior! (-> self draw mgeo effect v1-154 effect-usage) 8) + ) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self lightjak on-off)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (cond + ((logtest? (-> *part-group-id-table* 175 flags) (sp-group-flag sp13)) + (let ((s5-4 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-4 + (let ((t9-41 (method-of-type part-tracker-subsampler activate))) + (t9-41 (the-as part-tracker-subsampler s5-4) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-42 run-function-in-process) + (a0-94 s5-4) + (a1-32 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 175)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 6) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-42) a0-94 a1-32 *part-tracker-subsampler-params-default*) + ) + (-> s5-4 ppointer) + ) + ) + ) + (else + (let ((s5-5 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-5 + (let ((t9-44 (method-of-type part-tracker activate))) + (t9-44 (the-as part-tracker s5-5) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-45 run-function-in-process) + (a0-97 s5-5) + (a1-35 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 175)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 6) + ((the-as (function object object object none) t9-45) a0-97 a1-35 *part-tracker-params-default*) + ) + (-> s5-5 ppointer) + ) + ) + ) + ) + (cond + ((logtest? arg0 (lightjak-stage regen)) + (go target-lightjak-regen (the-as int (-> self control lightjak-sound-id))) + ) + ((logtest? arg0 (lightjak-stage freeze)) + (go target-lightjak-freeze) + ) + (else + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + ) + ) + (ja-no-eval :group! jakb-lightjak-get-on-out-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (and (not (-> self lightjak wings)) (logtest? arg0 (lightjak-stage swoop))) + (set! (-> self lightjak wings) (process-spawn wings :init wings-init 'open :name "wings" :to self)) + ) + (ja-no-eval :group! jakb-lightjak-get-on-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (< 31.0 (ja-aframe-num 0))) + (goto cfg-81) + ) + (suspend) + (ja :num! (seek!)) + ) + (label cfg-81) + (go target-stance) + ) + :post target-no-stick-post + ) + +;; failed to figure out what this is: +(defstate target-lightjak-get-off (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pole-grab 'lightjak 'slide 'wade 'launch 'edge-grab) + #f + ) + (('change-mode) + (case (-> block param 0) + (('grab) + (when (not (focus-test? self dead)) + (if (not (-> block param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + ) + (('attack-invinc) + (target-attacked + message + (the-as attack-info (-> block param 1)) + proc + (the-as touching-shapes-entry (-> block param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *lightjak-trans-mods*) + (case (get-status *gui-control* (the-as sound-id (-> self lightjak on-off))) + (((gui-status pending) (gui-status ready) (gui-status active)) + ) + (else + (set! (-> self lightjak on-off) + (the-as + uint + (add-process *gui-control* self (gui-channel jak-effect-1) (gui-action queue) "jak-onof" -99.0 0) + ) + ) + ) + ) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (target-lightjak-end-mode #t) + ) + :trans (-> target-lightjak-get-on trans) + :code (behavior () + (let ((v1-1 (-> self water flags))) + (cond + ((and (logtest? (water-flag touch-water) v1-1) + (logtest? (water-flag under-water swimming) v1-1) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + (go target-swim-stance) + ) + ((let ((v1-10 (ja-group))) + (not (and v1-10 (= v1-10 jakb-lightjak-get-on-ja))) + ) + (let ((gp-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! gp-0 (- (current-time) (-> self clock old-frame-counter))) + (if (>= gp-0 300) + (go target-falling #f) + ) + (suspend) + ) + ) + ) + ) + ) + (vector-reset! (-> self control transv)) + ((-> target-lightjak-get-off exit)) + (cond + ((logtest? (-> self control status) (collide-status on-water)) + ) + (else + (let ((v1-33 (ja-group))) + (cond + ((and v1-33 (= v1-33 jakb-lightjak-get-on-ja)) + (ja-no-eval :num! (seek! 0.0)) + (while (not (ja-done? 0)) + (seek! (-> self lightjak-interp) 0.0 (* 2.0 (seconds-per-frame))) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.1)) + ) + (else + (if (-> self lightjak wings) + (sound-play "ltjak-wings-in") + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-get-off-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self lightjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 10.0 60.0)) + (if (and (>= (ja-aframe-num 0) 24.0) + (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (= (-> self lightjak-interp) 0.0) + ) + (goto cfg-49) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + (label cfg-49) + (go target-stance) + ) + :post (-> target-grab post) + ) + +;; definition for symbol *lightjak-swoop-mods*, type surface +(define *lightjak-swoop-mods* (new 'static 'surface + :name 'swoop + :turnv 32768.0 + :turnvf 90.0 + :turnvv 18204.445 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flag check-edge air gun-off no-board) + ) + ) + +;; failed to figure out what this is: +(defstate target-lightjak-swoop (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float)) + (set-time! (-> self state-time)) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (apply-settings *setting-control*) + (set! (-> self lightjak get-off-lock) #t) + (set! (-> self fact lightjak-effect-time) + (+ (- (seconds 20) (-> self fact lightjak-start-time)) (current-time)) + ) + (if (not (-> self lightjak wings)) + (set! (-> self lightjak wings) (process-spawn wings :init wings-init 'open :name "wings" :to self)) + ) + (when (and (-> self next-state) (= (-> self next-state name) 'target-lightjak-swoop)) + (if (not (logtest? (-> self lightjak stage) (lightjak-stage ls1))) + (send-event self 'get-pickup (pickup-type eco-pill-light) (- (-> *FACT-bank* lightjak-swoop-inc))) + ) + (send-event (ppointer->process (-> self lightjak wings)) 'open) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + (set-time! (-> self control sliding-start-time)) + (set! (-> self control unknown-symbol03) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + (+! (-> self lightjak swoop-count) 1) + (let ((f30-0 163840.0)) + (let ((f0-6 (if (and (-> self next-state) (= (-> self next-state name) 'target-lightjak-swoop)) + 1.4 + (lerp-scale 0.0 1.0 (* arg0 arg0) 0.25 0.95) + ) + ) + ) + (set! (-> self control unknown-float35) (* 0.0016666667 (* 285.0 f0-6) f30-0)) + ) + (set! (-> self control dynam gravity-max) 245760.0) + (set! (-> self control dynam gravity-length) f30-0) + ) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control mod-surface) *lightjak-swoop-mods*) + (set-setting! 'string-min-height 'low (meters 1) 0) + (set-setting! 'string-max-height 'low (meters 10) 0) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + ) + :exit (behavior () + (remove-setting! 'board) + (remove-setting! 'gun) + (when (not (and (-> self next-state) (let ((v1-7 (-> self next-state name))) + (or (= v1-7 'target-lightjak-swoop) (= v1-7 'target-lightjak-swoop-again)) + ) + ) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (remove-setting! 'string-min-height) + (remove-setting! 'string-max-height) + ) + (target-exit) + ) + :trans (behavior () + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-hit-ground #f) + ) + (if #t + (set-time! (-> self control sliding-start-time)) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + (when (time-elapsed? (-> self control sliding-start-time) (seconds 0.2)) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + ) + (if (or (and (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 0.0) + (and (< (target-height-above-ground) 4096.0) + (or (= (-> self control gspot-pat-surfce mode) (pat-mode ground)) + (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + ) + ) + ) + (!= (-> self fact shield-level) 0.0) + ) + (go target-lightjak-swoop-falling #f) + ) + 0 + ) + :code (behavior ((arg0 float)) + (sound-play "ltjak-flap") + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-swoop1-ja :num! (seek!) :frame-num 0.0) + (let ((v1-16 (new-stack-vector0))) + (let ((f0-5 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-16 (-> self control transv) (vector-float*! v1-16 (-> self control dynam gravity-normal) f0-5)) + ) + (let* ((f0-6 (vector-length v1-16)) + (f1-1 f0-6) + (f2-0 (-> self control unknown-float35)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-16 v1-16 (/ f0-6 f1-1)) + ) + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (if (and (cpad-pressed? (-> self control cpad number) x) (time-elapsed? (-> self state-time) (seconds 0.5))) + (go + target-lightjak-swoop-again + (* 0.0033333334 (the float (- (-> self control sliding-start-time) (-> self state-time)))) + ) + ) + ) + (go target-lightjak-swoop-falling #f) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-lightjak-swoop-again (target) + :event target-jump-event-handler + :enter (-> target-lightjak-swoop enter) + :exit (-> target-lightjak-swoop exit) + :trans (-> target-lightjak-swoop trans) + :code (behavior ((arg0 float)) + (sound-play "ltjak-flap") + (let ((f30-0 44.0)) + (let ((a1-1 6)) + (let ((v1-4 (ja-group))) + (cond + ((and v1-4 (= v1-4 jakb-lightjak-swoop1-ja)) + (set! f30-0 (lerp-scale 48.0 44.0 (ja-aframe-num 0) 30.0 44.0)) + (set! a1-1 30) + ) + ((let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 jakb-lightjak-swoop2-ja)) + ) + (set! f30-0 (lerp-scale 48.0 44.0 (ja-aframe-num 0) 54.0 74.0)) + (set! a1-1 30) + ) + ((let ((v1-18 (ja-group))) + (and v1-18 (or (= v1-18 jakb-lightjak-swoop-fall-ja) (= v1-18 jakb-lightjak-swoop-fall-loop-ja))) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! jakb-lightjak-swoop2-ja :num! (seek! max 2.0) :frame-num (ja-aframe 69.0 0)) + (until (ja-done? 0) + (let ((v1-37 (new-stack-vector0)) + (f0-5 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-37 (-> self control transv) (vector-float*! v1-37 (-> self control dynam gravity-normal) f0-5)) + (let* ((f1-2 (vector-length v1-37)) + (f2-0 f1-2) + (f0-6 (* 0.95 f0-5)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-6) + (vector-float*! v1-37 v1-37 (/ f1-2 f2-0)) + ) + ) + ) + (suspend) + (ja :num! (seek! max 2.0)) + ) + (set! a1-1 0) + ) + ) + ) + (ja-channel-push! 1 (the-as time-frame a1-1)) + ) + (ja-no-eval :group! jakb-lightjak-swoop2-ja :num! (seek!) :frame-num (ja-aframe f30-0 0)) + ) + (while (< (ja-aframe-num 0) 48.0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-73 (new-stack-vector0))) + (let ((f0-20 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-73 (-> self control transv) (vector-float*! v1-73 (-> self control dynam gravity-normal) f0-20)) + ) + (let* ((f0-21 (vector-length v1-73)) + (f1-5 f0-21) + (f2-1 (-> self control unknown-float35)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) + (vector-float*! v1-73 v1-73 (/ f0-21 f1-5)) + ) + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (if (and (cpad-pressed? (-> self control cpad number) x) + (time-elapsed? (-> self state-time) (seconds 0.5)) + (and (>= (ja-aframe-num 0) 54.0) 0) + ) + (go + target-lightjak-swoop-again + (* 0.0033333334 (the float (- (-> self control sliding-start-time) (-> self state-time)))) + ) + ) + ) + (go target-lightjak-swoop-falling #f) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-lightjak-swoop-falling (target) + :event target-jump-event-handler + :enter (behavior ((arg0 symbol)) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (apply-settings *setting-control*) + (set! (-> self control mod-surface) *jump-mods*) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (set-time! (-> self state-time)) + ) + :exit (-> target-lightjak-swoop exit) + :trans (behavior () + (if (and (cpad-pressed? (-> self control cpad number) x) + (not (and (< (target-height-above-ground) 8192.0) + (or (= (-> self control gspot-pat-surfce mode) (pat-mode ground)) + (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) + ) + ) + ) + (= (-> self fact shield-level) 0.0) + ) + (go target-lightjak-swoop-again 1.0) + ) + (target-falling-trans + (the-as symbol (-> self control unknown-spool-anim00)) + (the-as time-frame (if (= (-> self control unknown-spool-anim00) #f) + 0 + (the-as int (/ (the-as int (-> *TARGET-bank* stuck-time)) 2)) + ) + ) + #f + ) + ) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-lightjak-swoop-fall-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! jakb-lightjak-swoop-fall-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post target-post + ) + +;; definition of type freeze-screen +(deftype freeze-screen (process-drawable) + ((anim-frame float) + (transition float) + (gui-id-1 sound-id) + (gui-id-2 sound-id) + ) + (:state-methods + idle + active + (deactive symbol) + die + ) + (:methods + (freeze-screen-method-24 (_type_) none) + ) + ) + +;; definition for method 3 of type freeze-screen +(defmethod inspect ((this freeze-screen)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tanim-frame: ~f~%" (-> this anim-frame)) + (format #t "~2Ttransition: ~f~%" (-> this transition)) + (format #t "~2Tgui-id-1: ~D~%" (-> this gui-id-1)) + (format #t "~2Tgui-id-2: ~D~%" (-> this gui-id-2)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-freeze-screen collectables collectables-warp-time-lod0-jg collectables-warp-time-idle-ja + ((collectables-warp-time-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; failed to figure out what this is: +(defstate idle (freeze-screen) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (set-time! (-> self state-time)) + (go-virtual active) + ) + (('die) + (go-virtual die) + ) + (('untrigger) + (if (-> block param 0) + (go-virtual die) + ) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self transition) 0.0) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate active (freeze-screen) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) + (go-virtual deactive (the-as symbol (-> block param 0))) + ) + (('die) + (go-virtual die) + ) + ) + ) + :enter (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (until #f + (set! (-> self anim-frame) (* 15.0 (- 1.0 (-> *setting-control* user-current slow-time)))) + (set! (-> self transition) (-> *setting-control* user-current slow-time)) + (ja :num-func num-func-identity :frame-num (-> self anim-frame)) + (suspend) + ) + #f + ) + :post (behavior () + (freeze-screen-method-24 self) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate deactive (freeze-screen) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual die) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (until #f + (set! (-> self anim-frame) (* 15.0 (- 1.0 (-> *setting-control* user-current slow-time)))) + (set! (-> self transition) (-> *setting-control* user-current slow-time)) + (when (= (-> self anim-frame) 15.0) + (if arg0 + (go-virtual die) + (go-virtual idle) + ) + ) + (ja :num-func num-func-identity :frame-num (-> self anim-frame)) + (suspend) + ) + #f + ) + :post (behavior () + (freeze-screen-method-24 self) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate die (freeze-screen) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (seek! (-> self transition) 0.0 (seconds-per-frame)) + (suspend) + ) + ) + ) + ) + +;; definition for method 24 of type freeze-screen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod freeze-screen-method-24 ((this freeze-screen)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s3-0 (camera-matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + (f30-0 4096.0) + ) + (let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) + (set-vector! (-> this root scale) f0-4 f0-4 f0-4 1.0) + ) + (set! (-> gp-0 quad) (-> (camera-pos) quad)) + (vector-normalize-copy! s5-0 (-> s3-0 fvec) 1.0) + (matrix->quaternion (-> this root quat) s3-0) + (let ((v1-10 (-> this root trans))) + (let ((a0-5 f30-0)) + (.mov vf7 a0-5) + ) + (.lvf vf5 (&-> s5-0 quad)) + (.lvf vf4 (&-> gp-0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-10 quad) vf6) + ) + ) + 0 + (none) + ) + ) + +;; definition for function freeze-screen-init +;; INFO: Used lq/sq +(defbehavior freeze-screen-init freeze-screen ((arg0 vector) (arg1 quaternion) (arg2 entity)) + (process-entity-set! self arg2) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-freeze-screen" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self anim-frame) 15.0) + (set! (-> self transition) 0.0) + (set-vector! (-> self draw color-emissive) 0.0 0.0 0.0 0.0) + (set-vector! (-> self draw color-emissive) 0.0 0.0 0.0 0.0) + (logior! (-> self skel status) (joint-control-status blend-shape)) + (ja :group! collectables-warp-time-end-ja) + (set-setting! 'freeze-screen #t 0.0 0) + (go-virtual idle) + ) + +;; definition for method 10 of type freeze-screen +(defmethod deactivate ((this freeze-screen)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (disable *screen-filter*) + (call-parent-method this) + (none) + ) + +;; definition of type freeze-control +(deftype freeze-control (process) + ((clock-pos float) + (freeze-screen handle) + (sound-id sound-id) + (tick-time time-frame) + (abort? symbol) + (freeze-id sound-id) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type freeze-control +(defmethod inspect ((this freeze-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tclock-pos: ~f~%" (-> this clock-pos)) + (format #t "~2Tfreeze-screen: ~D~%" (-> this freeze-screen)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Ttick-time: ~D~%" (-> this tick-time)) + (format #t "~2Tabort?: ~A~%" (-> this abort?)) + (format #t "~2Tfreeze-id: ~D~%" (-> this freeze-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (freeze-control) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (let ((v0-0 (-> block param 0))) + (set! (-> self abort?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (set-setting! 'music-volume 'rel 0.5 0) + (set-setting! 'sfx-volume 'rel 0.9 0) + (set-setting! 'ambient-volume 'rel 0.9 0) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'test-pickup) + (set! (-> a1-3 param 0) (the-as uint 8)) + (let ((f0-0 (the-as float (send-event-function (ppointer->process (-> self parent)) a1-3)))) + (send-event + (ppointer->process (-> self parent)) + 'get-pickup + (pickup-type eco-pill-light) + (- (fmin (-> *FACT-bank* lightjak-freeze-inc) (+ -1.0 f0-0))) + ) + ) + ) + (set-action! + *gui-control* + (gui-action play) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + :exit (behavior () + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* bg-clock) 1.0) + (update-rates! (-> *display* part-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (send-event (handle->process (-> self freeze-screen)) 'untrigger #t) + (let ((f30-0 1.0)) + (if (>= f30-0 (send-event (ppointer->process (-> self parent)) 'test-pickup (pickup-type eco-pill-light))) + (send-event (ppointer->process (-> self parent)) 'get-pickup (pickup-type eco-pill-light) -100.0) + ) + ) + (set-action! + *gui-control* + (gui-action fade) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + ) + :code (behavior () + (set! (-> self clock-pos) 1.0) + (suspend) + (send-event (handle->process (-> self freeze-screen)) 'trigger) + (while (< 0.05 (-> self clock-pos)) + (seek! (-> self clock-pos) 0.05 (seconds-per-frame)) + (suspend) + ) + (let ((gp-0 (current-time))) + (while (and (not (time-elapsed? gp-0 (the-as time-frame (-> *FACT-bank* lightjak-freeze-duration)))) + (let ((v1-15 #x20000) + (a0-8 (-> self parent)) + ) + (logtest? (the-as focus-status v1-15) + (-> (the-as process-focusable (if a0-8 + (the-as process-focusable (-> a0-8 0 self)) + ) + ) + focus-status + ) + ) + ) + (not (-> self abort?)) + ) + (suspend) + ) + ) + (while (< (-> self clock-pos) 1.0) + (case (-> self abort?) + (('force) + (return #f) + ) + ) + (seek! (-> self clock-pos) 1.0 (* 2.0 (seconds-per-frame))) + (suspend) + ) + ) + :post (behavior () + (set-setting! 'slow-time 'abs (lerp-scale 1.0 0.0 (-> self clock-pos) 0.05 1.0) 0) + (apply-settings *setting-control*) + (format *stdebug* "freeze = ~,,2f ~,,2~%" (-> self clock-pos) (-> *setting-control* user-current slow-time)) + (update-rates! (-> *display* entity-clock) (-> self clock-pos)) + (update-rates! (-> *display* bg-clock) (-> self clock-pos)) + (update-rates! (-> *display* target-clock) (- 1.0 (* 0.1 (- 1.0 (-> self clock-pos))))) + ) + ) + +;; definition for function freeze-control-init +(defbehavior freeze-control-init freeze-control ((arg0 sound-id)) + (set! (-> self clock-pos) 1.0) + (set! (-> self sound-id) arg0) + (set! (-> self abort?) #f) + (set! (-> self freeze-screen) + (ppointer->handle + (process-spawn + freeze-screen + :init freeze-screen-init + (math-camera-pos) + *null-vector* + (-> self entity) + :name "freeze-screen" + :to *display-pool* + ) + ) + ) + (set! (-> self freeze-id) + (add-process *gui-control* self (gui-channel freeze) (gui-action play) "freeze" -99.0 0) + ) + (go-virtual idle) + ) + +;; definition of type freeze-watcher +(deftype freeze-watcher (process) + ((old-clock clock) + ) + (:state-methods + (active clock) + ) + ) + +;; definition for method 3 of type freeze-watcher +(defmethod inspect ((this freeze-watcher)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Told-clock: ~A~%" (-> this old-clock)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate active (freeze-watcher) + :virtual #t + :exit (behavior () + (+! (-> self parent 0 clock ref-count) -1) + (+! (-> self old-clock ref-count) 1) + (set! (-> self parent 0 clock) (-> self old-clock)) + ) + :code (behavior ((arg0 clock)) + (let ((s4-0 (-> self parent 0 clock)) + (gp-0 (current-time)) + ) + (copy! arg0 s4-0) + (+! (-> s4-0 ref-count) -1) + (+! (-> arg0 ref-count) 1) + (set! (-> self parent 0 clock) arg0) + (+! (-> self clock ref-count) -1) + (+! (-> self parent 0 clock ref-count) 1) + (set! (-> self clock) (-> self parent 0 clock)) + (while (let* ((s5-2 (ppointer->process (-> self parent))) + (v1-31 (if (type? s5-2 process-focusable) + s5-2 + ) + ) + ) + (and v1-31 + (or (focus-test? (the-as process-focusable v1-31) dead hit) + (and (-> (the-as process-focusable v1-31) next-state) + (let ((v1-34 (-> (the-as process-focusable v1-31) next-state name))) + (or (= v1-34 'hit) + (= v1-34 'knocked) + (= v1-34 'knocked-recover) + (= v1-34 'die) + (= v1-34 'die-falling) + (= v1-34 'die-fast) + ) + ) + ) + ) + (not (time-elapsed? gp-0 (seconds 5))) + ) + ) + (update-rates! (-> self clock) (seek (-> self clock clock-ratio) 1.0 (* 4.0 (seconds-per-frame)))) + (format *stdebug* "watcher ~d ~f~%" (-> self clock index) (-> self clock clock-ratio)) + (suspend) + ) + ) + (while (!= (-> self clock clock-ratio) (lerp-scale 1.0 0.05 (-> *setting-control* user-current slow-time) 0.0 1.0)) + (update-rates! (-> self clock) (seek + (-> self clock clock-ratio) + (lerp-scale 1.0 0.05 (-> *setting-control* user-current slow-time) 0.0 1.0) + (* 4.0 (seconds-per-frame)) + ) + ) + (format *stdebug* "watcher ~d ~f~%" (-> self clock index) (-> self clock clock-ratio)) + (suspend) + ) + ) + ) + +;; definition for function freeze-watcher-init +(defbehavior freeze-watcher-init freeze-watcher ((arg0 clock)) + (set! (-> self old-clock) (-> self parent 0 clock)) + (go-virtual active arg0) + ) + +;; definition for function freeze-hit-begin +;; WARN: Return type mismatch int vs none. +;; WARN: Function freeze-hit-begin has a return type of none, but the expression builder found a return statement. +(defbehavior freeze-hit-begin process () + (local-vars (gp-0 clock)) + (cond + ((or (< (-> *setting-control* user-current slow-time) 0.01) (>= (-> self clock index) 12)) + ) + (else + (if (>= (-> self clock index) 12) + (return #f) + ) + (dotimes (v1-12 10) + (when (zero? (-> *display* clock (+ v1-12 12) ref-count)) + (set! gp-0 (-> *display* clock (+ v1-12 12))) + (goto cfg-18) + ) + ) + (return #f) + (label cfg-18) + (process-spawn freeze-watcher :init freeze-watcher-init gp-0 :name "freeze-watcher" :to self) + ) + ) + 0 + (none) + ) + +;; definition for function freeze-hit-end +;; WARN: Return type mismatch int vs none. +(defbehavior freeze-hit-end process () + (let ((gp-0 (-> self child))) + (while gp-0 + (send-event (ppointer->process gp-0) 'notice 'freeze-hit-end) + (set! gp-0 (-> gp-0 0 brother)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-lightjak-freeze (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pole-grab 'darkjak 'lightjak 'slide 'wade 'launch 'edge-grab 'jump 'shove 'attack 'attack-or-shove) + #f + ) + (('attack 'attack-or-shove 'swim) + #f + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self target-flags) (target-flags tf4)) + (set! (-> self lightjak freeze-sound) + (add-process *gui-control* self (gui-channel jak-mode) (gui-action queue) "ljfreeze" -99.0 0) + ) + (set! (-> self lightjak get-off-lock) #t) + ) + :exit (behavior () + (if (not (handle->process (-> self lightjak freeze-control))) + (set-action! + *gui-control* + (gui-action stop) + (-> self lightjak freeze-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (logclear! (-> self target-flags) (target-flags tf4 tf6)) + (target-exit) + ) + :code (behavior () + (send-event (handle->process (-> self notify)) 'notify 'attack 27) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (cond + ((logtest? (-> *part-group-id-table* 180 flags) (sp-group-flag sp13)) + (let ((gp-0 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-0 + (let ((t9-2 (method-of-type part-tracker-subsampler activate))) + (t9-2 (the-as part-tracker-subsampler gp-0) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-3 run-function-in-process) + (a0-10 gp-0) + (a1-3 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 180)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 19) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-3) a0-10 a1-3 *part-tracker-subsampler-params-default*) + ) + (-> gp-0 ppointer) + ) + ) + ) + (else + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-1 + (let ((t9-5 (method-of-type part-tracker activate))) + (t9-5 (the-as part-tracker gp-1) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-6 run-function-in-process) + (a0-13 gp-1) + (a1-6 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 180)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 19) + ((the-as (function object object object none) t9-6) a0-13 a1-6 *part-tracker-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 180 flags) (sp-group-flag sp13)) + (let ((gp-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-2 + (let ((t9-8 (method-of-type part-tracker-subsampler activate))) + (t9-8 (the-as part-tracker-subsampler gp-2) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-9 run-function-in-process) + (a0-16 gp-2) + (a1-9 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 180)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 28) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-9) a0-16 a1-9 *part-tracker-subsampler-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + (else + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-3 + (let ((t9-11 (method-of-type part-tracker activate))) + (t9-11 (the-as part-tracker gp-3) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-12 run-function-in-process) + (a0-19 gp-3) + (a1-12 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 180)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 28) + ((the-as (function object object object none) t9-12) a0-19 a1-12 *part-tracker-params-default*) + ) + (-> gp-3 ppointer) + ) + ) + ) + ) + (set! (-> self control mod-surface) *roll-flip-mods*) + (let ((f30-0 0.0)) + (if (time-elapsed? (-> self fact lightjak-start-time) (seconds 2)) + (set! f30-0 9.0) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-lightjak-freeze-ja :num! (seek! (ja-aframe 20.0 0)) :frame-num (ja-aframe f30-0 0)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + (cond + ((logtest? (-> *part-group-id-table* 181 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) quad) + ) + (let ((gp-7 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-7 + (let ((t9-22 (method-of-type part-tracker-subsampler activate))) + (t9-22 (the-as part-tracker-subsampler gp-7) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-23 run-function-in-process) + (a0-33 gp-7) + (a1-22 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 181)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-23) a0-33 a1-22 *part-tracker-subsampler-params-default*) + ) + (-> gp-7 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) quad) + ) + (let ((gp-9 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-9 + (let ((t9-26 (method-of-type part-tracker activate))) + (t9-26 (the-as part-tracker gp-9) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-27 run-function-in-process) + (a0-37 gp-9) + (a1-26 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 181)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-27) a0-37 a1-26 *part-tracker-params-default*) + ) + (-> gp-9 ppointer) + ) + ) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! (-> self lightjak freeze-control) (ppointer->handle (process-spawn + freeze-control + :init freeze-control-init + (-> self lightjak freeze-sound) + :name "freeze-control" + :to self + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (go target-stance) + ) + :post target-no-stick-post + ) + +;; failed to figure out what this is: +(defstate target-lightjak-shield (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pole-grab 'darkjak 'lightjak 'slide 'wade 'launch 'edge-grab 'jump 'shove 'attack 'attack-or-shove) + #f + ) + (('attack 'attack-or-shove 'swim) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self target-flags) (target-flags tf4)) + (set! (-> self neck flex-blend) 0.0) + (quaternion-copy! (-> self control unknown-quaternion04) (-> self control dir-targ)) + (set! (-> self lightjak get-off-lock) #t) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (logclear! (-> self target-flags) (target-flags tf4 tf6)) + (target-exit) + ) + :code (behavior () + (send-event (handle->process (-> self notify)) 'notify 'attack 28) + (if (logtest? (-> self control status) (collide-status on-ground)) + (set! (-> self control mod-surface) *attack-mods*) + (set! (-> self control mod-surface) *jump-attack-mods*) + ) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (cond + ((>= 0.0 f0-1) + (let ((v1-19 (new-stack-vector0))) + (let ((f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-19 (-> self control transv) (vector-float*! v1-19 (-> self control dynam gravity-normal) f0-3)) + ) + (let* ((f0-4 (vector-length v1-19)) + (f1-2 f0-4) + (f2-0 33775.48) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-19 v1-19 (/ f0-4 f1-2)) + ) + ) + ) + ) + (else + (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (seconds-per-frame)))) + (f0-6 (* 0.5 f1-5 (seconds-per-frame) f0-1)) + (v1-25 (new-stack-vector0)) + ) + (let ((f1-9 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-25 (-> self control transv) (vector-float*! v1-25 (-> self control dynam gravity-normal) f1-9)) + ) + (let* ((f1-10 (vector-length v1-25)) + (f2-5 f1-10) + (f0-10 (+ 1024.0 (sqrtf (* 245760.0 (+ 2048.0 f0-6))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-10) + (vector-float*! v1-25 v1-25 (/ f1-10 f2-5)) + ) + ) + ) + ) + ) + ) + (set! (-> self control dynam gravity-length) 122880.0) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (let ((gp-0 jakb-lightjak-shield-ja)) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + (ja-channel-push! 1 (seconds 0.05)) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + (ja-no-eval :group! gp-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek! max (-> self control current-surface align-speed))) + ) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-stance) + (go target-falling #f) + ) + ) + :post target-post + ) + +;; failed to figure out what this is: +(let ((a0-106 (copy *jump-mods* 'global))) + (set! (-> a0-106 flags) (surface-flag gun-off gun-fast-exit no-board)) + (set! *heal-mods* a0-106) + ) + +;; failed to figure out what this is: +(defstate target-lightjak-regen (target) + :event target-generic-event-handler + :enter (behavior ((arg0 int)) + (logior! (-> self target-flags) (target-flags tf4)) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile guard vehicle)) + (set! (-> self control unknown-handle02) (the-as handle #f)) + (set-time! (-> self lightjak regen-start-time)) + (set! (-> self lightjak get-off-lock) #t) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags tf4)) + (set-action! + *gui-control* + (gui-action fade) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (send-event (handle->process (-> self control unknown-handle02)) 'die) + (remove-setting! 'process-mask) + (target-exit) + ) + :trans (behavior () + (set-time! (-> self lightjak regen-time)) + ) + :code (behavior ((arg0 int)) + (set-time! (-> self state-time)) + (sound-play "heal-rise") + (if (nonzero? arg0) + (set! (-> self control unknown-sound-id00) (the-as sound-id arg0)) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* self (gui-channel jak-mode) (gui-action queue) "jak-heal" -99.0 0) + ) + ) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *heal-mods*) + (let ((f28-0 0.0)) + 0 + 0.0 + (let* ((f0-2 (-> self game eco-pill-light)) + (f26-0 (- (-> self fact health-max) (-> self fact health))) + (f30-0 (/ (-> *FACT-bank* eco-pill-light-max-default) (-> self fact health-max))) + (gp-1 (the int (fmin f26-0 (ceil (/ f0-2 f30-0))))) + ) + (let ((v1-17 (ja-group))) + (if (and v1-17 (= v1-17 jakb-lightjak-stance-ja)) + (ja-channel-push! 1 (seconds 0.05)) + (set! f28-0 + (cond + ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) + (not (logtest? (-> self control status) (collide-status on-surface))) + ) + (ja-channel-push! 1 (seconds 0.1)) + 14.0 + ) + (else + (set! f28-0 6.0) + (ja-channel-push! 1 (seconds 0.1)) + f28-0 + ) + ) + ) + ) + ) + (show-hud 'hud-health) + (ja-no-eval :group! jakb-lightjak-heal-ja :num! (seek!) :frame-num (ja-aframe f28-0 0)) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 2.0 1.0) + (set-forward-vel (* 0.6 (-> self control ctrl-xz-vel))) + (suspend) + (ja :num! (seek!)) + ) + (show-hud 'hud-health) + (set-action! + *gui-control* + (gui-action play) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (let ((v1-64 (point-off-screen (new 'stack-no-clear 'vector)))) + (set! (-> *part-id-table* 642 init-specs 9 initial-valuef) (- (-> v1-64 y) (-> self control trans y))) + (set! (-> *part-id-table* 643 init-specs 9 initial-valuef) (- (-> v1-64 y) (-> self control trans y))) + (set! (-> *part-id-table* 644 init-specs 9 initial-valuef) (- (-> v1-64 y) (-> self control trans y))) + (set! (-> *part-id-table* 645 init-specs 9 initial-valuef) (- (-> v1-64 y) (-> self control trans y))) + ) + (set! (-> self control unknown-handle02) + (ppointer->handle + (cond + ((logtest? (-> *part-group-id-table* 177 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-2 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-2 + (let ((t9-19 (method-of-type part-tracker-subsampler activate))) + (t9-19 + (the-as part-tracker-subsampler s5-2) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-20 run-function-in-process) + (a0-46 s5-2) + (a1-12 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 177)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-20) a0-46 a1-12 *part-tracker-subsampler-params-default*) + ) + (-> s5-2 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (let ((s5-3 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-3 + (let ((t9-22 (method-of-type part-tracker activate))) + (t9-22 (the-as part-tracker s5-3) *entity-pool* "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-23 run-function-in-process) + (a0-52 s5-3) + (a1-15 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 177)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-23) a0-52 a1-15 *part-tracker-params-default*) + ) + (-> s5-3 ppointer) + ) + ) + ) + ) + ) + ) + (set! (-> self post-hook) target-no-stick-post) + (set! (-> self control mod-surface) *jump-mods*) + (set! (-> self control dynam gravity-max) 0.0) + (set! (-> self control dynam gravity-length) 0.0) + (let ((s5-4 0)) + (while (or (> gp-1 0) (< s5-4 2)) + (ja-no-eval :group! jakb-lightjak-heal-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (>= (- (-> *display* game-clock frame-counter) (-> self fact eco-source-time)) (seconds 0.5)) (> gp-1 0)) + (set! (-> self fact eco-source-time) (-> *display* game-clock frame-counter)) + (set! (-> self fact eco-source) (process->handle self)) + (send-event self 'get-pickup (pickup-type health) 1.0) + (if (not (logtest? (-> self lightjak stage) (lightjak-stage ls1))) + (send-event self 'get-pickup (pickup-type eco-pill-light) (- f30-0)) + ) + (+! gp-1 -1) + ) + (let ((v1-150 (point-off-screen (new 'stack-no-clear 'vector)))) + (set! (-> *part-id-table* 642 init-specs 9 initial-valuef) (- (-> v1-150 y) (-> self control trans y))) + (set! (-> *part-id-table* 643 init-specs 9 initial-valuef) (- (-> v1-150 y) (-> self control trans y))) + (set! (-> *part-id-table* 644 init-specs 9 initial-valuef) (- (-> v1-150 y) (-> self control trans y))) + (set! (-> *part-id-table* 645 init-specs 9 initial-valuef) (- (-> v1-150 y) (-> self control trans y))) + ) + (suspend) + (ja :num! (seek!)) + ) + (+! s5-4 1) + ) + ) + ) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (cond + ((>= 5734.4 (target-height-above-ground)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-lightjak-heal-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (not (-> self lightjak lightjak-before-powerjak)) + (target-lightjak-end-mode #f) + ) + (go target-stance) + ) + (else + (if (not (-> self lightjak lightjak-before-powerjak)) + (target-lightjak-end-mode #f) + ) + (go target-falling 'target-lightjak-regen) + ) + ) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate open (lightjak-shield) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (go-virtual close) + ) + (('hit) + (go-virtual hit) + ) + ) + ) + :code (behavior () + (cond + ((logtest? (-> *part-group-id-table* 178 flags) (sp-group-flag sp13)) + (let ((gp-0 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-0 + (let ((t9-1 (method-of-type part-tracker-subsampler activate))) + (t9-1 (the-as part-tracker-subsampler gp-0) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-2 run-function-in-process) + (a0-2 gp-0) + (a1-2 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 178)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 3) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-2) a0-2 a1-2 *part-tracker-subsampler-params-default*) + ) + (-> gp-0 ppointer) + ) + ) + ) + (else + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-1 + (let ((t9-4 (method-of-type part-tracker activate))) + (t9-4 (the-as part-tracker gp-1) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-5 run-function-in-process) + (a0-5 gp-1) + (a1-5 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 178)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 3) + ((the-as (function object object object none) t9-5) a0-5 a1-5 *part-tracker-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + ) + (let ((v1-30 (ja-group))) + (when (not (and v1-30 (= v1-30 jakb-shield-start-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-shield-start-ja :num! min) + ) + ) + (sound-play "shield-on") + (while (not (ja-max? 0)) + (suspend) + (set! (-> self fade) (/ (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -1)))) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! jakb-shield-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (ppointer->process (-> self parent))) + (s3-0 (if (type? gp-0 process-focusable) + (the-as process-focusable gp-0) + ) + ) + (s4-0 (camera-matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'vector)) + (f30-0 4096.0) + ) + (let ((f0-0 3.0)) + (set-vector! (-> self root scale) f0-0 f0-0 f0-0 1.0) + ) + (set! (-> gp-1 quad) (-> (get-trans s3-0 5) quad)) + (vector-normalize-copy! s5-0 (-> s4-0 fvec) 0.0) + (matrix->quaternion (-> self root quat) s4-0) + (let ((v1-11 (-> self root trans))) + (let ((a0-5 f30-0)) + (.mov vf7 a0-5) + ) + (.lvf vf5 (&-> s5-0 quad)) + (.lvf vf4 (&-> gp-1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-11 quad) vf6) + ) + ) + (set! (-> self draw force-fade) (the-as uint (the int (* 128.0 (- 1.0 (-> self fade)))))) + (sound-play "ltjak-shield" :id (the-as sound-id (-> self tone))) + (ja-post) + ) + ) + ) + +;; failed to figure out what this is: +(defstate close (lightjak-shield) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (go-virtual open) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (not (and v1-2 (= v1-2 jakb-shield-start-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-shield-start-ja :num! max) + ) + ) + (sound-play "shield-off") + (while (not (ja-min? 0)) + (suspend) + (set! (-> self fade) (/ (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -1)))) + (ja :num! (seek! 0.0)) + ) + ) + :post (-> (method-of-type lightjak-shield open) post) + ) + +;; failed to figure out what this is: +(defstate hit (lightjak-shield) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('close) + (go-virtual close) + ) + (('hit) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) + (go-virtual hit) + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (if (not (logtest? (-> self parent 0 lightjak stage) (lightjak-stage ls1))) + (send-event + (ppointer->process (-> self parent)) + 'get-pickup + (pickup-type eco-pill-light) + (- (-> *FACT-bank* lightjak-shield-hit-inc)) + ) + ) + (sound-play "shield-hit") + (ja-channel-push! 1 (seconds 0.05)) + (cond + ((logtest? (-> *part-group-id-table* 179 flags) (sp-group-flag sp13)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when gp-1 + (let ((t9-5 (method-of-type part-tracker-subsampler activate))) + (t9-5 (the-as part-tracker-subsampler gp-1) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-6 run-function-in-process) + (a0-8 gp-1) + (a1-5 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 179)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) self) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) 3) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-6) a0-8 a1-5 *part-tracker-subsampler-params-default*) + ) + (-> gp-1 ppointer) + ) + ) + ) + (else + (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when gp-2 + (let ((t9-8 (method-of-type part-tracker activate))) + (t9-8 (the-as part-tracker gp-2) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-9 run-function-in-process) + (a0-11 gp-2) + (a1-8 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 179)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) self) + (set! (-> *part-tracker-params-default* mat-joint) 3) + ((the-as (function object object object none) t9-9) a0-11 a1-8 *part-tracker-params-default*) + ) + (-> gp-2 ppointer) + ) + ) + ) + ) + (ja-no-eval :group! jakb-shield-hit-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! jakb-shield-start-ja :num! max) + (go-virtual open) + ) + :post (-> (method-of-type lightjak-shield open) post) + ) + +;; definition for function lightjak-shield-init +;; WARN: Return type mismatch object vs none. +(defbehavior lightjak-shield-init lightjak-shield () + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar-shield" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + (logior! (-> self draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> self draw force-fade) (the-as uint 128)) + (set! (-> self fade) 0.0) + (set! (-> self tone) (the-as rgba (new-sound-id))) + (ja-channel-set! 1) + (ja :group! jakb-shield-start-ja :num! min) + (go-virtual open) + (none) + ) + +;; definition for method 10 of type lightjak-shield +(defmethod deactivate ((this lightjak-shield)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set! (-> this parent 0 lightjak shield) (the-as (pointer lightjak-shield) #f)) + (let ((v1-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-3 command) (sound-command set-param)) + (set! (-> v1-3 id) (the-as sound-id (-> this tone))) + (set! (-> v1-3 params volume) -4) + (set! (-> v1-3 auto-time) 48) + (set! (-> v1-3 auto-from) 2) + (set! (-> v1-3 params mask) (the-as uint 17)) + (-> v1-3 id) + ) + (call-parent-method this) + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/target/target-swim_REF.gc b/test/decompiler/reference/jak3/engine/target/target-swim_REF.gc new file mode 100644 index 00000000000..02a9a57177d --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-swim_REF.gc @@ -0,0 +1,1037 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate target-wade-stance (target) + :event target-standard-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *wade-mods*) + (set-zero! (-> self water bob)) + ) + :exit (behavior () + (target-state-hook-exit) + (target-exit) + (let ((v1-1 (-> self skel effect))) + (set! (-> v1-1 channel-offset) 0) + ) + 0 + ) + :trans (behavior () + ((-> self state-hook)) + (when (and (not (logtest? (water-flag wading) (-> self water flags))) + (time-elapsed? (-> self water wade-time) (seconds 0.05)) + ) + (if (logtest? (water-flag swimming) (-> self water flags)) + (go target-swim-stance) + (go target-stance) + ) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (go target-duck-stance #f) + ) + (if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-wade-walk) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (when (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #t)) + (sound-play "swim-stroke") + (spawn-ripples (-> self water) 1.4 (-> self control trans) 0 (-> self control transv) #f) + (go target-attack) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t)) + (go target-running-attack) + ) + (if (and (using-gun? self) (let ((v1-82 (ja-group))) + (and v1-82 (= v1-82 jakb-stance-loop-ja)) + ) + ) + (go target-gun-stance) + ) + ) + :code (-> target-stance code) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-wade-walk (target) + :event target-standard-event-handler + :enter (behavior () + ((-> target-wade-stance enter)) + ) + :exit (-> target-wade-stance exit) + :trans (behavior () + ((-> self state-hook)) + (when (and (not (logtest? (water-flag wading) (-> self water flags))) + (time-elapsed? (-> self water wade-time) (seconds 0.1)) + ) + (if (logtest? (water-flag swimming) (-> self water flags)) + (go target-swim-stance) + (go target-stance) + ) + ) + (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-wade-stance) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (go target-duck-walk #f) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (when (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #t)) + (sound-play "swim-stroke") + (spawn-ripples (-> self water) 1.4 (-> self control trans) 0 (-> self control transv) #f) + (go target-attack) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t)) + (go target-running-attack) + ) + ) + :code (behavior () + (let ((gp-0 105) + (f30-0 0.0) + ) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 jakb-walk-ja) (= v1-2 jakb-run-ja))) + (set! gp-0 15) + (set! f30-0 (ja-frame-num 0)) + ) + ((let ((v1-9 (ja-group))) + (and v1-9 (or (= v1-9 jakb-jump-ja) (= v1-9 jakb-jump-loop-ja))) + ) + (set! gp-0 30) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (= v1-16 jakb-swim-walk-ja)) + ) + (set! gp-0 120) + ) + ) + ) + (cond + ((and (= (ja-group-size) 6) (let ((v1-25 (ja-group))) + (and v1-25 (= v1-25 jakb-wade-shallow-walk-ja)) + ) + ) + ) + (else + (ja-channel-push! 6 (the-as time-frame gp-0)) + (ja :group! jakb-wade-shallow-walk-ja + :num! (identity f30-0) + :dist (-> *TARGET-bank* wade-shallow-walk-cycle-dist) + ) + (ja :chan 1 + :group! jakb-wade-deep-walk-ja + :num! (identity f30-0) + :dist (-> *TARGET-bank* wade-deep-walk-cycle-dist) + ) + (let ((gp-3 (-> self skel root-channel 2))) + (let ((f0-2 0.0)) + (set! (-> gp-3 frame-interp 1) f0-2) + (set! (-> gp-3 frame-interp 0) f0-2) + ) + (set! (-> gp-3 dist) (-> *TARGET-bank* walk-cycle-dist)) + (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim jakb-walk-ja) num-func-identity) + (set! (-> gp-3 frame-num) f30-0) + ) + (let ((gp-4 (-> self skel root-channel 3))) + (let ((f0-4 0.0)) + (set! (-> gp-4 frame-interp 1) f0-4) + (set! (-> gp-4 frame-interp 0) f0-4) + ) + (set! (-> gp-4 dist) (-> *TARGET-bank* walk-down-cycle-dist)) + (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim jakb-walk-down-ja) num-func-identity) + (set! (-> gp-4 frame-num) f30-0) + ) + (let ((gp-5 (-> self skel root-channel 4))) + (let ((f0-6 0.0)) + (set! (-> gp-5 frame-interp 1) f0-6) + (set! (-> gp-5 frame-interp 0) f0-6) + ) + (set! (-> gp-5 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (joint-control-channel-group-eval! gp-5 (the-as art-joint-anim jakb-walk-left-ja) num-func-identity) + (set! (-> gp-5 frame-num) f30-0) + ) + ) + ) + ) + (set! (-> self skel root-channel 2 command) (joint-control-command push)) + (set! (-> self skel root-channel 5 command) (joint-control-command stack)) + (let ((f28-0 0.0) + (f26-0 0.0) + (f30-1 (lerp-scale 1.0 0.0 (-> self control ctrl-xz-vel) 16384.0 32768.0)) + (gp-6 0) + ) + (until #f + (let ((f0-10 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control local-slope-z))))) + (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) + ) + (let ((f1-4 (fabs (- f0-10 f28-0)))) + (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4))))) + ) + (let ((f0-14 (fabs (- f24-0 f26-0)))) + (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))) + ) + ) + (ja :chan 3 :group! jakb-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) + (cond + ((>= f28-0 0.0) + (let ((v1-83 (-> self skel root-channel 3))) + (let ((f0-20 (fabs f28-0))) + (set! (-> v1-83 frame-interp 1) f0-20) + (set! (-> v1-83 frame-interp 0) f0-20) + ) + (set! (-> v1-83 dist) (-> *TARGET-bank* walk-up-cycle-dist)) + (set! (-> v1-83 frame-group) (the-as art-joint-anim jakb-walk-up-ja)) + ) + ) + (else + (let ((v1-86 (-> self skel root-channel 3))) + (let ((f0-22 (fabs f28-0))) + (set! (-> v1-86 frame-interp 1) f0-22) + (set! (-> v1-86 frame-interp 0) f0-22) + ) + (set! (-> v1-86 dist) (-> *TARGET-bank* walk-down-cycle-dist)) + (set! (-> v1-86 frame-group) (the-as art-joint-anim jakb-walk-down-ja)) + ) + ) + ) + (cond + ((>= f26-0 0.0) + (let ((v1-89 (-> self skel root-channel 4))) + (let ((f0-25 (fabs f26-0))) + (set! (-> v1-89 frame-interp 1) f0-25) + (set! (-> v1-89 frame-interp 0) f0-25) + ) + (set! (-> v1-89 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (set! (-> v1-89 frame-group) (the-as art-joint-anim jakb-walk-right-ja)) + ) + ) + (else + (let ((v1-92 (-> self skel root-channel 4))) + (let ((f0-27 (fabs f26-0))) + (set! (-> v1-92 frame-interp 1) f0-27) + (set! (-> v1-92 frame-interp 0) f0-27) + ) + (set! (-> v1-92 dist) (-> *TARGET-bank* walk-side-cycle-dist)) + (set! (-> v1-92 frame-group) (the-as art-joint-anim jakb-walk-left-ja)) + ) + ) + ) + (let* ((f0-30 (- (-> self water height) (-> self control trans y))) + (f24-1 + (lerp-scale + 0.0 + 1.0 + f0-30 + (lerp (-> self water wade-height) (-> self water swim-height) 0.25) + (lerp (-> self water wade-height) (-> self water swim-height) 0.75) + ) + ) + ) + (let ((v1-100 (-> self skel effect))) + (set! (-> v1-100 channel-offset) (if (< 0.5 f24-1) + 1 + 0 + ) + ) + ) + 0 + (set! f30-1 + (seek f30-1 (lerp-scale 1.0 0.0 (-> self control ctrl-xz-vel) 16384.0 32768.0) (* 4.0 (seconds-per-frame))) + ) + (let ((v1-107 (-> self skel root-channel 1))) + (set! (-> v1-107 frame-interp 1) f24-1) + (set! (-> v1-107 frame-interp 0) f24-1) + ) + (ja :num! (loop! + (/ (-> self control ctrl-xz-vel) + (* 60.0 + (/ (* (current-cycle-distance (-> self skel)) (-> self control scale x)) (-> *TARGET-bank* run-cycle-length)) + ) + ) + ) + ) + (let ((s5-3 (-> self skel root-channel 5)) + (f0-44 (lerp f30-1 0.0 f24-1)) + ) + (set! (-> s5-3 frame-interp 1) f0-44) + (set! (-> s5-3 frame-interp 0) f0-44) + ) + ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (ja :chan 3 :num! (chan 0)) + (ja :chan 4 :num! (chan 0)) + (when (and (time-elapsed? (the-as time-frame gp-6) (seconds 0.2)) + (< (- (-> self water height) (-> self control trans y)) 4096.0) + ) + (case (the int (ja-aframe-num 0)) + ((15 16 17 18) + (spawn-ripples + (-> self water) + 0.2 + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg Rtoes)) + 0 + (vector-float*! (new 'stack-no-clear 'vector) (-> self control transv) 2.5) + #f + ) + (set! gp-6 (the-as int (current-time))) + ) + ((46 47 48 49) + (spawn-ripples + (-> self water) + 0.2 + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg Ltoes)) + 0 + (vector-float*! (new 'stack-no-clear 'vector) (-> self control transv) 2.5) + #f + ) + (set! gp-6 (the-as int (current-time))) + ) + ) + ) + (suspend) + ) + ) + #f + ) + :post target-post + ) + +;; definition for function target-swim-tilt +(defbehavior target-swim-tilt target ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)))) + (let ((v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ))) + (f0-1 (fmin 1.0 (* arg0 (/ (-> self control ctrl-xz-vel) (-> self control current-surface target-speed))))) + ) + (seek! + (-> self control unknown-float43) + (fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3)) + (* arg1 (seconds-per-frame)) + ) + ) + (let ((a2-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)))) + (forward-up-nopitch->quaternion (-> self control override-quat) gp-0 a2-2) + ) + ) + (quaternion-rotate-x! + (-> self control override-quat) + (-> self control override-quat) + (if (>= (-> self control unknown-float43) 0.0) + 16384.0 + -16384.0 + ) + ) + (set! (-> self control override-quat-alpha) (fabs (-> self control unknown-float43))) + (if (and (-> self next-state) (= (-> self next-state name) 'target-swim-down)) + (seek! (-> self control unknown-float001) -6144.0 (* 4096.0 (seconds-per-frame))) + (seek! (-> self control unknown-float001) 0.0 (* 2048.0 (seconds-per-frame))) + ) + (set! (-> self control draw-offset y) (-> self control unknown-float001)) + ) + +;; failed to figure out what this is: +(defstate target-swim (target) + :event target-standard-event-handler + :code nothing + :post target-swim-post + ) + +;; failed to figure out what this is: +(defstate target-swim-stance (target) + :parent target-swim + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *swim-mods*) + (logior! (-> self water flags) (water-flag swim-ground)) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + ) + :exit (behavior () + (target-state-hook-exit) + (set! (-> self control mod-surface target-speed) 28672.0) + (target-exit) + (when (not (and (-> self next-state) (begin (-> self next-state name) (state-type? (-> self next-state) 'target-swim))) + ) + (quaternion-identity! (-> self control override-quat)) + (set! (-> self control override-quat-alpha) 0.0) + ) + (when (not (and (-> self next-state) (let ((v1-14 (-> self next-state name))) + (or (= v1-14 'target-swim-stance) (= v1-14 'target-swim-walk)) + ) + ) + ) + (let ((v1-15 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-15 command) (sound-command set-param)) + (set! (-> v1-15 id) (-> self control board-jump-and-swim-sound)) + (set! (-> v1-15 params volume) -4) + (set! (-> v1-15 auto-time) 960) + (set! (-> v1-15 auto-from) 2) + (set! (-> v1-15 params mask) (the-as uint 17)) + (-> v1-15 id) + ) + ) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (logtest? (-> self control status) (collide-status on-surface)) + (not (logtest? (-> self control status) (collide-status on-water))) + ) + (set-zero! (-> self water bob)) + ) + (when (and (not (logtest? (water-flag swimming) (-> self water flags))) + (time-elapsed? (-> self state-time) (seconds 0.1)) + ) + (if (logtest? (water-flag wading) (-> self water flags)) + (go target-wade-stance) + (go target-stance) + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) + ) + (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle square) + ) + (-> *setting-control* user-current dive) + (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) + ) + (spawn-ripples (-> self water) 0.7 (-> self control trans) 1 *null-vector* #t) + (set! (-> self control unknown-float43) 0.0) + (go target-swim-down) + ) + (if (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (let ((gp-0 (ja-group))) + (ja-aframe-num 0) + (if (or (and (= gp-0 jakb-swim-up-ja) #t) (and (= gp-0 jakb-swim-down-to-up-ja) #t)) + #f + #t + ) + ) + ) + (go target-swim-walk) + ) + (target-swim-tilt 0.0 2.0 0.0 1.0) + (sound-play "swim-bubbles" :id (-> self control board-jump-and-swim-sound)) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 jakb-swim-up-ja) (= v1-2 jakb-swim-down-to-up-ja))) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! jakb-swim-up-to-stance-ja + :num! (seek! max (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 1.0 + 2.0 + ) + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (let ((a0-9 (-> self skel root-channel 0))) + (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) + (let ((v1-38 (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 1.0 + 2.0 + ) + ) + ) + (set! (-> a0-9 param 1) v1-38) + ) + (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + (else + (let ((v1-43 (ja-group))) + (if (and v1-43 (= v1-43 jakb-swim-walk-ja)) + (ja-channel-push! 1 (seconds 0.83)) + (ja-channel-push! 1 (seconds 0.15)) + ) + ) + ) + ) + ) + (until #f + (ja :group! jakb-swim-stance-ja :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (can-play-stance-amibent?) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate target-swim-walk (target) + :parent target-swim + :enter (behavior () + ((-> target-swim-stance enter)) + (die-on-next-update! (-> self water bob)) + (set! (-> self control unknown-word04) (the-as uint (current-time))) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + ) + :exit (-> target-swim-stance exit) + :trans (behavior () + ((-> self state-hook)) + (if (and (logtest? (-> self control status) (collide-status on-surface)) + (not (logtest? (-> self control status) (collide-status on-water))) + ) + (set-zero! (-> self water bob)) + ) + (when (and (not (logtest? (water-flag swimming) (-> self water flags))) + (time-elapsed? (-> self water swim-time) (seconds 0.1)) + ) + (if (logtest? (water-flag wading) (-> self water flags)) + (go target-wade-stance) + (go target-stance) + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) + ) + (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle square) + ) + (-> *setting-control* user-current dive) + (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) + ) + (spawn-ripples (-> self water) 0.7 (-> self control trans) 1 *null-vector* #t) + (set! (-> self control unknown-float43) 0.0) + (go target-swim-down) + ) + (cond + ((= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (if (>= (the-as uint (- (current-time) (the-as int (-> self control unknown-word04)))) (the-as uint 15)) + (go target-swim-stance) + ) + ) + (else + (set! (-> self control unknown-word04) (the-as uint (current-time))) + ) + ) + (target-swim-tilt 0.0 2.0 0.0 1.0) + (sound-play "swim-bubbles" :id (-> self control board-jump-and-swim-sound)) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 jakb-swim-up-ja) (= v1-2 jakb-swim-down-to-up-ja) (= v1-2 jakb-swim-up-to-stance-ja))) + (ja-channel-push! 1 (seconds 0.3)) + ) + ((let ((v1-8 (ja-group))) + (and v1-8 (= v1-8 jakb-swim-up-to-stance-ja)) + ) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! jakb-swim-walk-ja :num! (seek!) :frame-num (ja-aframe 19.0 0)) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (if (not (logtest? (-> self align flags) (align-flags disabled))) + (set! (-> self control mod-surface target-speed) + (* (-> self align delta trans z) (-> self control current-surface alignv) (-> self clock frames-per-second)) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.15)) + ) + ) + ) + (until #f + (ja-no-eval :group! jakb-swim-walk-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (if (not (logtest? (-> self align flags) (align-flags disabled))) + (set! (-> self control mod-surface target-speed) + (* (-> self align delta trans z) (-> self control current-surface alignv) (-> self clock frames-per-second)) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate target-swim-down (target) + :parent target-swim + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (t0-7 symbol)) + (case message + (('attack 'attack-invinc 'attack-or-shove) + (let ((v1-1 (the-as attack-info (-> block param 1)))) + (set! t0-7 (or (not (logtest? (-> v1-1 mask) (attack-mask mode))) + (case (-> v1-1 mode) + (('bot 'lava 'melt 'dark-eco-pool) + #f + ) + (('drown-death 'sharkey 'instant-death 'crush 'death 'grenade 'endlessfall) + (set! t0-7 'drown-death) + (set! (-> v1-1 mode) t0-7) + t0-7 + ) + (else + #t + ) + ) + ) + ) + (when t0-7 + (if (not (logtest? (attack-mask damage) (-> v1-1 mask))) + (set! (-> v1-1 damage) (-> *FACT-bank* health-single-inc)) + ) + (if (!= (-> v1-1 mode) 'drown-death) + (set! (-> v1-1 mode) 'damage) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (- (-> self fact health) (-> v1-1 damage)))) + (set! (-> v1-1 mode) 'drown-death) + ) + (logior! (-> v1-1 mask) (attack-mask mode)) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + ) + ) + (('slide) + ) + ) + (target-standard-event-handler proc argc message block) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (logclear! (-> self water flags) (water-flag swim-ground)) + (set! (-> self control mod-surface) *dive-mods*) + (set! (-> self control dynam gravity-max) 16384.0) + (set! (-> self control dynam gravity-length) 16384.0) + (set-time! (-> self water swim-time)) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self neck flex-blend) 0.0) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (target-exit) + (when (not (and (-> self next-state) (let ((v1-11 (-> self next-state name))) + (or (= v1-11 'target-swim-stance) + (= v1-11 'target-swim-walk) + (= v1-11 'target-swim-down) + (= v1-11 'target-swim-up) + ) + ) + ) + ) + (quaternion-identity! (-> self control override-quat)) + (set! (-> self control override-quat-alpha) 0.0) + ) + (when (not (and (-> self next-state) (let ((v1-19 (-> self next-state name))) + (or (= v1-19 'target-swim-down) (= v1-19 'target-swim-up)) + ) + ) + ) + (let ((v1-21 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-21 command) (sound-command set-param)) + (set! (-> v1-21 id) (-> self control bubbles-sound)) + (set! (-> v1-21 params volume) -4) + (set! (-> v1-21 auto-time) 960) + (set! (-> v1-21 auto-from) 2) + (set! (-> v1-21 params mask) (the-as uint 17)) + (-> v1-21 id) + ) + ) + (set! (-> self neck flex-blend) 1.0) + ) + :trans (behavior () + (if (time-elapsed? (-> self water swim-time) (seconds 0.5)) + (go target-stance) + ) + (cond + ((time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) + (set! (-> self control mod-surface) *dive-mods*) + (if (and (-> self next-state) (= (-> self next-state name) 'target-swim-down)) + (target-swim-tilt -0.9 1.0 0.0 0.5) + ) + ) + (else + (set! (-> self control mod-surface) *dive-bottom-mods*) + (if (and (-> self next-state) (let ((v1-18 (-> self next-state name))) + (or (= v1-18 'target-swim-down) (= v1-18 'target-swim-stance)) + ) + ) + (target-swim-tilt 0.0 2.0 -1.0 1.0) + ) + ) + ) + ) + :code (behavior () + (let ((gp-0 60) + (s5-0 3000) + (f30-0 0.0) + ) + (let ((v1-2 (ja-group))) + (set! f30-0 + (cond + ((and v1-2 (or (= v1-2 jakb-swim-stance-ja) + (= v1-2 jakb-swim-walk-ja) + (= v1-2 jakb-swim-up-to-stance-ja) + (= v1-2 jakb-swim-up-ja) + (= v1-2 jakb-swim-down-to-up-ja) + ) + ) + (let ((t9-0 ja-channel-push!) + (a0-16 1) + (v1-7 (ja-group)) + ) + (t9-0 a0-16 (the-as time-frame (if (and v1-7 (= v1-7 jakb-swim-down-to-up-ja)) + 105 + 22 + ) + ) + ) + ) + (let ((s4-0 #f)) + (ja-no-eval :group! jakb-swim-walk-to-down-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) + (when (and (>= (ja-aframe-num 0) 73.0) (not s4-0)) + (set! s4-0 #t) + (when (or (= (-> self prev-state name) 'target-swim-stance) (= (-> self prev-state name) 'target-swim-walk)) + (sound-play "swim-dive") + (spawn-ripples (-> self water) 0.7 (-> self control trans) 1 *null-vector* #f) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja :group! jakb-swim-down-ja :num! min) + f30-0 + ) + (else + (let ((v1-59 (ja-group))) + (cond + ((and v1-59 (or (= v1-59 jakb-flop-down-ja) + (= v1-59 jakb-moving-flop-down-ja) + (= v1-59 jakb-flop-down-loop-ja) + (= v1-59 jakb-moving-flop-down-loop-ja) + ) + ) + (ja-channel-push! 1 (seconds 0.075)) + (set! gp-0 120) + (ja :group! jakb-swim-down-ja :num! (identity (ja-aframe 124.0 0))) + -16384.0 + ) + (else + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! jakb-swim-down-ja :num! min) + f30-0 + ) + ) + ) + ) + ) + ) + ) + (until #f + (when (and (!= (-> self tobot?) 'tobot) (time-elapsed? (-> self state-time) (seconds 0.05))) + (if (and (or (not (cpad-hold? (-> self control cpad number) circle square)) + (-> self control unknown-spool-anim00) + (not (-> *setting-control* user-current dive)) + ) + (time-elapsed? (-> self state-time) gp-0) + ) + (go target-swim-up) + ) + (if (or (time-elapsed? (-> self control unknown-time-frame27) s5-0) + (and (logtest? (-> self control status) (collide-status on-surface)) + (and (< (-> self water swim-depth) 8192.0) (time-elapsed? (-> self state-time) gp-0)) + ) + ) + (go target-swim-up) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) + (sound-play "water-bubbles" :id (-> self control bubbles-sound)) + ) + (let ((s4-4 (new-stack-vector0)) + (f0-13 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! s4-4 (-> self control transv) (vector-float*! s4-4 (-> self control dynam gravity-normal) f0-13)) + (let* ((f28-0 (vector-length s4-4)) + (f26-0 f28-0) + (f24-0 (+ f0-13 f30-0)) + ) + (set! f30-0 (seek f30-0 0.0 (* 32768.0 (seconds-per-frame)))) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f24-0) + (vector-float*! s4-4 s4-4 (/ f28-0 f26-0)) + ) + ) + ) + (suspend) + (ja :num! (loop! (lerp-scale 0.4 1.0 (vector-length (-> self control transv)) 0.0 16384.0))) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate target-swim-up (target) + :parent target-swim + :event (-> target-swim-down event) + :enter (behavior () + ((-> target-swim-down enter)) + ) + :exit (-> target-swim-down exit) + :trans (behavior () + (if (and (cpad-pressed? (-> self control cpad number) x) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + (not (logtest? (water-flag head-under-water bouncing) (-> self water flags))) + ) + (go + target-swim-jump-jump + (-> *TARGET-bank* swim-jump-height-min) + (-> *TARGET-bank* swim-jump-height-max) + (the-as surface #f) + ) + ) + (if (and (time-elapsed? (-> self state-time) (seconds 10)) + (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + ) + (send-event self 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'drown-death) + ) + ) + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle square) + (-> *setting-control* user-current dive) + (or (not (time-elapsed? (-> self control unknown-time-frame27) (seconds 10))) + (logtest? (-> self control status) (collide-status touch-ceiling)) + ) + (and (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) + (time-elapsed? (-> self state-time) (seconds 0.05)) + ) + ) + (go target-swim-down) + ) + (sound-play "water-bubbles" :id (-> self control bubbles-sound)) + ((-> target-swim-down trans)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 1.0)) + (let ((s5-0 #t) + (gp-0 #f) + ) + (ja-no-eval :group! jakb-swim-down-to-up-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (target-swim-tilt + (if (< 8192.0 (-> self water swim-depth)) + 0.5 + 0.0 + ) + 1.0 + 0.0 + 0.1 + ) + (when (and (not gp-0) + (or (>= (ja-aframe-num 0) 240.0) (not (logtest? (water-flag head-under-water) (-> self water flags)))) + ) + (set! gp-0 #t) + (sound-play "swim-surface") + (spawn-ripples (-> self water) 0.2 (-> self control trans) 1 (-> self control transv) #t) + ) + (if (and (not (logtest? (-> self water flags) (water-flag under-water))) + (and (or (>= (ja-aframe-num 0) 222.0) + (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (>= (ja-aframe-num 0) 200.0)) + ) + (!= (-> self tobot?) 'tobot) + ) + ) + (goto cfg-51) + ) + (compute-alignment! (-> self align)) + (when (not (logtest? (-> self water flags) (water-flag under-water))) + (logior! (-> self water flags) (water-flag swim-ground)) + (set! s5-0 #f) + ) + (if s5-0 + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja :group! jakb-swim-up-ja :num! min) + (until #f + (target-swim-tilt + (if (< 8192.0 (-> self water swim-depth)) + 0.3 + 0.0 + ) + 1.0 + 0.0 + 0.1 + ) + (if (and (not (logtest? (-> self water flags) (water-flag under-water))) (!= (-> self tobot?) 'tobot)) + (goto cfg-51) + ) + (if (cpad-pressed? (-> self control cpad number) x) + (set! f30-0 2.0) + ) + (compute-alignment! (-> self align)) + (when (logtest? (-> self water flags) (water-flag under-water)) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0) + (set! (-> self control transv y) (+ 8192.0 (* 8192.0 f30-0))) + ) + (suspend) + (ja :num! (loop! f30-0)) + (set! f30-0 (seek f30-0 1.0 (seconds-per-frame))) + ) + ) + #f + (label cfg-51) + (logior! (-> self water flags) (water-flag swim-ground)) + (set-time! (-> self water swim-time)) + (start-bobbing! (-> self water) -4096.0 600 1500) + (set! (-> self water bob start-time) (+ (current-time) (seconds -0.05))) + (go target-swim-stance) + ) + ) + +;; failed to figure out what this is: +(defstate target-swim-jump-jump (target) + :parent target-swim + :event (-> target-jump event) + :enter (-> target-jump enter) + :exit target-exit + :trans (behavior () + (cond + ((not (time-elapsed? (-> self state-time) (seconds 0.5))) + (logior! (-> self water flags) (water-flag jump-out)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + ) + (else + (set! (-> self trans-hook) (-> target-jump trans)) + ) + ) + ((-> target-jump trans)) + ) + :code (-> target-jump code) + ) + +;; failed to figure out what this is: +(defstate target-swim-jump (target) + :event target-standard-event-handler + :enter (-> target-swim-stance enter) + :exit (behavior () + ((-> target-swim-stance exit)) + (die-on-next-update! (-> self water bob)) + (set! (-> self water align-offset) 0.0) + (logior! (-> self water flags) (water-flag jump-out)) + ) + :code (behavior ((arg0 float) (arg1 float)) + (die-on-next-update! (-> self water bob)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! jakb-swim-jump-ja :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (compute-alignment! (-> self align)) + (if (not (logtest? (-> self align flags) (align-flags disabled))) + (+! (-> self water align-offset) (* 0.6 (-> self align delta trans y))) + ) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek! max 2.0)) + ) + ) + (let ((f0-7 (fmax 0.0 (- (-> self water bob-offset))))) + (let ((v1-36 (new-stack-vector0))) + (let ((f1-5 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-36 (-> self control transv) (vector-float*! v1-36 (-> self control dynam gravity-normal) f1-5)) + ) + (let* ((f1-6 (vector-length v1-36)) + (f2-2 f1-6) + (f3-0 0.4096) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f3-0) + (vector-float*! v1-36 v1-36 (/ f1-6 f2-2)) + ) + ) + ) + (go target-swim-jump-jump (+ f0-7 arg0) (+ f0-7 arg1) (the-as surface #f)) + ) + ) + :post target-post + ) diff --git a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc new file mode 100644 index 00000000000..f6ec59d4282 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc @@ -0,0 +1,2602 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-jchar jakb jakb-lod0-jg -1 + ((jakb-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :texture-level 10 + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 1 + ) + +;; failed to figure out what this is: +(defskelgroup skel-jchar-normal jakb jakb-lod0-jg -1 + ((jak-ext-geo-c+0-jakclod0-skirt-cg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :shadow jak-ext-geo-c+0-jakclod0-sash-cg + :texture-level 10 + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 1 + ) + +;; failed to figure out what this is: +(defskelgroup skel-jchar-old jakb jakb-lod0-jg -1 + ((jakb-old-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :texture-level 10 + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 1 + ) + +;; failed to figure out what this is: +(defskelgroup skel-jchar-c jakb jakb-lod0-jg -1 + ((jakb-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :shadow jakb-c-shadow-mg + :texture-level 10 + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 1 + :clothing (((mesh 10) + (gravity-constant (meters 16)) + (wind-constant 0.5) + (cloth-width 13) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-skirt") + (tex-name2 "jakc-skirt") + (tex-name3 "jakc-skirt") + (alt-tex-name "jakc-jacketbody") + (alt-tex-name2 "jakc-jacketbody") + (alt-tex-name3 "jakc-jacketbody") + (cloth-thickness 1.0) + (initial-xform 3) + (drag 0.151) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + ) + ((mesh 11) + (gravity-constant (meters 32)) + (wind-constant 0.75) + (cloth-width 6) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-skirt") + (tex-name2 "jakc-skirt") + (tex-name3 "jakc-skirt") + (alt-tex-name "jakc-jacketbody") + (alt-tex-name2 "jakc-jacketbody") + (alt-tex-name3 "jakc-jacketbody") + (cloth-thickness 1.0) + (initial-xform 3) + (drag 0.251) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + ) + ((mesh 12) + (gravity-constant (meters 16)) + (wind-constant 1.25) + (cloth-width 6) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-scarfhanging") + (tex-name2 "jakc-scarfhanging") + (tex-name3 "jakc-scarfhanging") + (alt-tex-name "jakc-eyebrow-norm") + (alt-tex-name2 "jakc-eyebrow-norm") + (alt-tex-name3 "jakc-eyebrow-norm") + (cloth-thickness 2.0) + (initial-xform 5) + (drag 0.151) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-jchar-wings jakb jakb-wings-wings-lod0-jg -1 + ((jakb-wings-wings-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :shadow jakb-walk-down-ja + :texture-level 10 + :sort 2 + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 4 + ) + +;; failed to figure out what this is: +(defskelgroup skel-jchar-shield jakb jakb-shield-shield-lod0-jg -1 + ((jakb-shield-shield-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :texture-level 10 + :shadow-joint-index 3 + :light-index 5 + ) + +;; definition for symbol *target-shadow-control*, type shadow-control +(define *target-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #x2)) + :shadow-dir (new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0) + :bot-plane (new 'static 'plane :y 1.0 :w 37683.2) + :top-plane (new 'static 'plane :y 1.0 :w 4096.0) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-jak-highres jak-highres jak-highres-lod0-jg jak-highres-idle-ja + ((jak-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :shadow jak-highres-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + :light-index 1 + ) + +;; failed to figure out what this is: +(defskelgroup skel-jakc-highres jakc-highres jakc-highres-lod0-jg jakc-highres-idle-ja + ((jakc-highres-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :longest-edge (meters 1) + :shadow jakc-highres-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + :clothing (((mesh jakc-highres-jakcfma0-skirt-cg) + (gravity-constant (meters 16)) + (wind-constant 0.5) + (cloth-width 13) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-skirt") + (tex-name2 "jakc-skirt") + (tex-name3 "jakc-skirt") + (cloth-thickness 1.0) + (initial-xform 3) + (drag 0.151) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + (timestep-frequency 7) + ) + ((mesh jakc-highres-jakcfma0-sash-cg) + (gravity-constant (meters 32)) + (wind-constant 0.75) + (cloth-width 6) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-skirt") + (tex-name2 "jakc-skirt") + (tex-name3 "jakc-skirt") + (cloth-thickness 1.0) + (initial-xform 3) + (drag 0.251) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + (timestep-frequency 7) + ) + ((mesh jakc-highres-jakcfma0-scarf-cg) + (gravity-constant (meters 16)) + (wind-constant 1.25) + (cloth-width 6) + (flags (cloth-flag use-wind double-sided)) + (tex-name "jakc-scarfhanging") + (tex-name2 "jakc-scarfhanging") + (tex-name3 "jakc-scarfhanging") + (cloth-thickness 2.0) + (initial-xform 4) + (drag 0.151) + (ball-collision-radius (meters 0.05)) + (num-iterations 1) + (timestep-frequency 7) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-generic-blast collectables collectables-generic-blast-lod0-jg collectables-generic-blast-idle-ja + ((collectables-generic-blast-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + :texture-level 10 + :light-index 4 + ) + +;; failed to figure out what this is: +(defskelgroup skel-generic-ripples collectables collectables-generic-ripples-lod0-jg collectables-generic-ripples-idle-ja + ((collectables-generic-ripples-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + :texture-level 10 + :light-index 4 + ) + +;; failed to figure out what this is: +(defskelgroup skel-bomb-blast collectables collectables-bomb-blast-lod0-jg collectables-bomb-blast-idle-ja + ((collectables-bomb-blast-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + :texture-level 10 + :light-index 4 + ) + +;; definition of type target-bank +(deftype target-bank (basic) + ((jump-collide-offset meters) + (jump-height-min meters) + (jump-height-max meters) + (double-jump-height-min meters) + (double-jump-height-max meters) + (flip-jump-height-min meters) + (flip-jump-height-max meters) + (duck-jump-height-min meters) + (duck-jump-height-max meters) + (flop-jump-height-min meters) + (flop-jump-height-max meters) + (attack-jump-height-min meters) + (attack-jump-height-max meters) + (edge-grab-jump-height-min meters) + (edge-grab-jump-height-max meters) + (swim-jump-height-min meters) + (swim-jump-height-max meters) + (tube-jump-height-min meters) + (tube-jump-height-max meters) + (carry-jump-height-min meters) + (carry-jump-height-max meters) + (mech-jump-height-min meters) + (mech-jump-height-max meters) + (mech-carry-jump-height-min meters) + (mech-carry-jump-height-max meters) + (indax-jump-height-min meters) + (indax-jump-height-max meters) + (indax-double-jump-height-min meters) + (indax-double-jump-height-max meters) + (roll-duration time-frame) + (roll-jump-pre-window time-frame) + (roll-jump-post-window time-frame) + (roll-timeout time-frame) + (roll-speed-min meters) + (roll-speed-inc meters) + (roll-flip-duration time-frame) + (roll-flip-height meters) + (roll-flip-dist meters) + (roll-flip-art-height meters) + (roll-flip-art-dist meters) + (duck-slide-distance meters) + (fall-far meters) + (fall-far-inc meters) + (attack-timeout time-frame) + (ground-timeout time-frame) + (slide-down-timeout time-frame) + (fall-timeout time-frame) + (fall-stumble-threshold meters) + (yellow-projectile-speed meters) + (hit-invulnerable-timeout time-frame) + (same-attack-invulnerable-timeout time-frame) + (run-cycle-length float) + (walk-cycle-dist meters) + (walk-up-cycle-dist meters) + (walk-down-cycle-dist meters) + (walk-side-cycle-dist meters) + (run-cycle-dist meters) + (run-up-cycle-dist meters) + (run-down-cycle-dist meters) + (run-side-cycle-dist meters) + (run-wall-cycle-dist meters) + (duck-walk-cycle-dist meters) + (wade-shallow-walk-cycle-dist meters) + (wade-deep-walk-cycle-dist meters) + (mech-walk-cycle-dist meters) + (mech-run-cycle-dist meters) + (smack-surface-dist meters) + (smack-surface-height meters) + (min-dive-depth meters) + (root-radius meters) + (root-offset vector :inline) + (body-radius meters) + (edge-radius meters) + (edge-offset vector :inline) + (edge-grab-height-off-ground meters) + (head-radius meters) + (head-height meters) + (head-offset vector :inline) + (spin-radius meters) + (spin-offset vector :inline) + (duck-spin-radius meters) + (duck-spin-offset vector :inline) + (punch-radius meters) + (punch-offset vector :inline) + (uppercut-radius meters) + (uppercut0-offset vector :inline) + (uppercut1-offset vector :inline) + (flop-radius meters) + (flop0-offset vector :inline) + (flop1-offset vector :inline) + (stuck-time seconds) + (stuck-timeout seconds) + (stuck-distance meters) + (tongue-pull-speed-min float) + (tongue-pull-speed-max float) + (yellow-attack-timeout time-frame) + (fall-height meters) + (mech-jump-thrust-fuel float) + (strafe-jump-pre-window time-frame) + (strafe-jump basic) + (strafe-duck-jump basic) + (dark-jump-height-min meters) + (dark-jump-height-max meters) + (ladder-walk-up-speed meters) + (ladder-walk-down-speed meters) + (ladder-slide-speed meters) + (invisible-duration time-frame) + (mech-walk-carry-cycle-dist meters) + ) + ) + +;; definition for method 3 of type target-bank +(defmethod inspect ((this target-bank)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tjump-collide-offset: (meters ~m)~%" (-> this jump-collide-offset)) + (format #t "~1Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) + (format #t "~1Tjump-height-max: (meters ~m)~%" (-> this jump-height-max)) + (format #t "~1Tdouble-jump-height-min: (meters ~m)~%" (-> this double-jump-height-min)) + (format #t "~1Tdouble-jump-height-max: (meters ~m)~%" (-> this double-jump-height-max)) + (format #t "~1Tflip-jump-height-min: (meters ~m)~%" (-> this flip-jump-height-min)) + (format #t "~1Tflip-jump-height-max: (meters ~m)~%" (-> this flip-jump-height-max)) + (format #t "~1Tduck-jump-height-min: (meters ~m)~%" (-> this duck-jump-height-min)) + (format #t "~1Tduck-jump-height-max: (meters ~m)~%" (-> this duck-jump-height-max)) + (format #t "~1Tflop-jump-height-min: (meters ~m)~%" (-> this flop-jump-height-min)) + (format #t "~1Tflop-jump-height-max: (meters ~m)~%" (-> this flop-jump-height-max)) + (format #t "~1Tattack-jump-height-min: (meters ~m)~%" (-> this attack-jump-height-min)) + (format #t "~1Tattack-jump-height-max: (meters ~m)~%" (-> this attack-jump-height-max)) + (format #t "~1Tedge-grab-jump-height-min: (meters ~m)~%" (-> this edge-grab-jump-height-min)) + (format #t "~1Tedge-grab-jump-height-max: (meters ~m)~%" (-> this edge-grab-jump-height-max)) + (format #t "~1Tswim-jump-height-min: (meters ~m)~%" (-> this swim-jump-height-min)) + (format #t "~1Tswim-jump-height-max: (meters ~m)~%" (-> this swim-jump-height-max)) + (format #t "~1Ttube-jump-height-min: (meters ~m)~%" (-> this tube-jump-height-min)) + (format #t "~1Ttube-jump-height-max: (meters ~m)~%" (-> this tube-jump-height-max)) + (format #t "~1Tcarry-jump-height-min: (meters ~m)~%" (-> this carry-jump-height-min)) + (format #t "~1Tcarry-jump-height-max: (meters ~m)~%" (-> this carry-jump-height-max)) + (format #t "~1Tmech-jump-height-min: (meters ~m)~%" (-> this mech-jump-height-min)) + (format #t "~1Tmech-jump-height-max: (meters ~m)~%" (-> this mech-jump-height-max)) + (format #t "~1Tmech-carry-jump-height-min: (meters ~m)~%" (-> this mech-carry-jump-height-min)) + (format #t "~1Tmech-carry-jump-height-max: (meters ~m)~%" (-> this mech-carry-jump-height-max)) + (format #t "~1Tindax-jump-height-min: (meters ~m)~%" (-> this indax-jump-height-min)) + (format #t "~1Tindax-jump-height-max: (meters ~m)~%" (-> this indax-jump-height-max)) + (format #t "~1Tindax-double-jump-height-min: (meters ~m)~%" (-> this indax-double-jump-height-min)) + (format #t "~1Tindax-double-jump-height-max: (meters ~m)~%" (-> this indax-double-jump-height-max)) + (format #t "~1Troll-duration: ~D~%" (-> this roll-duration)) + (format #t "~1Troll-jump-pre-window: ~D~%" (-> this roll-jump-pre-window)) + (format #t "~1Troll-jump-post-window: ~D~%" (-> this roll-jump-post-window)) + (format #t "~1Troll-timeout: ~D~%" (-> this roll-timeout)) + (format #t "~1Troll-speed-min: (meters ~m)~%" (-> this roll-speed-min)) + (format #t "~1Troll-speed-inc: (meters ~m)~%" (-> this roll-speed-inc)) + (format #t "~1Troll-flip-duration: ~D~%" (-> this roll-flip-duration)) + (format #t "~1Troll-flip-height: (meters ~m)~%" (-> this roll-flip-height)) + (format #t "~1Troll-flip-dist: (meters ~m)~%" (-> this roll-flip-dist)) + (format #t "~1Troll-flip-art-height: (meters ~m)~%" (-> this roll-flip-art-height)) + (format #t "~1Troll-flip-art-dist: (meters ~m)~%" (-> this roll-flip-art-dist)) + (format #t "~1Tduck-slide-distance: (meters ~m)~%" (-> this duck-slide-distance)) + (format #t "~1Tfall-far: (meters ~m)~%" (-> this fall-far)) + (format #t "~1Tfall-far-inc: (meters ~m)~%" (-> this fall-far-inc)) + (format #t "~1Tattack-timeout: ~D~%" (-> this attack-timeout)) + (format #t "~1Tground-timeout: ~D~%" (-> this ground-timeout)) + (format #t "~1Tslide-down-timeout: ~D~%" (-> this slide-down-timeout)) + (format #t "~1Tfall-timeout: ~D~%" (-> this fall-timeout)) + (format #t "~1Tfall-stumble-threshold: (meters ~m)~%" (-> this fall-stumble-threshold)) + (format #t "~1Tyellow-projectile-speed: (meters ~m)~%" (-> this yellow-projectile-speed)) + (format #t "~1Thit-invulnerable-timeout: ~D~%" (-> this hit-invulnerable-timeout)) + (format #t "~1Tsame-attack-invulnerable-timeout: ~D~%" (-> this same-attack-invulnerable-timeout)) + (format #t "~1Trun-cycle-length: ~f~%" (-> this run-cycle-length)) + (format #t "~1Twalk-cycle-dist: (meters ~m)~%" (-> this walk-cycle-dist)) + (format #t "~1Twalk-up-cycle-dist: (meters ~m)~%" (-> this walk-up-cycle-dist)) + (format #t "~1Twalk-down-cycle-dist: (meters ~m)~%" (-> this walk-down-cycle-dist)) + (format #t "~1Twalk-side-cycle-dist: (meters ~m)~%" (-> this walk-side-cycle-dist)) + (format #t "~1Trun-cycle-dist: (meters ~m)~%" (-> this run-cycle-dist)) + (format #t "~1Trun-up-cycle-dist: (meters ~m)~%" (-> this run-up-cycle-dist)) + (format #t "~1Trun-down-cycle-dist: (meters ~m)~%" (-> this run-down-cycle-dist)) + (format #t "~1Trun-side-cycle-dist: (meters ~m)~%" (-> this run-side-cycle-dist)) + (format #t "~1Trun-wall-cycle-dist: (meters ~m)~%" (-> this run-wall-cycle-dist)) + (format #t "~1Tduck-walk-cycle-dist: (meters ~m)~%" (-> this duck-walk-cycle-dist)) + (format #t "~1Twade-shallow-walk-cycle-dist: (meters ~m)~%" (-> this wade-shallow-walk-cycle-dist)) + (format #t "~1Twade-deep-walk-cycle-dist: (meters ~m)~%" (-> this wade-deep-walk-cycle-dist)) + (format #t "~1Tmech-walk-cycle-dist: (meters ~m)~%" (-> this mech-walk-cycle-dist)) + (format #t "~1Tmech-run-cycle-dist: (meters ~m)~%" (-> this mech-run-cycle-dist)) + (format #t "~1Tsmack-surface-dist: (meters ~m)~%" (-> this smack-surface-dist)) + (format #t "~1Tsmack-surface-height: (meters ~m)~%" (-> this smack-surface-height)) + (format #t "~1Tmin-dive-depth: (meters ~m)~%" (-> this min-dive-depth)) + (format #t "~1Troot-radius: (meters ~m)~%" (-> this root-radius)) + (format #t "~1Troot-offset: ~`vector`P~%" (-> this root-offset)) + (format #t "~1Tbody-radius: (meters ~m)~%" (-> this body-radius)) + (format #t "~1Tedge-radius: (meters ~m)~%" (-> this edge-radius)) + (format #t "~1Tedge-offset: ~`vector`P~%" (-> this edge-offset)) + (format #t "~1Tedge-grab-height-off-ground: (meters ~m)~%" (-> this edge-grab-height-off-ground)) + (format #t "~1Thead-radius: (meters ~m)~%" (-> this head-radius)) + (format #t "~1Thead-height: (meters ~m)~%" (-> this head-height)) + (format #t "~1Thead-offset: ~`vector`P~%" (-> this head-offset)) + (format #t "~1Tspin-radius: (meters ~m)~%" (-> this spin-radius)) + (format #t "~1Tspin-offset: ~`vector`P~%" (-> this spin-offset)) + (format #t "~1Tduck-spin-radius: (meters ~m)~%" (-> this duck-spin-radius)) + (format #t "~1Tduck-spin-offset: ~`vector`P~%" (-> this duck-spin-offset)) + (format #t "~1Tpunch-radius: (meters ~m)~%" (-> this punch-radius)) + (format #t "~1Tpunch-offset: ~`vector`P~%" (-> this punch-offset)) + (format #t "~1Tuppercut-radius: (meters ~m)~%" (-> this uppercut-radius)) + (format #t "~1Tuppercut0-offset: ~`vector`P~%" (-> this uppercut0-offset)) + (format #t "~1Tuppercut1-offset: ~`vector`P~%" (-> this uppercut1-offset)) + (format #t "~1Tflop-radius: (meters ~m)~%" (-> this flop-radius)) + (format #t "~1Tflop0-offset: ~`vector`P~%" (-> this flop0-offset)) + (format #t "~1Tflop1-offset: ~`vector`P~%" (-> this flop1-offset)) + (format #t "~1Tstuck-time: (seconds ~e)~%" (-> this stuck-time)) + (format #t "~1Tstuck-timeout: (seconds ~e)~%" (-> this stuck-timeout)) + (format #t "~1Tstuck-distance: (meters ~m)~%" (-> this stuck-distance)) + (format #t "~1Ttongue-pull-speed-min: ~f~%" (-> this tongue-pull-speed-min)) + (format #t "~1Ttongue-pull-speed-max: ~f~%" (-> this tongue-pull-speed-max)) + (format #t "~1Tyellow-attack-timeout: ~D~%" (-> this yellow-attack-timeout)) + (format #t "~1Tfall-height: (meters ~m)~%" (-> this fall-height)) + (format #t "~1Tmech-jump-thrust-fuel: ~f~%" (-> this mech-jump-thrust-fuel)) + (format #t "~1Tstrafe-jump-pre-window: ~D~%" (-> this strafe-jump-pre-window)) + (format #t "~1Tstrafe-jump: ~A~%" (-> this strafe-jump)) + (format #t "~1Tstrafe-duck-jump: ~A~%" (-> this strafe-duck-jump)) + (format #t "~1Tdark-jump-height-min: (meters ~m)~%" (-> this dark-jump-height-min)) + (format #t "~1Tdark-jump-height-max: (meters ~m)~%" (-> this dark-jump-height-max)) + (format #t "~1Tladder-walk-up-speed: (meters ~m)~%" (-> this ladder-walk-up-speed)) + (format #t "~1Tladder-walk-down-speed: (meters ~m)~%" (-> this ladder-walk-down-speed)) + (format #t "~1Tladder-slide-speed: (meters ~m)~%" (-> this ladder-slide-speed)) + (format #t "~1Tinvisible-duration: ~D~%" (-> this invisible-duration)) + (format #t "~1Tmech-walk-carry-cycle-dist: (meters ~m)~%" (-> this mech-walk-carry-cycle-dist)) + (label cfg-4) + this + ) + +;; definition for symbol *TARGET-bank*, type target-bank +(define *TARGET-bank* (new 'static 'target-bank + :jump-collide-offset (meters 0.7) + :jump-height-min (meters 1.01) + :jump-height-max (meters 3.5) + :double-jump-height-min (meters 1) + :double-jump-height-max (meters 2.5) + :flip-jump-height-min (meters 5) + :flip-jump-height-max (meters 7) + :duck-jump-height-min (meters 7) + :duck-jump-height-max (meters 7) + :flop-jump-height-min (meters 5) + :flop-jump-height-max (meters 7) + :attack-jump-height-min (meters 5) + :attack-jump-height-max (meters 6.5) + :edge-grab-jump-height-min (meters 1.7) + :edge-grab-jump-height-max (meters 1.7) + :swim-jump-height-min (meters 5) + :swim-jump-height-max (meters 5) + :tube-jump-height-min (meters 1.75) + :tube-jump-height-max (meters 2.5) + :carry-jump-height-min (meters 1.75) + :carry-jump-height-max (meters 2) + :mech-jump-height-min (meters 1.5) + :mech-jump-height-max (meters 1.5) + :mech-carry-jump-height-min (meters 5) + :mech-carry-jump-height-max (meters 3) + :indax-jump-height-min (meters 1.01) + :indax-jump-height-max (meters 3.5) + :indax-double-jump-height-min (meters 1) + :indax-double-jump-height-max (meters 2.5) + :roll-duration (seconds 0.5) + :roll-jump-pre-window (seconds 1) + :roll-jump-post-window (seconds 0.1) + :roll-speed-min (meters 11.5) + :roll-speed-inc (meters 1.5) + :roll-flip-duration (seconds 0.7) + :roll-flip-height (meters 3.52) + :roll-flip-dist (meters 17.3) + :roll-flip-art-height (meters 3.2969) + :roll-flip-art-dist (meters 12.5) + :duck-slide-distance (meters 5.75) + :fall-far (meters 30) + :fall-far-inc (meters 20) + :attack-timeout (seconds 0.3) + :ground-timeout (seconds 0.2) + :slide-down-timeout (seconds 0.2) + :fall-timeout (seconds 1) + :fall-stumble-threshold (meters 39.9) + :yellow-projectile-speed (meters 60) + :hit-invulnerable-timeout (seconds 1) + :same-attack-invulnerable-timeout (seconds 2) + :run-cycle-length 60.0 + :walk-cycle-dist (meters 2.8) + :walk-up-cycle-dist (meters 2.8) + :walk-down-cycle-dist (meters 2.8) + :walk-side-cycle-dist (meters 2.8) + :run-cycle-dist (meters 6.25) + :run-up-cycle-dist (meters 5) + :run-down-cycle-dist (meters 5) + :run-side-cycle-dist (meters 6.25) + :run-wall-cycle-dist (meters 2.8) + :duck-walk-cycle-dist (meters 3.25) + :wade-shallow-walk-cycle-dist (meters 6) + :wade-deep-walk-cycle-dist (meters 6) + :mech-walk-cycle-dist (meters 4) + :mech-run-cycle-dist (meters 8) + :smack-surface-dist (meters 1.25) + :min-dive-depth (meters 2) + :root-radius (meters 2.2) + :root-offset (new 'static 'vector :y 4915.2 :w 1.0) + :body-radius (meters 0.7) + :edge-radius (meters 0.35) + :edge-offset (new 'static 'vector :y 4915.2 :z 4096.0 :w 1.0) + :edge-grab-height-off-ground (meters 2.3) + :head-radius (meters 0.7) + :head-height (meters 1.4) + :head-offset (new 'static 'vector :y 4915.2 :w 1.0) + :spin-radius (meters 2.2) + :spin-offset (new 'static 'vector :y 6553.6 :w 1.0) + :duck-spin-radius (meters 1.2) + :duck-spin-offset (new 'static 'vector :y 4096.0 :w 1.0) + :punch-radius (meters 1.3) + :punch-offset (new 'static 'vector :y 5324.8 :w 1.0) + :uppercut-radius (meters 1) + :uppercut0-offset (new 'static 'vector :y 3276.8 :w 1.0) + :uppercut1-offset (new 'static 'vector :y 9011.2 :w 1.0) + :flop-radius (meters 1.4) + :flop0-offset (new 'static 'vector :y 3276.8 :w 1.0) + :flop1-offset (new 'static 'vector :y 9011.2 :w 1.0) + :stuck-time (seconds 0.3) + :stuck-timeout (seconds 2) + :stuck-distance (meters 0.05) + :tongue-pull-speed-min 0.15 + :tongue-pull-speed-max 0.22 + :yellow-attack-timeout (seconds 0.2) + :fall-height (meters 1) + :mech-jump-thrust-fuel 900.0 + :strafe-jump-pre-window (seconds 0.5) + :strafe-jump #f + :strafe-duck-jump #f + :dark-jump-height-min (meters 20.5) + :dark-jump-height-max (meters 20.5) + :ladder-walk-up-speed (meters 2.5) + :ladder-walk-down-speed (meters 3) + :ladder-slide-speed (meters 20) + :invisible-duration (seconds 30) + :mech-walk-carry-cycle-dist (meters 8) + ) + ) + +;; definition for function target-start-attack +;; WARN: Return type mismatch int vs none. +(defbehavior target-start-attack target () + (let* ((v1-0 *game-info*) + (a0-1 (+ (-> v1-0 attack-id) 1)) + ) + (set! (-> v1-0 attack-id) a0-1) + (set! (-> self control target-attack-id) a0-1) + ) + (set! (-> self control attack-count) (the-as uint 0)) + (set! (-> self control bomb-scale) 0.0) + (+! (-> self anim-seed) 1) + 0 + (none) + ) + +;; definition for function target-danger-set! +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-danger-set! target ((arg0 symbol) (arg1 symbol)) + (let* ((s4-0 (-> self control collision-spheres 6)) + (s5-0 (-> self control collision-spheres 7)) + (gp-0 (-> self control collision-spheres 8)) + (s2-0 (-> self control collision-spheres 9)) + (v1-4 arg1) + (f30-0 (if (or (= v1-4 'cone) (= v1-4 'eco-red)) + 2.0 + 1.0 + ) + ) + ) + (set! (-> self control penetrate-using) (penetrate touch)) + (set! (-> self control penetrated-by) (penetrate lunge)) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set! (-> self control danger-mode) arg0) + (logclear! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 transform-index) -2) + (set! (-> s4-0 prim-core collide-as) (collide-spec)) + (set! (-> s4-0 prim-core collide-with) (collide-spec)) + (set! (-> s4-0 local-sphere w) 0.0) + (set! (-> s5-0 transform-index) -2) + (set! (-> s5-0 prim-core collide-as) (collide-spec)) + (set! (-> s5-0 prim-core collide-with) (collide-spec)) + (set! (-> s5-0 local-sphere w) 0.0) + (set! (-> gp-0 transform-index) -2) + (set! (-> gp-0 prim-core collide-as) (collide-spec)) + (set! (-> gp-0 prim-core collide-with) (collide-spec)) + (set! (-> gp-0 local-sphere w) 0.0) + (set! (-> s2-0 transform-index) -2) + (set! (-> s2-0 prim-core collide-as) (collide-spec)) + (set! (-> s2-0 prim-core collide-with) (collide-spec)) + (set! (-> s2-0 local-sphere w) 0.0) + (case arg0 + (('harmless #f) + (set! (-> self control danger-mode) #f) + (target-collide-set! (-> self control collide-mode) (-> self control collide-mode-transition)) + ) + (('carry?) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* spin-offset) + (+ 8192.0 (-> *TARGET-bank* spin-radius)) + ) + (set! (-> self control root-prim local-sphere quad) (-> s4-0 local-sphere quad)) + ) + (('spin 'spin-air 'get-on) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 9830.4 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* spin-offset) + (-> *TARGET-bank* spin-radius) + ) + (set! (-> self control penetrate-using) (penetrate touch spin)) + ) + (('board-spin) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 9830.4 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s4-0 local-sphere)) (-> *TARGET-bank* spin-offset) 6963.2) + (set! (-> self control penetrate-using) (penetrate touch spin board)) + ) + (('board-zap) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 13107.2 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s4-0 local-sphere)) (-> *TARGET-bank* spin-offset) 12288.0) + (set! (-> self control penetrate-using) (penetrate touch spin board)) + ) + (('duck-spin) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 10649.6 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* duck-spin-offset) + (-> *TARGET-bank* duck-spin-radius) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius)) + (set! (-> s5-0 transform-index) 46) + (set! (-> self control penetrate-using) (penetrate touch spin)) + ) + (('duck-slide) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* duck-spin-offset) + (-> *TARGET-bank* duck-spin-radius) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius)) + (set! (-> s5-0 transform-index) 40) + (set! (-> self control penetrate-using) (penetrate touch punch)) + ) + (('roll-solid) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* duck-spin-offset) + (+ 819.2 (-> *TARGET-bank* duck-spin-radius)) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius)) + (set! (-> s5-0 transform-index) 8) + (set! (-> self control danger-mode) 'roll) + (set! (-> self control penetrate-using) (penetrate touch roll)) + ) + (('flip) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* duck-spin-offset) + (+ 819.2 (-> *TARGET-bank* duck-spin-radius)) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius)) + (set! (-> s5-0 transform-index) 8) + (set! (-> self control danger-mode) 'flip) + (set! (-> self control penetrate-using) (penetrate touch roll)) + ) + (('punch 'dark-smack) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 11878.4 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* punch-offset) + (-> *TARGET-bank* punch-radius) + ) + (when (not (focus-test? self indax)) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* punch-radius)) + (set! (-> s5-0 transform-index) 27) + ) + (set! (-> self control penetrate-using) (penetrate touch punch)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage bomb0)) + ) + (logior! (-> self control penetrate-using) (penetrate dark-punch)) + ) + (if (= arg0 'dark-smack) + (logior! (-> self control penetrate-using) (penetrate dark-smack)) + ) + ) + (('uppercut) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 11878.4 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* uppercut0-offset) + (-> *TARGET-bank* uppercut-radius) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* uppercut-radius)) + (set! (-> s5-0 transform-index) 27) + (set! (-> gp-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> gp-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> gp-0 local-sphere)) + (-> *TARGET-bank* uppercut1-offset) + (-> *TARGET-bank* uppercut-radius) + ) + (set! (-> self control penetrate-using) (penetrate touch uppercut)) + ) + (('flop) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* flop0-offset) + (-> *TARGET-bank* flop-radius) + ) + (set! f30-0 1.0) + (set! (-> self control danger-mode) 'flop) + (set! (-> self control penetrate-using) (penetrate touch flop)) + ) + (('flop-down) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* flop0-offset) + (-> *TARGET-bank* flop-radius) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s5-0 local-sphere)) + (-> *TARGET-bank* flop1-offset) + (-> *TARGET-bank* flop-radius) + ) + (if (!= f30-0 1.0) + (set! f30-0 2.1) + ) + (set! (-> self control danger-mode) 'flop) + (set! (-> self control penetrate-using) (penetrate touch flop)) + ) + (('flut-attack) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (new 'static 'vector :y 6553.6 :w 1.0) + 12288.0 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s4-0 local-sphere)) + (-> *TARGET-bank* spin-offset) + (+ 2048.0 (-> *TARGET-bank* punch-radius)) + ) + (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) + (sphere<-vector+r! + (the-as sphere (-> s5-0 local-sphere)) + *null-vector* + (+ 1228.8 (-> *TARGET-bank* punch-radius)) + ) + (set! (-> s5-0 transform-index) 8) + (set! (-> self control penetrate-using) (penetrate touch flut-attack)) + ) + (('mech-punch) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self control penetrate-using) (penetrate touch mech)) + ) + (('bomb) + (let* ((f0-32 (-> self control bomb-scale)) + (f28-0 (lerp-scale (-> *TARGET-bank* root-radius) 122880.0 f0-32 0.0 1.0)) + ) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + f28-0 + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s4-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s4-0 prim-core collide-with) + (logclear (-> self control default-collide-with-fgnd) (collide-spec collectable)) + ) + (sphere<-vector+r! (the-as sphere (-> s4-0 local-sphere)) (-> *TARGET-bank* root-offset) f28-0) + ) + (set! (-> self control penetrate-using) (penetrate touch dark-bomb)) + ) + (else + (format 0 "ERROR: ~A unknown danger mode ~A" self arg0) + ) + ) + (when (= arg1 'cone) + (let ((f28-1 16384.0)) + (sphere<-vector+r! + (the-as sphere (-> self control root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (+ (-> *TARGET-bank* root-radius) (* 2.0 f28-1)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> s2-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) + (set! (-> s2-0 prim-core collide-with) + (logclear (-> self control default-collide-with-fgnd) (collide-spec collectable)) + ) + (set! (-> s2-0 transform-index) 0) + (sphere<-vector+r! + (the-as sphere (-> s2-0 local-sphere)) + (new 'static 'vector :y 12288.0 :z 16384.0 :w 1.0) + f28-1 + ) + ) + (set! (-> self control penetrate-using) (penetrate touch dark-bomb)) + ) + (when (and (!= f30-0 1.0) (not (or (= arg0 'harmless) (= arg0 #f)))) + (set! (-> self control root-prim local-sphere w) (* (-> self control root-prim local-sphere w) f30-0)) + (set! (-> s4-0 local-sphere w) (* (-> s4-0 local-sphere w) f30-0)) + (set! (-> s5-0 local-sphere w) (* (-> s5-0 local-sphere w) f30-0)) + (set! (-> gp-0 local-sphere w) (* (-> gp-0 local-sphere w) f30-0)) + ) + ) + (case (-> self fact eco-type) + ((1) + (logior! (-> self control penetrate-using) (penetrate eco-yellow)) + ) + ((2) + (logior! (-> self control penetrate-using) (penetrate eco-red)) + ) + ((3) + (set! (-> self control penetrate-using) + (the-as penetrate (logior (penetrate eco-blue) (-> self control penetrate-using))) + ) + ) + ((5) + (set! (-> self control penetrate-using) + (the-as penetrate (logior (penetrate eco-green) (-> self control penetrate-using))) + ) + ) + ) + (none) + ) + +;; definition for function target-collide-set! +(defbehavior target-collide-set! target ((arg0 symbol) (arg1 float)) + (let ((gp-0 (-> self control))) + (if (and (= arg0 'normal) + (enabled-gun? self) + (not (logtest? (-> self control current-surface flags) (surface-flag duck))) + ) + (set! arg0 'gun) + ) + (set! (-> self control collide-mode) arg0) + (set! (-> self control collide-mode-transition) arg1) + (logclear! (-> self control penetrate-using) (penetrate tube vehicle board mech)) + (set! (-> self control penetrated-by) (penetrate lunge)) + (dotimes (v1-10 4) + (set! (-> gp-0 collision-spheres v1-10 transform-index) -2) + ) + (set! (-> gp-0 collision-spheres 3 prim-core collide-as) (collide-spec)) + (set! (-> gp-0 collision-spheres 3 prim-core collide-with) (collide-spec)) + (set! (-> gp-0 collision-spheres 4 prim-core collide-as) (collide-spec jak)) + (set! (-> gp-0 collision-spheres 4 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + hit-by-player-list + hit-by-others-list + player-list + water + collectable + blocking-plane + tobot + pusher + vehicle-mesh + obstacle-for-jak + shield + vehicle-mesh-no-block-use + ) + ) + (cond + ((= arg0 'pole) + (set-vector! (-> gp-0 collision-spheres 0 local-sphere) 0.0 0.0 0.0 (-> *TARGET-bank* body-radius)) + (set-vector! (-> gp-0 collision-spheres 1 local-sphere) 0.0 0.0 0.0 (-> *TARGET-bank* body-radius)) + (set-vector! (-> gp-0 collision-spheres 2 local-sphere) 0.0 0.0 0.0 (-> *TARGET-bank* body-radius)) + (set! (-> gp-0 collision-spheres 0 transform-index) 40) + (set! (-> gp-0 collision-spheres 1 transform-index) 38) + (set! (-> gp-0 collision-spheres 2 transform-index) 8) + ) + ((= arg0 'board) + (logior! (-> self control penetrate-using) (penetrate touch board)) + ) + ((= arg0 'racer) + (set! (-> gp-0 draw-offset y) 4096.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (new 'static 'vector :y 8192.0 :w 1.0) + 16384.0 + ) + (set-vector! (-> gp-0 collision-spheres 0 local-sphere) 0.0 6553.6 0.0 6553.6) + (set-vector! (-> gp-0 collision-spheres 1 local-sphere) 0.0 9420.8 0.0 6553.6) + (set-vector! (-> gp-0 collision-spheres 2 local-sphere) 0.0 12288.0 0.0 6553.6) + (logior! (-> self control penetrate-using) (penetrate touch vehicle)) + ) + ((= arg0 'flut) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (new 'static 'vector :y 8192.0 :w 1.0) + 12288.0 + ) + (set-vector! (-> gp-0 collision-spheres 0 local-sphere) 0.0 4915.2 0.0 4915.2) + (set-vector! (-> gp-0 collision-spheres 1 local-sphere) 0.0 7782.4004 0.0 4915.2) + (set-vector! (-> gp-0 collision-spheres 2 local-sphere) 0.0 10649.6 0.0 4915.2) + (if (= (-> self flut mode) 'racer) + (logior! (-> self control penetrate-using) (penetrate flut)) + ) + ) + ((= arg0 'mech) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (new 'static 'vector :y 8192.0 :w 1.0) + 16384.0 + ) + (set-vector! (-> gp-0 collision-spheres 0 local-sphere) 0.0 4096.0 0.0 4096.0) + (set-vector! (-> gp-0 collision-spheres 1 local-sphere) 0.0 8601.6 0.0 6553.6) + (set-vector! (-> gp-0 collision-spheres 2 local-sphere) 0.0 14745.6 0.0 6963.2) + (logior! (-> self control penetrate-using) (penetrate touch mech)) + ) + ((= arg0 'mech-carry) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (new 'static 'vector :y 12288.0 :w 1.0) + 20480.0 + ) + (set-vector! (-> gp-0 collision-spheres 0 local-sphere) 0.0 4096.0 0.0 4096.0) + (set-vector! (-> gp-0 collision-spheres 1 local-sphere) 0.0 8601.6 0.0 6553.6) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ 5734.4 (lerp-scale 9011.2 12288.0 arg1 0.0 1.0)) + 0.0 + (lerp-scale 9420.8 12697.6 arg1 0.0 1.0) + ) + ) + ((= arg0 'duck) + (set! (-> self control duck-gun-tube-transision) arg1) + (let ((f30-1 (- 1.0 arg1))) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + (* 0.0 f30-1) + (-> *TARGET-bank* body-radius) + ) + (if (using-gun? self) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ 2867.2 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 2867.2 f30-1)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 5734.4 f30-1)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + ) + ) + ((= arg0 'indax) + (let ((f30-2 0.2)) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + (* 0.0 f30-2) + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 2867.2 f30-2)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 5734.4 f30-2)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + ) + (set! (-> gp-0 collision-spheres 4 prim-core collide-as) (collide-spec)) + (set! (-> gp-0 collision-spheres 4 prim-core collide-with) (collide-spec)) + 0 + ) + ((= arg0 'tube) + (set! (-> self control duck-gun-tube-transision) arg1) + (let ((f30-3 (- 1.0 arg1))) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + (* 0.0 f30-3) + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 2867.2 f30-3)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ (-> *TARGET-bank* body-radius) (* 5734.4 f30-3)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + ) + (logior! (-> self control penetrate-using) (penetrate touch tube)) + ) + ((= arg0 'carry) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ 2867.2 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ 5734.4 (-> *TARGET-bank* body-radius)) + 0.0 + (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 arg1 0.0 1.0) + ) + ) + ((= arg0 'gun) + (set! (-> self control duck-gun-tube-transision) arg1) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ 2867.2 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ 5734.4 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 3 local-sphere) + 0.0 + (+ 5734.4 (-> *TARGET-bank* body-radius)) + 0.0 + (lerp-scale (-> *TARGET-bank* body-radius) 4915.2 arg1 0.0 1.0) + ) + (set! (-> gp-0 collision-spheres 3 prim-core collide-with) (collide-spec + backgnd + bot + crate + obstacle + hit-by-player-list + hit-by-others-list + player-list + water + collectable + blocking-plane + tobot + pusher + vehicle-mesh + obstacle-for-jak + shield + vehicle-mesh-no-block-use + ) + ) + ) + (else + (set! (-> self control duck-gun-tube-transision) 0.0) + (set! (-> gp-0 draw-offset y) 0.0) + (sphere<-vector+r! + (the-as sphere (-> gp-0 root-prim local-sphere)) + (-> *TARGET-bank* root-offset) + (-> *TARGET-bank* root-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 0 local-sphere) + 0.0 + (-> *TARGET-bank* body-radius) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 1 local-sphere) + 0.0 + (+ 2867.2 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + (set-vector! + (-> gp-0 collision-spheres 2 local-sphere) + 0.0 + (+ 5734.4 (-> *TARGET-bank* body-radius)) + 0.0 + (-> *TARGET-bank* body-radius) + ) + ) + ) + (set! (-> gp-0 nav-radius) (-> gp-0 collision-spheres 2 local-sphere w)) + ) + 0 + ) + +;; definition for method 27 of type control-info +(defmethod get-quaternion ((this control-info)) + "Get the quat for this [[trsqv]]." + (-> this quat-for-control) + ) + +;; definition for function target-skel-group +;; WARN: Return type mismatch art-group vs skeleton-group. +(defun target-skel-group () + (the-as skeleton-group (cond + (*target* + (case (-> *target* ext-geo) + (((target-geo jakb)) + (art-group-get-by-name *level* "skel-jchar-normal" (the-as (pointer level) #f)) + ) + (((target-geo jakb-old)) + (art-group-get-by-name *level* "skel-jchar-old" (the-as (pointer level) #f)) + ) + (((target-geo jakc)) + (art-group-get-by-name *level* "skel-jchar-c" (the-as (pointer level) #f)) + ) + (else + (art-group-get-by-name *level* "skel-jchar" (the-as (pointer level) #f)) + ) + ) + ) + (else + (art-group-get-by-name *level* "skel-jchar" (the-as (pointer level) #f)) + ) + ) + ) + ) + +;; definition for function debounce-speed +(defbehavior debounce-speed target ((arg0 float) (arg1 float) (arg2 vector) (arg3 vector)) + (if (and (< 0.3 arg0) (< arg0 0.7) (< 0.0 arg1) (< (vector-dot arg2 arg3) 0.2)) + (set! arg0 0.0) + ) + arg0 + ) + +;; definition for function target-align-vel-z-adjust +(defbehavior target-align-vel-z-adjust target ((arg0 float)) + (let ((f1-0 (-> self control local-slope-z))) + (* arg0 (if (< 0.0 f1-0) + (* (- 1.0 f1-0) (-> self control current-surface alignv)) + (-> self control current-surface alignv) + ) + ) + ) + ) + +;; definition for method 27 of type target +(defmethod get-inv-mass ((this target)) + (if (focus-test? this mech) + 0.1 + 1.0 + ) + ) + +;; definition for method 16 of type target +;; INFO: Used lq/sq +;; WARN: Return type mismatch control-info vs trsqv. +(defmethod apply-alignment ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) + (with-pp + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> arg2 quad)) + (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) + (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) + (let* ((s3-0 (-> this control c-R-w)) + (s0-0 (-> this control w-R-c)) + (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control dynam gravity) s0-0)) + (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control transv) s0-0)) + ) + (if (logtest? arg0 (align-opts no-gravity)) + (set-vector! s1-0 0.0 0.0 0.0 1.0) + ) + (when (logtest? arg0 (align-opts adjust-x-vel)) + (set! (-> a1-3 x) + (+ (* (-> arg1 trans x) (-> s2-0 x) (-> pp clock frames-per-second)) (* (-> s1-0 x) (seconds-per-frame))) + ) + (if (not (logtest? arg0 (align-opts adjust-xz-vel keep-other-velocities))) + (set! (-> a1-3 z) 0.0) + ) + ) + (if (and (logtest? arg0 (align-opts adjust-y-vel)) + (not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0))) + ) + (set! (-> a1-3 y) + (+ (* (-> arg1 trans y) (-> s2-0 y) (-> pp clock frames-per-second)) (* (-> s1-0 y) (seconds-per-frame))) + ) + ) + (when (logtest? arg0 (align-opts adjust-xz-vel)) + (set! (-> a1-3 z) + (+ (* (-> arg1 trans z) (-> s2-0 z) (-> pp clock frames-per-second)) (* (-> s1-0 z) (seconds-per-frame))) + ) + (if (not (logtest? arg0 (align-opts adjust-x-vel keep-other-velocities))) + (set! (-> a1-3 x) 0.0) + ) + ) + (vector-matrix*! (-> this control transv) a1-3 s3-0) + ) + ) + ) + (if (logtest? arg0 (align-opts adjust-quat)) + (quaternion-normalize! + (quaternion*! (-> this control quat-for-control) (-> this control quat-for-control) (-> arg1 quat)) + ) + ) + (the-as trsqv (-> this control)) + ) + ) + +;; definition for function average-turn-angle +(defun average-turn-angle ((arg0 target)) + (let ((f30-0 0.0)) + (dotimes (s5-0 8) + (+! f30-0 + (fabs + (deg-diff (atan (-> arg0 control turn-history-ctrl s5-0 x) (-> arg0 control turn-history-ctrl s5-0 z)) 0.0) + ) + ) + ) + (* 0.125 f30-0) + ) + ) + +;; definition for function can-play-stance-amibent? +(defbehavior can-play-stance-amibent? target () + (and (or (and (kiosk?) + (>= (+ -300000 (-> *display* real-clock frame-counter)) (seconds 60)) + (>= (- (-> *display* base-clock frame-counter) (-> self control cpad change-time)) (seconds 60)) + (>= (- (-> *display* game-clock frame-counter) (-> self game kiosk-timeout)) (seconds 60)) + ) + (and (time-elapsed? (-> self ambient-time) (seconds 30)) + (not (logtest? (-> self control status) (collide-status touch-actor))) + (logtest? (-> self control status) (collide-status on-surface)) + (not (or (logtest? (water-flag touch-water) (-> self water flags)) + (logtest? (-> self control status) (collide-status on-water)) + ) + ) + (not (logtest? (focus-status dead hit grabbed in-head edge-grab pole flut tube light board mech dark indax teleporting) + (-> self focus-status) + ) + ) + ) + ) + (not (paused?)) + (not (movie?)) + (>= (- (-> *display* base-clock frame-counter) (-> self control cpad change-time)) (seconds 30)) + (!= (-> self tobot?) 'tobot) + (not (-> *setting-control* user-current talking)) + (not (-> *setting-control* user-current spooling)) + (not (-> *setting-control* user-current movie)) + (not (-> *setting-control* user-current hint)) + (not (focus-test? self dead hit grabbed)) + (logtest? (game-feature sidekick) (-> self game features)) + (= (-> self ext-anim) (target-anim default)) + (case *kernel-boot-message* + (('kiosk) + (set! (-> self control cpad change-time) (-> *display* base-clock frame-counter)) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + #f + ) + (else + #t + ) + ) + ) + ) + +;; definition for function target-height-above-ground +(defbehavior target-height-above-ground target () + (- (-> self control trans y) (-> self control gspot-pos y)) + ) + +;; definition for function find-collision-below +;; INFO: Used lq/sq +(defun find-collision-below ((arg0 vector) (arg1 vector) (arg2 float)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s5-0 start-pos quad) (-> arg1 quad)) + (set-vector! (-> s5-0 move-dist) 0.0 (- arg2) 0.0 1.0) + (let ((v1-2 s5-0)) + (set! (-> v1-2 radius) 40.96) + (set! (-> v1-2 collide-with) (collide-spec backgnd hit-by-others-list pusher)) + (set! (-> v1-2 ignore-process0) #f) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) + (set! (-> arg0 quad) (-> s5-0 best-other-tri intersect quad)) + #t + ) + ) + ) + +;; definition for function can-jump? +(defbehavior can-jump? target ((mode symbol)) + (and (or (logtest? (-> self control status) (collide-status on-surface)) + (not (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout))) + (and (= mode 'board) + (or (not (time-elapsed? (-> self board last-jump-time) (seconds 0.05))) + (and (not (time-elapsed? (-> self control last-time-of-stuck) (seconds 0.5))) + (< (target-height-above-ground) 2048.0) + ) + ) + ) + (and (= mode 'flut) + (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.5))) + (< (target-height-above-ground) 6144.0) + ) + ) + (and (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + (or (= mode 'board) (!= (-> self control poly-pat event) 13)) + (if (= mode 'target-roll-flip) + (>= 0.5 (-> self control local-slope-z)) + #t + ) + ) + ) + ) + +;; definition for function target-jump-go +;; WARN: Return type mismatch object vs none. +(defbehavior target-jump-go target () + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + (none) + ) + +;; definition for function move-legs? +(defbehavior move-legs? target () + (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + ) + +;; definition for function jump-hit-ground-stuck? +(defbehavior jump-hit-ground-stuck? target () + (or (logtest? (-> self control status) (collide-status on-surface)) + (when (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) + ) + (set-time! (-> self control last-time-of-stuck)) + #t + ) + ) + ) + +;; definition for function target-time-to-ground +;; WARN: Return type mismatch int vs time-frame. +(defbehavior target-time-to-ground target () + (let ((f0-0 (target-height-above-ground)) + (f2-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f1-1 0.0) + ) + (while (< 0.0 f0-0) + (set! f1-1 (+ 5.0 f1-1)) + (+! f0-0 (* f2-0 (seconds-per-frame))) + (set! f2-0 (- f2-0 (* (-> self control dynam gravity-length) (seconds-per-frame)))) + ) + (the time-frame f1-1) + ) + ) + +;; definition for function fall-test +;; WARN: Return type mismatch object vs none. +(defbehavior fall-test target ((arg0 (state symbol target)) (arg1 float)) + (when (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) arg1) + ) + (if (not (time-elapsed? (-> self control rider-time) (-> *TARGET-bank* ground-timeout))) + (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) + ) + (go arg0 #f) + ) + (none) + ) + +;; definition for function slide-down-test +;; WARN: Return type mismatch object vs none. +(defbehavior slide-down-test target () + (if (and (not (logtest? (-> self control status) (collide-status on-surface touch-edge))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (logtest? (-> self control status) (collide-status touch-surface)) + (< (cos (-> self control current-surface slope-slip-angle)) (-> self control surface-angle)) + ) + (go target-slide-down) + ) + (none) + ) + +;; 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) (collide-status touch-wall)) + (or arg0 (not (logtest? (-> self control status) (collide-status touch-actor)))) + ) + ) + ) + +;; definition for function can-roll? +(defbehavior can-roll? target () + (and (or (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1))) + (logtest? (-> self control status) (collide-status on-surface)) + ) + (or (not (logtest? (-> self control status) (collide-status touch-wall))) + (>= 0.7 (-> self control touch-angle)) + ) + (< (-> self control local-slope-z) 0.7) + (and (not (logtest? (-> self target-flags) (target-flags prevent-attack prevent-duck))) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (time-elapsed? (-> *TARGET-bank* roll-timeout) (-> self control last-roll-end-time)) + (or (not (enabled-gun? self)) + (not (-> *TARGET-bank* strafe-duck-jump)) + (and (< 0.3 (vector-dot (-> self control to-target-pt-xz) (-> self control c-R-w fvec))) + (time-elapsed? (-> self control time-of-last-zero-input) (seconds 0.3)) + ) + ) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + ) + +;; definition for function can-duck? +(defbehavior can-duck? target () + (and (logtest? (-> self control status) (collide-status on-surface)) + (>= (-> self control ground-local-norm-dot-grav) 0.7) + (not (logtest? (water-flag under-water swimming) (-> self water flags))) + (not (logtest? (-> self target-flags) (target-flags prevent-duck))) + (or (not (logtest? (water-flag wading) (-> self water flags))) + (< (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) + ) + (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (let ((v1-23 (ja-group))) + (and (not (and v1-23 (or (= v1-23 (-> self draw art-group data 476)) (= v1-23 (-> self draw art-group data 477))))) + (or (= (-> self ext-anim) (target-anim default)) + (and (= (-> self ext-anim) (target-anim dark)) (focus-test? self dark) (nonzero? (-> self darkjak))) + ) + ) + ) + ) + ) + +;; definition for function can-exit-duck? +;; INFO: Used lq/sq +(defun can-exit-duck? ((arg0 target)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'sphere 2))) + (dotimes (s3-0 2) + ((method-of-type sphere new) (the-as symbol (-> s4-0 s3-0)) sphere) + ) + (set! (-> s4-0 0 quad) (-> arg0 control trans quad)) + (set! (-> s4-0 0 y) (+ 5734.4 (-> *TARGET-bank* body-radius) (-> s4-0 0 y))) + (set! (-> s4-0 0 r) (-> *TARGET-bank* body-radius)) + (set! (-> s4-0 1 quad) (-> arg0 control trans quad)) + (set! (-> s4-0 1 y) (+ 2867.2 (-> *TARGET-bank* body-radius) (-> s4-0 1 y))) + (set! (-> s4-0 1 r) (-> *TARGET-bank* body-radius)) + (let ((v1-12 gp-0)) + (set! (-> v1-12 spheres) s4-0) + (set! (-> v1-12 best-other-prim) (the-as collide-shape-prim 2)) + (set! (-> v1-12 collide-with) + (logclear + (-> arg0 control root-prim prim-core collide-with) + (collide-spec civilian enemy vehicle-sphere projectile) + ) + ) + (set! (-> v1-12 ignore-process0) #f) + (set! (-> v1-12 ignore-process1) #f) + (set! (-> v1-12 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-12 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-12 action-mask) (collide-action solid)) + ) + ) + (if (fill-and-probe-using-spheres *collide-cache* gp-0) + #f + #t + ) + ) + ) + +;; definition for function can-hands? +(defbehavior can-hands? target ((arg0 symbol)) + (cond + ((or (logtest? (-> self target-flags) (target-flags prevent-attack)) + (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands)) + ) + #f + ) + ((and (or (not arg0) + (and (not (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout))) + (< (-> self control local-slope-z) 0.7) + ) + ) + (time-elapsed? + (-> self control last-running-attack-end-time) + (if (and (= (-> self fact eco-type) 1) (>= (-> self fact eco-level) 1.0)) + (-> *TARGET-bank* yellow-attack-timeout) + (-> *TARGET-bank* attack-timeout) + ) + ) + ) + #t + ) + (else + (set-time! (-> self control last-hands-attempt-time)) + #f + ) + ) + ) + +;; definition for function can-feet? +(defbehavior can-feet? target ((arg0 symbol)) + (cond + ((or (logtest? (-> self target-flags) (target-flags prevent-attack)) + (logtest? (-> self control current-surface flags) (surface-flag no-attack no-feet)) + (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (logtest? (game-feature lightjak-shield) (-> self game features)) + (not (handle->process (-> self lightjak freeze-control))) + ) + ) + #f + ) + ((time-elapsed? (-> self control last-attack-end-time) (-> *TARGET-bank* attack-timeout)) + #t + ) + (else + (set-time! (-> self control last-feet-attempt-time)) + #f + ) + ) + ) + +;; definition for function are-still? +(defbehavior are-still? target () + (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (< (-> self control ctrl-xz-vel) 61440.0) + ) + ) + +;; definition for function vector-local+! +;; INFO: Used lq/sq +(defbehavior vector-local+! target ((arg0 vector) (arg1 vector)) + (let ((s5-0 (new-stack-vector0))) + (vector-matrix*! s5-0 arg1 (-> self control c-R-w)) + (vector+! arg0 arg0 s5-0) + ) + ) + +;; definition for function move-forward +;; INFO: Used lq/sq +(defbehavior move-forward target ((arg0 float)) + (let ((a1-0 (new-stack-vector0)) + (gp-0 (new-stack-vector0)) + ) + (set-vector! a1-0 0.0 0.0 arg0 1.0) + (vector-matrix*! gp-0 a1-0 (-> self control c-R-w)) + (vector+! (-> self control transv) (-> self control transv) gp-0) + ) + ) + +;; definition for function set-forward-vel +;; INFO: Used lq/sq +(defbehavior set-forward-vel target ((arg0 float)) + (let ((gp-0 (new-stack-vector0))) + (vector-matrix*! gp-0 (-> self control transv) (-> self control w-R-c)) + (set! (-> gp-0 z) arg0) + (set! (-> gp-0 x) 0.0) + (vector-matrix*! (-> self control transv) gp-0 (-> self control c-R-w)) + ) + ) + +;; definition for function delete-back-vel +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior delete-back-vel target () + (let ((gp-0 (new-stack-vector0))) + (vector-z-quaternion! gp-0 (-> self control dir-targ)) + (let ((v1-1 (new-stack-vector0)) + (f0-1 (vector-dot gp-0 (-> self control transv))) + ) + 0.0 + (vector-! v1-1 (-> self control transv) (vector-float*! v1-1 gp-0 f0-1)) + (let* ((f1-2 (vector-length v1-1)) + (f2-0 f1-2) + ) + (if (< f0-1 0.0) + (set! f0-1 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) gp-0 f0-1) + (vector-float*! v1-1 v1-1 (/ f1-2 f2-0)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-side-vel +;; INFO: Used lq/sq +(defbehavior set-side-vel target ((arg0 float)) + (let ((gp-0 (new-stack-vector0))) + (vector-matrix*! gp-0 (-> self control transv) (-> self control w-R-c)) + (set! (-> gp-0 x) arg0) + (set! (-> gp-0 z) 0.0) + (vector-matrix*! (-> self control transv) gp-0 (-> self control c-R-w)) + ) + ) + +;; definition for function target-timed-invulnerable +;; WARN: Return type mismatch int vs none. +(defun target-timed-invulnerable ((arg0 time-frame) (arg1 target) (arg2 int)) + (case arg2 + ((1) + (logior! (-> arg1 target-flags) (target-flags tinvuln1)) + (set-time! (-> arg1 control invul1-on-time)) + (set! (-> arg1 control invul1-off-time) arg0) + ) + ((2) + (logior! (-> arg1 target-flags) (target-flags tinvuln2)) + (set-time! (-> arg1 control invul2-on-time)) + (set! (-> arg1 control invul2-off-time) arg0) + ) + ) + (let ((t9-0 (method-of-object (-> arg1 control) collide-shape-method-49))) + 2 + #x8000 + 0 + (t9-0) + ) + (logior! (-> arg1 focus-status) (focus-status ignore)) + 0 + (none) + ) + +;; definition for function target-timed-invulnerable-off +;; WARN: Return type mismatch int vs none. +(defun target-timed-invulnerable-off ((arg0 target) (arg1 int)) + (let ((v1-0 arg1)) + (cond + ((zero? v1-0) + (logclear! (-> arg0 target-flags) (target-flags tinvuln1 tinvuln2)) + ) + ((= v1-0 1) + (logclear! (-> arg0 target-flags) (target-flags tinvuln1)) + ) + ((= v1-0 2) + (logclear! (-> arg0 target-flags) (target-flags tinvuln2)) + ) + ) + ) + (when (not (logtest? (target-flags tinvuln1 tinvuln2) (-> arg0 target-flags))) + (logclear! (-> arg0 draw status) (draw-control-status no-draw-bounds)) + (let ((t9-0 (method-of-object (-> arg0 control) collide-shape-method-49))) + 2 + 0 + #x8000 + (t9-0) + ) + ) + 0 + (none) + ) + +;; definition for function target-log-attack +(defbehavior target-log-attack target ((arg0 attack-info) (arg1 symbol)) + (if (and (= arg1 'background) (= (-> arg0 id) 2)) + (return #t) + ) + (let ((a3-0 (the-as object (-> self attack-info-old)))) + (dotimes (a2-2 8) + (let ((v1-9 (-> self attack-info-old a2-2))) + (when (= (-> arg0 id) (-> v1-9 id)) + (if (not (time-elapsed? (-> v1-9 attack-time) (-> *TARGET-bank* same-attack-invulnerable-timeout))) + (return #f) + ) + (cond + ((= arg1 'test) + ) + (else + (mem-copy! (the-as pointer v1-9) (the-as pointer arg0) 168) + ) + ) + (return #t) + ) + (if (< (-> v1-9 attack-time) (-> (the-as attack-info a3-0) attack-time)) + (set! a3-0 v1-9) + ) + ) + ) + (case arg1 + (('test) + ) + (else + (mem-copy! (the-as pointer a3-0) (the-as pointer arg0) 168) + ) + ) + ) + #t + ) + +;; definition for method 9 of type attack-info +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod attack-info-method-9 ((this attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable)) + (local-vars (v1-14 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (if (type? arg1 process-drawable) + arg1 + ) + ) + ) + (let ((v1-0 (if (type? arg2 process-drawable) + arg2 + ) + ) + ) + (cond + ((logtest? (attack-mask attacker-velocity) (-> this mask)) + (set! (-> arg0 attacker-velocity quad) (-> this attacker-velocity quad)) + (vector-normalize-copy! (-> arg0 trans) (-> arg0 attacker-velocity) 1.0) + ) + (v1-0 + (cond + (s5-0 + (vector-! (-> arg0 trans) (-> v1-0 root trans) (-> s5-0 root trans)) + (vector-normalize! (-> arg0 trans) 1.0) + (set! (-> arg0 attacker-velocity quad) (-> arg0 trans quad)) + ) + (else + (vector-z-quaternion! (-> arg0 trans) (-> v1-0 root quat)) + (vector-negate-in-place! (-> arg0 trans)) + (vector-normalize! (-> arg0 trans) 1.0) + (set! (-> arg0 attacker-velocity quad) (-> arg0 trans quad)) + ) + ) + ) + (else + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 attacker-velocity quad) (the-as uint128 0)) + ) + ) + ) + (if s5-0 + (set! (-> arg0 intersection quad) (-> s5-0 root trans quad)) + (set! (-> arg0 intersection quad) (-> (target-pos 0) quad)) + ) + ) + (.lvf vf1 (&-> (-> arg0 trans) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-14 vf1) + (cond + ((!= v1-14 0.0) + (set! (-> arg0 vector quad) (-> arg0 trans quad)) + (set! (-> arg0 vector y) 0.0) + (vector-xz-normalize! (-> arg0 vector) 1.0) + ) + (else + (set! (-> arg0 vector quad) (the-as uint128 0)) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 10 of type attack-info +(defmethod compute-intersect-info ((this attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry)) + (when (and arg3 arg1) + (let ((a1-2 (prims-touching? arg3 (the-as collide-shape (-> arg1 root)) (the-as uint -1)))) + (when a1-2 + (get-intersect-point (-> this intersection) a1-2 (the-as collide-shape (-> arg1 root)) arg3) + (logior! (-> this mask) (attack-mask intersection)) + ) + ) + ) + (when arg1 + (set! (-> this prev-state) (-> arg1 state)) + (logior! (-> this mask) (attack-mask prev-state)) + ) + (when (not (logtest? (-> this mask) (attack-mask attacker))) + (set! (-> this attacker) (process->handle arg2)) + (logior! (-> this mask) (attack-mask attacker)) + ) + (when (not (logtest? (-> this mask) (attack-mask attack-time))) + (set! (-> this attack-time) (-> *display* base-clock frame-counter)) + (logior! (-> this mask) (attack-mask attack-time)) + ) + (if (not (logtest? (attack-mask damage) (-> this mask))) + (set! (-> this damage) (-> *FACT-bank* health-default-inc)) + ) + this + ) + +;; definition for method 11 of type attack-info +;; INFO: Used lq/sq +(defmethod combine! ((this attack-info) (arg0 attack-info) (arg1 process-drawable)) + (let ((s4-0 (-> arg0 mask))) + (set! (-> this mask) (-> arg0 mask)) + (if (logtest? s4-0 (attack-mask attacker)) + (set! (-> this attacker) (-> arg0 attacker)) + ) + (if (logtest? s4-0 (attack-mask mode)) + (set! (-> this mode) (-> arg0 mode)) + ) + (if (logtest? s4-0 (attack-mask angle)) + (set! (-> this angle) (-> arg0 angle)) + ) + (if (logtest? s4-0 (attack-mask dist)) + (set! (-> this dist) (-> arg0 dist)) + ) + (if (logtest? s4-0 (attack-mask control)) + (set! (-> this control) (-> arg0 control)) + ) + (if (logtest? s4-0 (attack-mask speed)) + (set! (-> this speed) (-> arg0 speed)) + ) + (if (logtest? (attack-mask penetrate-using) s4-0) + (set! (-> this penetrate-using) (-> arg0 penetrate-using)) + ) + (if (logtest? (attack-mask damage) s4-0) + (set! (-> this damage) (-> arg0 damage)) + ) + (if (logtest? (attack-mask shield-damage) s4-0) + (set! (-> this shield-damage) (-> arg0 shield-damage)) + ) + (if (logtest? (attack-mask knock) s4-0) + (set! (-> this knock) (-> arg0 knock)) + ) + (if (logtest? (attack-mask count) s4-0) + (set! (-> this count) (-> arg0 count)) + ) + (if (logtest? s4-0 (attack-mask id)) + (set! (-> this id) (-> arg0 id)) + ) + (if (logtest? s4-0 (attack-mask shove-back)) + (set! (-> this shove-back) (-> arg0 shove-back)) + ) + (if (logtest? s4-0 (attack-mask shove-up)) + (set! (-> this shove-up) (-> arg0 shove-up)) + ) + (if (logtest? s4-0 (attack-mask invinc-time)) + (set! (-> this invinc-time) (-> arg0 invinc-time)) + ) + (if (logtest? s4-0 (attack-mask rotate-to)) + (set! (-> this rotate-to) (-> arg0 rotate-to)) + ) + (if (logtest? s4-0 (attack-mask intersection)) + (set! (-> this intersection quad) (-> arg0 intersection quad)) + ) + (if (logtest? (attack-mask attacker-velocity) s4-0) + (set! (-> this attacker-velocity quad) (-> arg0 attacker-velocity quad)) + ) + (cond + ((not (logtest? s4-0 (attack-mask vector))) + (let* ((s2-0 (handle->process (-> this attacker))) + (v1-65 (if (type? s2-0 process-drawable) + (the-as process-drawable s2-0) + ) + ) + ) + (when (and v1-65 (nonzero? (-> v1-65 root))) + (set! (-> this trans quad) (-> v1-65 root trans quad)) + (vector-! (-> this vector) (-> arg1 root trans) (-> v1-65 root trans)) + (logior! (-> this mask) (attack-mask vector)) + ) + ) + ) + (else + (let* ((s3-1 (handle->process (-> this attacker))) + (v1-72 (if (type? s3-1 process-drawable) + (the-as process-drawable s3-1) + ) + ) + ) + (if (and v1-72 (nonzero? (-> v1-72 root))) + (set! (-> this trans quad) (-> v1-72 root trans quad)) + ) + ) + (set! (-> this vector quad) (-> arg0 vector quad)) + (when (not (logtest? s4-0 (attack-mask shove-back))) + (let ((v1-79 (-> this vector))) + (set! (-> this shove-back) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z))))) + ) + ) + (if (not (logtest? s4-0 (attack-mask shove-up))) + (set! (-> this shove-up) (-> this vector y)) + ) + ) + ) + (if (not (logtest? (-> this mask) (attack-mask dist))) + (set! (-> this dist) (fabs (-> this shove-back))) + ) + (if (logtest? s4-0 (attack-mask trans)) + (set! (-> this trans quad) (-> arg0 trans quad)) + ) + ) + this + ) + +;; definition for function ground-tween-initialize +(defbehavior ground-tween-initialize target ((arg0 ground-tween-info) + (arg1 uint) + (arg2 uint) + (arg3 uint) + (arg4 uint) + (arg5 uint) + (arg6 uint) + (arg7 float) + ) + (set! (-> arg0 group 0) arg2) + (set! (-> arg0 group 1) arg3) + (set! (-> arg0 group 2) arg4) + (set! (-> arg0 group 3) arg5) + (set! (-> arg0 group 4) arg6) + (dotimes (s2-0 3) + (set! (-> arg0 chan s2-0) (+ arg1 s2-0)) + (let ((s1-0 (-> self skel root-channel (-> arg0 chan s2-0)))) + (let ((f0-1 (fabs (-> arg0 blend s2-0)))) + (set! (-> s1-0 frame-interp 1) f0-1) + (set! (-> s1-0 frame-interp 0) f0-1) + ) + (joint-control-channel-group-eval! s1-0 (the-as art-joint-anim arg2) num-func-identity) + (set! (-> s1-0 frame-num) arg7) + ) + ) + arg0 + ) + +;; definition for function ground-tween-update +;; WARN: Return type mismatch int vs none. +(defbehavior ground-tween-update target ((arg0 ground-tween-info) (arg1 float) (arg2 float) (arg3 float)) + (let ((f0-1 (fmax -1.0 (fmin 1.0 arg1))) + (f30-0 (fmax -1.0 (fmin 1.0 arg2))) + ) + (let ((f1-5 (fabs (- f0-1 (-> arg0 blend 1))))) + (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + ) + (let ((f0-9 (fabs (- f30-0 (-> arg0 blend 2))))) + (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + ) + ) + (cond + ((>= (-> arg0 blend 1) 0.0) + (let ((v1-12 (-> self skel root-channel (-> arg0 chan 1)))) + (let ((f0-16 (fabs (-> arg0 blend 1)))) + (set! (-> v1-12 frame-interp 1) f0-16) + (set! (-> v1-12 frame-interp 0) f0-16) + ) + (set! (-> v1-12 frame-group) (the-as art-joint-anim (-> arg0 group 1))) + ) + ) + (else + (let ((v1-15 (-> self skel root-channel (-> arg0 chan 1)))) + (let ((f0-18 (fabs (-> arg0 blend 1)))) + (set! (-> v1-15 frame-interp 1) f0-18) + (set! (-> v1-15 frame-interp 0) f0-18) + ) + (set! (-> v1-15 frame-group) (the-as art-joint-anim (-> arg0 group 2))) + ) + ) + ) + (cond + ((>= (-> arg0 blend 2) 0.0) + (let ((v1-18 (-> self skel root-channel (-> arg0 chan 2)))) + (let ((f0-21 (fabs (-> arg0 blend 2)))) + (set! (-> v1-18 frame-interp 1) f0-21) + (set! (-> v1-18 frame-interp 0) f0-21) + ) + (set! (-> v1-18 frame-group) (the-as art-joint-anim (-> arg0 group 4))) + ) + ) + (else + (let ((v1-21 (-> self skel root-channel (-> arg0 chan 2)))) + (let ((f0-23 (fabs (-> arg0 blend 2)))) + (set! (-> v1-21 frame-interp 1) f0-23) + (set! (-> v1-21 frame-interp 0) f0-23) + ) + (set! (-> v1-21 frame-group) (the-as art-joint-anim (-> arg0 group 3))) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-pos +(defun target-pos ((arg0 int)) + (let ((a1-0 *target*)) + (cond + (a1-0 + (if (zero? arg0) + (-> a1-0 control trans) + (vector<-cspace! (new 'static 'vector) (-> a1-0 node-list data arg0)) + ) + ) + (else + (camera-pos) + ) + ) + ) + ) + +;; definition for function target-cam-pos +;; INFO: Used lq/sq +(defun target-cam-pos () + (let ((gp-0 *target*)) + (cond + ((not gp-0) + (camera-pos) + ) + ((logtest? (-> gp-0 target-flags) (target-flags tf6)) + (add-debug-sphere + *display-camera-marks* + (bucket-id debug-no-zbuf1) + (-> gp-0 alt-cam-pos) + (meters 0.2) + (new 'static 'rgba :r #xff :a #x80) + ) + (-> gp-0 alt-cam-pos) + ) + ((logtest? (-> gp-0 target-flags) (target-flags tf12)) + (add-debug-sphere + *display-camera-marks* + (bucket-id debug-no-zbuf1) + (-> gp-0 alt-cam-pos) + (meters 0.2) + (new 'static 'rgba :r #xff :a #x80) + ) + (-> gp-0 alt-cam-pos) + ) + ((logtest? (-> gp-0 target-flags) (target-flags tf14)) + (let ((s5-0 (new 'static 'vector))) + (set! (-> s5-0 quad) (-> gp-0 control camera-pos quad)) + (set! (-> s5-0 y) (fmax (-> s5-0 y) (-> gp-0 alt-cam-pos y))) + (add-debug-sphere + *display-camera-marks* + (bucket-id debug-no-zbuf1) + s5-0 + (meters 0.2) + (new 'static 'rgba :r #xff :a #x80) + ) + s5-0 + ) + ) + (else + (add-debug-sphere + *display-camera-marks* + (bucket-id debug-no-zbuf1) + (-> gp-0 control camera-pos) + (meters 0.2) + (new 'static 'rgba :r #xff :b #xff :a #x80) + ) + (-> gp-0 control camera-pos) + ) + ) + ) + ) + +;; definition for function target-rot +(defun target-rot () + (let ((v1-0 *target*)) + (if v1-0 + (-> v1-0 control quat-for-control) + *unity-quaternion* + ) + ) + ) + +;; definition for method 21 of type target +;; INFO: Used lq/sq +(defmethod get-trans ((this target) (arg0 int)) + "Get the `trans` for this process." + (local-vars (v0-0 vector)) + (let ((v1-0 (-> this control))) + (cond + ((zero? arg0) + (-> v1-0 trans) + ) + ((= arg0 1) + (let ((a1-2 (-> this water flags))) + (cond + ((and (logtest? (water-flag touch-water) a1-2) + (logtest? (water-flag under-water swimming) a1-2) + (not (logtest? (focus-status mech) (-> this focus-status))) + ) + (set! v0-0 (new 'static 'vector :w 1.0)) + (set! (-> v0-0 quad) (-> this control trans quad)) + (set! (-> v0-0 y) (-> this water height)) + v0-0 + ) + (else + (-> v1-0 gspot-pos) + ) + ) + ) + ) + ((= arg0 2) + (if (logtest? (-> this draw status) (draw-control-status no-draw no-draw-temp)) + (-> v1-0 trans) + (vector<-cspace! (new 'static 'vector) (-> this node-list data 8)) + ) + ) + ((= arg0 3) + (cond + ((logtest? (-> this draw status) (draw-control-status no-draw no-draw-temp)) + (set! v0-0 (new 'static 'vector)) + (set! (-> v0-0 quad) (-> v1-0 trans quad)) + (vector+float*! v0-0 v0-0 (-> this control local-normal) 8192.0) + ) + (else + (set! v0-0 (vector<-cspace! (new 'static 'vector) (-> this node-list data 6))) + (set! (-> v0-0 w) 4096.0) + ) + ) + v0-0 + ) + ((= arg0 4) + (target-cam-pos) + ) + ((= arg0 5) + (if (= (-> this draw origin w) 0.0) + (-> v1-0 trans) + (-> this draw origin) + ) + ) + ((= arg0 6) + (let ((f0-5 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) + (cond + ((and (< 0.0 f0-5) (focus-test? this in-air)) + (let* ((v0-1 (new 'static 'vector)) + (f0-6 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-5)) + (f0-9 (/ (* 0.5 f0-6 f0-6) (-> v1-0 dynam gravity-length))) + ) + (vector+float*! v0-1 (-> v1-0 trans) (-> v1-0 dynam gravity-normal) f0-9) + ) + ) + (else + (-> v1-0 trans) + ) + ) + ) + ) + ((= arg0 7) + (-> v1-0 last-trans-on-ground) + ) + ((= arg0 8) + (-> v1-0 last-trans-leaving-surf) + ) + (else + (-> v1-0 trans) + ) + ) + ) + ) + +;; definition for method 24 of type target +(defmethod time-to-apex-or-ground ((this target) (arg0 int)) + (let ((v1-0 (-> this control))) + (cond + ((zero? arg0) + (let ((f0-1 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) + (if (and (< 0.0 f0-1) (focus-test? this in-air)) + (time-to-apex f0-1 (- (-> v1-0 dynam gravity-length))) + 0 + ) + ) + ) + ((= arg0 1) + (if (focus-test? this in-air) + (the-as int (target-time-to-ground)) + 0 + ) + ) + (else + 0 + ) + ) + ) + ) + +;; definition for method 22 of type target +(defmethod get-quat ((this target) (arg0 int)) + "Get the quaternion for this process." + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (-> this control quat) + ) + ((= v1-0 1) + (-> this control quat-for-control) + ) + ((= v1-0 2) + (-> this control dir-targ) + ) + ((= v1-0 3) + (if (using-gun? this) + (forward-up->quaternion + (new 'static 'quaternion) + (-> this gun fire-dir-out) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this control quat-for-control)) + ) + (-> this control quat) + ) + ) + (else + (-> this control quat) + ) + ) + ) + ) + +;; definition for method 25 of type target +;; WARN: Return type mismatch float vs meters. +(defmethod get-water-height ((this target)) + (the-as meters (if (logtest? (-> this water flags) (water-flag active)) + (-> this water surface-height) + (-> this control trans y) + ) + ) + ) + +;; definition for method 26 of type target +(defmethod get-notice-time ((this target)) + (-> this neck notice-time) + ) + +;; definition for function external-target-spawn +;; INFO: Used lq/sq +(defun external-target-spawn ((arg0 vector) (arg1 quaternion) (arg2 process) (arg3 symbol) (arg4 manipy-options)) + (local-vars + (v1-5 symbol) + (sv-96 process) + (sv-112 (function vector entity-actor skeleton-group vector manipy-options none :behavior manipy)) + (sv-128 entity-actor) + ) + (let* ((s1-0 (get-process *default-dead-pool* manipy #x20000 1)) + (s5-0 (when s1-0 + (let ((t9-1 (method-of-type manipy activate))) + (t9-1 (the-as manipy s1-0) arg2 "manipy" (the-as pointer #x70004000)) + ) + (let ((s5-1 run-function-in-process)) + (set! sv-96 s1-0) + (set! sv-112 manipy-init) + (set! v1-5 (when (not (logtest? (-> arg2 mask) (process-mask process-tree))) + (set! sv-128 (the-as entity-actor v1-5)) + (set! sv-128 (-> arg2 entity)) + v1-5 + ) + ) + (let ((t0-1 (target-skel-group)) + (t1-0 (if (logtest? arg4 (manipy-options mo3)) + (the-as vector #f) + (new 'static 'vector :y 2867.2 :w 3276.8) + ) + ) + (t2-0 2) + ) + ((the-as (function object object object object object object object none) s5-1) + sv-96 + sv-112 + arg0 + sv-128 + t0-1 + t1-0 + t2-0 + ) + ) + ) + (-> s1-0 ppointer) + ) + ) + ) + (when s5-0 + (cond + ((logtest? arg4 (manipy-options mo2)) + (send-event (ppointer->process s5-0) 'anim-mode 'still) + (send-event (ppointer->process s5-0) 'art-joint-anim "pilot-wcar-turn-back" 0 #x40a00000) + ) + (else + (send-event (ppointer->process s5-0) 'anim-mode 'loop) + (send-event (ppointer->process s5-0) 'art-joint-anim "duck-stance") + ) + ) + (send-event + (ppointer->process s5-0) + 'eval + (lambda :behavior target + () + (logior! (-> self control root-prim prim-core action) (collide-action solid)) + (none) + ) + ) + (send-event (ppointer->process s5-0) 'user-data arg3) + (cond + ((logtest? arg4 (manipy-options mo1)) + (send-event + (ppointer->process s5-0) + 'trans-hook + (lambda :behavior manipy + () + (target-update-segs self) + (if (and (and *target* + (and (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (and (focus-test? *target* indax) + (not (focus-test? *target* in-head pole light board mech dark teleporting)) + (>= (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) + (= (-> *setting-control* user-current bg-a) 0.0) + (send-event *target* 'end-mode 'indax) + ) + ) + (script-eval (the-as pair (-> self userdata))) + ) + (none) + ) + ) + ) + ((logtest? arg4 (manipy-options mo0)) + (send-event + (ppointer->process s5-0) + 'trans-hook + (lambda :behavior manipy + () + (target-update-segs self) + (when (and (and *target* (and (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (focus-test? *target* indax) + (not (focus-test? *target* in-head pole light board mech dark teleporting)) + (can-display-query? self "indax" -99.0) + ) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((v1-14 gp-0)) + (set! (-> v1-14 width) (the float 340)) + ) + (let ((v1-15 gp-0)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-0) + (a0-13 (-> *setting-control* user-default language)) + ) + (set! (-> v1-16 scale) (if (or (= a0-13 (language-enum korean)) (= a0-13 (language-enum russian))) + 0.9 + 0.7 + ) + ) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text (lookup-text! *common-text* (text-id text-0083) #f) gp-0 #f 44 (bucket-id bucket579)) + ) + (if (and (cpad-pressed? 0 triangle) (send-event *target* 'end-mode 'indax)) + (script-eval (the-as pair (-> self userdata))) + ) + ) + (none) + ) + ) + ) + ((logtest? arg4 (manipy-options mo2)) + (send-event + (ppointer->process s5-0) + 'trans-hook + (lambda :behavior target + () + (target-update-segs self) + (set! (-> self control trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) + (quaternion-copy! (-> self control quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) + (none) + ) + ) + ) + (else + (send-event + (ppointer->process s5-0) + 'trans-hook + (lambda :behavior target () (target-update-segs self) (none)) + ) + ) + ) + (quaternion-copy! (-> (the-as process-drawable (-> s5-0 0)) root quat) arg1) + ) + s5-0 + ) + ) + +;; definition for function target-reset-on-task-finish +;; WARN: Return type mismatch int vs none. +(defun target-reset-on-task-finish () + (when *target* + (set! (-> *target* fact health) (-> *target* fact health-max)) + (if (using-gun? *target*) + (send-event *target* 'end-mode 'gun) + ) + ) + (hide-hud 'hud-health) + (hide-hud 'hud-gun) + (set! (-> *game-info* gun-ammo 0) (fmax (-> *game-info* gun-ammo 0) (-> *FACT-bank* ammo-yellow-start))) + (set! (-> *game-info* gun-ammo 1) (fmax (-> *game-info* gun-ammo 1) (-> *FACT-bank* ammo-red-start))) + (set! (-> *game-info* gun-ammo 2) (fmax (-> *game-info* gun-ammo 2) (-> *FACT-bank* ammo-blue-start))) + (set! (-> *game-info* gun-ammo 3) (fmax (-> *game-info* gun-ammo 3) (-> *FACT-bank* ammo-dark-start))) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/target/target2_REF.gc b/test/decompiler/reference/jak3/engine/target/target2_REF.gc new file mode 100644 index 00000000000..df78d5a0030 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target2_REF.gc @@ -0,0 +1,2035 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(let ((a0-1 (copy *walk-no-turn-mods* 'global))) + (set! (-> a0-1 flags) (surface-flag gun-off gun-fast-exit)) + (set! *trip-mods* a0-1) + ) + +;; failed to figure out what this is: +(defstate target-load-wait (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('loading) + (set-time! (-> self state-time)) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :exit target-exit + :code (behavior () + (set! (-> self control mod-surface) *trip-mods*) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.05))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-trip-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (let ((v1-22 (process->ppointer self))) + (set! (-> a1-3 from) v1-22) + ) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'joystick) + (set! (-> a1-3 param 0) (the-as uint 0)) + (set! (-> a1-3 param 1) (the-as uint 0)) + (send-event-function *camera* a1-3) + ) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.3)) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) + (suspend) + ) + ) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! jakb-painful-land-ja :num! (seek!) :frame-num (ja-aframe 40.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-painful-land-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (go target-stance) + ) + :post target-no-stick-post + ) + +;; failed to figure out what this is: +(defstate target-stance-ambient (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('movie) + (go target-stance) + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self neck flex-blend) 0.0) + ((-> target-stance enter)) + (let ((v1-2 (rand-vu-int-count 7))) + (cond + ((zero? v1-2) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-1" :anim-name "jak-ambient-1" :parts 1 :command-list '()) + ) + ) + ((= v1-2 1) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-2" :anim-name "jak-ambient-2" :parts 1 :command-list '()) + ) + ) + ((= v1-2 2) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-3" :anim-name "jak-ambient-3" :parts 1 :command-list '()) + ) + ) + ((= v1-2 3) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-4" :anim-name "jak-ambient-4" :parts 1 :command-list '()) + ) + ) + ((= v1-2 4) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-5" :anim-name "jak-ambient-5" :parts 1 :command-list '()) + ) + ) + ((= v1-2 5) + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-6" :anim-name "jak-ambient-6" :parts 1 :command-list '()) + ) + ) + (else + (set! (-> self spool-anim) + (new 'static 'spool-anim :name "jak-ambient-7" :anim-name "jak-ambient-7" :parts 1 :command-list '()) + ) + ) + ) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (set-time! (-> self ambient-time)) + (let ((a0-0 (-> self spool-anim))) + (when (and a0-0 (= (-> *setting-control* user-current spooling) (process->ppointer self))) + (ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1) + (ja-channel-set! 1) + (ja :group! jakb-stance-loop-ja :num! min) + ) + ) + (set! (-> self spool-anim) #f) + ((-> target-stance exit)) + (target-exit) + ) + :trans (behavior () + (gui-control-method-12 + *gui-control* + self + (gui-channel art-load) + (gui-action queue) + (-> self spool-anim name) + 0 + -99.0 + (new 'static 'sound-id) + ) + (if (or (cpad-hold? (-> self control cpad number) start l1 r1 triangle circle x square) + *progress-process* + (want-to-powerjak?) + ) + (go target-stance) + ) + ) + :code (behavior () + (while (let ((v1-15 (file-status *art-control* (-> self spool-anim name) 0))) + (not (or (= v1-15 'locked) (= v1-15 'active))) + ) + (if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-stance) + ) + (suspend) + (ja :num! (loop!)) + ) + (ja-play-spooled-anim + (-> self spool-anim) + (the-as art-joint-anim jakb-stance-loop-ja) + (the-as art-joint-anim jakb-stance-loop-ja) + (the-as + (function process-drawable symbol) + (lambda :behavior target () (!= (-> *cpad-list* cpads 0 stick0-speed) 0.0)) + ) + (spooler-flags) + ) + (go target-stance) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-stance-look-around (target) + :event target-standard-event-handler + :enter (-> target-stance enter) + :exit (-> target-stance exit) + :trans (-> target-stance trans) + :code (behavior () + (while (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'dist-from-interp-src) + (and (or (< (the-as float (send-event-function *camera* a1-0)) 4915.2) + (not (time-elapsed? (-> self state-time) (seconds 0.05))) + ) + (and (not (time-elapsed? (-> self state-time) (seconds 0.07))) (zero? (ja-group-size))) + ) + ) + (suspend) + ) + (go target-stance) + ) + :post target-post + ) + +;; failed to figure out what this is: +(let ((a0-22 (copy *duck-mods* 'global))) + (set! (-> a0-22 flags) (surface-flag gun-inactive)) + (set! *look-around-mods* a0-22) + ) + +;; failed to figure out what this is: +(defstate target-look-around (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (let ((v1-4 message)) + (cond + ((= v1-4 'end-mode) + (case (-> block param 0) + (('in-head) + (if (not (focus-test? self dead)) + (go target-stance-look-around) + ) + ) + ) + ) + ((= v1-4 'gun) + (target-gun-fire (the-as pickup-type (-> block param 0))) + ) + ((or (= v1-4 'push-trans) (= v1-4 'push-transv)) + (set! (-> self cam-user-mode) 'normal) + (target-standard-event-handler proc argc message block) + ) + ((-> self control danger-mode) + (target-dangerous-event-handler proc argc message block) + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self cam-user-mode) 'look-around) + (set! (-> self control mod-surface) *look-around-mods*) + (logior! (-> self focus-status) (focus-status in-head)) + (set-setting! 'mode-name 'cam-eye 0.0 0) + ) + :exit (behavior () + (set! (-> self cam-user-mode) 'normal) + (target-exit) + (remove-setting! 'mode-name) + ) + :trans (behavior () + (when (or (cpad-pressed? (-> self control cpad number) r3) + (< 2048.0 (target-height-above-ground)) + (not (-> *setting-control* user-current allow-look-around)) + ) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons r3)) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons r3)) + (set! (-> self cam-user-mode) 'normal) + ) + ) + :code (behavior () + (local-vars (a1-0 event-message-block) (f30-0 float)) + (until (>= f30-0 (the-as float (send-event-function *camera* a1-0))) + (if (!= (-> self cam-user-mode) 'look-around) + (go target-stance) + ) + (suspend) + (set! f30-0 8192.0) + (set! a1-0 (new 'stack-no-clear 'event-message-block)) + (let ((v1-5 (process->ppointer self))) + (set! (-> a1-0 from) v1-5) + ) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'dist-from-interp-dest) + ) + (ja-channel-set! 0) + (set! (-> self control transv quad) (the-as uint128 0)) + (until #f + (if (!= (-> self cam-user-mode) 'look-around) + (go target-stance-look-around) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + ) + :post (behavior () + (target-no-move-post) + (when (using-gun? self) + (let ((gp-0 (camera-matrix))) + (let ((s5-1 (vector-float*! (new-stack-vector0) (-> gp-0 fvec) 8192.0))) + (vector+float*! s5-1 s5-1 (-> gp-0 uvec) -4096.0) + (vector+! (-> self gun fire-point) (camera-pos) s5-1) + ) + (set! (-> self gun fire-dir-out quad) (-> gp-0 fvec quad)) + ) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) + (target-gun-check) + ) + ) + ) + +;; failed to figure out what this is: +(defstate target-grab (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (case message + (('end-mode) + (case (-> block param 0) + (('grab) + (go target-stance) + ) + (('gun) + (target-gun-end-mode #t) + ) + (('darkjak) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (target-darkjak-end-mode #t) + (set! v0-0 'target-darkjak-get-off) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + ) + (('lightjak) + (if (and (focus-test? self light) (nonzero? (-> self lightjak))) + (target-lightjak-end-mode #t) + ) + ) + ) + ) + (('play-anim) + (go target-grab (the-as symbol (-> block param 0))) + ) + (('clone-anim) + (go target-clone-anim (process->handle (the-as process (-> block param 0)))) + ) + (('change-mode) + (case (-> block param 0) + (('normal) + (cond + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (target-darkjak-end-mode #t) + ) + ((and (focus-test? self light) (nonzero? (-> self lightjak))) + (target-lightjak-end-mode #t) + ) + ((using-gun? self) + (target-gun-end-mode #t) + ) + ) + ) + (('gun) + (cond + ((using-gun? self) + (send-event self 'gun-type (-> block param 2)) + ) + ((want-to-gun? self #t) + (if (logtest? (-> self game features) (game-feature gun)) + (target-gun-init (the-as pickup-type (-> block param 2))) + ) + ) + ) + ) + (('demo) + enter-state + (go target-demo) + ) + (('title) + enter-state + (go target-title) + ) + (('grab) + (if (and (and (-> self next-state) (= (-> self next-state name) 'target-grab-ride)) (-> block param 1)) + (go target-grab 'stance) + ) + ) + (('grab-ride) + (if (and (and (-> self next-state) (= (-> self next-state name) 'target-grab)) (-> block param 1)) + (go target-grab-ride (process->handle proc)) + ) + ) + ) + ) + (('anim) + (set! v0-0 (-> block param 0)) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self board latch?) #f) + (set! (-> self control mod-surface) *grab-mods*) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self target-flags) (target-flags tf2)) + (logior! (-> self focus-status) (focus-status grabbed)) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (logior! (-> self skel effect flags) (effect-control-flag ecf2)) + (let ((v1-12 (new-stack-vector0)) + (f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-12 (-> self control transv) (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-2)) + (let* ((f1-2 (vector-length v1-12)) + (f2-0 f1-2) + ) + (if (< 0.0 f0-2) + (set! f0-2 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-2) + (vector-float*! v1-12 v1-12 (/ f1-2 f2-0)) + ) + ) + ) + ) + :exit (behavior () + (let ((v1-1 (-> self control root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self control backup-collide-with)) + ) + (set-time! (-> self ambient-time)) + (logclear! (-> self target-flags) (target-flags tf2)) + (logclear! (-> self skel effect flags) (effect-control-flag ecf2)) + (target-exit) + ) + :code (behavior ((arg0 symbol)) + (set-forward-vel 0.0) + (let ((gp-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! gp-0 (- (current-time) (-> self clock old-frame-counter))) + (suspend) + ) + (if (or (> gp-0 0) + (let ((v1-10 (ja-group))) + (and v1-10 (or (= v1-10 jakb-jump-ja) (= v1-10 jakb-jump-loop-ja) (= v1-10 jakb-duck-high-jump-ja))) + ) + ) + (target-hit-ground-anim #f (are-still?)) + ) + ) + (-> self control unknown-spool-anim00) + (until #f + (let ((gp-2 (-> self control unknown-spool-anim00))) + (case gp-2 + (('stance) + (cond + ((logtest? (water-flag swimming) (-> self water flags)) + (ja-channel-push! 1 (seconds 0.15)) + (until #f + (ja :group! jakb-swim-stance-ja :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) + ) + ) + ) + #f + ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (ja-channel-push! 1 (seconds 0.15)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 446) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (when (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (set! (-> self control unknown-word04) (the-as uint 'stance)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ((and (focus-test? self light) (nonzero? (-> self lightjak))) + (ja-channel-push! 1 (seconds 0.15)) + (until #f + (ja-no-eval :group! jakb-lightjak-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (when (not (and (focus-test? self light) (nonzero? (-> self lightjak)))) + (set! (-> self control unknown-word04) (the-as uint 'stance)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ((using-gun? self) + (let* ((v1-133 (gun->eco (-> self gun gun-type))) + (s5-2 (cond + ((= v1-133 (pickup-type eco-blue)) + jakb-gun-stance-blue-ja + ) + ((= v1-133 (pickup-type eco-yellow)) + jakb-gun-stance-yellow-ja + ) + ((= v1-133 (pickup-type eco-dark)) + jakb-gun-stance-dark-ja + ) + (else + jakb-gun-stance-ja + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.15)) + (until #f + (ja :group! s5-2 :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (if (or (!= gp-2 (-> self control unknown-spool-anim00)) (not (using-gun? self))) + (goto cfg-131) + ) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + ) + (else + (target-stance-push 1) + (until #f + (ja-no-eval :group! jakb-stance-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (or (!= gp-2 (-> self control unknown-spool-anim00)) (using-gun? self)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + ) + (('shock-in) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! jakb-shocked-ja :num! (seek! (ja-aframe 15.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek! (ja-aframe 15.0 0))) + ) + (until #f + (ja-no-eval :group! jakb-shocked-ja :num! (seek! (ja-aframe 26.0 0)) :frame-num (ja-aframe 16.0 0)) + (until (ja-done? 0) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek! (ja-aframe 26.0 0))) + ) + ) + #f + ) + (('shock-out) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! jakb-shocked-ja :num! (seek!) :frame-num (ja-aframe 17.0 0)) + (until (ja-done? 0) + (if (!= gp-2 (-> self control unknown-spool-anim00)) + (goto cfg-131) + ) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control unknown-word04) (the-as uint 'stance)) + ) + (('target-darkjak-get-off) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-darkjak-get-off-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 10.0 60.0)) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-darkjak-get-off-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 10.0 60.0)) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control unknown-word04) (the-as uint 'stance)) + ) + ) + ) + (label cfg-131) + ) + #f + ) + :post (behavior () + (if (logtest? (-> self control status) (collide-status on-surface)) + (set! (-> self control transv quad) (the-as uint128 0)) + ) + (set! (-> self game kiosk-timeout) (-> *display* game-clock frame-counter)) + (target-no-stick-post) + ) + ) + +;; failed to figure out what this is: +(defstate target-grab-ride (target) + :event (-> target-grab event) + :enter (behavior ((arg0 handle)) + ((-> target-grab enter) 'stance) + ) + :exit (behavior () + ((-> target-grab exit)) + (let ((v1-2 (-> self control root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-2 prim-core collide-with) (-> self control backup-collide-with)) + ) + ) + :code (behavior ((arg0 handle)) + (let ((v1-1 (-> self control root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-channel-set! 0) + (until #f + (let* ((s5-0 (handle->process arg0)) + (a0-6 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if a0-6 + (move-to-point! (-> self control) (get-trans (the-as process-focusable a0-6) 0)) + ) + ) + (suspend) + ) + #f + ) + :post (behavior () + (set! (-> self game kiosk-timeout) (-> *display* game-clock frame-counter)) + (target-no-move-post) + ) + ) + +;; failed to figure out what this is: +(defstate target-pole-cycle (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + (target-standard-event-handler proc argc message block) + ) + ) + :enter (behavior ((arg0 handle)) + (set! (-> self control anim-handle) arg0) + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *pole-mods*) + (logior! (-> self focus-status) (focus-status pole)) + (target-collide-set! 'pole 0.0) + (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (set! (-> self control transv quad) (the-as uint128 0)) + (send-event *camera* 'ease-in) + (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float #f)) + (set! (-> self control hand-to-edge-dist) 0.5) + ) + :exit (behavior () + (target-collide-set! 'normal 0.0) + (logclear! (-> self focus-status) (focus-status pole)) + (set! (-> self control anim-handle) (the-as handle #f)) + ) + :trans (behavior () + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + (time-elapsed? (-> self state-time) (seconds 0.4)) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (cond + ((< 44.0 (ja-aframe-num 0)) + (set-forward-vel -49152.0) + (let ((v1-19 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-19 (-> self control transv) (vector-float*! v1-19 (-> self control dynam gravity-normal) f0-2)) + ) + (let* ((f0-3 (vector-length v1-19)) + (f1-1 f0-3) + (f2-0 -81920.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-19 v1-19 (/ f0-3 f1-1)) + ) + ) + ) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (go target-falling 'target-pole-cycle) + ) + ((>= (ja-aframe-num 0) 14.0) + (remove-exit) + (go target-pole-flip-up 28672.0 28672.0 (* 1024.0 (- 26.0 (ja-aframe-num 0)))) + ) + (else + (remove-exit) + (go target-pole-flip-forward 14336.0 14336.0 57344.0) + ) + ) + ) + ) + :code (behavior ((arg0 handle)) + (sound-play "edge-grab") + (target-compute-pole) + (set! (-> self control unknown-word04) + (the-as + uint + (vector-dot (-> self control edge-grab-edge-dir) (vector-normalize! (-> self control unknown-vector37) 1.0)) + ) + ) + (let ((v1-8 (ja-group))) + (cond + ((and v1-8 (= v1-8 jakb-pole-jump-loop-ja)) + (while (not (-> self control did-move-to-pole-or-max-jump-height)) + (ja :num! (seek!)) + (suspend) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe 37.0 0)) + ) + (else + (while (not (-> self control did-move-to-pole-or-max-jump-height)) + (suspend) + ) + (suspend) + (ja-channel-push! 1 (seconds 0.15)) + ) + ) + ) + (ja-no-eval :group! jakb-pole-cycle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (set! (-> self anim-seed) (the-as uint (if (rand-vu-percent? 0.1) + 0 + 1 + ) + ) + ) + (ja-no-eval :group! jakb-pole-cycle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (can-play-stance-amibent?) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defstate target-pole-flip-up (target) + :event target-standard-event-handler + :exit (-> target-pole-cycle exit) + :code (behavior ((arg0 float) (arg1 float) (arg2 float)) + (let ((f0-2 (+ 1.0 (fmin 17.0 (ja-aframe-num 0))))) + (ja-no-eval :group! jakb-pole-flip-up-ja :num! (seek!) :frame-num (ja-aframe f0-2 0)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-forward-vel arg2) + (go target-pole-flip-up-jump arg0 arg1) + ) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defstate target-pole-flip-up-jump (target) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + ((-> target-jump-forward enter) arg0 arg1) + (set! (-> self control mod-surface) *forward-pole-jump-mods*) + ) + :exit target-exit + :trans (behavior () + ((-> target-jump-forward trans)) + (vector-flatten! (-> self control transv) (-> self control transv) (-> self control edge-grab-edge-dir)) + ) + :code (behavior ((arg0 float) (arg1 float)) + (send-event *camera* 'damp-up) + (ja :group! jakb-pole-jump-loop-ja :num! min) + (let ((f0-1 (target-height-above-ground)) + (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) + (suspend) + (ja :num! (loop!)) + (set! f0-1 (target-height-above-ground)) + (set! f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + ) + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (ja :group! jakb-jump-loop-ja :num! (loop!)) + ) + #f + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-pole-flip-forward (target) + :event target-standard-event-handler + :exit (-> target-pole-cycle exit) + :code (behavior ((arg0 float) (arg1 float) (arg2 float)) + (let ((f30-1 (+ 4.0 (ja-aframe-num 0)))) + (ja-no-eval :group! jakb-pole-flip-forward-ja :num! (seek! (ja-aframe 16.0 0)) :frame-num (ja-aframe f30-1 0)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 16.0 0))) + ) + (set-forward-vel arg2) + (go target-pole-flip-forward-jump arg0 arg1) + ) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defstate target-pole-flip-forward-jump (target) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + ((-> target-jump enter) arg0 arg1 (the-as surface #f)) + (set! (-> self control mod-surface) *forward-pole-jump-mods*) + ) + :exit target-exit + :trans (behavior () + ((-> target-jump-forward trans)) + (vector-flatten! (-> self control transv) (-> self control transv) (-> self control edge-grab-edge-dir)) + ) + :code (behavior ((arg0 float) (arg1 float)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ((the-as (function none) (-> target-pole-flip-up-jump code))) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-edge-grab (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (case (-> block param 0) + (('edge-grab) + (go target-falling 'target-edge-grab) + ) + ) + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> *edge-grab-info* pilot-edge-grab?) #f) + (set! (-> self control unknown-handle000) (the-as handle #f)) + (set! (-> self control mod-surface) *edge-grab-mods*) + (set-time! (-> self control edge-grab-start-time)) + (logior! (-> self control root-prim prim-core action) (collide-action dont-push-away)) + (logior! (-> self focus-status) (focus-status edge-grab)) + (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (set! (-> self control transv quad) (the-as uint128 0)) + (send-event *camera* 'ease-in) + (if (!= (-> self skel top-anim interp) 0.0) + (set! (-> self skel top-anim interp) 0.000000000000000000000000000000001) + ) + ) + :exit (behavior () + (let ((v1-2 (handle->process (-> self control unknown-handle000)))) + (when v1-2 + (if (not (-> self control unknown-symbol000)) + (logclear! (-> (the-as process-focusable v1-2) root root-prim prim-core action) (collide-action edge-grabbed)) + ) + ) + ) + (set! (-> self control unknown-handle000) (the-as handle #f)) + (when (focus-test? self edge-grab) + (logclear! (-> self focus-status) (focus-status edge-grab)) + (logclear! (-> self control root-prim prim-core action) (collide-action dont-push-away)) + (send-event *camera* 'damp-up) + ) + (if (!= (-> self skel top-anim interp) 0.0) + (set! (-> self skel top-anim interp) 1.0) + ) + (set! (-> self control draw-offset y) 0.0) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) + (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + (cond + ((or (< -0.2 (local-pad-angle)) (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)) + (let ((a1-2 (new 'stack-no-clear 'collide-query))) + (let ((v1-25 a1-2)) + (set! (-> v1-25 spheres) (-> *collide-edge-work* world-player-leap-up-spheres)) + (set! (-> v1-25 best-other-prim) (the-as collide-shape-prim 6)) + (set! (-> v1-25 collide-with) (-> self control root-prim prim-core collide-with)) + (set! (-> v1-25 ignore-process0) #f) + (set! (-> v1-25 ignore-process1) #f) + (set! (-> v1-25 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-25 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-25 action-mask) (collide-action solid)) + ) + (when (not (fill-and-probe-using-spheres *collide-cache* a1-2)) + (if (!= (-> self skel top-anim interp) 0.0) + (set! (-> self skel top-anim interp) 1.0) + ) + (remove-exit) + (go + target-edge-grab-jump + (-> *TARGET-bank* edge-grab-jump-height-min) + (-> *TARGET-bank* edge-grab-jump-height-max) + #f + ) + ) + ) + ) + (else + (when (!= (-> self skel top-anim interp) 0.0) + (set! (-> self skel top-anim interp) 1.0) + (let* ((v1-47 (-> self skel float-channels)) + (v1-52 (cond + ((= v1-47 1) + (-> self skel channel (-> self skel active-channels)) + ) + ((= v1-47 2) + (-> self skel channel (+ (-> self skel active-channels) 1)) + ) + (else + (the-as joint-control-channel #f) + ) + ) + ) + ) + (if v1-52 + (set! (-> v1-52 frame-interp 1) 1.0) + ) + ) + ) + (remove-exit) + (go target-edge-grab-off) + ) + ) + ) + (if (using-gun? self) + (seek! (-> self control draw-offset y) 778.24 (* 4096.0 (seconds-per-frame))) + ) + ) + :code (behavior () + (target-compute-edge) + (let ((gp-0 *edge-grab-info*)) + (set! (-> self control unknown-handle000) (-> gp-0 actor-handle)) + (set! (-> self control unknown-symbol000) #f) + (let ((v1-4 (handle->process (-> self control unknown-handle000)))) + (if v1-4 + (logior! (-> (the-as process-focusable v1-4) root root-prim prim-core action) (collide-action edge-grabbed)) + ) + ) + (set! (-> self control unknown-word04) + (the-as + uint + (vector-dot (-> self control edge-grab-edge-dir) (vector-normalize! (-> self control unknown-vector37) 1.0)) + ) + ) + (cond + ((= (-> gp-0 pilot-edge-grab?) 'target-double-jump) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-jump-ja :num! (seek! (ja-aframe 14.0 0) 0.75) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 14.0 0) 0.75)) + ) + (sound-play "jump-double") + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-jump-ja :num! (seek! (ja-aframe 14.0 0)) :frame-num (ja-aframe 5.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 14.0 0))) + ) + ) + ((-> gp-0 pilot-edge-grab?) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-jump-ja :num! (seek! (ja-aframe 14.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 14.0 0))) + ) + ) + (else + (while (< 0.0 (-> self control hand-to-edge-dist)) + (let ((v1-60 (ja-group))) + (when (not (and v1-60 (= v1-60 jakb-jump-loop-ja))) + (ja-channel-push! 1 (the-as time-frame (if (using-gun? self) + 15 + 45 + ) + ) + ) + (ja :group! jakb-jump-loop-ja :num! min) + ) + ) + (suspend) + ) + ) + ) + ) + (target-edge-grab-anim (the-as float (-> self control unknown-word04))) + ) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defstate target-edge-grab-jump (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (case (-> block param 0) + (('edge-grab) + (go target-falling 'target-edge-grab) + ) + ) + ) + (('ladder) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :exit (-> target-edge-grab exit) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (case arg2 + (('ladder) + (ja-channel-push! 1 (seconds 0.1)) + ) + (else + (when (-> *edge-grab-info* pilot-edge-grab?) + (set! arg0 (+ 8192.0 arg0)) + (set! arg1 (+ 8192.0 arg1)) + ) + (ja-channel-set! 1) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (logclear! (-> self focus-status) (focus-status edge-grab)) + (logclear! (-> self control root-prim prim-core action) (collide-action dont-push-away)) + (set! (-> self control transv quad) (the-as uint128 0)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((a1-4 (cond + ((using-gun? self) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-edge-grab-to-jump-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + jakb-gun-edge-grab-to-jump-ja + ) + (else + jakb-edge-grab-to-jump-ja + ) + ) + ) + ) + (ja-no-eval :group! a1-4 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (set! (-> self control transv quad) (the-as uint128 0)) + (case arg2 + (('ladder) + ) + (else + (target-compute-edge-rider) + ) + ) + (compute-alignment! (-> self align)) + (when (not (logtest? (-> self align flags) (align-flags disabled))) + (vector-matrix*! s3-0 (the-as vector (-> self align delta)) (-> self control c-R-w)) + (move-by-vector! (-> self control) s3-0) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self control time-of-last-clear-wall-in-jump) 0) + (set-forward-vel 16384.0) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) + (send-event *camera* 'damp-up) + (go target-jump-forward arg0 arg1) + ) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defstate target-edge-grab-off (target) + :event target-standard-event-handler + :exit (-> target-edge-grab exit) + :code (behavior () + (ja-channel-set! 1) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (send-event *camera* 'damp-up) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (if (using-gun? self) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-edge-grab-off-ja) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-no-eval :group! jakb-edge-grab-off-ja :num! (seek! (ja-aframe 191.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (when (not (logtest? (-> self align flags) (align-flags disabled))) + (vector-matrix*! gp-0 (the-as vector (-> self align delta)) (-> self control c-R-w)) + (move-by-vector! (-> self control) gp-0) + ) + (suspend) + (ja :num! (seek! (ja-aframe 191.0 0))) + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (logclear! (-> self focus-status) (focus-status edge-grab)) + (logclear! (-> self control root-prim prim-core action) (collide-action dont-push-away)) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) + (vector-float*! (-> self control transv) (-> self control edge-grab-across-edge-dir) -40960.0) + (if (not (time-elapsed? (-> self control rider-time) (seconds 0.2))) + (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) + ) + (go target-falling 'target-edge-grab) + ) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defstate target-eco-powerup (target) + :event target-standard-event-handler + :exit (behavior () + (logand! (-> self target-effect) -101) + (target-exit) + ) + :trans (behavior () + (slide-down-test) + ) + :code (behavior ((arg0 int) (arg1 float)) + (case arg0 + ((8) + (logior! (-> self target-effect) 36) + ) + ((7) + (logior! (-> self target-effect) 64) + ) + ) + (set! (-> self neck flex-blend) 0.0) + (set-time! (-> self state-time)) + (if (= arg1 (-> *FACT-bank* eco-full-inc)) + (set! (-> self control mod-surface) *double-jump-mods*) + (set! (-> self control mod-surface) *walk-mods*) + ) + (let ((gp-0 (lambda :behavior target + () + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (not (logtest? (water-flag touch-water) (-> self water flags))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + (target-jump-go) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #t)) + (go target-attack-air #f) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #f)) + (go target-running-attack) + ) + ) + ) + ) + (case arg0 + ((7) + (let ((s5-1 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! s5-1 (- (current-time) (-> self clock old-frame-counter))) + (if (>= s5-1 300) + (goto cfg-15) + ) + (gp-0) + (suspend) + ) + ) + (label cfg-15) + (set! (-> self post-hook) target-no-stick-post) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-powerjak-get-on-ja :num! (seek! max 1.2) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! max 1.2)) + ) + (ja-no-eval :group! jakb-powerjak-get-on-loop-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + (ja-no-eval :group! jakb-powerjak-get-on-ja :num! (seek! (ja-aframe 6.0 0) 1.2) :frame-num max) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! (ja-aframe 6.0 0) 1.2)) + ) + (go target-stance) + ) + (else + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-powerup-ja + :num! (seek! max (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 2.0 + 3.0 + ) + ) + :frame-num (ja-aframe + (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 0.0 + 6.0 + ) + 0 + ) + ) + (until (ja-done? 0) + (gp-0) + (compute-alignment! (-> self align)) + (align! + (-> self align) + (align-opts adjust-y-vel) + 1.0 + (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 2.0 + 1.0 + ) + 1.0 + ) + (suspend) + (let ((a0-21 (-> self skel root-channel 0))) + (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group frames num-frames) -1))) + (let ((v1-124 (if (= arg1 (-> *FACT-bank* eco-full-inc)) + 2.0 + 3.0 + ) + ) + ) + (set! (-> a0-21 param 1) v1-124) + ) + (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (go target-falling 'target-eco-powerup) + ) + ) + ) + ) + :post target-post + ) + +;; failed to figure out what this is: +(let ((a0-90 (copy *walk-mods* 'global))) + (set! (-> a0-90 flags) (surface-flag gun-off gun-fast-exit)) + (set! *hit-ground-hard-mods* a0-90) + ) + +;; failed to figure out what this is: +(defstate target-hit-ground-hard (target) + :event target-standard-event-handler + :enter (behavior ((arg0 float)) + (set! (-> self control last-running-attack-end-time) 0) + (set! (-> self control last-attack-end-time) 0) + (set-forward-vel 0.0) + (set! (-> self control mod-surface) *hit-ground-hard-mods*) + (logior! (-> self focus-status) (focus-status hit)) + ) + :exit (behavior () + (if (not (and (-> self next-state) (= (-> self next-state name) 'target-death))) + (logclear! (-> self focus-status) (focus-status dead hit)) + ) + (target-exit) + ) + :code (behavior ((arg0 float)) + (when (!= arg0 0.0) + (let ((f0-5 (the float (the int (+ 1.0 (/ (- arg0 (-> *TARGET-bank* fall-far)) (-> *TARGET-bank* fall-far-inc)))))) + ) + (pickup-collectable! + (-> self fact) + (pickup-type health) + (* (-> *FACT-bank* health-single-inc) (- (fmax 0.0 f0-5))) + (the-as handle #f) + ) + ) + (target-timed-invulnerable (-> *TARGET-bank* hit-invulnerable-timeout) self 1) + ) + (cond + ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) + (set! (-> self attack-info attacker) (the-as handle #f)) + (go target-death 'target-hit-ground-hard) + ) + (else + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (ja-channel-push! 1 1) + (ja :group! jakb-painful-land-ja :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) + ) + ) + (ja :group! jakb-painful-land-end-ja :num! min) + (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) + (suspend) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (ja :num! (seek!)) + ) + ) + (go target-stance) + ) + ) + ) + :post target-no-stick-post + ) + +;; definition for symbol *hide-mods*, type surface +(define *hide-mods* (new 'static 'surface + :name 'run + :turnv 262144.0 + :turnvf 15.0 + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 40960.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags (surface-flag look-around gun-off) + ) + ) + +;; failed to figure out what this is: +(defstate target-hide (target) + :event target-standard-event-handler + :enter (behavior () + (set! (-> self control mod-surface) *hide-mods*) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control wall-contact-normal) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (if (using-gun? self) + (target-top-anim-base-mode 37) + ) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control bend-target) 0.0) + ) + :trans (behavior () + (if (and (logtest? (water-flag wading) (-> self water flags)) (not (using-gun? self))) + (go target-wade-stance) + ) + (if (= (-> self control ground-pat material) (pat-material ice)) + (go target-ice-stance) + ) + (if (and (move-legs?) + (and (time-elapsed? (-> self state-time) (seconds 1)) + (let ((f0-1 (vector-dot (-> self control to-target-pt-xz) (-> self control wall-contact-normal)))) + (< 0.1 f0-1) + ) + ) + ) + (go target-walk) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (go target-duck-stance #f) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (if (and (using-gun? self) + (and (-> self next-state) (= (-> self next-state name) 'target-stance)) + (let ((v1-85 (ja-group))) + (and v1-85 (= v1-85 jakb-stance-loop-ja)) + ) + ) + (go target-gun-stance) + ) + (if (and (logtest? (game-feature feature19) (-> self game features)) + (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons r1) + ) + ) + (go target-carry-pickup) + ) + (slide-down-test) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + (set-forward-vel (* 0.7 (-> self control ctrl-xz-vel))) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-wall-hide-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 2 (seconds 0.05)) + (let ((a0-5 (-> self skel root-channel 1))) + (let ((f0-7 0.2)) + (set! (-> a0-5 frame-interp 1) f0-7) + (set! (-> a0-5 frame-interp 0) f0-7) + ) + (set! (-> a0-5 frame-group) (the-as art-joint-anim jakb-wall-hide-body-ja)) + (set! (-> a0-5 param 0) 1.0) + (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim jakb-wall-hide-body-ja) num-func-loop!) + ) + (set! (-> self control unknown-word04) (the-as uint 0.5)) + (set! (-> self control did-move-to-pole-or-max-jump-height) 0.5) + (set! (-> self control unknown-float35) (the-as float #f)) + (let ((gp-0 + (lambda :behavior target + () + (ja :chan 1 :num! (loop! (the-as float (-> self control unknown-word04)))) + (if (rand-vu-percent? 0.05) + (set! (-> self control did-move-to-pole-or-max-jump-height) (rand-vu-float-range 0.5 1.5)) + ) + (set! (-> self control unknown-word04) (the-as uint (seek + (the-as float (-> self control unknown-word04)) + (-> self control did-move-to-pole-or-max-jump-height) + (* 2.0 (seconds-per-frame)) + ) + ) + ) + (let ((v0-4 (> (-> self neck look-at-count) 0))) + (set! (-> self control unknown-float35) (the-as float v0-4)) + v0-4 + ) + ) + ) + ) + (until #f + (let ((s5-0 (rand-vu-int-range 30 600))) + (ja :group! jakb-wall-hide-head-ja) + (let ((s4-0 (current-time))) + (until (time-elapsed? s4-0 s5-0) + (gp-0) + (suspend) + ) + ) + ) + (let ((f30-0 (rand-vu-float-range 0.5 1.5))) + (cond + ((or (cpad-hold? 1 r3) (-> self control unknown-float35)) + (let ((f30-1 (rand-vu-float-range 0.25 0.75))) + (ja-no-eval :group! jakb-wall-hide-scared-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek!)) + ) + (let ((s5-1 (rand-vu-int-range 1 10))) + (dotimes (s4-1 s5-1) + (ja-no-eval :group! jakb-wall-hide-scared-loop-ja :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + ) + (ja-no-eval :group! jakb-wall-hide-scared-return-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((rand-vu-percent? 0.5) + (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (let ((s5-2 (rand-vu-int-range 60 300)) + (s4-2 (current-time)) + ) + (until (time-elapsed? s4-2 s5-2) + (gp-0) + (suspend) + ) + ) + (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! 0.0 f30-0) :frame-num max) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! 0.0 f30-0)) + ) + ) + (else + (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! 0.0 f30-0) :frame-num max) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! 0.0 f30-0)) + ) + (let ((s5-3 (rand-vu-int-range 60 300)) + (s4-3 (current-time)) + ) + (until (time-elapsed? s4-3 s5-3) + (gp-0) + (suspend) + ) + ) + (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (gp-0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + ) + ) + #f + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-launch (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) + 'target-launch + (target-standard-event-handler proc argc message block) + ) + ) + :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *turn-around-mods*) + (ja-channel-push! 1 (seconds 0.15)) + (set-forward-vel 0.0) + (ja-no-eval :group! jakb-duck-stance-ja :num! (seek! (ja-aframe 15.0 0) 3.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 15.0 0) 3.0)) + ) + (if arg1 + (send-event *camera* 'change-state arg1 (seconds 0.6)) + ) + (if (nonzero? arg3) + (process-spawn-function + process + (lambda :behavior process + ((arg0 vector) (arg1 time-frame) (arg2 float)) + (local-vars (sv-32 time-frame) (sv-40 vector) (sv-44 symbol)) + (set! sv-32 (current-time)) + (let ((v1-2 (new-stack-vector0))) + (set! (-> v1-2 quad) (-> arg0 quad)) + (set! sv-40 v1-2) + ) + (set! sv-44 #t) + (until (time-elapsed? 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 last-trans-any-surf y)) arg2) + ) + (vector-xz-normalize! (-> (the-as target s4-0) control transv) 0.0) + (when (< (vector-vector-xz-distance (-> (the-as target s4-0) control trans) sv-40) 20480.0) + (let ((v1-15 (vector-! (new-stack-vector0) (-> (the-as target s4-0) control trans) sv-40))) + (set! (-> (the-as target s4-0) control trans x) (+ (-> sv-40 x) (fmax -2867.2 (fmin 2867.2 (-> v1-15 x))))) + (set! (-> (the-as target s4-0) control trans z) (+ (-> sv-40 z) (fmax -2867.2 (fmin 2867.2 (-> v1-15 z))))) + ) + ) + ) + (else + (if sv-44 + (set! sv-32 (current-time)) + ) + (set! sv-44 (the-as symbol #f)) + (when (and (-> (the-as target s4-0) next-state) + (let ((v1-25 (-> (the-as target s4-0) next-state name))) + (or (= v1-25 'target-duck-high-jump-jump) (= v1-25 'target-falling)) + ) + ) + (let ((v1-28 (-> (the-as target s4-0) control trans)) + (s3-0 (-> (the-as target s4-0) control transv)) + ) + (set! (-> s3-0 x) (- (-> sv-40 x) (-> v1-28 x))) + (set! (-> s3-0 z) (- (-> sv-40 z) (-> v1-28 z))) + (let* ((v1-29 s3-0) + (f30-0 (sqrtf (+ (* (-> v1-29 x) (-> v1-29 x)) (* (-> v1-29 z) (-> v1-29 z))))) + ) + (if (< 122880.0 f30-0) + (vector-xz-normalize! s3-0 122880.0) + ) + (if (< 4096.0 f30-0) + (forward-up-nopitch->quaternion + (-> (the-as target s4-0) control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> (the-as target s4-0) control quat)) + ) + ) + ) + ) + ) + ) + ) + ) + (suspend) + 0 + ) + #f + ) + arg2 + arg3 + #x480c0000 + :to self + ) + ) + (go target-high-jump arg0 arg0 'launch) + ) + :post target-no-stick-post + ) + +;; failed to figure out what this is: +(defstate target-play-anim (target) + :event target-generic-event-handler + :enter (behavior ((arg0 string) (arg1 handle)) + (set! (-> self control anim-handle) arg1) + (let ((t9-0 (method-of-object (-> self control) collide-shape-moving-method-60))) + #x47200000 + #x47200000 + (-> self control root-prim prim-core collide-with) + (t9-0) + ) + (logior! (-> self focus-status) (focus-status grabbed)) + (set! (-> self neck flex-blend) 0.0) + ) + :exit (behavior () + (send-event (handle->process (-> self control anim-handle)) 'end-mode) + (target-exit) + ) + :code (behavior ((arg0 string) (arg1 handle)) + (let ((gp-0 (get-art-by-name (-> self draw art-group) arg0 art-joint-anim))) + (when gp-0 + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (ja-channel-set! 1) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + ) + ) + (go target-stance) + ) + :post target-no-stick-post + ) + +;; failed to figure out what this is: +(defstate target-clone-anim (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ((-> target-grab event) proc argc message block) + ) + :enter (behavior ((arg0 handle)) + (set! (-> self control anim-handle) arg0) + (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (set! (-> self control unknown-word04) (the-as uint #t)) + (quaternion-copy! (the-as quaternion (-> self control unknown-vector38)) (-> self control quat)) + (logior! (-> self focus-status) (focus-status grabbed)) + (vector-reset! (-> self control transv)) + (set! (-> self neck flex-blend) 0.0) + (send-event (ppointer->process (-> self sidekick)) 'shadow #t) + ) + :exit (behavior () + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (send-event (ppointer->process (-> self sidekick)) 'shadow #t) + (let ((gp-0 (joint-node jakb-lod0-jg main)) + (a1-2 (-> self control camera-pos)) + ) + (cond + ((not (-> self control unknown-spool-anim00)) + ) + ((not (logtest? (-> self draw status) (draw-control-status no-draw))) + (move-to-point! (-> self control) a1-2) + (matrix->quaternion (-> self control quat-for-control) (-> gp-0 bone transform)) + (quaternion-copy! (-> self control quat) (-> self control quat-for-control)) + (let ((t9-5 (method-of-object (-> self control) collide-shape-moving-method-60))) + #x45800000 + #x47200000 + #t + (-> self control root-prim prim-core collide-with) + (t9-5) + ) + (when (logtest? (-> self control status) (collide-status on-water)) + (let ((a1-6 (new-stack-vector0))) + (set! (-> a1-6 x) (-> self control trans x)) + (set! (-> a1-6 y) (-> self water height)) + (set! (-> a1-6 z) (-> self control trans z)) + (set! (-> a1-6 w) 1.0) + (move-to-point! (-> self control) a1-6) + ) + ) + ) + (else + (format 0 "ERROR: : camera used backup position~%") + (move-to-point! (-> self control) (-> self control unknown-vector37)) + (quaternion-copy! (-> self control quat) (the-as quaternion (-> self control unknown-vector38))) + ) + ) + ) + (rot->dir-targ! (-> self control)) + (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set-time! (-> self control last-time-on-surface)) + (ja-channel-set! 0) + (ja-post) + (target-exit) + ) + :code (behavior ((arg0 handle)) + (clone-anim arg0 #t "") + (go target-stance) + ) + :post target-no-ja-move-post + ) + +;; failed to figure out what this is: +(let ((v1-28 (copy *walk-mods* 'global))) + (set! (-> v1-28 name) 'float) + (set! (-> v1-28 target-speed) 81920.0) + (set! (-> v1-28 transv-max) 81920.0) + (set! (-> v1-28 flags) (surface-flag gun-off)) + (set! *float-mods* v1-28) + ) + +;; failed to figure out what this is: +(defstate target-float (target) + :event target-generic-event-handler + :enter (behavior () + (sound-play-by-spec (static-sound-spec "menu-pick" :group 1 :fo-curve 1) (new-sound-id) (the-as vector #t)) + (set! (-> self control additional-decaying-velocity-end-time) 0) + (vector-reset! (-> self control additional-decaying-velocity)) + (let ((v1-3 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-3 (-> self control transv) (vector-float*! v1-3 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f0-2 (vector-length v1-3)) + (f1-1 f0-2) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-3 v1-3 (/ f0-2 f1-1)) + ) + ) + ) + (set! (-> self control dynam gravity-max) 0.0) + (set! (-> self control dynam gravity-length) 0.0) + (set! (-> self control mod-surface) *float-mods*) + (target-darkjak-end-mode #t) + (target-lightjak-end-mode #t) + ) + :exit (behavior () + (sound-play-by-spec (static-sound-spec "menu-back" :group 1 :fo-curve 1) (new-sound-id) (the-as vector #t)) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (target-exit) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2 r2 l1 r1 x)) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons l2 r2 l1 r1 x)) + (when (nonzero? (-> self gun)) + (set! (-> self gun using-gun-type) (pickup-type none)) + (set! (-> self gun latch?) #f) + ) + (if (nonzero? (-> self board)) + (set! (-> self board latch?) #f) + ) + ) + :trans (behavior () + (set-time! (-> self control time-of-last-debug-float)) + (cond + ((cpad-hold? (-> self control cpad number) r2) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self control trans quad)) + (let ((v1-14 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control dynam gravity-normal) a1-0)) + ) + 0.0 + (vector-! v1-14 a1-0 (vector-float*! v1-14 (-> self control dynam gravity-normal) f0-1)) + (let* ((f1-2 (vector-length v1-14)) + (f2-0 f1-2) + (f0-2 (+ 512.0 f0-1)) + ) + (vector+! + a1-0 + (vector-float*! a1-0 (-> self control dynam gravity-normal) f0-2) + (vector-float*! v1-14 v1-14 (/ f1-2 f2-0)) + ) + ) + ) + (move-to-point! (-> self control) a1-0) + ) + ) + ((cpad-hold? (-> self control cpad number) l2) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> self control trans quad)) + (let ((v1-29 (new-stack-vector0)) + (f0-5 (vector-dot (-> self control dynam gravity-normal) a1-1)) + ) + 0.0 + (vector-! v1-29 a1-1 (vector-float*! v1-29 (-> self control dynam gravity-normal) f0-5)) + (let* ((f1-5 (vector-length v1-29)) + (f2-1 f1-5) + (f0-6 (+ -512.0 f0-5)) + ) + (vector+! + a1-1 + (vector-float*! a1-1 (-> self control dynam gravity-normal) f0-6) + (vector-float*! v1-29 v1-29 (/ f1-5 f2-1)) + ) + ) + ) + (move-to-point! (-> self control) a1-1) + ) + ) + ((cpad-pressed? (-> self control cpad number) l1 x) + (go (the-as (state target) target-falling)) + ) + ) + (let ((v1-43 (new-stack-vector0))) + (let ((f0-9 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-43 (-> self control transv) (vector-float*! v1-43 (-> self control dynam gravity-normal) f0-9)) + ) + (let* ((f0-10 (vector-length v1-43)) + (f1-7 f0-10) + (f2-2 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) + (vector-float*! v1-43 v1-43 (/ f0-10 f1-7)) + ) + ) + ) + ) + :code target-stance-anim + :post target-post + ) + +;; failed to figure out what this is: +(let ((v1-31 (copy *walk-mods* 'global))) + (set! (-> v1-31 name) 'blast-recover) + (set! (-> v1-31 flags) (surface-flag gun-off gun-fast-exit)) + (set! *blast-recover-mods* v1-31) + ) + +;; failed to figure out what this is: +(defstate target-blast-recover (target) + :event target-standard-event-handler + :code (behavior ((arg0 rigid-body-impact)) + (when (= (-> self ext-anim) (target-anim default)) + (set-forward-vel 0.0) + (set! (-> self control mod-surface) *blast-recover-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-blast-recover-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (the-as time-frame arg0)) + (ja-no-eval :group! jakb-blast-recover-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-no-eval :group! jakb-blast-recover-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-walk) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (go target-stance) + ) + :post target-no-stick-post + ) diff --git a/test/decompiler/reference/jak3/engine/target/target_REF.gc b/test/decompiler/reference/jak3/engine/target/target_REF.gc new file mode 100644 index 00000000000..15e4b35c52b --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target_REF.gc @@ -0,0 +1,4271 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function target-falling-trans +;; WARN: Return type mismatch int vs none. +(defbehavior target-falling-trans target ((arg0 symbol) (arg1 time-frame) (arg2 symbol)) + (set! arg2 (and (cpad-pressed? (-> self control cpad number) circle) (and (can-feet? #f) arg2))) + (if arg2 + (go target-attack-air #f) + ) + (when (= arg0 'target-eco-powerup) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (not (logtest? (water-flag touch-water) (-> self water flags))) + (not (time-elapsed? (-> self state-time) (seconds 3))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + (target-jump-go) + ) + ) + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-hit-ground #f) + ) + (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (>= arg1 0) + (time-elapsed? (-> self state-time) arg1) + (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) + ) + #t + ) + (logior! (-> self control status) (collide-status on-surface)) + (go target-hit-ground 'stuck) + ) + (when (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (the-as game-feature (logand (game-feature lightjak-regen) (-> *setting-control* user-current features))) + (-> self game features) + ) + (and (< (-> self fact health) (-> self fact health-max)) (zero? (-> self lightjak latch-out-time))) + ) + ) + (set! (-> self lightjak lightjak-before-powerjak) #t) + (go target-lightjak-regen 0) + ) + (if (!= (-> self state-time) (current-time)) + (slide-down-test) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-startup (target) + :event target-standard-event-handler + :code (behavior () + (suspend) + (suspend) + (go target-stance) + ) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defstate target-stance (target) + :event target-standard-event-handler + :enter (behavior () + (set! (-> self control mod-surface) *walk-mods*) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control bend-target) 0.0) + (target-state-hook-exit) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (logtest? (water-flag wading) (-> self water flags)) (not (using-gun? self))) + (go target-wade-stance) + ) + (when (= (-> self control ground-pat material) (pat-material ice)) + (set! (-> self control bend-target) 0.0) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (remove-exit) + (go target-ice-stance) + ) + (when (move-legs?) + (set! (-> self control bend-target) 0.0) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (remove-exit) + (go target-walk) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) r1) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (= (-> self ext-anim) (target-anim dark)) + (logtest? (the-as game-feature (logand (game-feature darkjak-smack) (-> *setting-control* user-current features))) + (-> self game features) + ) + (can-hands? #t) + ) + (go target-darkjak-smack-charge) + ) + (when (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-secrets button-invis) (-> self game secrets)) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (not (logtest? (target-flags invisible) (-> self target-flags))) + (>= (-> self game eco-pill-dark) (-> *FACT-bank* darkjak-button-invis-inc)) + ) + (target-invisible-start (seconds 30)) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-button-invis-inc))) + ) + ) + (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (set! (-> self control bend-target) 0.0) + (remove-exit) + (go target-duck-stance #f) + ) + (when (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-feature lightjak-regen) (-> self game features)) + (and (< (-> self fact health) (-> self fact health-max)) (zero? (-> self lightjak latch-out-time))) + ) + ) + (set! (-> self lightjak lightjak-before-powerjak) #t) + (go target-lightjak-regen 0) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (if (and (using-gun? self) + (and (-> self next-state) (= (-> self next-state name) 'target-stance)) + (let ((v1-163 (ja-group))) + (and v1-163 (or (= v1-163 jakb-stance-loop-ja) (= v1-163 jakb-lightjak-stance-ja))) + ) + ) + (go target-gun-stance) + ) + (if (and (logtest? (game-feature feature19) (-> self game features)) + (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons r1) + ) + ) + (go target-carry-pickup) + ) + (slide-down-test) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + ) + :code target-stance-anim + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-walk (target) + :event target-walk-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *walk-mods*) + ) + :exit (behavior () + (target-effect-exit) + (target-state-hook-exit) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (using-gun? self) + (and (-> self next-state) (= (-> self next-state name) 'target-walk)) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + ) + (go target-gun-walk) + ) + (when (= (-> self control ground-pat material) (pat-material ice)) + (target-effect-exit) + (remove-exit) + (go target-ice-walk) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons l1) + ) + (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (can-roll?)) + ) + (go target-roll) + ) + (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (target-effect-exit) + (remove-exit) + (go target-duck-walk #f) + ) + (when (not (move-legs?)) + (target-effect-exit) + (remove-exit) + (go target-stance) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) r1) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (= (-> self ext-anim) (target-anim dark)) + (logtest? (the-as game-feature (logand (game-feature darkjak-smack) (-> *setting-control* user-current features))) + (-> self game features) + ) + (can-hands? #t) + ) + (go target-darkjak-smack-charge) + ) + (when (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-secrets button-invis) (-> self game secrets)) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (not (logtest? (target-flags invisible) (-> self target-flags))) + (>= (-> self game eco-pill-dark) (-> *FACT-bank* darkjak-button-invis-inc)) + ) + (target-invisible-start (seconds 30)) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-button-invis-inc))) + ) + ) + (when (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-feature lightjak-regen) (-> self game features)) + (and (< (-> self fact health) (-> self fact health-max)) (zero? (-> self lightjak latch-out-time))) + ) + ) + (set! (-> self lightjak lightjak-before-powerjak) #t) + (go target-lightjak-regen 0) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (when (and (turn-around?) (time-elapsed? (-> self state-time) (seconds 0.3))) + (set! (-> self control transv quad) + (-> self control transv-history (-> self control idx-of-fastest-xz-vel) quad) + ) + (set! (-> self control transv w) 1.0) + (go target-turn-around) + ) + (if (and (logtest? (game-feature feature19) (-> self game features)) + (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons r1) + ) + ) + (go target-carry-pickup) + ) + (if (wall-hide?) + (go target-hide) + ) + (slide-down-test) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + ) + :code (behavior () + (target-walk-anim -300) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-turn-around (target) + :event target-standard-event-handler + :enter (behavior () + (vector-turn-to (-> self control transv)) + (set! (-> self control mod-surface) *turn-around-mods*) + (set! (-> self control bend-target) 1.0) + ) + :exit (behavior () + (target-state-hook-exit) + (set-forward-vel 0.0) + (set! (-> self control ctrl-xz-vel) 0.0) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set! (-> self control bend-target) 0.0) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #t)) + (go target-attack) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t)) + (go target-running-attack) + ) + (if (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (seconds 0.08)) + ) + (go target-falling #f) + ) + (slide-down-test) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! jakb-turn-around-ja :num! min) + (quaternion-rotate-y! (-> self control dir-targ) (-> self control dir-targ) 32768.0) + (compute-alignment! (-> self align)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 2.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + ) + (remove-exit) + (set! (-> self control bend-target) 0.0) + (set! (-> self control ctrl-xz-vel) (* 40960.0 (-> self darkjak-giant-interp))) + (set-forward-vel (-> self control ctrl-xz-vel)) + (target-state-hook-exit) + (go target-walk) + ) + :post target-no-stick-post + ) + +;; failed to figure out what this is: +(defstate target-slide-down (target) + :event target-walk-event-handler + :enter (behavior () + (set! (-> self control mod-surface) *jump-mods*) + ) + :exit (behavior () + (set-time! (-> self control unknown-time-frame13)) + ) + :trans (behavior () + (when (or (logtest? (-> self control status) (collide-status on-surface)) + (if (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + #t + ) + ) + (logior! (-> self control status) (collide-status on-surface)) + (if (using-gun? self) + (go target-stance) + (go target-duck-stance #f) + ) + ) + ) + :code (behavior () + (cond + ((= (-> self ext-anim) (target-anim default)) + (let ((v1-3 (ja-group))) + (if (not (and v1-3 (= v1-3 jakb-duck-stance-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (until #f + (ja-no-eval :group! jakb-duck-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + (else + (let ((v1-34 (ja-group))) + (if (not (and v1-34 (= v1-34 jakb-jump-loop-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (until #f + (ja-no-eval :group! jakb-jump-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + ) + :post target-post + ) + +;; definition for symbol *slide-down-mods*, type surface +(define *slide-down-mods* (new 'static 'surface + :name 'run + :turnv 131072.0 + :turnvf 60.0 + :turnvv 524288.0 + :turnvvf 30.0 + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 81920.0 + :target-speed 81920.0 + :seek0 0.4 + :seek90 0.4 + :seek180 0.4 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags (surface-flag no-turn-around) + ) + ) + +;; definition for symbol *slide-jump-mods*, type surface +(define *slide-jump-mods* (new 'static 'surface + :name 'jump + :turnv 32768.0 + :turnvf 300.0 + :turnvv 18204.445 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.05 + :seek90 0.05 + :seek180 0.05 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +;; failed to figure out what this is: +(defstate target-slide-down-to-ground (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('slide) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *slide-down-mods*) + (set! (-> self control sliding-start-time) 0) + (set! (-> self control force-turn-to-strength) 1.0) + (set! (-> self control force-turn-to-speed) 1.0) + ) + :exit (behavior () + (target-effect-exit) + (target-exit) + (set-time! (-> self control unknown-time-frame13)) + ) + :trans (behavior () + (if (and (or (and (logtest? (-> self control status) (collide-status on-surface)) + (and (< 0.9 (-> self control surface-angle)) + (!= (-> self control cur-pat material) 14) + (!= (-> self control cur-pat event) 7) + (!= (-> self control cur-pat event) 14) + (or (= (-> self control cur-pat mode) (pat-mode ground)) + (= (-> self control cur-pat mode) (pat-mode halfpipe)) + ) + ) + ) + (if (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + #t + ) + ) + (zero? (-> self control sliding-start-time)) + ) + (set-time! (-> self control sliding-start-time)) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + (!= (-> self state-time) (current-time)) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control force-turn-to-direction) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) + ) + (vector-normalize-copy! (-> self control transv) (-> self control force-turn-to-direction) 40960.0) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) *slide-jump-mods*) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + (!= (-> self state-time) (current-time)) + ) + (go target-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + (time-elapsed? (-> self control last-running-attack-end-time) (seconds 0.7)) + (!= (-> self state-time) (current-time)) + ) + (go target-running-attack) + ) + (when (= (-> self control force-turn-to-strength) 0.0) + (logior! (-> self control status) (collide-status on-surface)) + (if (using-gun? self) + (go target-stance) + (go target-duck-stance #f) + ) + ) + (set! (-> self control ctrl-xz-vel) (* 40960.0 (-> self darkjak-giant-interp))) + ) + :code (-> target-walk code) + :post (behavior () + (cond + ((zero? (-> self control sliding-start-time)) + (vector-normalize! + (vector-flatten! + (-> self control force-turn-to-direction) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal)) + (-> self control surface-normal) + ) + 1.0 + ) + (if (< 0.0 + (vector-dot + (-> self control force-turn-to-direction) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control force-turn-to-direction) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control force-turn-to-direction)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + ) + ) + ((nonzero? (-> self control sliding-start-time)) + (seek! (-> self control force-turn-to-strength) 0.0 (* 4.0 (seconds-per-frame))) + ) + ) + (set! (-> self control turn-lockout-end-time) (+ (current-time) (seconds 0.1))) + (target-post) + ) + ) + +;; definition for function init-var-jump +;; INFO: Used lq/sq +(defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 symbol) (arg3 symbol) (arg4 vector) (arg5 float)) + (logclear! (-> self control status) (collide-status touch-ceiling-sticky)) + (set-time! (-> self control unknown-time-frame19)) + (delete-back-vel) + (let* ((f0-0 arg5) + (f1-0 0.0) + (f2-2 (+ (* 0.0016666667 (-> self control dynam gravity-length)) + (fmax 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + ) + (f0-1 (* f0-0 (fmax f1-0 (/ (* 0.5 f2-2 f2-2) (-> self control dynam gravity-length))))) + (s5-1 (+ arg0 f0-1)) + ) + (let ((s2-1 (+ arg1 f0-1))) + (when (not (time-elapsed? (-> self control rider-time) (seconds 0.05))) + (let ((f0-4 + (fmax + 0.0 + (fmin 28672.0 (* 0.5 (vector-dot (-> self control dynam gravity-normal) (-> self control rider-last-move)))) + ) + ) + ) + (set! s5-1 (+ s5-1 f0-4)) + (set! s2-1 (+ s2-1 f0-4)) + ) + (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) + ) + (set! (-> self control unknown-float36) 0.0) + (set! (-> self control unknown-float37) 0.0) + (cond + (arg3 + (set! (-> self control unknown-word04) + (the-as uint (- s5-1 (+ -409.6 (-> *TARGET-bank* jump-collide-offset)))) + ) + (set! (-> self control did-move-to-pole-or-max-jump-height) (- s2-1 (-> *TARGET-bank* jump-collide-offset))) + ) + (else + (set! (-> self control unknown-word04) (the-as uint s5-1)) + (set! (-> self control did-move-to-pole-or-max-jump-height) s2-1) + ) + ) + ) + (when arg2 + (- (sqrtf (* 2.0 (-> self control dynam gravity-length) s5-1)) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + (new 'stack-no-clear 'vector) + (let ((v1-55 (new-stack-vector0))) + (let ((f0-20 (vector-dot (-> self control dynam gravity-normal) arg4))) + 0.0 + (vector-! v1-55 arg4 (vector-float*! v1-55 (-> self control dynam gravity-normal) f0-20)) + ) + (let* ((f0-21 (vector-length v1-55)) + (f1-18 f0-21) + (f2-15 + (- (sqrtf (* 2.0 (-> self control dynam gravity-length) s5-1)) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + arg4 + (vector-float*! arg4 (-> self control dynam gravity-normal) f2-15) + (vector-float*! v1-55 v1-55 (/ f0-21 f1-18)) + ) + ) + ) + ) + ) + (let ((v0-2 (-> self control unknown-vector37))) + (set! (-> v0-2 quad) (-> self control trans quad)) + v0-2 + ) + ) + +;; definition for function mod-var-jump +;; INFO: Used lq/sq +(defbehavior mod-var-jump target ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 vector)) + (local-vars (v0-1 vector)) + (let ((f0-1 (* 0.033333335 (the float (- (current-time) (-> self state-time)))))) + (cond + ((or (< 1.0 f0-1) (< (-> self control unknown-float36) 0.0) (not arg2)) + (set! (-> self control unknown-float36) -1.0) + ) + (else + (set! (-> self control unknown-float36) f0-1) + (set! (-> self control unknown-float37) f0-1) + (when arg0 + (let ((s3-1 (vector-! (new-stack-vector0) (-> self control trans) (-> self control unknown-vector37))) + (s4-0 (new-stack-vector0)) + ) + (let ((f1-5 (vector-dot (-> self control dynam gravity-normal) arg3))) + 0.0 + (vector-! s4-0 arg3 (vector-float*! s4-0 (-> self control dynam gravity-normal) f1-5)) + ) + (let* ((f30-0 (vector-length s4-0)) + (f28-0 f30-0) + (f0-7 + (- (sqrtf + (* 2.0 + (-> self control dynam gravity-length) + (- (lerp-scale + (the-as float (-> self control unknown-word04)) + (-> self control did-move-to-pole-or-max-jump-height) + f0-1 + 0.0 + 1.0 + ) + (vector-dot (-> self control dynam gravity-normal) s3-1) + ) + ) + ) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + arg3 + (vector-float*! arg3 (-> self control dynam gravity-normal) f0-7) + (vector-float*! s4-0 s4-0 (/ f30-0 f28-0)) + ) + ) + ) + ) + ) + ) + ) + 0 + (when (and arg1 (ja-group) (and (-> (ja-group) extra) #t)) + (let ((v1-57 (res-lump-struct (-> (ja-group) extra) 'collide-offset vector :time (ja-aframe-num 0)))) + (cond + (v1-57 + (set! v0-1 (-> self control anim-collide-offset-local)) + (set! (-> v0-1 quad) (-> v1-57 quad)) + ) + (else + (set! v0-1 (-> self control anim-collide-offset-local)) + (set! (-> v0-1 quad) (the-as uint128 0)) + ) + ) + ) + v0-1 + ) + ) + +;; definition for symbol *duck-mods*, type surface +(define *duck-mods* + (new 'static 'surface + :name 'duck + :turnv 131072.0 + :turnvf 30.0 + :turnvv 524288.0 + :turnvvf 30.0 + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 16384.0 + :target-speed 16384.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (surface-clamp-speed arg0 arg1 arg2 arg3) + (when (= arg3 1) + (cond + ((or (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (using-gun? self) (= (gun->eco (-> self gun gun-type)) (pickup-type eco-blue))) + ) + (set! (-> arg0 target-speed) 0.0) + (set! (-> arg0 seek0) 0.0) + (set! (-> arg0 seek90) 0.0) + (set! (-> arg0 seek180) 0.0) + (set! (-> arg0 turnv) 0.0) + (set! (-> arg0 turnvv) 0.0) + ) + (else + (set! (-> arg0 target-speed) 16384.0) + ) + ) + ) + ) + :flags (surface-flag duck) + ) + ) + +;; failed to figure out what this is: +(defstate target-duck-stance (target) + :event target-standard-event-handler + :enter (behavior ((arg0 symbol)) + (if (not arg0) + (set-time! (-> self state-time)) + ) + (set! (-> self control bend-target) 1.0) + (set! (-> self control mod-surface) *duck-mods*) + (target-collide-set! 'duck 1.0) + (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) + 0 + ) + :exit (behavior () + (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-duck-walk) + (= v1-3 'target-duck-stance) + (= v1-3 'target-walk) + (= v1-3 'target-stance) + (= v1-3 'target-stance-look-around) + ) + ) + ) + ) + (target-state-hook-exit) + ) + (target-exit) + (if (= (-> self control collide-mode) 'duck) + (target-collide-set! 'normal 0.0) + ) + ) + :trans (behavior () + ((-> self state-hook)) + (if (or (and (or (not (cpad-hold? (-> self control cpad number) l1)) + (logtest? (-> self target-flags) (target-flags prevent-duck)) + ) + (let ((v1-13 (ja-group))) + (and (not (and v1-13 (or (= v1-13 jakb-duck-roll-end-ja) + (= v1-13 jakb-duck-roll-ja) + (= v1-13 jakb-gun-duck-roll-end-ja) + (= v1-13 jakb-gun-duck-roll-ja) + ) + ) + ) + (can-exit-duck? self) + ) + ) + ) + (and (nonzero? (-> self ext-anim)) (!= (-> self ext-anim) 2)) + ) + (go target-stance) + ) + (if (and (move-legs?) (and (!= (-> self control current-surface seek0) 0.0) (zero? (-> self ext-anim)))) + (go target-duck-walk 'duck) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) r1) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (= (-> self ext-anim) (target-anim dark)) + (logtest? (the-as game-feature (logand (game-feature darkjak-smack) (-> *setting-control* user-current features))) + (-> self game features) + ) + (can-hands? #t) + ) + (go target-darkjak-smack-charge) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck) + (target-jump-go) + ) + ) + (when (and (cpad-pressed? (-> self control cpad number) square) (can-hands? #t)) + (if (and (can-exit-duck? self) + (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + ) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + (slide-down-test) + ) + :code (behavior ((arg0 symbol)) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 jakb-duck-roll-ja) (= v1-2 jakb-gun-duck-roll-ja))) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (cond + ((using-gun? self) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.7))) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-duck-roll-end-ja) + 0.0 + 0 + 30 + 1.0 + 6.0 + #f + ) + (ja-no-eval :group! jakb-gun-duck-roll-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-duck-roll-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (set! (-> self neck flex-blend) 1.0) + (set! (-> self neck base-joint) (the-as uint 6)) + ) + ((let ((v1-68 (ja-group))) + (and (and v1-68 (= v1-68 jakb-duck-stance-ja)) (= (-> self skel root-channel 0) (-> self skel channel))) + ) + ) + ((let ((v1-78 (ja-group))) + (and v1-78 (or (= v1-78 jakb-duck-walk-ja) (= v1-78 jakb-gun-duck-walk-ja))) + ) + (ja-channel-push! 1 (seconds 0.1)) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 473) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= (-> self ext-anim) (target-anim default)) + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! jakb-stance-to-duck-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (go target-stance) + ) + ) + ) + (until #f + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-no-eval :group! (-> self draw art-group data 474) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-duck-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-duck-walk (target) + :event target-standard-event-handler + :enter (behavior ((arg0 symbol)) + (let ((gp-0 arg0)) + (if (nonzero? (-> self ext-anim)) + (go target-duck-stance arg0) + ) + (if (not gp-0) + (set-time! (-> self state-time)) + ) + ) + (set! (-> self control bend-target) 1.0) + (target-collide-set! 'duck 1.0) + (let ((v1-11 (ja-group))) + (if (not (and v1-11 (or (= v1-11 jakb-duck-roll-ja) (= v1-11 jakb-gun-duck-roll-ja)))) + (set! (-> self control mod-surface) *duck-mods*) + ) + ) + ) + :exit (-> target-duck-stance exit) + :trans (behavior () + (local-vars (v1-22 joint-control-channel)) + ((-> self state-hook)) + (when (and (or (not (cpad-hold? (-> self control cpad number) l1)) + (logtest? (-> self target-flags) (target-flags prevent-duck)) + (and (logtest? (water-flag wading) (-> self water flags)) + (>= (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) + ) + ) + (can-exit-duck? self) + ) + (if (and (using-gun? self) + (begin (set! v1-22 (get-channel (-> self skel top-anim) 0)) v1-22) + (= (-> v1-22 frame-group) jakb-gun-duck-roll-end-ja) + ) + (target-top-anim-base-mode 60) + ) + (go target-walk) + ) + (if (not (move-legs?)) + (go target-duck-stance 'duck) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck) + (target-jump-go) + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) + (can-hands? #t) + (can-exit-duck? self) + (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + (slide-down-test) + ) + :code (behavior ((arg0 symbol)) + (let ((gp-0 (if (using-gun? self) + jakb-gun-duck-walk-ja + jakb-duck-walk-ja + ) + ) + (v1-6 (ja-group)) + ) + (cond + ((and (and v1-6 (or (= v1-6 jakb-duck-walk-ja) (= v1-6 jakb-gun-duck-walk-ja))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + (else + (let ((v1-16 (ja-group))) + (cond + ((and v1-16 (= v1-16 jakb-duck-stance-ja)) + (ja-channel-push! 1 (seconds 0.45)) + (ja :group! gp-0 :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! gp-0 :num! min) + ) + ) + ) + ) + ) + ) + (logior! (-> self target-flags) (target-flags lleg-no-ik rleg-no-ik)) + (until #f + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (set! (-> self control mod-surface) *duck-mods*) + ) + (ja :num! (loop! (fmin 3.0 (/ (-> self control ctrl-xz-vel) + (* 60.0 (/ (-> *TARGET-bank* duck-walk-cycle-dist) (-> *TARGET-bank* run-cycle-length))) + ) + ) + ) + ) + (suspend) + ) + #f + ) + :post target-post + ) + +;; definition for function target-jump-top-anim +;; WARN: Return type mismatch int vs none. +(defbehavior target-jump-top-anim target () + (let ((gp-0 (get-channel (-> self skel top-anim) 0))) + (when gp-0 + (let ((s5-0 (-> gp-0 frame-group)) + (f0-0 (ja-aframe-num 0)) + ) + (when (or (= s5-0 jakb-gun-side-jump-ja) (= s5-0 jakb-gun-front-jump-ja)) + (let ((v1-13 (ja-group))) + (if (and v1-13 (= v1-13 jakb-duck-high-jump-ja)) + (set! (-> gp-0 frame-num) (/ (- f0-0 (+ 16.0 (-> s5-0 artist-base))) (-> s5-0 artist-step))) + (set! (-> gp-0 frame-num) (/ (- f0-0 (-> s5-0 artist-base)) (-> s5-0 artist-step))) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (when (= (-> self control jump-kind) 'launch) + (talker-spawn-func (-> *talker-speech* 45) *entity-pool* (target-pos 0) (the-as region #f)) + (talker-spawn-func (-> *talker-speech* 46) *entity-pool* (target-pos 0) (the-as region #f)) + enter-state + (let ((a0-7 (-> self control unknown-dword07)) + (a1-3 (-> self control unknown-dword08)) + (a2-3 (-> self control unknown-vector37)) + ) + (set! (-> a2-3 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-7) (the-as symbol a1-3) a2-3 (-> self control unknown-dword10)) + ) + ) + (set-time! (-> self state-time)) + (sound-play "jump" :vol 70) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + *jump-mods* + ) + ) + ) + (set! (-> self control mod-surface) arg2) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) + ) + (set! (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) + ) + ) + :exit target-exit + :trans (behavior () + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (let ((t9-0 target-falling-trans) + (a0-1 #f) + (v1-12 (ja-group)) + ) + (t9-0 + a0-1 + (the-as time-frame (if (and v1-12 (= v1-12 jakb-jump-loop-ja)) + 15 + -1 + ) + ) + #t + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) x) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + (* 12288.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) + ) + (and (< -116736.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (not (logtest? (water-flag touch-water) (-> self water flags))) + (not (logtest? (target-flags prevent-jump prevent-double-jump) (-> self target-flags))) + ) + ) + (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) + (and (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + (* 26624.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) + ) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + ) + (go + target-flop + 65502.96 + -163840.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + 'flop + ) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (slide-down-test) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) + (seconds-per-frame) + ) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (let ((f28-0 20.0) + (f30-0 1.0) + ) + (when (and (using-gun? self) (not (-> self gun charge-active?))) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-side-jump-ja) 0.0 30 30 1.0 0.0 #f) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (let ((v1-21 (ja-group))) + (cond + ((and (and v1-21 (= v1-21 jakb-flop-down-land-ja)) (>= 25.0 (ja-aframe-num 0)) (>= (ja-aframe-num 0) 17.0)) + (set! (-> self neck flex-blend) 0.0) + (ja-channel-push! 1 0) + (cond + ((and (using-gun? self) (zero? (-> self ext-anim))) + (ja :group! jakb-duck-high-jump-ja :num! (identity (ja-aframe 16.0 0))) + (set! f28-0 35.0) + ) + (else + (ja :group! jakb-flop-jump-ja :num! (identity (ja-aframe 25.0 0))) + (set! f28-0 24.0) + (set! f30-0 0.3) + ) + ) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 444) :num! min) + (suspend) + 0 + ) + (else + (ja-channel-push! 2 (seconds 0.05)) + (ja :group! jakb-jump-ja :num! min) + (let ((a0-26 (-> self skel root-channel 1))) + (let ((f0-8 (-> self control unknown-float35))) + (set! (-> a0-26 frame-interp 1) f0-8) + (set! (-> a0-26 frame-interp 0) f0-8) + ) + (set! (-> a0-26 frame-group) (the-as art-joint-anim jakb-jump-forward-ja)) + (set! (-> a0-26 param 0) 0.0) + (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim jakb-jump-forward-ja) num-func-chan) + ) + (suspend) + (ja :group! jakb-jump-ja :num! (+!)) + (let ((a0-28 (-> self skel root-channel 1))) + (let ((f0-11 (-> self control unknown-float35))) + (set! (-> a0-28 frame-interp 1) f0-11) + (set! (-> a0-28 frame-interp 0) f0-11) + ) + (set! (-> a0-28 frame-group) (the-as art-joint-anim jakb-jump-forward-ja)) + (set! (-> a0-28 param 0) 0.0) + (joint-control-channel-group-eval! a0-28 (the-as art-joint-anim jakb-jump-forward-ja) num-func-chan) + ) + (suspend) + 0 + ) + ) + ) + (until (ja-done? 0) + (let ((f26-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f24-0 (- f28-0 (ja-aframe-num 0))) + ) + (target-jump-top-anim) + (ja :num! (seek! max (if (and (< 0.0 f26-1) (< 0.0 f24-0)) + (fmin (fmin 3.0 f24-0) (/ (* 5.0 f24-0) (the float (time-to-apex f26-1 -245760.0)))) + f30-0 + ) + ) + ) + ) + (when (>= (ja-group-size) 2) + (let ((a0-33 (-> self skel root-channel 1))) + (let ((f0-26 (-> self control unknown-float35))) + (set! (-> a0-33 frame-interp 1) f0-26) + (set! (-> a0-33 frame-interp 0) f0-26) + ) + (set! (-> a0-33 param 0) 0.0) + (joint-control-channel-group-eval! a0-33 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (suspend) + ) + ) + (target-falling-anim -1 (seconds 0.2)) + (go target-falling #f) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-jump-forward (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + ((-> target-jump enter) arg0 arg1 (the-as surface #f)) + (set! (-> self control mod-surface) *forward-jump-mods*) + ) + :exit target-exit + :trans (-> target-jump trans) + :code (behavior ((arg0 float) (arg1 float)) + (when (and (using-gun? self) (not (-> self gun charge-active?))) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-side-jump-ja) 3.0 30 30 1.0 0.0 #f) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-ja) + 3.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (ja-channel-set! 1) + (ja-no-eval :group! jakb-jump-ja :num! (seek!) :frame-num (ja-aframe 3.0 0)) + (until (ja-done? 0) + (set! (-> self control time-of-last-clear-wall-in-jump) 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (target-jump-top-anim) + (ja :group! jakb-jump-loop-ja :num! (loop!)) + ) + #f + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-double-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + (if (and (cpad-pressed? (-> self control cpad number) x) + (and (focus-test? self light) + (nonzero? (-> self lightjak)) + (logtest? (-> self lightjak stage) (lightjak-stage swoop)) + ) + (logtest? (the-as game-feature (logand (game-feature lightjak-swoop) (-> *setting-control* user-current features))) + (-> self game features) + ) + (>= (-> self game eco-pill-light) (-> *FACT-bank* lightjak-swoop-inc)) + (= (-> self fact shield-level) 0.0) + (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-feet))) + (and (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + (zero? (-> self lightjak latch-out-time)) + ) + ) + (go target-lightjak-swoop 1.2) + ) + (when (= (-> self control jump-kind) 'launch) + enter-state + (let ((a0-21 (-> self control unknown-dword07)) + (a1-1 (-> self control unknown-dword08)) + (a2-0 (-> self control unknown-vector37)) + ) + (set! (-> a2-0 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-21) (the-as symbol a1-1) a2-0 (-> self control unknown-dword10)) + ) + ) + (set-time! (-> self state-time)) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (if (!= (-> self control mod-surface) *slide-jump-mods*) + (set! (-> self control mod-surface) *double-jump-mods*) + ) + ) + :exit target-exit + :trans (behavior () + (let ((t9-0 target-falling-trans) + (a0-0 #f) + (v1-2 (ja-group)) + ) + (t9-0 + a0-0 + (the-as time-frame (if (and v1-2 (= v1-2 jakb-jump-loop-ja)) + 15 + -1 + ) + ) + #t + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) square) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (go + target-flop + 33775.48 + -122880.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + 'flop + ) + ) + (if (!= (-> self state-time) (current-time)) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + ) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))) + (seconds-per-frame) + ) + ) + :code (behavior ((arg0 float) (arg1 float)) + (sound-play "jump-double") + (when (and (using-gun? self) (not (-> self gun charge-active?))) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-side-jump-ja) 7.0 30 30 1.0 0.0 #f) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-ja) + 7.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 444) :num! (seek!) :frame-num (ja-aframe 7.0 0)) + ) + (else + (ja-channel-push! 2 (seconds 0.05)) + (ja-no-eval :group! jakb-jump-ja :num! (seek!) :frame-num (ja-aframe 5.0 0)) + (ja :chan 1 :group! jakb-jump-forward-ja :num! (chan 0)) + ) + ) + (until (ja-done? 0) + (suspend) + (target-jump-top-anim) + (ja :num! (seek!)) + (when (>= (ja-group-size) 2) + (let ((a0-20 (-> self skel root-channel 1))) + (let ((f0-13 (-> self control unknown-float35))) + (set! (-> a0-20 frame-interp 1) f0-13) + (set! (-> a0-20 frame-interp 0) f0-13) + ) + (set! (-> a0-20 param 0) 0.0) + (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-chan) + ) + ) + ) + (target-falling-anim -1 (seconds 0.2)) + (go target-falling #f) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-high-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 object)) + (when (and (= (-> self control jump-kind) 'launch) (!= arg2 'launch)) + enter-state + (let ((a0-3 (-> self control unknown-dword07)) + (a1-1 (-> self control unknown-dword08)) + (a2-1 (-> self control unknown-vector37)) + ) + (set! (-> a2-1 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-1 (-> self control unknown-dword10)) + ) + ) + (set! (-> self control unknown-symbol03) (the-as float arg2)) + (if (and (or (= arg2 'duck) (= arg2 'launch)) (zero? (-> self ext-anim))) + (go target-duck-high-jump arg0 arg1 (the-as symbol arg2)) + ) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (sound-play "jump" :pitch 0.3) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (set! (-> self control mod-surface) (cond + ((= arg2 'flip) + *flip-jump-mods* + ) + ((= arg2 'flop-forward) + *forward-high-jump-mods* + ) + (else + *high-jump-mods* + ) + ) + ) + (set! (-> self control unknown-float35) + (fmax 0.0 (fmin 0.5 (* 0.00008138021 (+ -409.6 (-> self control ctrl-xz-vel))))) + ) + ) + :exit target-exit + :trans (behavior () + (let ((t9-0 target-falling-trans) + (a0-0 #f) + (v1-2 (ja-group)) + ) + (t9-0 + a0-0 + (the-as time-frame (if (and v1-2 (= v1-2 jakb-jump-loop-ja)) + 15 + -1 + ) + ) + #t + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (go + target-flop + 33775.48 + -122880.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + 'flop + ) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control ctrl-xz-vel))))) + (seconds-per-frame) + ) + ) + :code (-> target-jump code) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-duck-high-jump (target) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control mod-surface) *turn-around-mods*) + (case arg2 + (('launch) + ) + (else + ) + ) + ) + :exit target-exit + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((v1-2 (ja-group))) + (if (not (and (and v1-2 (= v1-2 jakb-duck-stance-ja)) (= (-> self skel root-channel 0) (-> self skel channel)))) + (ja-channel-push! 1 (seconds 0.04)) + ) + ) + (let ((v1-11 arg2)) + (cond + ((or (= v1-11 'flop) (= v1-11 'flop-forward)) + (ja-no-eval :group! jakb-flop-jump-ja :num! (seek! (ja-aframe 25.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 25.0 0))) + ) + ) + ((using-gun? self) + (ja :group! jakb-duck-high-jump-ja :num! (identity (ja-aframe 16.0 0))) + ) + (else + (ja-no-eval :group! jakb-duck-high-jump-ja :num! (seek! (ja-aframe 16.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 16.0 0))) + ) + ) + ) + ) + (go target-duck-high-jump-jump arg0 arg1 arg2) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-duck-high-jump-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-symbol03) (the-as float arg2)) + (set-time! (-> self state-time)) + (sound-play "jump" :vol 80 :pitch -0.4) + (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (cond + ((= arg2 'launch) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *launch-jump-mods*) + ) + (else + (set! (-> self control mod-surface) *high-jump-mods*) + ) + ) + ) + :exit target-exit + :trans (behavior () + ((-> target-high-jump trans)) + (let ((v1-2 (-> self control unknown-symbol03))) + (when (= (the-as int v1-2) 'launch) + (when *sound-player-enable* + (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-0 command) (sound-command set-param)) + (set! (-> gp-0 id) (-> self control unknown-sound-id00)) + (let ((a1-0 (ear-trans 0))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 control))) + (set! a1-0 (-> s5-0 control trans)) + (set! a1-0 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> gp-0 params trans) a1-0) + ) + (set! (-> gp-0 params mask) (the-as uint 32)) + (-> gp-0 id) + ) + ) + ) + ) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (when (and (using-gun? self) (not (-> self gun charge-active?))) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-side-jump-ja) 0.0 30 30 1.0 0.0 #f) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (let* ((f30-0 1.0) + (v1-18 arg2) + (f28-0 (cond + ((= v1-18 'launch) + 110.0 + ) + ((or (= v1-18 'flop) (= v1-18 'flop-forward)) + (set! f30-0 0.75) + 44.0 + ) + (else + 35.0 + ) + ) + ) + ) + (until (ja-done? 0) + (let ((f24-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f26-0 (- f28-0 (ja-aframe-num 0))) + ) + (target-jump-top-anim) + (let ((f22-1 (fmin (fmin 3.0 f26-0) (/ (* 5.0 f26-0) (the float (time-to-apex f24-0 -245760.0))))) + (s5-0 (-> self skel root-channel 0)) + ) + (set! (-> s5-0 param 0) (the float (+ (-> s5-0 frame-group frames num-frames) -1))) + (let ((v1-41 (cond + ((and (< 0.0 f24-0) (< 0.0 f26-0)) + (if (= arg2 'launch) + (set! f30-0 (lerp f30-0 (* 4.0 f22-1) 0.25)) + ) + f22-1 + ) + (else + f30-0 + ) + ) + ) + ) + (set! (-> s5-0 param 1) v1-41) + ) + (joint-control-channel-group-eval! s5-0 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (suspend) + ) + ) + (cond + ((or (= arg2 'flop) (= arg2 'flop-forward)) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (ja :group! jakb-jump-loop-ja :num! (loop!)) + ) + #f + ) + (else + (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (ja :group! jakb-jump-loop-ja :num! (loop!)) + ) + #f + ) + ) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-falling (target) + :event target-jump-event-handler + :enter (behavior ((arg0 symbol)) + (case arg0 + (('uppercut) + (set! (-> self control mod-surface) *uppercut-jump-mods*) + ) + (else + (set! (-> self control mod-surface) *jump-mods*) + ) + ) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (target-falling-trans + (the-as symbol (-> self control unknown-spool-anim00)) + (the-as time-frame (if (= (-> self control unknown-spool-anim00) #f) + 0 + (the-as int (/ (the-as int (-> *TARGET-bank* stuck-time)) 2)) + ) + ) + #t + ) + ) + :code (behavior ((arg0 symbol)) + (case arg0 + (('uppercut) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self gun surpress-time) 0) + (send-event self 'gun (-> self gun gun-type)) + (set! (-> self gun track-target-hold-time) 0) + 0 + ) + (('hit) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! jakb-hit-from-front-ja :num! (seek!) :frame-num (ja-aframe 15.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (target-falling-anim -1 (seconds 0.33)) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-hit-ground (target) + :event target-walk-event-handler + :enter (behavior ((arg0 symbol)) + (set! (-> self control turn-go-the-long-way) 0.0) + (cond + ((or (= arg0 'stuck) (focus-test? self indax)) + ) + (else + (let ((f0-2 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control last-trans-any-surf) (-> self control trans)) + ) + ) + ) + (if (and (< (-> *TARGET-bank* fall-far) f0-2) (not (logtest? (-> self control status) (collide-status on-water)))) + (go target-hit-ground-hard f0-2) + ) + ) + ) + ) + (cond + ((= arg0 'stuck) + ) + (else + (target-land-effect) + ) + ) + (set! (-> self control last-running-attack-end-time) 0) + (set! (-> self control last-attack-end-time) 0) + (if (>= (-> self control ground-impact-vel) (-> *TARGET-bank* fall-stumble-threshold)) + (set-forward-vel 0.0) + ) + (if (!= (-> self control ground-pat material) (pat-material ice)) + (delete-back-vel) + ) + (set! (-> self control mod-surface) *walk-mods*) + (start-bobbing! + (-> self water) + (lerp-scale 0.0 4096.0 (-> self control ground-impact-vel) 40960.0 102400.0) + 600 + 1500 + ) + (when (and (using-gun? self) (let ((v1-35 (-> self water flags))) + (and (not (and (logtest? (water-flag touch-water) v1-35) + (logtest? (water-flag under-water swimming) v1-35) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + ) + (not (-> self gun charge-active?)) + ) + ) + ) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-side-jump-land-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type eco-red) (pickup-type eco-dark)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-land-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-front-jump-land-ja) + 0.0 + 30 + 30 + 1.0 + 25.0 + #f + ) + ) + ) + ) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + ) + :trans (behavior () + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (if (and (or (cpad-hold? (-> self control cpad number) l1) (not (can-exit-duck? self))) (can-duck?)) + (go target-duck-stance #f) + ) + (when (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (if (logtest? (water-flag wading) (-> self water flags)) + (go target-wade-walk) + (go target-walk) + ) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (if (and (cpad-hold? (-> self control cpad number) r1) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (logtest? (the-as game-feature (logand (game-feature darkjak-smack) (-> *setting-control* user-current features))) + (-> self game features) + ) + (can-hands? #t) + ) + (go target-darkjak-smack-charge) + ) + (when (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-secrets button-invis) (-> self game secrets)) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (not (logtest? (target-flags invisible) (-> self target-flags))) + (>= (-> self game eco-pill-dark) (-> *FACT-bank* darkjak-button-invis-inc)) + ) + (target-invisible-start (seconds 30)) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-button-invis-inc))) + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (if (and (using-gun? self) (-> self gun charge-active?)) + (go target-stance) + ) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + (slide-down-test) + ) + :code (behavior ((arg0 symbol)) + (target-hit-ground-anim #f (are-still?)) + (go target-stance) + ) + :post target-post + ) + +;; definition for symbol *attack-mods*, type surface +(define *attack-mods* (new 'static 'surface + :name 'attack + :tiltv 65536.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (case (-> self control ground-pat event) + (((pat-event slide)) + (set! (-> arg0 seek0) 0.05) + (set! (-> arg0 seek90) 0.05) + (set! (-> arg0 seek180) 0.05) + ) + ) + ) + ) + ) + :mode 'attack + :flags (surface-flag attack spin gun-inactive gun-turn-fast) + ) + ) + +;; failed to figure out what this is: +(let ((v1-25 (copy *attack-mods* 'global))) + (set! (-> v1-25 flags) (surface-flag attack spin gun-turn-fast)) + (set! (-> v1-25 mult-hook) + (the-as + (function surface surface surface int none) + (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + ((-> *attack-mods* mult-hook) arg0 arg1 arg2 arg3) + (when (= arg3 1) + (if (and (nonzero? (-> self gun turn-fast-hold-time)) (< (current-time) (-> self gun turn-fast-hold-time))) + (set-quaternion! (-> self control) (-> self control dir-targ)) + ) + ) + ) + ) + ) + (set! *attack-end-mods* v1-25) + ) + +;; failed to figure out what this is: +(let ((v1-27 (copy *attack-mods* 'global))) + (set! (-> v1-27 seek0) 0.0) + (set! (-> v1-27 fric) 0.0) + (set! (-> v1-27 nonlin-fric-dist) 0.0) + (set! (-> v1-27 transv-max) 81920.0) + (set! (-> v1-27 target-speed) 245760.0) + (set! *attack-find-mods* v1-27) + ) + +;; failed to figure out what this is: +(defstate target-attack (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (cond + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self control) + (the-as uint 1920) + ) + (when (target-send-attack + proc + (-> self control danger-mode) + (the-as touching-shapes-entry (-> block param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + (set-time! (-> self gun combo-window-start)) + (let ((v0-2 (the-as object (-> self state name)))) + (set! (-> self gun combo-window-state) (the-as symbol v0-2)) + v0-2 + ) + ) + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + (('gun-combo) + (when (-> block param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-stance) + ) + #t + ) + (('slide) + #f + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (target-start-attack) + (target-danger-set! 'spin #f) + (if (not (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (logtest? (-> self darkjak stage) (darkjak-stage force-on active)) + ) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-spin-inc))) + ) + (set! (-> self control mod-surface) *attack-mods*) + (set! (-> self water drip-mult) 4.0) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (if (< 0.0 (-> self control turn-to-magnitude)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control to-target-pt-xz) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (quaternion-copy! (-> self control unknown-quaternion04) (-> self control dir-targ)) + (set! (-> self control unknown-float41) 0.0) + (set! (-> self control unknown-float42) 0.0) + ) + :exit (behavior () + (if (zero? (-> self gun track-target-hold-time)) + (quaternion-copy! (-> self control dir-targ) (-> self control unknown-quaternion04)) + ) + (set-time! (-> self control last-attack-end-time)) + (target-exit) + ) + :code (behavior () + (let ((s5-0 jakb-attack-from-stance-ja) + (gp-0 (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage no-anim)) + ) + (combo-tracker-method-13 + (-> self control unknown-combo-tracker00) + (if (time-elapsed? (-> self control send-attack-time) (seconds 2)) + (the-as handle #f) + (-> self control send-attack-dest) + ) + (-> self control trans) + 49152.0 + (-> self control c-R-w fvec) + 65536.0 + ) + ) + ) + ) + (if gp-0 + (combo-tracker-method-12 + (-> self control unknown-combo-tracker00) + (-> self control trans) + (get-trans gp-0 3) + gp-0 + (current-time) + ) + ) + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (set! s5-0 (-> self draw art-group data 449)) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + ) + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! s5-0 jakb-gun-attack-from-stance-ja) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -3276.8) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-blue-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! s5-0 jakb-gun-attack-from-stance-blue-ja) + (set! (-> self control unknown-sound-id01) (sound-play "blue-whoosh")) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-ja) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! s5-0 jakb-gun-attack-from-stance-ja) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -3276.8) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + ) + ) + ) + (else + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! s5-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (set! (-> self control mod-surface) *attack-mods*) + (when (and gp-0 (send-event (handle->process (-> self control unknown-combo-tracker00 target)) 'combo)) + (let* ((s5-1 (handle->process (-> self control unknown-combo-tracker00 target))) + (s5-2 (get-trans + (the-as process-focusable (if (type? s5-1 process-focusable) + (the-as process-focusable s5-1) + ) + ) + 3 + ) + ) + ) + (when (< 4096.0 (vector-vector-xz-distance s5-2 (-> self control trans))) + (let ((f30-1 (-> self control transv y))) + (vector-! (-> self control transv) s5-2 (-> self control trans)) + (let ((v1-116 + (point-tracker-method-11 + (-> self control unknown-combo-tracker00) + (new 'stack-no-clear 'vector) + (-> self control trans) + s5-2 + (* 0.009107469 (the float (- (current-time) (-> self control unknown-combo-tracker00 move-start-time)))) + ) + ) + ) + (vector-xz-normalize! + (-> self control transv) + (fmin 163840.0 (sqrtf (+ (* (-> v1-116 x) (-> v1-116 x)) (* (-> v1-116 z) (-> v1-116 z))))) + ) + ) + (set! (-> self control mod-surface) *attack-find-mods*) + (set! (-> self control transv y) f30-1) + ) + ) + ) + ) + (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 49) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (target-jump-go) + ) + (suspend) + (ja :num! (seek! max (-> self control current-surface align-speed))) + ) + ) + (cond + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -12743.111) + ) + ((using-gun? self) + (when (zero? (-> self gun track-target-hold-time)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-blue-end-ja) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -3640.889) + ) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-end-ja) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -5461.3335) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-from-stance-end-ja) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -5461.3335) + ) + ) + ) + ) + (else + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + ) + ) + (go target-stance) + ) + :post target-post + ) + +;; definition for symbol *run-attack-mods*, type surface +(define *run-attack-mods* (new 'static 'surface + :name 'punch + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 91750.4 + :target-speed 122880.0 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags (surface-flag no-turn-around turn-to-pad attack gun-inactive) + ) + ) + +;; failed to figure out what this is: +(defstate target-running-attack (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (cond + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self control) + (the-as uint 1920) + ) + (let ((gp-1 (target-send-attack + proc + (-> self control danger-mode) + (the-as touching-shapes-entry (-> block param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + ) + ) + (when gp-1 + (set-time! (-> self control sliding-start-time)) + (set-time! (-> self gun combo-window-start)) + (set! (-> self gun combo-window-state) (-> self state name)) + (let ((v1-13 (if (type? proc process-focusable) + proc + ) + ) + ) + (when v1-13 + (let* ((s5-1 (-> (the-as process-focusable v1-13) root)) + (v1-14 (if (type? s5-1 collide-shape) + s5-1 + ) + ) + ) + (if (and v1-14 (or (logtest? (-> v1-14 root-prim prim-core collide-as) (collide-spec enemy)) + (logtest? (-> v1-14 root-prim prim-core action) (collide-action no-smack)) + ) + ) + (+! (-> self control unknown-word04) 1) + ) + ) + ) + ) + (cond + ((or (= gp-1 'die) (= gp-1 'push)) + (let ((v0-2 (the-as object (current-time)))) + (set! (-> self control unknown-time-frame18) (the-as time-frame v0-2)) + v0-2 + ) + ) + ((= gp-1 'back) + (let ((f0-0 -122880.0)) + (set! (-> self control unknown-word04) (the-as uint f0-0)) + f0-0 + ) + ) + ) + ) + ) + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + (('gun-combo) + (if (-> block param 0) + (go target-stance) + ) + #t + ) + (('slide) + #f + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (-> self next-state) (= (-> self next-state name) 'target-running-attack)) + (and (= (-> self ext-anim) (target-anim dark)) (zero? (-> self darkjak latch-out-time))) + ) + (go target-darkjak-running-attack) + ) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square)) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons square)) + (set-time! (-> self state-time)) + (combo-tracker-method-12 + (-> self control unknown-combo-tracker00) + *null-vector* + *null-vector* + (the-as process #f) + (current-time) + ) + (set! (-> self control sliding-start-time) 0) + (set! (-> self control unknown-time-frame18) 0) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + (set! (-> self control mod-surface) *run-attack-mods*) + (cond + ((= (-> self control ground-pat event) (pat-event slide)) + (set! (-> *run-attack-mods* turnv) 0.0) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (else + (set! (-> *run-attack-mods* turnv) 655360.0) + (set! (-> *run-attack-mods* turnvv) 655360.0) + ) + ) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (if (or (< (fabs (-> self control local-slope-x)) 0.3) (< 0.3 (fabs (-> self control local-slope-z)))) + (set! (-> self control bend-target) 1.0) + ) + (set! (-> self upper-body twist z) 0.0) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (set! (-> *run-attack-mods* turnv) 0.0) + (set! (-> *run-attack-mods* turnvv) 0.0) + (set-time! (-> self control last-running-attack-end-time)) + (target-exit) + ) + :trans (behavior () + (when (!= (-> self state-time) (current-time)) + (when (and (or (smack-surface? #t) + (and (>= (-> self control surface-slope-z) 0.7) + (not (logtest? (-> self control status) (collide-status touch-actor))) + ) + ) + (begin + (set-time! (-> self control unknown-time-frame18)) + (set! (-> self control bend-target) 0.0) + (let ((v1-11 (new-stack-vector0)) + (f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-11 (-> self control transv) (vector-float*! v1-11 (-> self control dynam gravity-normal) f0-3)) + (let* ((f1-3 (vector-length v1-11)) + (f2-0 f1-3) + (f0-4 (fmin 0.0 f0-3)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-4) + (vector-float*! v1-11 v1-11 (/ f1-3 f2-0)) + ) + ) + ) + #t + ) + (or (zero? (-> self control sliding-start-time)) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) + ) + (!= (-> self control unknown-word04) 1) + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) x) + (< 4096.0 (-> self control ctrl-xz-vel)) + (or (time-elapsed? (-> self state-time) (seconds 0.1)) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square))) + ) + (not (logtest? (-> self target-flags) (target-flags prevent-jump prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack))) + (let ((v1-48 (ja-group))) + (and (not (and v1-48 (= v1-48 jakb-darkjak-attack-combo3-ja))) + (and (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) + (not (logtest? (-> self target-flags) (target-flags prevent-jump))) + ) + ) + ) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + (if (and (logtest? (water-flag touch-water) (-> self water flags)) + (zero? (mod (- (current-time) (-> self state-time)) 21)) + ) + (spawn-ripples + (-> self water) + 0.6 + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg neckB)) + 0 + (-> self control transv) + #f + ) + ) + (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 28) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + :code (behavior () + (if (logtest? (water-flag touch-water) (-> self water flags)) + (sound-play "swim-stroke") + ) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((gp-1 jakb-attack-punch-ja)) + (ja-channel-push! 1 (seconds 0.02)) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-butt-ja) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 jakb-gun-attack-butt-blue-ja) + ) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-butt-blue-ja) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 jakb-gun-attack-butt-blue-ja) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-butt-ja) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 jakb-gun-attack-butt-ja) + ) + ) + ) + (ja-no-eval :group! gp-1 :num! (seek!)) + ) + (target-start-attack) + (target-danger-set! 'punch #f) + (if (not (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (logtest? (-> self darkjak stage) (darkjak-stage force-on active)) + ) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-punch-inc))) + ) + (initialize (-> self control impact-ctrl) self 28 3276.8 (-> self control root-prim prim-core collide-with)) + (let ((f26-0 (the-as number 0.0)) + (f30-0 1.0) + (gp-2 0) + (f28-0 1.0) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (when (not (ja-min? 0)) + (cond + ((and (>= (ja-aframe-num 0) 20.0) + (and (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) + ) + ) + (go target-falling #f) + ) + ((< (the-as float f26-0) 0.0) + (set! f26-0 (seek (the-as float f26-0) -0.04096 (* 491520.0 (seconds-per-frame)))) + (set-forward-vel (the-as float f26-0)) + ) + ((and (nonzero? (-> self control unknown-time-frame18)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) + ) + (set-forward-vel 0.0) + ) + ((and (not (cpad-hold? (-> self control cpad number) square)) + (time-elapsed? (-> self control unknown-combo-tracker00 move-start-time) (seconds 0.05)) + ) + (if (= (-> self control ground-pat material) (pat-material ice)) + (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) + (set-forward-vel (* 0.8 (-> self control ctrl-xz-vel))) + ) + ) + ((ja-done? 0) + (set-forward-vel (the-as float f26-0)) + ) + (else + (set! f26-0 + (* (target-align-vel-z-adjust (-> self align delta trans z)) (-> self clock frames-per-second) f30-0) + ) + (set-forward-vel (the-as float f26-0)) + ) + ) + ) + (let ((s5-1 (new-stack-vector0))) + (vector-matrix*! s5-1 (-> self control transv) (-> self control w-R-c)) + (set! (-> s5-1 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) s5-1 (-> self control c-R-w)) + ) + (when (!= (the-as float (-> self control unknown-word04)) 0.0) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f26-0 (-> self control unknown-word04)) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + ) + (when (and (>= (the-as float f26-0) 0.0) + (let ((s5-2 (ja-group)) + (f24-0 (ja-aframe-num 0)) + ) + (if (or (and (= s5-2 jakb-attack-punch-ja) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim jakb-attack-punch-ja) frames num-frames) -1)) (ja-frame-num 0)) + ) + (and (= s5-2 jakb-gun-attack-butt-ja) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim jakb-gun-attack-butt-ja) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= s5-2 jakb-gun-attack-butt-blue-ja) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim jakb-gun-attack-butt-blue-ja) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + ) + #t + ) + ) + ) + (let ((s5-3 (new 'stack-no-clear 'collide-query))) + (when (and (>= (impact-control-method-11 + (-> self control impact-ctrl) + s5-3 + (the-as process #f) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + 0.0 + ) + (>= 0.0 (vector-dot (-> s5-3 best-other-tri normal) (-> self control impact-ctrl dir))) + ) + (when (= (-> s5-3 best-other-tri pat mode) (pat-mode wall)) + (cond + ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s5-3 best-other-tri intersect quad)) + (let ((s5-4 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) + (when s5-4 + (let ((t9-36 (method-of-type part-tracker-subsampler activate))) + (t9-36 (the-as part-tracker-subsampler s5-4) self "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-37 run-function-in-process) + (a0-72 s5-4) + (a1-16 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-subsampler-params-default* duration) 0) + (set! (-> *part-tracker-subsampler-params-default* callback) #f) + (set! (-> *part-tracker-subsampler-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-subsampler-params-default* target) #f) + (set! (-> *part-tracker-subsampler-params-default* mat-joint) *launch-matrix*) + (set! (-> *part-tracker-subsampler-params-default* subsample-num) 1.0) + ((the-as (function object object object none) t9-37) a0-72 a1-16 *part-tracker-subsampler-params-default*) + ) + (-> s5-4 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s5-3 best-other-tri intersect quad)) + (let ((s5-5 (get-process *default-dead-pool* part-tracker #x4000 0))) + (when s5-5 + (let ((t9-39 (method-of-type part-tracker activate))) + (t9-39 (the-as part-tracker s5-5) self "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-40 run-function-in-process) + (a0-77 s5-5) + (a1-19 part-tracker-init) + ) + (set! (-> *part-tracker-params-default* group) (-> *part-group-id-table* 12)) + (set! (-> *part-tracker-params-default* duration) 0) + (set! (-> *part-tracker-params-default* callback) #f) + (set! (-> *part-tracker-params-default* userdata) (the-as uint #f)) + (set! (-> *part-tracker-params-default* target) #f) + (set! (-> *part-tracker-params-default* mat-joint) *launch-matrix*) + ((the-as (function object object object none) t9-40) a0-77 a1-19 *part-tracker-params-default*) + ) + (-> s5-5 ppointer) + ) + ) + ) + ) + (let ((name (if (using-gun? self) + (the-as sound-name (static-sound-name "gun-punch-w-hit")) + (the-as sound-name (static-sound-name "punch-w-hit")) + ) + ) + ) + (play-effect-sound + (-> self skel effect) + (the-as symbol "punch") + -1.0 + (-> self control impact-ctrl joint) + (the-as basic #f) + (the-as sound-name name) + ) + ) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f26-0 -61440.0) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max (* (-> self control current-surface align-speed) f28-0))) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (if (< 2 gp-2) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) + ) + (+! gp-2 1) + ) + ) + (if (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (go target-falling #f) + ) + (when (and (using-gun? self) + (or (< (-> self control pad-magnitude) 0.7) (= (gun->eco (-> self gun gun-type)) (pickup-type eco-blue))) + ) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.5))) + (when (zero? (-> self gun track-target-hold-time)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-butt-blue-end-ja) + 0.0 + 0 + 60 + 1.0 + 12.0 + #f + ) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-butt-end-ja) + 0.0 + 0 + 60 + 1.0 + 12.0 + #f + ) + ) + ) + ) + ) + (go target-stance) + ) + :post target-post + ) + +;; definition for symbol *jump-attack-mods*, type surface +(define *jump-attack-mods* + (new 'static 'surface + :name 'attack + :turnvv 18204.445 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 24576.0 + :target-speed 24576.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (if (and (>= (-> self gun fire-pending) 2) (< (-> self gun fire-pending) 5)) + (logclear! (-> arg0 flags) (surface-flag gun-direct)) + ) + (case (-> self control ground-pat event) + (((pat-event slide)) + (set! (-> arg0 seek0) 0.05) + (set! (-> arg0 seek90) 0.05) + (set! (-> arg0 seek180) 0.05) + ) + ) + ) + ) + ) + :mode 'air + :flags (surface-flag check-edge air attack spin gun-direct laser-hide) + ) + ) + +;; failed to figure out what this is: +(defstate target-attack-air (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) + (cond + (v0-0 + (empty) + v0-0 + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (target-start-attack) + (target-danger-set! 'spin-air #f) + (if (not (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (logtest? (-> self darkjak stage) (darkjak-stage force-on active)) + ) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-spin-inc))) + ) + (set! (-> self control mod-surface) *jump-attack-mods*) + (set! (-> self neck flex-blend) 0.0) + (let ((f0-4 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (cond + ((or (>= 0.0 f0-4) (= arg0 'flop)) + (let ((v1-28 (new-stack-vector0))) + (let ((f0-6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-28 (-> self control transv) (vector-float*! v1-28 (-> self control dynam gravity-normal) f0-6)) + ) + (let* ((f0-7 (vector-length v1-28)) + (f1-2 f0-7) + (f2-0 33775.48) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-28 v1-28 (/ f0-7 f1-2)) + ) + ) + ) + ) + (else + (let* ((f1-5 (/ f0-4 (* (-> self control dynam gravity-length) (seconds-per-frame)))) + (f0-9 (* 0.5 f1-5 (seconds-per-frame) f0-4)) + ) + (let ((v1-36 (ja-group))) + (if (and v1-36 + (or (= v1-36 jakb-attack-uppercut-ja) + (= v1-36 jakb-gun-attack-upperbutt-ja) + (= v1-36 jakb-gun-attack-upperbutt-blue-ja) + ) + ) + (set! f0-9 + (fmax + 0.0 + (- (-> *TARGET-bank* attack-jump-height-max) + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control last-trans-any-surf)) + ) + ) + ) + ) + ) + ) + (let ((v1-47 (new-stack-vector0))) + (let ((f1-11 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-47 (-> self control transv) (vector-float*! v1-47 (-> self control dynam gravity-normal) f1-11)) + ) + (let* ((f1-12 (vector-length v1-47)) + (f2-7 f1-12) + (f0-14 (+ 1024.0 (sqrtf (* 245760.0 (+ 2048.0 f0-9))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-14) + (vector-float*! v1-47 v1-47 (/ f1-12 f2-7)) + ) + ) + ) + ) + ) + ) + ) + (set! (-> self control dynam gravity-length) 122880.0) + (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (set-time! (-> self control last-attack-end-time)) + (target-exit) + ) + :trans (behavior () + (when (logtest? (-> self control status) (collide-status on-surface)) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-hit-ground #f) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) + (seek! + (-> self control dynam gravity-length) + (-> self control standard-dynamics gravity-length) + (* 245760.0 (seconds-per-frame)) + ) + ) + (when (and (time-elapsed? (-> self state-time) (seconds 0.05)) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control last-transv)) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + ) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + ) + (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 43) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (and (cpad-pressed? (-> self control cpad number) r1) + (zero? (-> self gun fire-pending)) + (!= (-> self gun gun-type) 31) + ) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow)) + (+! (-> self gun fire-pending) 5) + ) + (((pickup-type eco-blue)) + (+! (-> self gun fire-pending) 5) + (set! (-> self gun fire-spinv) 218453.33) + ) + (((pickup-type eco-red)) + (+! (-> self gun fire-pending) 2) + ) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (target-attack-air-anim) + (go target-falling #f) + ) + :post target-post + ) + +;; failed to figure out what this is: +(let ((v1-34 (copy *turn-around-mods* 'global))) + (set! (-> v1-34 flags) (surface-flag attack gun-inactive)) + (set! *uppercut-mods* v1-34) + ) + +;; definition for symbol *uppercut-jump-mods*, type surface +(define *uppercut-jump-mods* (new 'static 'surface + :name 'uppercut + :turnvv 18204.445 + :turnvvf 30.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (surface-clamp-speed arg0 arg1 arg2 arg3) + (when (= arg3 1) + (when (nonzero? (-> self gun track-target-hold-time)) + (set! (-> arg0 turnv) 262144.0) + (set! (-> arg0 turnvf) 15.0) + ) + ) + ) + :mode 'air + :flags (surface-flag check-edge air attack spin gun-direct laser-hide) + ) + ) + +;; failed to figure out what this is: +(defstate target-attack-uppercut (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('change-mode) + (if (and (= (-> block param 0) 'gun) (focus-test? self dark)) + #f + (target-dangerous-event-handler proc argc message block) + ) + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float)) + (set-time! (-> self state-time)) + (target-start-attack) + (target-danger-set! 'uppercut #f) + (if (not (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (logtest? (-> self darkjak stage) (darkjak-stage force-on active)) + ) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-uppercut-inc))) + ) + (set! (-> self control mod-surface) *uppercut-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.15))) + (if (using-gun? self) + (target-top-anim-base-mode 37) + ) + (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) + 0 + ) + :exit (behavior () + (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-bomb1))) + (set-action! + *gui-control* + (gui-action stop) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (target-exit) + ) + :code (behavior ((arg0 float) (arg1 float)) + (let* ((v1-2 (ja-group)) + (f30-0 (if (and v1-2 (= v1-2 jakb-duck-stance-ja)) + 5.0 + 0.0 + ) + ) + ) + (cond + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-blue)) + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-upperbutt-blue-ja) + f30-0 + 5 + 30 + 1.0 + 0.0 + #f + ) + (ja-no-eval :group! jakb-gun-attack-upperbutt-blue-ja + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim jakb-gun-attack-upperbutt-ja) + f30-0 + 5 + 30 + 1.0 + 0.0 + #f + ) + (ja-no-eval :group! jakb-gun-attack-upperbutt-ja + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + ) + ) + ((and (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + (and (= (-> self ext-anim) (target-anim dark)) + (logtest? (the-as game-feature (logand (game-feature darkjak-bomb1) (-> *setting-control* user-current features))) + (-> self game features) + ) + (zero? (-> self darkjak latch-out-time)) + (>= (-> self game eco-pill-dark) (-> *FACT-bank* darkjak-bomb-min)) + ) + ) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* self (gui-channel jak-effect-1) (gui-action queue) "darkbom1" -99.0 0) + ) + (ja-no-eval :group! (-> self draw art-group data 441) + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + (go target-darkjak-bomb1) + ) + (else + (ja-no-eval :group! jakb-attack-uppercut-ja :num! (seek! (ja-aframe 7.0 0)) :frame-num (ja-aframe f30-0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + ) + ) + (go target-attack-uppercut-jump arg0 arg1) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-attack-uppercut-jump (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('gun-combo) + (when (-> block param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (let ((v1-7 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-7 (-> self control transv) (vector-float*! v1-7 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f0-2 (vector-length v1-7)) + (f1-1 f0-2) + (f2-3 + (- (sqrtf (* 8192.0 (-> self control dynam gravity-length))) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-3) + (vector-float*! v1-7 v1-7 (/ f0-2 f1-1)) + ) + ) + ) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.5))) + (go target-falling 'uppercut) + ) + #t + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float)) + (if (and (= (-> self control ground-pat material) (pat-material ice)) (< 32768.0 (-> self control ctrl-xz-vel))) + (set-forward-vel 32768.0) + ) + (set-time! (-> self state-time)) + (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *uppercut-jump-mods*) + (target-start-attack) + (target-danger-set! 'uppercut #f) + (set-time! (-> self gun combo-window-start)) + (set! (-> self gun combo-window-state) (-> self state name)) + (set! (-> self gun track-target-hold-time) 0) + 0 + ) + :exit target-exit + :trans (behavior () + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-hit-ground #f) + ) + (when (and (cpad-pressed? (-> self control cpad number) square) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) + (not (logtest? (-> self target-flags) (target-flags prevent-attack))) + (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (build-conversions (-> self control transv)) + (go + target-flop + 65502.96 + -163840.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + 'flop + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) + (and (can-feet? #f) + (let ((v1-65 (ja-group))) + (and v1-65 (or (= v1-65 jakb-attack-uppercut-ja) (= v1-65 jakb-gun-attack-upperbutt-ja))) + ) + (>= (ja-aframe-num 0) 12.0) + ) + ) + (go target-attack-air 'uppercut) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 28) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (if (and (= (-> self control danger-mode) 'uppercut) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) -8192.0) + ) + (target-danger-set! 'harmless #f) + ) + (slide-down-test) + ) + :code (behavior ((arg0 float) (arg1 float)) + (when (or (= (-> self skel top-anim frame-group) jakb-gun-attack-upperbutt-ja) + (= (-> self skel top-anim frame-group) jakb-gun-attack-upperbutt-blue-ja) + ) + (let ((v1-10 (get-channel (-> self skel top-anim) 0))) + (if v1-10 + (set! (-> v1-10 param 1) 0.9) + ) + ) + ) + (compute-alignment! (-> self align)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.9)) + (compute-alignment! (-> self align)) + (set! (-> self control turn-go-the-long-way) 1.0) + (let ((v1-27 (ja-group))) + (if (and v1-27 (= v1-27 jakb-attack-uppercut-ja)) + (align! + (-> self align) + (the-as align-opts (cond + ((>= 30.0 (ja-aframe-num 0)) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.1))) + (if (nonzero? (-> self gun track-target-hold-time)) + 2 + 18 + ) + ) + ((>= 43.0 (ja-aframe-num 0)) + (set! (-> self control mod-surface) *double-jump-mods*) + 2 + ) + (else + 0 + ) + ) + ) + 1.0 + 0.95 + 1.0 + ) + (align! + (-> self align) + (the-as align-opts (cond + ((>= 35.0 (ja-aframe-num 0)) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.1))) + (if (nonzero? (-> self gun track-target-hold-time)) + 2 + 18 + ) + ) + ((>= 43.0 (ja-aframe-num 0)) + (set! (-> self control mod-surface) *double-jump-mods*) + 2 + ) + (else + 0 + ) + ) + ) + 1.0 + 0.95 + 1.0 + ) + ) + ) + ) + (set-time! (-> self gun surpress-time)) + (go target-falling #f) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-flop (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v1-0 symbol)) + (let ((v0-0 (target-bonk-event-handler proc argc message block))) + (cond + (v0-0 + (empty) + v0-0 + ) + ((begin (set! v1-0 message) (= v1-0 'slide)) + #f + ) + ((= v1-0 'swim) + (cond + ((< 6144.0 (target-height-above-ground)) + (sound-play "swim-flop") + (set! (-> self control unknown-float43) 0.0) + (go target-swim-down) + ) + (else + (go target-flop-hit-ground 'swim) + ) + ) + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float) (arg2 float) (arg3 object)) + (cond + ((and (= (-> self fact eco-type) 1) (>= (-> self fact eco-level) 1.0)) + (go target-yellow-jump-blast) + ) + ((and (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage invinc)) + ) + (and (= (-> self ext-anim) (target-anim dark)) + (logtest? (the-as game-feature (logand (game-feature darkjak-bomb0) (-> *setting-control* user-current features))) + (-> self game features) + ) + (zero? (-> self darkjak latch-out-time)) + (>= (-> self game eco-pill-dark) (-> *FACT-bank* darkjak-bomb-min)) + ) + ) + (go target-darkjak-bomb0) + ) + ) + (if (= arg2 0.0) + (set-forward-vel arg2) + (set-forward-vel (-> self control ctrl-xz-vel)) + ) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (set! (-> self control mod-surface) *flop-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control dynam gravity-max) 245760.0) + (set! (-> self control dynam gravity-length) 245760.0) + (let ((v1-44 (new-stack-vector0))) + (let ((f0-8 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-44 (-> self control transv) (vector-float*! v1-44 (-> self control dynam gravity-normal) f0-8)) + ) + (let* ((f0-9 (vector-length v1-44)) + (f1-4 f0-9) + (f2-0 29491.2) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-44 v1-44 (/ f0-9 f1-4)) + ) + ) + ) + ) + :exit (behavior () + (let ((v1-2 (get-channel (-> self skel top-anim) 0))) + (when v1-2 + (case (-> v1-2 frame-group) + ((jakb-gun-flop-down-ja) + (set! (-> v1-2 param 1) 10.0) + ) + ) + ) + ) + (target-danger-set! 'harmless #f) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) + (set! (-> self neck flex-blend) 1.0) + ) + :trans (behavior () + (delete-back-vel) + (let ((gp-1 (logtest? (-> self control status) (collide-status on-surface)))) + (when (and (not gp-1) (let ((v1-6 (ja-group))) + (and v1-6 (or (= v1-6 jakb-flop-down-loop-ja) (= v1-6 jakb-moving-flop-down-ja))) + ) + ) + (when (and (or (< (target-move-dist (seconds 0.1)) 1638.4) + (and (logtest? (-> self control status) (collide-status touch-wall)) (< 0.7 (-> self control poly-angle))) + ) + (not (logtest? (-> self control status) (collide-status touch-actor))) + (>= (-> self control unknown-word04) (the-as uint 2)) + ) + (set-time! (-> self control last-time-of-stuck)) + (set! gp-1 'stuck) + ) + ) + (when gp-1 + (logior! (-> self control status) (collide-status on-surface)) + (when (or (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage bomb0)) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + (if (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect (-> self skel effect) (the-as symbol "group-red-eco-strike-ground") (ja-frame-num 0) 0) + ) + (let ((v1-56 + (process-spawn + touch-tracker + :init touch-tracker-init + (-> self control trans) + #x45800000 + 30 + :name "touch-tracker" + :to self + ) + ) + ) + (send-event + (ppointer->process v1-56) + 'function + (lambda :behavior target + ((arg0 process-focusable)) + (set! (-> arg0 root root-prim local-sphere w) + (seek (-> arg0 root root-prim local-sphere w) 28672.0 (* 286720.0 (seconds-per-frame))) + ) + ) + ) + ) + ) + (go target-flop-hit-ground gp-1) + ) + ) + (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (do-effect + (-> self skel effect) + (the-as symbol "group-red-eco-spinkick") + (ja-frame-num 0) + (if (rand-vu-percent? 0.5) + 28 + 19 + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (when (and (not (-> self control danger-mode)) + (let ((v1-80 (ja-group))) + (and v1-80 (= v1-80 jakb-flop-down-ja)) + ) + (>= (ja-aframe-num 0) 8.0) + ) + (target-start-attack) + (target-danger-set! 'flop #f) + (if (not (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (logtest? (-> self darkjak stage) (darkjak-stage force-on active)) + ) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-flop-inc))) + ) + ) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 float) (arg3 object)) + (if (using-gun? self) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-flop-down-ja) 0.0 0 30 1.0 0.0 #f) + ) + (ja-channel-set! 2) + (ja-no-eval :group! jakb-flop-down-ja :num! (seek!) :frame-num 0.0) + (ja :chan 1 :group! jakb-moving-flop-down-ja :num! (chan 0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (let ((gp-1 (-> self skel root-channel 1))) + (let ((f0-10 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 0.0 40960.0))) + (set! (-> gp-1 frame-interp 1) f0-10) + (set! (-> gp-1 frame-interp 0) f0-10) + ) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group frames num-frames) -1))) + (set! (-> gp-1 param 1) 1.0) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) + (target-danger-set! 'flop-down #f) + (let ((v1-56 (get-channel (-> self skel top-anim) 0))) + (if (and v1-56 (= (-> v1-56 frame-group) jakb-gun-flop-down-ja)) + (set! (-> v1-56 param 1) 0.0) + ) + ) + (let ((f30-0 1.0)) + (let ((v1-58 (new-stack-vector0))) + (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control align-xz-vel)))) + 0.0 + (vector-! + v1-58 + (-> self control align-xz-vel) + (vector-float*! v1-58 (-> self control dynam gravity-normal) f0-17) + ) + ) + (let* ((f0-18 (vector-length v1-58)) + (f1-1 f0-18) + (f2-0 -368640.0) + ) + (vector+! + (-> self control align-xz-vel) + (vector-float*! (-> self control align-xz-vel) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-58 v1-58 (/ f0-18 f1-1)) + ) + ) + ) + (let ((v1-59 (new-stack-vector0))) + (let ((f0-21 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-59 (-> self control transv) (vector-float*! v1-59 (-> self control dynam gravity-normal) f0-21)) + ) + (let* ((f0-22 (vector-length v1-59)) + (f1-3 f0-22) + (f2-2 (* -368640.0 f30-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) + (vector-float*! v1-59 v1-59 (/ f0-22 f1-3)) + ) + ) + ) + (suspend) + (until #f + (+! (-> self control unknown-word04) 1) + (ja :num! (seek!)) + (let ((gp-2 (-> self skel root-channel 1))) + (let ((f0-28 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 0.0 40960.0))) + (set! (-> gp-2 frame-interp 1) f0-28) + (set! (-> gp-2 frame-interp 0) f0-28) + ) + (set! (-> gp-2 param 0) 0.0) + (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-chan) + ) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) + (let ((v1-77 (new-stack-vector0)) + (f0-33 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-77 (-> self control transv) (vector-float*! v1-77 (-> self control dynam gravity-normal) f0-33)) + (let* ((f2-3 (vector-length v1-77)) + (f1-7 f2-3) + ) + (if (< (-> self control current-surface transv-max) f2-3) + (set! f2-3 (-> self control current-surface transv-max)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-33) + (vector-float*! v1-77 v1-77 (/ f2-3 f1-7)) + ) + ) + ) + (if (and (time-elapsed? (-> self state-time) (-> *TARGET-bank* fall-timeout)) (!= (-> self tobot?) 'tobot)) + (go target-falling #f) + ) + (if (and (= *cheat-mode* 'debug) + (cpad-hold? (-> self control cpad number) r2) + (not *pause-lock*) + (!= (-> self tobot?) 'tobot) + ) + (go target-falling #f) + ) + (suspend) + ) + ) + #f + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-flop-hit-ground (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (-> self next-state) (= (-> self next-state name) 'target-flop-hit-ground)) + (case message + (('swim 'slide) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + (else + (target-jump-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (let ((f0-1 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control highest-jump-mark) (-> self control trans)) + ) + ) + ) + (if (< (-> *TARGET-bank* fall-far) f0-1) + (go target-hit-ground-hard f0-1) + ) + ) + (target-land-effect) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (set-time! (-> self state-time)) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (set-forward-vel 0.0) + (set! (-> self control mod-surface) *flop-land-mods*) + (logclear! (-> *flop-land-mods* flags) (surface-flag check-edge)) + (logior! (-> self target-flags) (target-flags tf15)) + (set! (-> self neck flex-blend) 0.0) + (cond + ((= arg0 'swim) + ) + (else + ) + ) + ) + :exit target-exit + :trans (behavior () + (when (and (!= (-> self control unknown-spool-anim00) 'stuck) (!= (-> self state-time) (current-time))) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #f) + ) + (go target-attack-air 'flop) + ) + ) + (when (and (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) + (not (time-elapsed? (-> self state-time) (seconds 0.25))) + ) + (do-effect + (-> self skel effect) + (the-as symbol "group-red-eco-spinkick") + (ja-frame-num 0) + (if (rand-vu-percent? 0.5) + 28 + 19 + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (let ((v1-37 (ja-group))) + (if (and (and v1-37 (= v1-37 jakb-flop-down-land-ja)) (>= (ja-aframe-num 0) 28.0)) + (logior! (-> *flop-land-mods* flags) (surface-flag check-edge)) + ) + ) + (slide-down-test) + ) + :code (behavior ((arg0 symbol)) + (target-hit-ground-anim arg0 (are-still?)) + (go target-falling #f) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-roll (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (= message 'touched) + (send-event proc 'roll) + ) + (case message + (('gun-combo) + (when (-> block param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (let ((a0-8 (-> self control))) + (set-quaternion! a0-8 (-> self control dir-targ)) + (go target-duck-stance (the-as symbol a0-8)) + ) + ) + #t + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (target-collide-set! 'duck 1.0) + (set-time! (-> self state-time)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (set! (-> self control mod-surface) *roll-mods*) + (+! (-> self control unknown-word02) 1) + (rot->dir-targ! (-> self control)) + (set-forward-vel (+ (-> *TARGET-bank* roll-speed-min) + (* (-> *TARGET-bank* roll-speed-inc) (the float (+ (-> self control unknown-word02) -1))) + ) + ) + (if (or (< (fabs (-> self control local-slope-x)) 0.3) (< 0.3 (fabs (-> self control local-slope-z)))) + (set! (-> self control bend-target) 1.0) + ) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control did-move-to-pole-or-max-jump-height) 0.0) + (set! (-> self gun track-target-hold-time) 0) + ) + :exit (behavior () + (when (not (and (-> self next-state) (= (-> self next-state name) 'target-roll))) + (set! (-> self control unknown-word02) 0) + (set-time! (-> self control last-roll-end-time)) + ) + (target-exit) + (target-collide-set! 'normal 0.0) + ) + :code (behavior () + (let ((gp-0 0)) + 0 + (let ((s5-0 0) + (f30-0 1.0) + (s4-0 #f) + ) + (ja-channel-push! 1 (seconds 0.04)) + (cond + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-duck-roll-ja) 0.0 15 30 1.0 0.0 #f) + (ja :group! jakb-gun-duck-roll-ja :num! min) + ) + (else + (ja :group! jakb-duck-roll-ja :num! min) + ) + ) + (until (ja-done? 0) + (if (cpad-pressed? (-> self control cpad number) x) + (set! gp-0 (the-as int (current-time))) + ) + (when (and (not s4-0) (time-elapsed? (-> self state-time) (seconds 0.2))) + (set! s4-0 #t) + (set-time! (-> self gun combo-window-start)) + (set! (-> self gun combo-window-state) (-> self state name)) + ) + (when (and (or (smack-surface? #f) (>= (-> self control surface-slope-z) 0.7)) + (>= (the-as uint (- (current-time) (the-as int (-> self control unknown-word04)))) (the-as uint 3)) + (time-elapsed? (-> self state-time) 1) + ) + (when (>= 6.0 (ja-aframe-num 0)) + (if (using-gun? self) + (target-top-anim-base-mode 15) + ) + (target-shoved + (-> *TARGET-bank* smack-surface-dist) + (-> *TARGET-bank* smack-surface-height) + (the-as process #f) + target-hit + ) + ) + (if (zero? s5-0) + (set! s5-0 (the-as int (current-time))) + ) + ) + (if (cpad-pressed? (-> self control cpad number) square) + (current-time) + ) + (compute-alignment! (-> self align)) + (cond + ((nonzero? s5-0) + ) + (else + (align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 f30-0) + (let ((s3-2 (new-stack-vector0))) + (vector-matrix*! s3-2 (-> self control transv) (-> self control w-R-c)) + (set! (-> s3-2 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) s3-2 (-> self control c-R-w)) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) + ) + ) + (if (and (or (not (time-elapsed? (the-as time-frame gp-0) (-> *TARGET-bank* roll-jump-pre-window))) + (cpad-pressed? (-> self control cpad number) x) + ) + (can-jump? 'target-roll-flip) + ) + (go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist)) + ) + ) + (set-time! (-> self state-hook-time)) + (set! (-> self state-hook) + (the-as + (function none :behavior target) + (lambda :behavior target + () + (cond + ((time-elapsed? (-> self state-hook-time) (-> *TARGET-bank* roll-jump-post-window)) + (let ((v0-0 (the-as object nothing))) + (set! (-> self state-hook) (the-as (function none :behavior target) v0-0)) + v0-0 + ) + ) + (else + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'target-roll-flip) + ) + (go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist)) + ) + ) + ) + ) + ) + ) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) + (go target-duck-stance 'roll) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-roll-flip (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('gun-combo) + (when (-> block param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-falling #f) + ) + #t + ) + (else + (target-jump-event-handler proc argc message block) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float)) + (set! (-> self control mod-surface) *roll-flip-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (set! (-> self gun track-target-hold-time) 0) + (set-time! (-> self gun combo-window-start)) + (set! (-> self gun combo-window-state) (-> self state name)) + (target-collide-set! 'duck 1.0) + ) + :exit (behavior () + (target-exit) + (target-collide-set! 'normal 0.0) + ) + :trans (behavior () + (if (and (or (smack-surface? #f) + (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + ) + (and (!= (-> self state-time) (current-time)) (not (using-gun? self))) + ) + (target-shoved + (-> *TARGET-bank* smack-surface-dist) + (-> *TARGET-bank* smack-surface-height) + (the-as process #f) + target-hit + ) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) + (can-feet? #f) + (let ((v1-20 (ja-group))) + (and (and v1-20 (= v1-20 jakb-jump-loop-ja)) (= (-> self skel root-channel 0) (-> self skel channel))) + ) + ) + (go target-attack-air #f) + ) + ) + :code (behavior ((arg0 float) (arg1 float)) + (local-vars (v1-37 symbol)) + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! jakb-roll-flip-ja :num! min) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-roll-flip-ja) 0.0 0 30 1.0 0.0 #f) + ) + (let ((f30-0 1.0)) + (until v1-37 + (compute-alignment! (-> self align)) + (if (not (ja-max? 0)) + (align! + (-> self align) + (align-opts adjust-y-vel adjust-xz-vel) + 1.0 + (/ arg0 (-> *TARGET-bank* roll-flip-art-height)) + (* f30-0 (/ arg1 (-> *TARGET-bank* roll-flip-art-dist))) + ) + (align! + (-> self align) + (align-opts adjust-xz-vel) + 1.0 + 1.0 + (* f30-0 (/ arg1 (-> *TARGET-bank* roll-flip-art-dist))) + ) + ) + (let ((s4-1 (new-stack-vector0))) + (vector-matrix*! s4-1 (-> self control transv) (-> self control w-R-c)) + (set! (-> s4-1 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) s4-1 (-> self control c-R-w)) + ) + (suspend) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) + (set! v1-37 + (or (ja-max? 0) + (and (>= (ja-aframe-num 0) 4.0) (logtest? (-> self control status) (collide-status on-surface))) + ) + ) + ) + ) + (set-time! (-> self state-time)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (when (time-elapsed? (-> self state-time) (seconds 0.01)) + (let ((v1-50 (ja-group))) + (when (not (and v1-50 (= v1-50 jakb-jump-loop-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-jump-loop-ja :num! min) + ) + ) + ) + (let ((v1-59 (new-stack-vector0)) + (f0-19 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-59 (-> self control transv) (vector-float*! v1-59 (-> self control dynam gravity-normal) f0-19)) + (let* ((f2-0 (vector-length v1-59)) + (f1-7 f2-0) + (f2-1 (* 0.9 f2-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-19) + (vector-float*! v1-59 v1-59 (/ f2-1 f1-7)) + ) + ) + ) + (suspend) + (let ((v1-62 (ja-group))) + (if (and v1-62 (= v1-62 jakb-jump-loop-ja)) + (ja :num! (loop!)) + (ja :num-func num-func-identity :frame-num max) + ) + ) + ) + (target-land-effect) + (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.1))) + (set-time! (-> self state-hook-time)) + (set! (-> self state-hook) + (the-as + (function none :behavior target) + (lambda :behavior target + () + (cond + ((time-elapsed? (-> self state-hook-time) (seconds 0.1)) + (let ((v0-0 (the-as object nothing))) + (set! (-> self state-hook) (the-as (function none :behavior target) v0-0)) + v0-0 + ) + ) + (else + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + (or (not (-> *TARGET-bank* strafe-duck-jump)) (not (enabled-gun? self))) + ) + (go target-high-jump (-> *TARGET-bank* flip-jump-height-min) (-> *TARGET-bank* flip-jump-height-max) 'flip) + ) + ) + ) + ) + ) + ) + (cond + ((not (can-exit-duck? self)) + (go target-duck-stance #f) + ) + (else + (let ((v1-86 (ja-group))) + (if (and v1-86 (= v1-86 jakb-jump-loop-ja)) + (go target-hit-ground #f) + (go target-stance) + ) + ) + ) + ) + ) + :post target-post + ) diff --git a/test/decompiler/reference/jak3/engine/ui/bigmap-h_REF.gc b/test/decompiler/reference/jak3/engine/ui/bigmap-h_REF.gc index 4785405b781..2404766e907 100644 --- a/test/decompiler/reference/jak3/engine/ui/bigmap-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/bigmap-h_REF.gc @@ -110,7 +110,7 @@ (bigmap-method-13 () none) (bigmap-method-14 () none) (bigmap-method-15 () none) - (bigmap-method-16 () none) + (bigmap-method-16 (_type_) none) (bigmap-method-17 () none) (bigmap-method-18 () none) (bigmap-method-19 () none) @@ -159,7 +159,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/ui/minimap-h_REF.gc b/test/decompiler/reference/jak3/engine/ui/minimap-h_REF.gc index e8c45e6d467..b9718a4ab0c 100644 --- a/test/decompiler/reference/jak3/engine/ui/minimap-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/minimap-h_REF.gc @@ -841,7 +841,7 @@ (node-id uint16 64) ) (:methods - (minimap-trail-method-9 () none) + (get-distance-with-path (_type_ vector vector) float) (minimap-trail-method-10 () none) ) ) @@ -931,9 +931,9 @@ ) (:methods (minimap-method-9 () none) - (minimap-method-10 () none) + (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail) (minimap-method-11 () none) - (minimap-method-12 () none) + (add-icon! (_type_ process uint int vector int) connection-minimap) (minimap-method-13 () none) (minimap-method-14 () none) (minimap-method-15 () none) @@ -998,7 +998,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress-static_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress-static_REF.gc index aac501f1619..f20fe93b84f 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress-static_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress-static_REF.gc @@ -1114,7 +1114,7 @@ ) (new 'static 'controls-page-info :title (text-id progress-controls-lightjak) - :feature (game-feature feature46) + :feature (game-feature lightjak) :strings (new 'static 'boxed-array :type controls-string-info (new 'static 'controls-string-info :button (text-id progress-controls-pad-l2-triangle) diff --git a/test/decompiler/reference/jak3/engine/util/script-h_REF.gc b/test/decompiler/reference/jak3/engine/util/script-h_REF.gc index ae415f410ec..6260541f805 100644 --- a/test/decompiler/reference/jak3/engine/util/script-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/util/script-h_REF.gc @@ -41,7 +41,7 @@ ) (:methods (new (symbol type object process vector) _type_) - (script-context-method-9 () none) + (eval! (_type_ pair) object) (script-context-method-10 () none) (script-context-method-11 () none) ) @@ -95,7 +95,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/util/sync-info-h_REF.gc b/test/decompiler/reference/jak3/engine/util/sync-info-h_REF.gc index 3392d673030..2b02f1ede31 100644 --- a/test/decompiler/reference/jak3/engine/util/sync-info-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/util/sync-info-h_REF.gc @@ -6,7 +6,7 @@ "Parameters used to set up a [[sync-info]]." ((sync-type symbol) (sync-flags sync-flags) - (entity basic) + (entity entity-actor) (period uint32) (percent float) (ease-in float) @@ -45,9 +45,9 @@ (:methods (sync-info-method-9 () none) (sync-info-method-10 () none) - (sync-info-method-11 () none) + (get-norm! (_type_ int) float) (sync-info-method-12 () none) - (sync-info-method-13 () none) + (initialize! (_type_ sync-info-params) none) (sync-info-method-14 () none) (sync-info-method-15 () none) ) @@ -315,7 +315,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/offline/config/jak3/config.jsonc b/test/offline/config/jak3/config.jsonc index 6adc57ee16e..2b3a5b40219 100644 --- a/test/offline/config/jak3/config.jsonc +++ b/test/offline/config/jak3/config.jsonc @@ -76,7 +76,11 @@ "(method 19 process-drawable)", "(method 10 joint-control)", // game-save - "(method 3 game-save)" + "(method 3 game-save)", + // target-handler + "target-send-attack", + // find-nearest + "find-nearest-focusable" ],